@layer fonts {
  @font-face {
    font-display: swap;
    font-family: 'League Spartan';
    font-style: normal;
    font-weight: 300;
    src: url('/fonts/league-spartan-v11-latin-300.woff2') format('woff2');
  }

  @font-face {
    font-display: swap;
    font-family: 'League Spartan';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/league-spartan-v11-latin-regular.woff2') format('woff2');
  }

  @font-face {
    font-display: swap;
    font-family: 'League Spartan';
    font-style: normal;
    font-weight: 600;
    src: url('/fonts/league-spartan-v11-latin-600.woff2') format('woff2');
  }

  @font-face {
    font-display: swap;
    font-family: 'League Spartan';
    font-style: normal;
    font-weight: 700;
    src: url('/fonts/league-spartan-v11-latin-700.woff2') format('woff2');
  }
}

@layer colors {
  :root {
    --c-brown: #9e7f66;
    --c-black: #111111;
    --c-white: #f2f2f2;

    --c-gray-100: #17182b;
    --c-gray-300: #242b37;
    --c-gray-400: #4c4c4c;
    --c-gray-500: #5c6779;

    --c-gray-450: #4c4c4c50;

    --c-shadow: #38425550;

    --color-text-light: var(--c-white);
    --color-text-dark: var(--c-black);
    --color-background-dark: var(--c-black);
    --color-background-light: var(--c-white);

    --color-tab: var(--c-gray-450);
    --color-tab-active: var(--c-gray-400);
  }
}

@layer typography {
  :root {
    --fs-80: calc(80 / 16 * 1rem);
    --fs-48: calc(48 / 16 * 1rem);
    --fs-32: calc(32 / 16 * 1rem);
    --fs-20: calc(20 / 16 * 1rem);
    --fs-17: calc(17 / 16 * 1rem);
    --fs-16: calc(16 / 16 * 1rem);

    --font-size-h1: var(--fs-32);
    --font-size-h2: var(--fs-32);
    --font-size-h3: var(--fs-20);

    --font-size-p: var(--fs-16);
    --font-size-tab: var(--fs-17);
    --font-size-p-sm: var(--fs-16);

    @media (width >= calc(768 / 16 * 1em)) {
      --font-size-h1: var(--fs-48);
      --font-size-h2: var(--fs-48);

      --font-size-p: var(--fs-20);
    }

    @media (width >= calc(1024 / 16 * 1em)) {
      --font-size-h1: var(--fs-80);
    }
  }

  h1,
  h2,
  h3,
  p {
    text-align: center;
    text-wrap: balance;

    @media (width >= calc(1024 / 16 * 1em)) {
      text-align: start;
    }
  }

  h1,
  h2,
  h3 {
    margin: 0;
  }

  h1 {
    line-height: 1;
    font-weight: 300;
    letter-spacing: -0.0125em;
    font-size: var(--font-size-h1);
  }

  h2 {
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: var(--font-size-h2);
  }

  h3 {
    font-weight: 700;
    letter-spacing: -0.0125em;
    line-height: calc(24 / 20);
    font-size: var(--font-size-h3);
  }

  p {
    line-height: 1.5;
    font-size: var(--font-size-p);

    &.small {
      font-size: var(--font-size-p-sm);
    }
  }

  a {
    text-decoration: none;
  }
}

@layer global {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    font-family: League Spartan, sans-serif;

    color: var(--c-gray-300);
    background-color: var(--color-background-light);
  }

  img {
    height: auto;
    display: block;
    max-width: 100%;
  }

  button {
    font-family: inherit;
  }

  .hidden-on-mobile {
    @media (width < calc(768 / 16 * 1em)) {
      display: none;
    }
  }

  .visually-hidden {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .shadow {
    border-radius: 5px;
    box-shadow: 0 75px 100px -50px var(--c-shadow);
  }
}

@layer layout {
  .wrapper {
    display: grid;
    grid-template-columns: 24px 1fr 24px;

    > * {
      grid-column: 2;
    }

    > .full-width {
      grid-column: 1 / -1;
    }

    @media (width >= calc(768 / 16 * 1em)) {
      grid-template-columns: 1fr min(1110px, 100% - 80px) 1fr;
    }
  }
}

@layer components {
  .button {
    width: fit-content;
    padding: 24px 55px;
    margin-inline: auto;

    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15625em;

    color: var(--color-text-light);
    border: 1px solid var(--color-text-light);
    border-radius: 5px;

    transition: 200ms ease-in-out;
    transition-property: color, background-color;

    &.dark {
      color: var(--color-text-light);
      border: 1px solid var(--color-background-dark);
      background-color: var(--color-background-dark);
    }

    &:hover {
      color: var(--color-text-dark);
      background-color: var(--color-background-light);
    }

    @media (width >= calc(1024 / 16 * 1em)) {
      margin-inline: 0;
    }
  }
}

@layer header {
  .header {
    .logo {
      position: absolute;
      top: 110px;

      @media ((width < calc(1024 / 16 * 1em))) {
        top: 374px;
        left: 50%;
        translate: -50% 0;
      }

      @media ((width < calc(768 / 16 * 1em))) {
        top: 232px;
        width: calc(82.4 / 16 * 1rem);
        height: calc(32 / 16 * 1rem);
      }
    }
  }
}

@layer hero {
  .hero {
    display: grid;
    grid-template-rows: 300px repeat(4, auto);

    color: var(--color-text-light);
    background-color: var(--color-background-dark);

    & .image {
      grid-row: 1 / -1;

      & img {
        justify-self: center;

        @media (width < calc(1024 / 16 * 1em)) {
          width: calc(768 / 16 * 1rem);
        }

        @media (width < calc(768 / 16 * 1em)) {
          width: calc(375 / 16 * 1rem);
        }

        @media (width >= calc(1024 / 16 * 1em)) {
          height: 100vh;
          min-height: 800px;
          object-fit: cover;
        }
      }
    }

    & .title {
      margin-block-end: 20px;
      line-height: 1.3;
      grid-row: 2;

      @media (width >= calc(1024 / 16 * 1em)) {
        line-height: 1;
        max-width: 15ch;
      }
    }

    & .description {
      grid-row: 3;
      line-height: 1.625;
      margin-block-end: 50px;

      @media (width >= calc(1024 / 16 * 1em)) {
        line-height: 1.5;
        max-width: 45ch;
      }
    }

    & .button {
      grid-row: 4;
    }

    @media (width >= calc(768 / 16 * 1em)) {
      grid-template-rows: 452px repeat(4, auto);
    }

    @media (width >= calc(1024 / 16 * 1em)) {
      min-height: 100vh;
      overflow: hidden;
      justify-items: start;
      grid-template-rows: 258px repeat(4, auto);
    }
  }
}

@layer features {
  .features {
    margin-block-start: -72px;

    .feature {
      display: grid;
      position: relative;
      justify-items: center;
      margin-block-end: 100px;

      @media (width >= calc(1024 / 16 * 1em)) {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
        column-gap: 125px;
      }

      & .image {
        margin-block-end: 48px;

        @media (width >= calc(768 / 16 * 1em)) {
          max-width: calc(573 / 16 * 1rem);
        }

        @media (width >= calc(1024 / 16 * 1em)) {
          max-width: calc(540 / 16 * 1rem);
          margin-block-end: 0;
        }
      }

      & .text-content {
        @media (width < calc(1024 / 16 * 1em)) {
          display: grid;
          justify-items: center;
        }
      }

      & .divider {
        margin-block-end: 36px;
      }

      & .title {
        margin-block-end: 13px;
        line-height: 1.25;
        max-width: 20ch;
      }

      & .description {
        max-width: 45ch;
      }

      & .pattern {
        position: absolute;
        max-width: none;
        top: 184px;
        right: 35%;
        z-index: -1;
      }

      &:nth-child(2) .pattern {
        bottom: -75px;
        left: 50%;
        top: auto;
        right: auto;
        height: 320px;
        width: 49vw;

        @media (width >= calc(1024/16 * 1em)) {
          bottom: 0;
          left: 25%;
        }
      }

      &:nth-child(2) picture {
        @media (width >= calc(1024/16 * 1em)) {
          order: 2;
        }
      }

      & .lines {
        position: absolute;
        top: 228px;
        right: 35px;

        @media (width >= calc(1024/16 * 1em)) {
          right: -40px;
        }
      }
    }
  }
}

@layer highlights {
  .highlights {
    color: var(--color-text-light);
    background-color: var(--color-background-dark);

    padding-block: 72px;

    & .content {
      @media (width >= calc(1024 / 16 * 1em)) {
        display: grid;
        align-items: start;
        grid-template-columns: repeat(2, 1fr);
        column-gap: 24px;
      }
    }

    & .text-content {
      display: grid;
      justify-items: center;

      @media (width >= calc(1024 / 16 * 1em)) {
        justify-items: start;
      }
    }

    & .divider {
      margin-block-end: 36px;
    }

    & .title {
      margin-block-end: 13px;
    }

    & .description {
      margin-block-end: 85px;

      @media (width >= calc(1024 / 16 * 1em)) {
        max-width: 40ch;
        text-wrap: auto;
      }
    }

    & .items {
      display: grid;
      justify-content: center;
      gap: 24px;
    }

    & .item {
      display: grid;
      position: relative;
      justify-items: center;

      &:not(:last-child) {
        border-block-end: 2px solid var(--c-shadow);
      }

      @media (width >= calc(768 / 16 * 1em)) {
        grid-template-columns: 160px 1fr;
        justify-items: start;
        column-gap: 80px;
      }
    }

    & .item-image {
      img {
        border-radius: 5px;
        margin-block-end: 36px;
      }
    }

    & .item-title {
      @media (width >= calc(768 / 16 * 1em)) {
        text-align: start;
        margin-block-start: 8px;
      }
    }

    & .item-description {
      margin-block-end: 56px;

      @media (width >= calc(768 / 16 * 1em)) {
        text-align: start;
        text-wrap: auto;
        max-width: 40ch;
        margin-block-end: 0;
        font-size: 14px;
      }
    }

    & .item-decorative {
      position: absolute;
      height: 1px;
      width: 50px;

      left: 160px;
      top: 18px;

      background-color: var(--c-brown);
    }

    @media (width >= calc(1024 / 16 * 1em)) {
      margin-block-start: -150px;
      padding-block-start: 120px;
    }
  }
}

@layer booking {
  .booking {
    position: relative;
    padding-block: 102px;

    & .tablist {
      position: absolute;
      width: 100%;

      display: grid;
      justify-items: center;
      gap: 16px;

      top: calc((100vw - 48px) / 0.815 + 102px + 40px);

      @media (width >= calc(694 / 16 * 1em)) {
        top: 948px;
      }

      @media (width >= calc(768 / 16 * 1em)) {
        top: calc(360px + 120px + 40px);
        grid-auto-flow: column;
      }

      @media (width >= calc(1024 / 16 * 1em)) {
        grid-auto-flow: row;
        justify-items: start;
        width: fit-content;

        left: 665px;
        top: auto;
        bottom: 160px;
      }

      @media (width >= calc(1160 / 16 * 1em)) {
        left: 688px;
      }
    }

    & .tab {
      border: none;
      cursor: pointer;
      position: relative;
      background: none;

      font-weight: 600;
      line-height: 1.64;
      letter-spacing: 0.147em;
      text-transform: uppercase;
      color: var(--color-tab);
      font-size: var(--font-size-tab);

      transition: color 200ms ease-in-out;

      &:hover,
      &[aria-selected='true'] {
        color: var(--color-tab-active);

        &::before {
          opacity: 1;
          width: 48px;

          @media (width >= calc(1024 / 16 * 1em)) {
            width: 143px;
            z-index: -1;
          }
        }
      }

      &::before {
        content: '';
        display: block;

        width: 0px;
        height: 1px;

        position: absolute;
        left: 50%;
        bottom: 0;
        translate: -50%;

        opacity: 0;
        background-color: var(--c-brown);

        transition: 200ms ease-in-out;
        transition-property: opacity, width;

        @media (width >= calc(1024 / 16 * 1em)) {
          left: -83px;
          bottom: 17px;
          transition-property: opacity;
        }
      }
    }

    & .tab-content {
      display: grid;
      justify-items: center;
      row-gap: calc(200 / 16 * 1rem);

      @media (width >= calc(768 / 16 * 1em)) {
        row-gap: calc(140 / 16 * 1rem);
      }

      @media (width >= calc(1024 / 16 * 1em)) {
        grid-template-columns: repeat(2, 1fr);
        align-items: start;
        column-gap: 125px;
      }

      .text-content {
        display: grid;
        justify-items: center;

        @media (width >= calc(1024 / 16 * 1em)) {
          justify-items: start;
        }
      }

      h3 {
        font-size: var(--font-size-h2);
        margin-block-end: 13px;

        @media (width >= calc(1024 / 16 * 1em)) {
          padding-block-start: 70px;
        }
      }

      p {
        margin-block-end: 27px;
        max-width: 42ch;
        text-wrap: auto;

        @media (width >= calc(768 / 16 * 1em)) {
          margin-block-end: 60px;
        }

        @media (width >= calc(1024 / 16 * 1em)) {
          font-size: var(--font-size-p-sm);
        }
      }
    }

    & .tab-image {
      @media (width >= calc(768 / 16 * 1em)) {
        max-width: calc(573 / 16 * 1rem);
      }

      @media (width >= calc(1024 / 16 * 1em)) {
        max-width: calc(540 / 16 * 1rem);
      }
    }

    & .pattern {
      position: absolute;
      right: 50%;
      z-index: -1;

      @media (width >= calc(1024 / 16 * 1em)) {
        right: 75%;
      }
    }

    & .lines {
      position: absolute;
      top: 82px;
      right: 77%;

      @media (width >= calc(1024 / 16 * 1em)) {
        top: 140px;
        right: 95%;
      }
    }

    @media (width >= calc(1024 / 16 * 1em)) {
      padding-block: 120px;
    }

    @media (width >= calc(1024 / 16 * 1em)) {
      padding-block: 160px;
    }
  }
}

@layer cta {
  .cta {
    min-height: 240px;
    color: var(--color-text-light);
    background-color: var(--color-background-dark);

    @media (width < calc(1024 / 16 * 1em)) {
      place-items: center;
    }

    .cta-picture {
      grid-row: 1;
    }

    .cta-image {
      height: 100%;
      object-fit: cover;
    }

    .text-content {
      display: grid;
      justify-items: center;
      gap: 24px;

      grid-row: 1;

      a {
        display: inline-block;
      }

      h2 {
        text-wrap: auto;
      }

      @media (width >= calc(1024 / 16 * 1em)) {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
      }
    }
  }
}

@layer footer {
  .footer {
    position: relative;
    padding-block: 80px;

    display: flex;
    flex-direction: column;
    justify-items: center;

    color: var(--color-text-light);
    background-color: var(--color-background-dark);

    & .logo {
      margin-block-end: 42px;
      margin-inline: auto;
    }

    & .text-content {
      @media (width >= calc(1024 / 16 * 1em)) {
        display: flex;
        gap: 180px;
      }
    }

    & .location {
      text-align: center;
      margin-block-end: 32px;

      @media (width >= calc(768 / 16 * 1em)) {
        text-align: start;
      }
    }

    & * {
      font-style: normal;
      text-transform: uppercase;
      letter-spacing: 2px;
      font-size: 14px;
      line-height: 2;

      @media (width >= calc(768 / 16 * 1em)) {
        text-align: start;
      }
    }

    a {
      color: inherit;

      &:hover {
        text-decoration: underline;
      }
    }

    .copyright {
      position: absolute;
      bottom: 0;
      width: 100%;
      text-align: center;
      font-weight: 300;
      font-size: 11px;
      opacity: 0.8;

      & a,
      & span {
        font-size: inherit;
      }
    }

    @media (width >= calc(768 / 16 * 1em)) {
      flex-direction: row;
      gap: 180px;
      justify-content: center;
      align-items: center;
    }
  }
}

@layer booking-page {
  .booking-header .logo {
    position: absolute;
    top: 40px;
    left: 50%;
    translate: -50% 0;

    @media (width >= calc(1024 / 16 * 1em)) {
      top: 65px;
      left: 50%;
      translate: -50% 0;
    }
  }

  .booking-hero {
    min-height: 600px;
    display: grid;
    grid-template-rows: 240px repeat(3, auto);

    color: var(--color-text-light);
    background-color: var(--color-background-dark);
    padding-bottom: 140px;

    & .image {
      grid-row: 1 / -1;

      & img {
        width: 100%;
        height: 600px;
        object-fit: cover;
      }
    }

    & .title {
      margin-block-end: 24px;
      grid-row: 2;
      margin-inline: auto;
    }

    & .description {
      grid-row: 3;
      margin-block-end: 24px;
      margin-inline: auto;
      text-wrap: auto;
      max-width: 45ch;
      text-align: center;
    }

    @media (width >= calc(1024 / 16 * 1em)) {
      min-height: 600px;
      overflow: hidden;
      justify-items: start;
      grid-template-rows: 228px repeat(3, auto);
    }
  }

  .booking-form {
    position: relative;
    margin-top: -120px;
    margin-bottom: 80px;

    & form {
      background-color: var(--color-background-light);
      padding: 32px;
      border-radius: 5px;
      box-shadow: 0 75px 100px -50px var(--c-shadow);
      max-width: 540px;
      margin: 0 auto;

      @media (width >= calc(768 / 16 * 1em)) {
        padding: 48px;
      }
    }

    & .form-grid {
      display: grid;
      gap: 32px;
    }

    & .lines {
      position: absolute;
      top: 82px;
      right: 77%;

      @media (width >= calc(1024 / 16 * 1em)) {
        top: 140px;
        right: 95%;
      }
    }

    & .form-group {
      position: relative;
    }

    & input,
    & select {
      width: 100%;
      padding: 16px;
      border: 1px solid var(--c-gray-450);
      border-radius: 4px;
      font-family: League Spartan, sans-serif;
      font-size: 18px;
      color: var(--c-gray-300);
      background-color: transparent;

      &::placeholder {
        color: var(--c-gray-450);
      }

      &:focus {
        outline: none;
        border-color: var(--c-gray-300);
      }

      &.error {
        border-color: #b54949;
      }
    }

    & .error-message {
      color: #b54949;
      font-size: 12px;
      margin-top: 8px;
      font-weight: 500;
    }

    & .select-wrapper {
      position: relative;

      &::after {
        content: '';
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 14px;
        height: 8px;
        background-image: url('/assets/icons/icon-arrow.svg');
        background-repeat: no-repeat;
        background-position: center;
        pointer-events: none;
      }
    }

    & select {
      appearance: none;
      padding-right: 40px;
    }

    & .form-date-time {
      & h3 {
        margin-bottom: 8px;
        font-size: 16px;
        font-weight: 600;
        color: var(--c-gray-300);

        @media (width < calc(1024 / 16 * 1em)) {
          text-align: left;
        }
      }
    }

    & .form-date,
    & .form-time {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 16px;
    }

    & .time-am-pm select {
      text-transform: uppercase;
    }

    & .form-people {
      border: 1px solid var(--c-gray-450);
      border-radius: 4px;
      padding: 20px 16px;
    }

    & .people-control {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    & #people-count {
      font-size: 18px;
      font-weight: 600;
      color: var(--c-gray-300);
    }

    & .counter-button {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 32px;
      height: 32px;
      background: transparent;
      border: none;
      cursor: pointer;
    }

    & .reservation-button {
      width: 100%;
      margin-top: 16px;
      background-color: var(--color-background-dark);
      color: var(--color-text-light);
      border: none;
      cursor: pointer;
      font-weight: 600;
      padding: 20px;

      &:hover {
        background-color: var(--c-brown);
        color: var(--color-text-light);
      }
    }
  }
}
