/* ============================================================
   Sterling & Cole — components.css
   Buttons · mobile nav · cookie banner · reveal
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  padding: 0.9rem 1.6rem;
}
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.section-dark .btn-primary { background: var(--on-dark); color: var(--dark); }
.section-dark .btn-primary:hover { background: #fff; }

.btn-text {
  background: transparent;
  color: var(--ink);
  padding: 0.9rem 0.2rem;
  border-radius: 0;
  border-bottom: 1px solid var(--ink);
}
.btn-text span { transition: transform 0.2s ease; }
.btn-text:hover span { transform: translateX(4px); }

/* ---------- Mobile nav ---------- */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  margin-right: -10px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block; width: 24px; height: 1.5px;
  background: var(--ink);
  margin-inline: auto;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem var(--gutter) 1.75rem;
  border-top: 1px solid var(--on-dark-line);
  background: var(--dark);
  color: var(--on-dark);
}
.mobile-nav a {
  font-family: var(--serif);
  font-size: 1.5rem;
  padding: 0.6rem 0;
  color: var(--on-dark);
  border-bottom: 1px solid var(--on-dark-line);
}
.mobile-nav a.btn { margin-top: 1rem; border-bottom: 1px solid transparent; justify-content: center; font-family: var(--sans); font-size: 0.95rem; }
.mobile-nav[hidden] { display: none; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 32px));
  z-index: 150;
  background: var(--dark);
  color: var(--on-dark);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-text { font-size: 0.85rem; color: var(--on-dark-60); line-height: 1.6; }
.cookie-text a { color: var(--on-dark); text-decoration: underline; text-underline-offset: 2px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cookie-actions .btn { flex: 1 1 auto; justify-content: center; }
.cookie-actions .btn-text { color: var(--on-dark); border-bottom-color: var(--on-dark-60); border-radius: 0; }
@media (min-width: 620px) {
  .cookie-banner { flex-direction: row; align-items: center; }
  .cookie-text { flex: 1; }
  .cookie-actions { flex: 0 0 auto; }
  .cookie-actions .btn { flex: 0 0 auto; }
}

/* ---------- Legal pages ---------- */
.legal-hero { padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.legal-hero .eyebrow { margin-bottom: 0.9rem; }
.legal-hero p.updated { color: var(--ink-55); margin-top: 1rem; font-size: 0.9rem; }
.legal-body { padding-block: clamp(2.5rem, 5vw, 4rem) var(--section-y); }
.legal-body .container { max-width: 760px; }
.legal-body h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin-top: 2.75rem; margin-bottom: 0.9rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { font-size: 1.2rem; margin-top: 1.75rem; margin-bottom: 0.6rem; }
.legal-body p, .legal-body li { color: var(--ink-70); }
.legal-body p + p { margin-top: 1rem; }
.legal-body ul { margin: 1rem 0; padding-left: 1.25rem; }
.legal-body li { margin-bottom: 0.5rem; }
.legal-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.legal-table th, .legal-table td { text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-table thead th { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-55); font-weight: 500; background: var(--bg-alt); }
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table td { color: var(--ink-70); }
.legal-table td:first-child { color: var(--ink); font-family: var(--serif); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
