/* Milestone 3: home repositioning, growth plan builder, channel tabs, ad creative studio, case teaser.
   Requires tokens.css, site.css, home.css. Motion only on interaction, removed under prefers-reduced-motion
   (site.css). No gradients. Contrast pairs used here are recorded in tests/check_m3.py. */

/* Press state for every button (hover lives in site.css) */
.btn:active { transform: translateY(1px); }
.btn { transition: background-color var(--motion), color var(--motion), border-color var(--motion), transform 80ms; }
button.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Hero and three equal paths */
.m3-hero h1 { max-width: 18ch; }
.m3-hero .lead { max-width: 60ch; }
.hero-art { display: none; }
@media (min-width: 1100px) {
  .hero-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s8); align-items: center; }
  .hero-art { display: block; width: 100%; max-width: 480px; height: auto; aspect-ratio: 480 / 400; justify-self: end; }
}
.paths { list-style: none; display: grid; gap: 0; margin-top: var(--s8); border-top: 2px solid var(--ink); }
.path { display: grid; gap: var(--s3); align-content: start; padding-block: var(--s5) var(--s6); border-bottom: 1px solid var(--line); }
.path-num { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-eyebrow); letter-spacing: .08em; color: var(--ink); }
.path-title { font-size: var(--fs-h3); line-height: 1.2; }

/* Growth plan builder */
.gp-section { scroll-margin-top: var(--header-h); }
.gp-section:focus { outline: none; }
.gp-grid { display: grid; gap: var(--s7); }
.gp-form fieldset { border: 0; margin: 0 0 var(--s6); padding: 0; }
.gp-form legend { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-body-l); margin-bottom: var(--s4); padding: 0; }
#gp-help { margin-bottom: var(--s5); color: var(--on-dark); }
.gp-field { margin: 0 0 var(--s6); }
.gp-legend { display: block; font-family: var(--font-body); font-weight: 600; font-size: var(--fs-body-l); margin-bottom: var(--s4); }
.gp-select {
  display: block; width: 100%; max-width: 26rem; min-height: 44px;
  padding: var(--s2) var(--s4); font: inherit; color: inherit;
  background: transparent; border: 1px solid currentColor; border-radius: 6px;
}
.gp-select option { color: #111; background: #fff; }
.gp-select:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
#gp-request[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s3); }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: var(--s2) var(--s4);
  border: 1.5px solid var(--on-dark); border-radius: 999px;
  color: var(--on-dark); font-size: var(--fs-small); font-weight: 600; line-height: 1.3;
  transition: background-color var(--motion), color var(--motion), border-color var(--motion);
}
.chip input[type="checkbox"] + span::before { content: ""; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; flex: none; }
.chip input[type="radio"] + span::before { content: ""; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 50%; flex: none; }
.chip:hover span { border-color: var(--accent-dark-bg); }
.chip input:checked + span { background: var(--accent-dark-bg); border-color: var(--accent-dark-bg); color: var(--ink); }
.chip input:checked + span::before { background: var(--ink); border-color: var(--ink); }
.chip input:active + span { transform: translateY(1px); }
.chip input:focus-visible + span { outline: 2px solid var(--focus-on-dark); outline-offset: 3px; }

.gp-panel { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: var(--s5); }
.gp-panel a { color: var(--ink); }
.gp-panel .btn-primary { background: var(--button); color: var(--white); }
.gp-panel .btn-primary:hover { background: var(--button-hover); }
.gp-panel :focus-visible { outline-color: var(--focus); }
.gp-paths { display: grid; gap: var(--s1); font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.2; }
.gp-paths strong { font-weight: 600; }
.gp-h { font-size: var(--fs-body); margin: var(--s5) 0 var(--s3); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; }
.gp-note { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-eyebrow); letter-spacing: .04em; }
.gp-services { list-style: none; border-top: 1px solid var(--line); }
.gp-services li { display: grid; grid-template-columns: 1fr auto; gap: var(--s1) var(--s4); padding-block: var(--s3); border-bottom: 1px solid var(--line); }
.gp-svc { font-weight: 600; }
.gp-price { font-family: var(--font-mono); font-size: var(--fs-eyebrow); text-align: right; align-self: start; padding-top: 2px; }
.gp-services p { grid-column: 1 / -1; font-size: var(--fs-small); }
/* Narrow panels: price label under the service name so names do not wrap one word per line */
@media (max-width: 560px) {
  .gp-services li { grid-template-columns: 1fr; }
  .gp-price { text-align: left; padding-top: 0; }
}
.gp-timeline { list-style: none; display: grid; gap: var(--s4); }
.gp-timeline > li { display: grid; gap: var(--s2); }
.gp-timeline ul { list-style: none; display: grid; gap: var(--s1); font-size: var(--fs-small); }
.gp-timeline ul li { padding-left: var(--s4); position: relative; }
.gp-timeline ul li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 2px; background: var(--accent-light-bg); }
.gp-prices { list-style: none; display: grid; gap: var(--s2); font-size: var(--fs-small); }
.gp-empty { font-size: var(--fs-body-l); }

/* Booking dialog */
.gp-dialog { width: min(720px, calc(100% - 2 * var(--s4))); max-height: calc(100% - 2 * var(--s4)); border: 0; border-radius: var(--radius); padding: var(--s5); background: var(--paper); color: var(--ink); }
.gp-dialog::backdrop { background: rgba(14, 22, 30, .72); }
.gp-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.gp-dialog .label { display: block; margin-bottom: var(--s2); }
.gp-summary { width: 100%; font: inherit; font-size: var(--fs-small); padding: var(--s3); border: 1px solid var(--ink); border-radius: var(--radius); background: var(--white); color: var(--ink); resize: vertical; }
.gp-copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-block: var(--s3); }
.gp-copy-row p { margin: 0; }
.gp-copy-row p:empty, .gp-dialog [hidden] { display: none; } /* m3b r1 review (5): no empty band */
.gp-dialog > .small { margin-bottom: var(--s3); }
.gp-frame .embed-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
/* m3b r1 review (6): loading state while the GHL calendar loads; full-height dialog at < 600 px so only the
   dialog scrolls (the iframe is tall enough for the GHL mobile calendar; GHL's own inner scroll is not
   controllable from this site, DECISIONS). */
.gp-loading { margin: 0 0 var(--s3); font-weight: 600; }
.gp-frame[data-loading] .embed-frame { background: repeating-linear-gradient(180deg, var(--white) 0 56px, var(--paper-2, #F1F3F4) 56px 72px); }
@media (max-width: 599px) {
  .gp-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border-radius: 0; padding: var(--s4); }
  .gp-frame .embed-frame { height: 1000px; }
}
.gp-dialog :focus-visible { outline-color: var(--focus); }

/* Channel tabs */
.channel-tabs { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s2); margin-bottom: var(--s6); scrollbar-width: thin; }
.channel-tabs [role="tab"] {
  flex: none; min-height: 44px; padding: var(--s2) var(--s4);
  border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink);
  font: 600 var(--fs-small)/1.3 var(--font-body); cursor: pointer;
  transition: background-color var(--motion), color var(--motion);
}
.channel-tabs [role="tab"]:hover { background: var(--white); }
.channel-tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--white); }
.channel-tabs [role="tab"]:active { transform: translateY(1px); }
.channel-panel { display: grid; gap: var(--s6); align-items: center; }
.channel-panel:focus-visible { outline-offset: 6px; }
.channel-art { width: 100%; max-width: 420px; aspect-ratio: 320 / 220; }
.channel-art text { font-family: var(--font-mono); }
.channel-copy { display: grid; gap: var(--s4); }

/* Ad creative studio */
.ads-head { display: grid; gap: var(--s6); }
.ads-copy { display: grid; gap: var(--s4); }
.ad-studio { margin-top: var(--s7); display: grid; gap: var(--s6); }
.ad-studio-head { display: grid; gap: var(--s3); max-width: 68ch; }
.ad-gallery-note { font-size: var(--fs-small); }
.ad-stills { display: grid; gap: var(--s4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ad-still { margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--ink); }
.ad-still img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
/* m3 p1 r4: four ads, two 16:9 and two 1:1 (billy and charles held, darlene-1x1 held N2); the two squares share a row */
.ad-gallery { display: grid; gap: var(--s5); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ad-item { margin: 0; min-width: 0; }
.ad-item.is-feature, .ad-item.is-wide { grid-column: span 6; }
.ad-item.is-square { grid-column: span 3; }
.ad-item video { display: block; width: 100%; height: auto; object-fit: cover; background: var(--ink); border-radius: var(--radius); }
.ad-item.is-feature video, .ad-item.is-wide video { aspect-ratio: 16 / 9; }
.ad-item.is-square video { aspect-ratio: 1 / 1; }
.ad-item figcaption { margin-top: var(--s2); font-size: var(--fs-small); }
@media (max-width: 599px) {
  .ad-gallery { grid-template-columns: 1fr; }
  .ad-item.is-feature, .ad-item.is-wide, .ad-item.is-square { grid-column: auto; }
  .ad-stills { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
}
@media (min-width: 1000px) {
  .ad-gallery { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  /* Two 16:9 ads side by side, then the two squares centred in one row (columns 3-6 and 7-10) */
  .ad-item.is-feature, .ad-item.is-wide { grid-column: span 6; }
  .ad-item.is-square { grid-column: span 4; }
  .ad-item:not(.is-square) + .ad-item.is-square { grid-column: 3 / span 4; }
  .ad-stills img { aspect-ratio: 3 / 2; }
}

/* Case teaser and home FAQ */
.case-row { grid-template-columns: 1fr; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; font-weight: 600; padding-block: var(--s3); list-style-position: outside; }
.faq summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.faq details p { padding-bottom: var(--s5); }

@media (min-width: 820px) {
  .paths { grid-template-columns: repeat(3, 1fr); gap: var(--s6); border-top: 0; }
  .path { border-top: 2px solid var(--ink); border-bottom: 0; grid-template-rows: auto auto 1fr auto; align-content: stretch; }
  .path > .row-link { align-self: end; }
  .channel-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s7); }
  .ads-head { grid-template-columns: 1fr 1.2fr; gap: var(--s8); }
  .case-row { grid-template-columns: 16rem 1fr auto; column-gap: var(--s6); align-items: start; }
  .case-row .label { grid-row: 1 / span 2; padding-top: var(--s1); }
  .case-row .row-link { grid-column: 3; grid-row: 1 / span 2; }
}
@media (min-width: 1100px) {
  .gp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s8); align-items: start; }
  /* m3 polish (QUALITY 94 defect 2, DECISIONS 68): the result panel is the taller column, so a sticky panel
     never stuck and the form column left a ~450px empty dark band. The shorter form sticks instead, keeping
     the controls beside the plan while it scrolls, and the section closes with less bottom padding. */
  .gp-panel { position: static; padding: var(--s6); }
  .gp-form { position: sticky; top: calc(var(--header-h) + var(--s5)); }
  .gp-section { padding-bottom: var(--s7); }
}
/* claude: the dialog sits inside the dark growth-plan band but has a light surface; reset the band's on-dark button colours */
.gp-dialog .btn-secondary { color: var(--ink); border-color: var(--ink); background: transparent; }
.gp-dialog .btn-secondary:hover { background: var(--ink); color: var(--white); }
.gp-dialog .btn-primary { background: var(--button); color: var(--white); }
#gp-dialog a, #gp-dialog .embed-fallback a { color: var(--ink); text-decoration-color: var(--ink); }
/* r5: one grid for every ad (QUALITY run-5 defect 5). Each ad sits in the same 16:10 card;
   square and vertical videos are letterboxed on dark, so rows always line up. */
.ad-gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)) !important; gap: var(--s5); }
.ad-item.is-card { grid-column: auto !important; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ad-item.is-card video { width: 100%; aspect-ratio: 16 / 10 !important; height: auto; object-fit: contain; background: #0B141B; border-radius: 12px; }
@media (min-width: 1024px) { .ad-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
