@import "reset.css";
@import "fonts.css";

/*
  Color Palette by Color Scheme Designer
  Palette URL: http://colorschemedesigner.com/#3B21CrXrbcOvy
  Generated by Color Scheme Designer (c) Petr Stanicek 2002-2010
*/

:root {
  --primary-1: hsl(212, 67%, 33%);
  --primary-2: hsl(212, 57%, 32%);
  --primary-3: hsl(212, 73%, 28%);
  --primary-4: hsl(212, 51%, 54%);
  --primary-5: hsl(212, 43%, 60%);
  --secondary-1: hsl(36, 78%, 48%);
  --secondary-2: hsl(36, 65%, 46%);
  --secondary-3: hsl(36, 81%, 40%);
  --secondary-4: hsl(36, 80%, 62%);
  --secondary-5: hsl(36, 75%, 70%);
  --text-color: hsl(0, 0%, 100%);
}

.hidden {
  display: none;
}

section {
  display: flow-root;

  & + section {
    margin-top: 1rem;
  }
}

a {
  color: var(--secondary-5);
  text-decoration: none;

  &:hover,
  &:active {
    color: var(--secondary-1);
  }
}

body {
  min-height: 100vh;
  background-color: var(--primary-4);
  color: var(--text-color);
  font-family: "Arbutus Slab", "Georgia", serif;
  font-size: 0.9em;
  display: flex;
  flex-direction: column;

  & > header,
  & > main {
    padding: 1em 1em;
  }

  & > main {
    flex: 1;
  }

  & > footer {
    padding: 0.6em 1em;
    clear: both;
    position: relative;
    width: 100%;
    background-color: var(--primary-2);
    font-size: 0.9em;
    line-height: 1.3;
    text-align: center;

    ul {
      display: inline-block;
    }
  }

  & > header {
    position: relative;
    width: 100%;
    background-color: var(--primary-2);
    transition: all 0.3s ease-in-out;

    a {
      transition: font-size 0.3s ease-in-out;
      color: hsl(0, 0%, 100%);
      text-transform: uppercase;
      font-size: clamp(18px, 4vw, 32px);
      letter-spacing: 0.2em;
      line-height: 1;

      h1 {
        color: hsl(0, 0%, 100%);
      }

      h1,
      .bw-byways {
        display: inline;
      }
    }
  }
}

header,
footer {
  font-family: "Capriola", "Helvetica Neue", sans-serif;
}

.flat-list {
  text-align: center;

  li {
    display: inline-block;

    &.nosep {
      margin-right: 0.5em;
    }

    &:not(.nosep):after {
      margin: 0 0.5em;
      color: hsla(0, 0%, 100%, 0.75);
      font-family: sans-serif;
      content: "⬥";
    }

    &:last-of-type:after {
      content: "";
      margin: 0;
    }
  }
}

.states,
.byway-list,
.websites {
  padding: 1em;
  line-height: 1.5;
  font-family: "Capriola", "Helvetica Neue", sans-serif;
  background-color: var(--primary-1);
  margin-bottom: 1em;

  header {
    font-size: 1.2em;
    line-height: 1;
    margin-bottom: 0.2em;
    position: relative;
  }
}

.color-tag {
  position: absolute;
  right: 0;
  top: 0;
  width: 1em;
  height: 1em;
  border-radius: 0.5em;
  border: 2px solid hsl(0, 0%, 100%);
}

.designation .color-tag {
  position: relative;
  display: inline-block;
  margin-right: 0.3em;
  vertical-align: text-top;
}

.byway,
.about {
  line-height: 1.5;
  margin: 1em auto;
  font-size: 1.2em;

  display: flex;
  flex-direction: column;
  gap: 1em;

  header {
    h1 {
      font-size: 1.2em;
    }

    p,
    .flat-list {
      font-size: 0.8em;
      display: inline-block;
    }

    p {
      font-style: italic;
    }

    .flat-list {
      float: right;
      margin-top: 0.25em;
    }
  }
}

.swipe {
  .next,
  .prev {
    position: absolute;
    width: 2em;
    height: 2em;
    top: 50%;
    margin-top: -1em;
    display: block;
    background: hsla(0, 0%, 100%, 0.75);
    color: hsla(0, 0%, 0%, 0.75);
    text-align: center;
    font-size: 0.8em;
    line-height: 2;
    transition: all 0.3s ease-in-out;
  }

  .prev {
    left: 0;
    transform: translateX(-100%);
  }

  .next {
    right: 0;
    transform: translateX(100%);
  }

  &:hover {
    .next,
    .prev {
      background: hsla(0, 0%, 100%, 0.75);
      transform: translateX(0);
    }
  }

  li {
    display: table-cell;
  }
}

.byway {
  .photos {
    margin: 1em auto;
    width: 100%;
    position: relative;
    overflow: hidden;
    max-width: 500px;
    max-height: 375px;

    li {
      overflow: hidden;
      max-width: 500px;
      max-height: 375px;
    }

    .photo {
      position: relative;
      overflow: hidden;
      max-width: 500px;
      max-height: 375px;
      display: inline-block;
      background: hsl(0, 0%, 0%);
      text-align: left;
      font-size: 0.8em;
      margin: 0;

      img {
        display: block;
        max-width: 100%;
        transition: opacity 0.3s ease-in-out;
      }

      &:hover {
        .caption {
          transform: translateY(-100%);
        }

        img {
          opacity: 0.75;
        }
      }
    }

    .caption {
      position: absolute;
      width: 100%;
      padding: 0.5em;
      background: hsla(0, 0%, 100%, 0.75);
      z-index: 1;
      transition: transform 0.3s ease-in-out;

      .title,
      .author {
        display: block;
        color: hsl(0, 0%, 20%);
        text-decoration: none;
        line-height: 1.5;
      }

      .author {
        font-style: italic;
        font-size: 0.9em;
        float: right;

        &:before {
          color: hsl(0, 0%, 0%);
          content: "by";
          margin-right: 0.2em;
        }
      }

      .copy {
        font-size: 0.6em;
        color: hsl(0, 0%, 33%);
        clear: both;

        img {
          margin-bottom: -4px;
          display: inline-block;
        }
      }
    }
  }

  .description {
    text-align: justify;

    p {
      margin-top: 0.5em;

      &:first-of-type {
        margin-top: 0;
      }
    }
  }
}

.books {
  text-align: center;

  .book {
    position: relative;
    display: inline-block;
    vertical-align: top;
    width: 150px;
    margin: 0.5em;

    img {
      display: block;
    }

    figcaption {
      text-align: left;
      font-size: 0.8em;

      .author {
        text-align: right;
      }
    }
  }
}

.announcement {
  line-height: 1.5;
  padding: 1em;
  margin-top: 1em;
  font-size: 1.2em;
  background-color: var(--secondary-2);
  text-align: center;

  a {
    color: var(--primary-3);

    &:hover,
    &:active {
      color: var(--primary-1);
    }
  }
}

.map {
  width: 100%;
  aspect-ratio: 20 / 9;

  iframe,
  #trip-map {
    width: 100%;
    height: 100%;
  }
}

#search-results {
  max-width: 1200px;
  margin: 1em auto 0;
  padding: 1em;
  background-color: hsl(264, 100%, 98%);

  .search-result {
    padding: 0.5em 0;
  }

  .search-result-body {
    color: hsl(0, 0%, 20%);
    padding: 0.75em 0;
    line-height: 1.4;
  }
}

.searchbox {
  margin: 1em auto;
  max-width: 700px;
  display: flex;

  form {
    display: contents;
  }

  input[type="search"],
  input[type="submit"] {
    padding: 0.2em 0.5em;
    -webkit-appearance: none;
    -webkit-border-radius: 0;
    border: none;
    outline: none;
    margin: 0;
    font-size: 1.5em;
    font-family: sans-serif;
  }

  input[type="search"] {
    flex: 1;
    background-color: hsl(0, 0%, 100%);
    color: var(--primary-3);
    width: 100%;
  }

  input[type="submit"] {
    background-color: var(--secondary-4);
    color: var(--text-color);
    width: 6em;

    &:hover,
    &:active {
      background-color: var(--secondary-3);
    }
  }
}

.over {
  box-shadow: 0 2px 4px hsla(0, 0%, 0%, 0.5);

  a {
    font-size: 18px;
  }
}

.bw-byways:before {
  margin-right: 0.2em;
}

@media only screen and (min-width: 100ch) {
  body {
    font-size: 1em;

    & > header,
    & > main {
      padding: 1em 5em;
    }

    & > header {
      position: sticky;
      top: 0;
      z-index: 100;
    }

    & > footer {
      padding: 0.5em 5em;
    }

    &:not(.top) > header {
      box-shadow: 0 2px 4px hsla(0, 0%, 0%, 0.5);

      a {
        font-size: 18px;
      }
    }
  }

  .description {
    .books {
      float: right;
      margin: 0 0 0 0.5em;

      .next,
      .prev {
        font-size: 1.4em;
      }
    }
  }
}
