/*
 * Hickory Chair · Designer Collections
 *
 * Shared styles for two surfaces:
 *   • collections.html   — the designer-led index (8 collection cards)
 *   • collection.html    — single-collection detail (hero + bio + pieces)
 *
 * Tokens duplicated locally (rather than relying on a host page :root)
 * because index.html embeds the same markup inside its Collection tab and
 * the brand tokens there live inside the page <style> block, not a global
 * stylesheet — the duplication keeps both surfaces visually identical.
 */

:root {
  --hc-ink:        #14110d;
  --hc-ink-soft:   #2c2620;
  --hc-muted:      #786d5f;
  --hc-muted-soft: #a89e8d;
  --hc-line:       rgba(20, 17, 13, 0.10);
  --hc-line-soft:  rgba(20, 17, 13, 0.06);
  --hc-hairline:   rgba(20, 17, 13, 0.18);
  --hc-canvas:     #f1ece2;
  --hc-paper:      #fbf8f1;
  --hc-soft:       #ece6d9;
  --hc-gold:       #97774a;
  --hc-gold-soft:  #b89773;
  --hc-gold-deep:  #6f5634;
  --hc-serif:      "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --hc-sans:       "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
 * Shared topbar (44pt + safe-area). Used by collections.html / collection.html
 * standalone pages. When the same markup is embedded inside index.html's
 * Collection tab, the topbar is suppressed (the host page has its own).
 */
.hc-collections-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(44px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(251, 248, 241, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(1.05);
  backdrop-filter: blur(20px) saturate(1.05);
  border-bottom: 1px solid var(--hc-line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 18px;
  padding-right: 18px;
  font-family: var(--hc-sans);
}
.hc-collections-topbar .title {
  font-family: var(--hc-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--hc-ink);
}
.hc-collections-topbar .meta {
  font-family: var(--hc-sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hc-muted);
  font-weight: 600;
}
.hc-collections-topbar .back {
  background: none;
  border: 0;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hc-ink);
  cursor: pointer;
  margin-left: -10px;
}
.hc-collections-topbar .back svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
 * Index hero — "The Collections / Designer-led, since 1911"
 */
.hc-collections-hero {
  padding: 44px 24px 22px;
  max-width: 880px;
  margin: 0 auto;
  text-align: left;
}
.hc-collections-hero .eyebrow {
  font-family: var(--hc-sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hc-gold-deep);
  font-weight: 600;
  margin: 0 0 12px;
}
.hc-collections-hero h1 {
  margin: 0 0 14px;
  font-family: var(--hc-serif);
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.005em;
  color: var(--hc-ink);
}
.hc-collections-hero p {
  margin: 0;
  font-family: var(--hc-serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--hc-ink-soft);
  max-width: 560px;
}

/* --------------------------------------------------------------------------
 * Index grid — 1-up on phone, 2-up tablet+
 */
.hc-collections-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px 56px;
  padding-left:  max(16px, env(safe-area-inset-left,  0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .hc-collections-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 18px 32px 72px;
  }
}

.hc-collection-card {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: var(--hc-paper);
  border: 1px solid var(--hc-line-soft);
  -webkit-tap-highlight-color: transparent;
  transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.hc-collection-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(28, 22, 14, 0.10);
  border-color: var(--hc-gold);
}

.hc-collection-card .photo {
  aspect-ratio: 16 / 9;
  background-color: var(--hc-soft);
  background-size: cover;
  background-position: center;
  position: relative;
}
.hc-collection-card .photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(20,17,13,0.20));
}

.hc-collection-card .body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hc-collection-card .eyebrow {
  font-family: var(--hc-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hc-gold-deep);
  margin: 0;
}
.hc-collection-card .name {
  margin: 0;
  font-family: var(--hc-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--hc-ink);
}
.hc-collection-card .bio {
  margin: 4px 0 0;
  font-family: var(--hc-serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--hc-ink-soft);
  /* clamp to 3 lines so cards stay even-height */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hc-collection-card .browse {
  margin: 8px 0 0;
  font-family: var(--hc-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--hc-gold-deep);
}

/* Skeleton state while __HC_DESIGNER_COLLECTIONS__ loads */
.hc-collections-loading {
  padding: 80px 24px;
  text-align: center;
  color: var(--hc-muted);
  font-family: var(--hc-sans);
  font-size: 13px;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
 * Single-collection detail (collection.html?slug=...)
 */
.hc-collection-hero {
  position: relative;
  width: 100%;
  height: 56vh;
  min-height: 380px;
  background-color: #2c2620;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hc-collection-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,17,13,0.18) 0%, rgba(20,17,13,0.10) 35%, rgba(20,17,13,0.78) 100%);
}
.hc-collection-hero .overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  padding: 28px 24px 36px;
  color: white;
  max-width: 720px;
  padding-left:  max(24px, env(safe-area-inset-left,  0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.hc-collection-hero .eyebrow {
  font-family: var(--hc-sans);
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin: 0 0 8px;
  font-weight: 600;
}
.hc-collection-hero h1 {
  margin: 0;
  font-family: var(--hc-serif);
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.005em;
}
.hc-collection-hero .designer {
  margin-top: 12px;
  font-family: var(--hc-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.92);
}

.hc-collection-bio {
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 24px 18px;
  padding-left:  max(24px, env(safe-area-inset-left,  0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.hc-collection-bio p {
  font-family: var(--hc-serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--hc-ink-soft);
  margin: 0 0 14px;
}
.hc-collection-bio details {
  margin: 8px 0 0;
}
.hc-collection-bio details summary {
  cursor: pointer;
  font-family: var(--hc-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hc-gold-deep);
  list-style: none;
  padding: 12px 0;
  border-top: 1px solid var(--hc-line-soft);
  -webkit-tap-highlight-color: transparent;
}
.hc-collection-bio details summary::-webkit-details-marker { display: none; }
.hc-collection-bio details summary::after {
  content: "  →";
  margin-left: 4px;
  transition: transform 200ms ease;
  display: inline-block;
}
.hc-collection-bio details[open] summary::after {
  transform: rotate(90deg);
}
.hc-collection-bio details p {
  font-size: 15px;
  margin: 8px 0 12px;
}

/* Pieces grid — 2-up phone, 4-up desktop, mirrors designer.html */
.hc-collection-pieces {
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 0 16px 56px;
  padding-left:  max(16px, env(safe-area-inset-left,  0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.hc-collection-pieces .section-h {
  margin: 0 0 12px;
  font-family: var(--hc-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hc-muted);
}
.hc-pieces-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 14px;
}
@media (min-width: 720px) {
  .hc-pieces-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 18px;
  }
}
@media (min-width: 1080px) {
  .hc-pieces-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.hc-piece-card {
  background: var(--hc-paper);
  border: 1px solid var(--hc-line-soft);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
  transition: transform 240ms ease, box-shadow 240ms ease;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.hc-piece-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(28,22,14,0.08);
}
.hc-piece-card .photo {
  aspect-ratio: 4 / 5;
  background-color: var(--hc-soft);
  background-size: cover;
  background-position: center;
}
.hc-piece-card .body { padding: 12px 12px 16px; }
.hc-piece-card .sku {
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--hc-gold-deep);
}
.hc-piece-card h4 {
  margin: 4px 0 6px;
  font-family: var(--hc-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}
.hc-piece-card .trade {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--hc-gold-deep);
  text-transform: uppercase;
  margin: 0;
}

/* "Speak with a designer" CTA at the bottom of the detail page */
.hc-collection-cta {
  max-width: 720px;
  margin: 24px auto 56px;
  padding: 28px 24px;
  background: var(--hc-canvas);
  border: 1px solid var(--hc-line-soft);
  border-radius: 10px;
  text-align: center;
  margin-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}
.hc-collection-cta .eyebrow {
  font-family: var(--hc-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hc-gold-deep);
  margin: 0 0 8px;
}
.hc-collection-cta h3 {
  margin: 0 0 8px;
  font-family: var(--hc-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--hc-ink);
}
.hc-collection-cta p {
  margin: 0 0 18px;
  font-family: var(--hc-serif);
  font-size: 15px;
  color: var(--hc-ink-soft);
}
.hc-collection-cta-trigger {
  display: inline-block;
  background: var(--hc-ink);
  color: white;
  font-family: var(--hc-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease;
  min-height: 44px;
}
.hc-collection-cta-trigger:hover { background: var(--hc-gold-deep); }

/* --------------------------------------------------------------------------
 * Embedded variant — when collections.html markup is mounted inside
 * index.html's Collection tab, the host page already supplies a topbar
 * and a tabbar. Rules below only apply when the wrapper is tagged
 * `data-hc-collections-embedded`.
 */
[data-hc-collections-embedded] .hc-collections-topbar { display: none; }
[data-hc-collections-embedded] .hc-collections-hero { padding-top: 28px; }
