/* ==========================================================================
   Terms of Use - Styles
   Shared tokens/reset/btn/footer-base -> css/global.css
   ========================================================================== */

/* ---------- Page-specific CSS Variables ---------- */
:root {
  --font-size-nav:        clamp(0.875rem, 1vw, 1rem);
  --font-size-page-title: clamp(1.75rem, 4vw, 3rem);
  --font-size-body:       clamp(1rem, 1.4vw, 1.25rem);
  --font-size-footer:     clamp(0.8125rem, 1vw, 1rem);
  --space-35:             2.1875rem;
  --space-76:             4.75rem;
  --space-110:            6.875rem;
  --space-171:            10.6875rem;
  --footer-height:        51px;
}

/* ---------- Page Wrapper ---------- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0 auto;
}

/* ==========================================================================
   HEADER / NAVBAR (Terms uses unique .header structure)
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-primary);
  width: 100%;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: var(--space-28) var(--space-30);
  max-width: var(--max-width);
  margin: 0 auto;
}

.header__logo {
  flex-shrink: 0;
  width: 126px;
  height: 59px;
}

.header__logo-link {
  display: block;
  text-decoration: none;
}

.header__logo-img {
  width: 126px;
  height: 59px;
  object-fit: cover;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.header__nav-link {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1rem;
  padding: 0.25rem 0;
  color: var(--color-white);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.header__nav-link:hover,
.header__nav-link:focus-visible {
  opacity: 0.8;
}

.header__nav-link:focus-visible {
  outline: 2px solid var(--color-light);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Mobile Menu Toggle */
.header__menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-8);
  color: var(--color-white);
}

.header__menu-toggle svg {
  width: 28px;
  height: 28px;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.main {
  flex: 1;
  background-color: var(--color-white);
  width: 100%;
}

.main__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-110) var(--space-171);
  display: flex;
  flex-direction: column;
  gap: var(--space-76);
}

.main__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-page-title);
  color: var(--color-primary);
  line-height: 1.3;
}

/* Terms Content */
.terms-content {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--color-primary);
  line-height: 1.65;
  max-width: 1097px;
}

.terms-content p { margin-bottom: 0; }
.terms-content p + p { margin-top: 0; }

.terms-content__notice {
  text-transform: uppercase;
  margin-bottom: 1.5em;
}

.terms-content__section-heading {
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1.5em;
}

.terms-content__clause {
  margin-bottom: 1.2em;
}

.terms-content__clause:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   FOOTER (Terms uses unique height / padding — overrides global.css)
   ========================================================================== */
.footer {
  background-color: var(--color-primary);
  width: 100%;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: var(--footer-height);
  padding: 0 var(--space-35);
  max-width: var(--max-width);
  margin: 0 auto;
  gap: var(--space-15);
}

.footer__copyright {
  font-family: var(--font-body);
  font-size: var(--font-size-footer);
  color: var(--color-light);
}

.footer__link {
  font-family: var(--font-body);
  font-size: var(--font-size-footer);
  color: var(--color-light);
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

.footer__link:hover,
.footer__link:focus-visible {
  opacity: 0.8;
}

.footer__link:focus-visible {
  outline: 2px solid var(--color-light);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ==========================================================================
   RESPONSIVE: Tablet (<=1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .main__inner {
    padding: 4rem 3rem;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .header__inner {
    padding: 1rem;
  }

  .header__logo-img {
    width: 100px;
    height: auto;
  }

  .header__menu-toggle {
    display: block;
  }

  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-primary);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .header__nav--open {
    display: flex;
  }

  .header__nav-list {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: flex-start;
  }

  .header__nav-link {
    font-size: 1rem;
    padding: 0.5rem 0;
    display: block;
    width: 100%;
  }

  .btn--contact {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
  }

  .main__inner {
    padding: 2.5rem 1.25rem;
    gap: 2rem;
  }

  .terms-content {
    max-width: 100%;
  }

  .footer__inner {
    flex-direction: column;
    height: auto;
    padding: 1rem 1.25rem;
    gap: 0.5rem;
    justify-content: center;
    text-align: center;
  }
}

/* ==========================================================================
   RESPONSIVE: Small Mobile (<=400px)
   ========================================================================== */
@media (max-width: 400px) {
  .main__inner {
    padding: 2rem 1rem;
    gap: 1.5rem;
  }

  .header__inner {
    padding: 1rem;
  }

  .footer__inner {
    padding: 0.75rem 1rem;
  }
}

/* ============================================================
   RESPONSIVE: Small mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .navbar__inner { padding: var(--space-16); }
  .main__inner {
    padding: 2rem 1rem;
    gap: 1.5rem;
  }

  .header__inner {
    padding: 1rem;
  }

  .footer__inner {
    padding: 0.75rem 1rem;
  }
  
}
