/*
 * Editorial Luxury component layer.
 * Linked from base.html AFTER style.css (Tailwind output) so these rules win.
 * Desktop is a centered-monogram header; mobile is a wordmark + fixed tab bar.
 */

/* ─── base ─── */
:root {
  --ink: #0F172A;
  --slate: #1E293B;
  --dust: #A8C1D9;
  --sky: #E3ECF3;
  --cream: #F8F5F0;
  --paper: #FFFFFF;
  --muted: #64748B;
  --line: #CBD5E1;
  --tabbar-h: 64px;
  --topbar-h: 52px;
}

html { scroll-behavior: smooth; }

body.editorial {
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.editorial a { color: inherit; text-decoration: none; }

/* ─── typography primitives ─── */
.eyebrow {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--dust { color: var(--dust); }

.display-1 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.25rem, 8vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.display-cream { color: var(--cream); }

.heading-1 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}
.heading-2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  line-height: 1.25;
  margin: 0 0 1rem;
}
.display-1 { margin: 0; }
.lead { margin: 0; }

.lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 38rem;
}
.lead--cream { color: rgba(248, 245, 240, 0.85); }

.rule-dust {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--dust);
  margin: 1.75rem 0;
  border: 0;
}

/* ─── layout ─── */
.section {
  padding: 5rem 1.25rem;
}
@media (min-width: 640px) { .section { padding: 6rem 1.5rem; } }
@media (min-width: 1024px) { .section { padding: 8rem 1.5rem; } }

.container-6xl {
  max-width: 72rem;
  margin-inline: auto;
}

/* ─── buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 1.5rem;
  border: 1px solid currentColor;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border-radius: 0;
}
/* Button colors use !important because .editorial a { color: inherit }
   has higher selector specificity and would otherwise win. */
.btn-primary { background: var(--ink); color: var(--cream) !important; border-color: var(--ink); }
.btn-primary:hover { background: transparent; color: var(--ink) !important; }
.btn-navy { background: linear-gradient(120deg, hsl(215 55% 18%) 0%, hsl(210 60% 30%) 100%); color: var(--cream) !important; border-color: transparent; }
.btn-navy:hover { filter: brightness(1.15); color: var(--cream) !important; }
.btn-ghost-cream { color: var(--cream) !important; border-color: rgba(248, 245, 240, 0.6); }
.btn-ghost-cream:hover { background: var(--cream); color: var(--ink) !important; border-color: var(--cream); }
.btn-ghost-ink { color: var(--ink) !important; border-color: var(--ink); }
.btn-ghost-ink:hover { background: var(--ink); color: var(--cream) !important; }

/* ─── cards ─── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card--accent::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--dust);
}

/* ─── hero shell ─── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--cream);
  background: var(--ink);
}
.hero--short { min-height: 56vh; }
.hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.55) 0%, rgba(15,23,42,0.9) 100%);
  z-index: 1;
}
.hero__inner {
  position: relative; z-index: 2;
  max-width: 44rem;
  padding: 0 1.5rem;
  width: 100%;
  margin-inline: auto;
}
@media (min-width: 1024px) { .hero { min-height: 85vh; } }

/* Desktop hero bg: cover the full area, image centered */
@media (min-width: 768px) {
  .hero:not(.hero--short) .hero__bg {
    background-size: cover;
    background-position: center;
  }
}

/* Mobile: content aligned to bottom so the hero image has room to breathe */
@media (max-width: 767px) {
  .hero:not(.hero--short) {
    align-items: flex-end;
    padding-bottom: 3.5rem;
  }
  .hero:not(.hero--short) .hero__overlay {
    background: linear-gradient(180deg,
      rgba(15,23,42,0.35) 0%,
      rgba(15,23,42,0.55) 45%,
      rgba(15,23,42,0.92) 100%);
  }
}

/* ─── desktop header (≥ 768px) ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 245, 240, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
          backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s ease;
}
body[data-scrolled="true"] .site-header {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.site-header__row1 {
  display: none;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2.5rem;
  height: 72px;
  padding: 0 2rem;
}
.site-header__rule { height: 1px; background: var(--line); opacity: 0.8; }
.site-header__mark {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 400;
  font-size: 1.125rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}

.site-nav {
  display: none;
  justify-content: center;
  gap: 2rem;
  padding-bottom: 0.75rem;
  border-top: 1px solid rgba(203, 213, 225, 0.3);
}
.site-nav-link {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 0 0.25rem;
  position: relative;
  transition: color 0.2s;
}
.site-nav-link:hover,
.site-nav-link[aria-current="page"] { color: var(--ink); }
.site-nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--dust);
}

@media (min-width: 768px) {
  .site-header__row1 { display: grid; }
  .site-nav { display: flex; }
}

/* ─── mobile top bar (< 768px) ─── */
.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 1rem;
  background: rgba(248, 245, 240, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
          backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transform: translateY(0);
  transition: transform 0.25s ease, box-shadow 0.3s ease;
}
body[data-topbar-hidden="true"] .mobile-topbar { transform: translateY(-100%); }
body[data-scrolled="true"] .mobile-topbar {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.mobile-topbar__mark {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

@media (min-width: 768px) { .mobile-topbar { display: none; } }

/* ─── bottom tab bar (< 768px only) ─── */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
          backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
  min-height: var(--tabbar-h);
  background: transparent;
  border: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: transform 0.12s ease, color 0.15s ease;
  cursor: pointer;
}
.tab:active { transform: scale(0.95); }
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
body[data-tab="home"]    .tab[data-tab="home"],
body[data-tab="work"]    .tab[data-tab="work"],
body[data-tab="fabrics"] .tab[data-tab="fabrics"],
body[data-tab="quote"]   .tab[data-tab="quote"],
body[data-tab="more"]    .tab[data-tab="more"] {
  color: var(--ink);
}
body[data-tab="home"]    .tab[data-tab="home"] svg,
body[data-tab="work"]    .tab[data-tab="work"] svg,
body[data-tab="fabrics"] .tab[data-tab="fabrics"] svg,
body[data-tab="quote"]   .tab[data-tab="quote"] svg {
  fill: var(--ink);
  stroke: var(--ink);
}

@media (min-width: 768px) {
  .tabbar, .more-sheet, .install-hint { display: none !important; }
}

main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { main { padding-bottom: 0; } }

/* ─── more sheet ─── */
.more-sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  z-index: 49;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 0.5rem 0;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.more-sheet[data-open="true"] { transform: translateY(0); }
.more-sheet a,
.more-sheet button {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}
.more-sheet a:last-child,
.more-sheet button:last-child { border-bottom: 0; }
.more-sheet__install {
  background: var(--sky) !important;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.more-sheet__install:hover { background: var(--dust) !important; }

/* ─── install hint (bottom-sheet toast above tab bar) ─── */
.install-hint {
  position: fixed;
  left: 0.75rem; right: 0.75rem;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 0.75rem);
  z-index: 48;
  background: var(--ink);
  color: var(--cream);
  padding: 0.75rem 0.75rem 0.75rem 0.75rem;
  border-radius: 14px;
  display: none;
  gap: 0.75rem;
  align-items: center;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.38), 0 2px 0 rgba(168, 193, 217, 0.25) inset;
}
.install-hint[data-visible="true"] { display: flex; }
.install-hint__icon {
  flex-shrink: 0;
  width: 46px; height: 46px;
  background: var(--cream);
  border-radius: 12px;
  padding: 5px;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}
.install-hint__icon img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 6px; }
.install-hint__body { flex: 1; min-width: 0; }
.install-hint__title {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.install-hint__sub {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  opacity: 0.7;
  line-height: 1.3;
}
.install-hint__actions { display: flex; gap: 0.25rem; align-items: center; flex-shrink: 0; }
.install-hint__actions button[data-action="install"] {
  background: var(--cream);
  color: var(--ink) !important;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.install-hint__actions button[data-action="install"]:active { transform: scale(0.96); }
.install-hint__actions button[data-action="dismiss"] {
  background: transparent;
  color: rgba(248, 245, 240, 0.55) !important;
  border: 0;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
}
.install-hint__actions button[data-action="dismiss"]:hover { color: rgba(248, 245, 240, 0.9) !important; }

/* ─── footer (desktop) ─── */
.site-footer {
  padding: 4rem 1.5rem 2rem;
  border-top: 1px solid var(--dust);
  color: var(--muted);
  font-size: 0.875rem;
}
@media (max-width: 767px) { .site-footer { padding-bottom: 0; } }

/* ─── masonry (gallery) ─── */
.masonry { column-gap: 1.25rem; }
.masonry > figure {
  break-inside: avoid;
  margin: 0 0 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: zoom-in;
  overflow: hidden;
}
.masonry > figure img { width: 100%; height: auto; display: block; transition: transform 0.5s ease; }
.masonry > figure:hover img { transform: scale(1.03); }
@media (min-width: 640px) { .masonry { column-count: 2; } }
@media (min-width: 1024px) { .masonry { column-count: 3; } }

/* ─── lightbox (shared across homepage carousel + gallery) ─── */
.lightbox {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lightbox[data-open="true"] { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox__close {
  position: absolute; top: 1rem; right: 1rem;
  background: transparent; border: 0; color: var(--cream);
  font-size: 1.75rem; cursor: pointer; line-height: 1;
}

/* ─── misc utilities ─── */
.hairline { border-top: 1px solid var(--line); }
.bg-cream-swatch { background: var(--cream); }
.bg-sky-swatch { background: var(--sky); }
.bg-ink-swatch { background: var(--ink); }
.bg-slate-swatch { background: var(--slate); }
.text-muted-swatch { color: var(--muted); }
.text-dust-swatch { color: var(--dust); }

/* ─── marquee (supplier partners) ─── */
.marquee {
  overflow: hidden;
  position: relative;
  padding: 2.5rem 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.marquee__track {
  display: flex;
  gap: 3.5rem;
  align-items: center;
  animation: marquee 45s linear infinite;
  width: max-content;
}
.marquee img { height: 40px; width: auto; filter: grayscale(1); opacity: 0.65; transition: filter 0.3s, opacity 0.3s; }
.marquee img:hover { filter: grayscale(0); opacity: 1; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
