/* Shared shell styles for public pages: unified header, footer, and nav behavior */
:root {
  --shell-primary: #ea580c;
  --shell-primary-deep: #c2410c;
  --shell-primary-soft: #fff2e8;
}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white, #ffffff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ── Brand / Logo ─────────────────────────────────────────── */
.header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.header .brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  border: none;
  border-radius: 0;
}

.header .brand-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1;
  color: var(--shell-primary-deep);
}

.header .brand-tag {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #64748b);
  margin-top: 2px;
}

/* ── Desktop Navigation ───────────────────────────────────── */
.header .main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.header .nav-link {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate, #334155);
  text-decoration: none;
  transition:
    background 0.22s ease,
    color 0.22s ease;
  white-space: nowrap;
}

.header .nav-link:hover {
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

.header .nav-link.active {
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
  font-weight: 700;
}

/* ── Header Action Buttons ────────────────────────────────── */
.header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header .auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Menu Button (hidden on desktop) ──────────────────────── */
.header .menu-btn {
  display: none;
  border: none;
  background: none;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER OVERRIDES
   ══════════════════════════════════════════════════════════════ */
.footer {
  background: #05070b;
  color: #d1d5db;
}

.footer .footer-link {
  color: #e5e7eb;
}

.footer .footer-link:hover {
  color: #fed7aa;
}

.footer .footer-head::after {
  background: var(--shell-primary);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE NAVIGATION
   ══════════════════════════════════════════════════════════════ */
body.mobile-nav-open {
  overflow: hidden;
}

/* Smooth page transitions for pages using shared shell partials */
body.shared-shell-loading {
  opacity: 0;
  transform: translateY(8px);
}

body.shared-shell-ready {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 280ms ease,
    transform 320ms ease;
}

body.shared-shell-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  body.shared-shell-ready,
  body.shared-shell-leaving {
    transition: none;
  }
}

/* ── Mobile Drawer Panel ────────────────────────────────────── */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(88vw, 340px);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-left: none;
  box-shadow:
    -20px 0 60px rgba(15, 23, 42, 0.22),
    -4px 0 16px rgba(15, 23, 42, 0.08);
  padding: 0;
  z-index: 240;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0s linear 0.32s;
}

.mobile-nav.open {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0s linear 0s;
}

/* ── Top Bar (Logo + Close) ─────────────────────────────────── */
.mobile-nav-top {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.mobile-brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.mobile-brand-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--shell-primary-deep);
}

.mobile-brand-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #94a3b8);
  margin-top: 2px;
}

.mobile-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.18s ease,
    color 0.18s ease;
  flex-shrink: 0;
}

.mobile-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* ── Navigation Links ───────────────────────────────────────── */
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px 8px;
  flex: 1;
}

.mobile-nav .nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.96rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  letter-spacing: 0.01em;
  position: relative;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.mobile-nav .nav-link:hover {
  background: #f8fafc;
  color: #1e293b;
  transform: translateX(2px);
}

.mobile-nav .nav-link.active {
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
  font-weight: 700;
}

.mobile-nav .nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--shell-primary);
}

/* ── Backdrop ───────────────────────────────────────────────── */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 230;
  transition: opacity 0.28s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Action Buttons ─────────────────────────────────────────── */
.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.mobile-nav-actions .auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-nav-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  font-size: 0.94rem;
  font-weight: 600;
  border-radius: 10px;
  letter-spacing: 0.01em;
}

.mobile-nav-actions .btn-primary {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

.mobile-nav-actions .btn-primary:hover {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

.mobile-nav-actions .btn-ghost {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #334155;
}

.mobile-nav-actions .btn-ghost:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤920px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 920px) {
  .header .header-inner {
    min-height: 64px;
    padding: 0 16px;
    gap: 10px;
  }

  .header .brand-logo {
    width: 40px;
    height: 40px;
  }

  .header .brand-name {
    font-size: 1.04rem;
    margin-bottom: 2px;
  }

  .header .brand-tag {
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .header .main-nav,
  .header .header-actions {
    display: none !important;
  }

  .header .menu-btn {
    display: flex;
    flex-direction: column;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .header .menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #1e293b;
    transition:
      transform 0.22s ease,
      opacity 0.22s ease;
  }

  .header .menu-btn.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .header .menu-btn.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .header .menu-btn.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .header .menu-btn:hover {
    background: #f1f5f9;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤560px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .header .header-inner {
    min-height: 58px;
    padding: 0 14px;
  }

  .header .brand-logo {
    width: 36px;
    height: 36px;
  }

  .header .brand-name {
    font-size: 0.98rem;
  }

  .header .brand-tag {
    font-size: 0.58rem;
  }

  .mobile-nav {
    width: min(92vw, 340px);
  }

  .mobile-nav .nav-link {
    font-size: 0.94rem;
    min-height: 46px;
    padding: 11px 14px;
  }

  .mobile-nav-actions .btn {
    min-height: 44px;
    font-size: 0.92rem;
  }

  .mobile-nav-actions {
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav-top {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px;
  }

  .mobile-nav-links {
    padding: 10px 12px 6px;
  }
}

/* ══════════════════════════════════════════════════════════════
   HIDE MOBILE NAV ON DESKTOP
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 921px) {
  .mobile-nav {
    display: none !important;
  }

  .mobile-nav-backdrop {
    display: none !important;
  }
}
