/* H&B Client Portal — shared styling. Depends on tokens.css. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  color: var(--ink);
  margin: var(--sp-5) 0 var(--sp-3);
}
h1 { font-size: var(--fs-2xl); margin-top: 0; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

/* Text hyperlinks (brand rule): bright blue, no colour change once clicked.
   Scoped to unclassed prose links so buttons/pills/cards keep their own colour. */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:not([class]):visited { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

/* Article figures: photo + caption inside doc bodies. */
.doc-figure { margin: var(--sp-5) 0; }
.doc-figure img { width: 100%; border-radius: 6px; }
.doc-figure figcaption {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
}
body.theme-dark .doc-figure figcaption { color: var(--cloud); }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }

blockquote {
  margin: var(--sp-4) 0;
  padding: var(--sp-2) var(--sp-4);
  border-left: 4px solid var(--cloud);
  color: var(--ink-soft);
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
pre { background: var(--surface); padding: var(--sp-3); border-radius: var(--radius-sm); overflow-x: auto; }
pre code { background: none; padding: 0; }

table { border-collapse: collapse; width: 100%; margin: var(--sp-4) 0; font-size: var(--fs-sm); }
th, td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); }
th { font-family: var(--font-heading); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }

/* Layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-4); }
.wrap--narrow { max-width: var(--maxw-narrow); }

/* Site header — dark on every page, matching the H&B wordmark */
.site-header {
  background: var(--grey);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
}
.site-header .brand { white-space: nowrap;

  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body); /* the H&B wordmark is Inter, not Bricolage */
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--white);
  letter-spacing: -0.02em;
}
.site-header .brand:hover { text-decoration: none; }
.site-header .brand-mark { width: 28px; height: 28px; border-radius: 50%; }
.site-header .client-name { color: var(--cloud); font-weight: 400; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; flex: 1; gap: 2.25rem; margin-left: 2.5rem; font-size: var(--fs-sm); }
.site-nav a, .site-nav a:link, .site-nav a:visited, .site-nav a:active, .site-nav a.active, .navbtn {
  color: #C6CBD6; text-decoration: none;
}
.site-nav a:hover, .navgroup:hover .navbtn, .navgroup:focus-within .navbtn { color: var(--white); }
/* grouped nav dropdowns (Insights / Production) */
.navgroup { position: relative; display: inline-flex; }
.navbtn { font: inherit; font-size: var(--fs-sm); background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; }

.caret { opacity: .85; transition: transform .15s ease; }
.navgroup:hover .caret, .navgroup:focus-within .caret { transform: rotate(180deg); }
.navmenu { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: .5rem; display: none; flex-direction: column; gap: .6rem; background: #26262b; border: 1px solid #3d3d45; border-radius: .6rem; padding: .75rem 1rem; min-width: 10rem; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.navgroup:hover .navmenu, .navgroup:focus-within .navmenu { display: flex; }
.navmenu::before { content: ""; position: absolute; top: -.5rem; left: 0; right: 0; height: .5rem; }
.navmenu a, .navmenu a:visited, .navmenu a.active { white-space: nowrap; color: #C6CBD6; text-decoration: none; }
.navmenu a:hover { color: var(--white); }

/* Hero */
.hero { padding: var(--sp-6) 0 var(--sp-5); }
.hero .kicker {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}
.hero p.lede { font-size: var(--fs-md); color: var(--ink-soft); max-width: 40em; }

/* Section cards on HOME */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-4) 0 var(--sp-6);
}
.card {
  display: block;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--cloud); text-decoration: none; }
.card h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); }
.card p { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.card .count {
  display: inline-block;
  margin-top: var(--sp-3);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Item lists on section pages */
.item-list { list-style: none; padding: 0; margin: var(--sp-4) 0 var(--sp-6); }
.item-list li {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.item-list .date { font-size: var(--fs-xs); color: var(--ink-soft); white-space: nowrap; min-width: 6.5em; }
.item-list .title { flex: 1; }

/* Batch groups on section pages */
.batch-group { margin: var(--sp-5) 0; }
.batch-head { border-left: 4px solid var(--tomato); padding-left: var(--sp-3); margin-bottom: var(--sp-2); }
.batch-title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  margin: 0 0 var(--sp-1);
}
.batch-desc { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); max-width: 46em; }
.batch-desc .batch-overview { white-space: nowrap; }
.batch-group .item-list { margin-top: var(--sp-2); margin-bottom: 0; }

/* Download-as-md button */
.btn-dl {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2em 0.9em;
  margin-left: var(--sp-2);
  color: var(--ink-soft);
}
.btn-dl:hover { color: var(--accent); border-color: var(--cloud); text-decoration: none; }

/* Status pills */
.status {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
}
.status--draft     { background: var(--mercury); color: var(--ink-soft); }
.status--ready     { background: var(--cloud); color: var(--grey); }
.status--live      { background: var(--blue); color: var(--white); }
.status--published { background: var(--blue); color: var(--white); }
.status--planned   { background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line); }
.status--discussion { background: var(--tomato); color: var(--white); }
/* Opportunities: relabelled pills — Ready (solid blue) / For Review (pale blue) */
.status--opp-ready   { background: var(--blue); color: var(--white); }
.status--opp-review  { background: var(--cloud); color: var(--grey); }

/* Article/script/brief body — light "runsheet" look: soft grey page, white content card */
body:not(.theme-dark) { background: #EEF2F7; }
body:not(.theme-dark) .site-footer { border-top: 0; }
.doc-body { padding-bottom: var(--sp-5); }
.doc-body .hero { padding-bottom: var(--sp-4); }
.doc-content {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.doc-content > :first-child { margin-top: 0; }
.doc-content > :last-child { margin-bottom: 0; }
.doc-meta { font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: var(--sp-4); }
.doc-meta .status { margin-left: var(--sp-2); }
@media (max-width: 640px) { .doc-content { padding: var(--sp-4); } }

/* CTA button */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  background: var(--tomato);
  color: var(--white);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 999px;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--sp-4) 0;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
}

/* Breadcrumb */
.crumbs { font-size: var(--fs-sm); color: var(--ink-soft); margin: var(--sp-4) 0 0; }
.crumbs a { color: var(--ink-soft); }

/* Dark theme — HOME + section index pages (body.theme-dark), matching humbleandbrag.com */
.theme-dark {
  --bg: var(--grey);
  --ink: var(--white);
  --ink-soft: #B9BDC7;
  --line: #45454E;
  --surface: #3A3A42;
  background: var(--bg);
}
.theme-dark h1, .theme-dark h2, .theme-dark h3, .theme-dark h4 { color: var(--white); }
.theme-dark .hero .kicker { color: var(--tomato); }
.theme-dark a { color: var(--cloud); }
.theme-dark .card {
  background: #383840;
  border-color: #45454E;
}
.theme-dark .card:hover { border-color: var(--cloud); box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35); }
.theme-dark .card h3 { color: var(--white); }
.theme-dark .card .count { color: var(--tomato); }
.theme-dark .item-list .title a { color: var(--mercury); }
.theme-dark .item-list .title a:hover { color: var(--white); }
.theme-dark .status--draft { background: #45454E; color: #B9BDC7; }
.theme-dark .status--planned { background: transparent; color: #B9BDC7; border-color: #56565F; }
.theme-dark .status--ready { background: var(--cloud); color: var(--grey); }
.theme-dark .site-footer { color: #8E929C; }

@media (max-width: 640px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .hero { padding-top: var(--sp-5); }
}

/* HOME intro block — optional per-client portalIntro in client.json */
.portal-intro {
  max-width: 60em;
  margin: 0 0 var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.portal-intro .kicker { margin-bottom: var(--sp-2); }
.portal-intro p { margin: 0 0 var(--sp-2); }
.portal-intro h3 { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-base); }
.portal-intro ul { margin: 0; padding-left: 1.2em; }
.portal-intro li { margin: 0 0 .35em; }
.theme-dark .portal-intro { background: #383840; border-color: #45454E; }
.theme-dark .portal-intro .kicker { color: var(--tomato); }
.theme-dark .portal-intro p, .theme-dark .portal-intro li { color: #C9CDD6; }

/* Watch-on-YouTube CTA on doc pages (item.video in content-index) */
.btn-watch {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-xs);
  background: var(--tomato);
  color: var(--grey);
  padding: 0.25em 0.9em;
  border-radius: 999px;
  text-decoration: none;
  vertical-align: middle;
}
.btn-watch:hover { filter: brightness(1.05); text-decoration: none; }

/* Editable Google Doc CTA on doc pages (item.doc in content-index) */
.btn-doc {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  background: var(--tomato);
  color: var(--grey);
  border: 1px solid var(--tomato);
  border-radius: 999px;
  padding: 0.2em 0.9em;
  margin-left: var(--sp-1);
  text-decoration: none;
  vertical-align: middle;
  white-space: nowrap;
}
.btn-doc:hover { filter: brightness(1.05); color: var(--grey); text-decoration: none; }

/* Founder avatar pair above the HOME kicker — sized to match the kicker's width */
.avatar-pair { display: flex; margin: 0 0 var(--sp-2); }
.avatar-pair img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid #f2f2f4;
  background: var(--grey);
  object-fit: cover;
}
.avatar-pair img + img { margin-left: -12px; }
.lede-sub { font-size: var(--fs-sm); color: #8E929C; margin: var(--sp-1, .5rem) 0 0; }


/* ---- Shoot-brief "runsheet" styling (brief.html carries body.brief-runsheet) ---- */
/* Matches the AI Samson runsheet house style: blue title, tomato section labels,
   blue sub-headings, mercury callout blockquotes. Column width comes from the
   widened --maxw-narrow so the header lockup + nav never wrap. */
.brief-runsheet .hero h1 { color: var(--blue); }
.brief-runsheet .doc-content h2 {
  font-family: var(--font-heading);
  color: var(--tomato);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin: var(--sp-5) 0 var(--sp-2);
}
.brief-runsheet .doc-content h3 { color: var(--blue); font-size: var(--fs-lg); }
.brief-runsheet .doc-content h4 { color: var(--blue); font-size: var(--fs-md); }
.brief-runsheet .doc-content blockquote {
  background: var(--mercury);
  border-left: 5px solid var(--tomato);
  border-radius: 8px;
  padding: var(--sp-3) var(--sp-4);
  color: var(--grey);
  font-style: italic;
}
.brief-runsheet .doc-content blockquote > :first-child { margin-top: 0; }
.brief-runsheet .doc-content blockquote > :last-child { margin-bottom: 0; }


/* ---------- mobile: burger nav ---------- */
.burger-cb { display: none; }
.burger {
  display: none; margin-left: auto; flex: none;
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  border: 1px solid #4A4A52;
}
.burger span { display: block; width: 17px; height: 2px; background: #E7EAF0; border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease; }

@media (max-width: 820px) {
  .site-header .wrap { flex-direction: row; align-items: center; flex-wrap: nowrap; position: relative; }
  .site-header .brand { font-size: 1rem; }
  .burger { display: flex; }
  .site-nav {
    display: none; position: absolute; top: calc(100% + .5rem); right: 0; left: 0;
    flex-direction: column; align-items: stretch; margin-left: 0; gap: 0;
    background: #26262b; border: 1px solid #3d3d45; border-radius: .7rem;
    padding: .65rem .9rem; z-index: 60; box-shadow: 0 12px 32px rgba(0,0,0,.4);
  }
  .burger-cb:checked ~ .site-nav { display: flex; }
  .burger-cb:checked ~ .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger-cb:checked ~ .burger span:nth-child(2) { opacity: 0; }
  .burger-cb:checked ~ .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-nav a { display: block; padding: .6rem .2rem; }
  .navgroup { display: block; }
  .navbtn { width: 100%; justify-content: space-between; padding: .6rem .2rem; pointer-events: none; }
  .caret { display: none; }
  .navmenu {
    position: static; transform: none; display: flex; margin: 0 0 .35rem;
    background: none; border: 0; border-left: 2px solid #3d3d45; border-radius: 0;
    padding: 0 0 0 .9rem; box-shadow: none; min-width: 0; gap: 0;
  }
}

/* ---------- mobile: tables stack into cards ---------- */
@media (max-width: 700px) {
  table { display: block !important; border: 0 !important; width: 100% !important; }
  table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table tbody { display: block !important; }
  table tr { display: block !important; margin: 0 0 .85rem; padding: .85rem 1rem;
    border: 1px solid var(--border, #DCE3EC); border-radius: 10px; }
  table td { display: flex !important; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .15rem 1rem;
    text-align: right !important; padding: .3rem 0 !important; border: 0 !important; width: auto !important; min-width: 0;
    overflow-wrap: anywhere; }
  table td:first-child { display: block !important; text-align: left !important; font-weight: 600;
    padding-bottom: .5rem !important; margin-bottom: .4rem;
    border-bottom: 1px solid rgba(170,196,231,.25) !important; }
  table td[data-label]:not(:first-child)::before {
    content: attr(data-label); flex: 0 1 auto; text-align: left; max-width: 100%; overflow-wrap: anywhere;
    font-family: "Bricolage Grotesque", sans-serif; font-size: 10px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--tomato, #FF684B); opacity: .85;
  }
  table td:empty { display: none !important; }
}

/* ---------- mobile: section-index item rows wrap so the status pill never overflows ----------
   On phones the date + long title + no-wrap status pill can exceed the viewport and push the
   pill off the right edge. Let the row wrap: title takes the full width on its own line, then
   the date (left) and status pill (right) share the line below. */
@media (max-width: 640px) {
  .item-list li {
    flex-wrap: wrap;
    align-items: center;
    row-gap: .35rem;
    column-gap: var(--sp-2);
  }
  .item-list .title { flex: 1 1 100%; order: 1; }
  .item-list .date  { order: 2; min-width: 0; }
  .item-list .status { order: 3; margin-left: auto; }
  /* long batch-overview labels must be free to wrap, not force horizontal scroll */
  .batch-desc .batch-overview { white-space: normal; }
}

/* ---------- grouped home page ---------- */
.home-group { margin-top: var(--sp-5); }
.home-group:first-of-type { margin-top: var(--sp-4); }
.home-group .ghead { display: flex; align-items: baseline; gap: var(--sp-3); }
.home-group .ghead h2 { font-family: var(--font-heading); font-size: 1.35rem; margin: 0; letter-spacing: -0.01em; }
.home-group .gcount { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tomato); }
.home-group .grule { height: 3px; width: 44px; background: var(--tomato); border-radius: 2px; margin-top: var(--sp-2); }
.home-group .card-grid { margin-top: var(--sp-3); }
