/* Golden Runs Library styles (started from the portal preview mock-up) */
:root {
  --gold: #C9A84C;
  --gold-ink: #8A6D1E;
  --gold-pale: #FDF6E3;
  --charcoal: #1C1C1C;
  --mid: #555550;
  --light: #F7F4EE;
  --white: #FFFFFF;
  --rule: rgba(28,28,28,0.14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', sans-serif; font-size: 16px; line-height: 1.6; background: var(--light); color: var(--charcoal); }
a { color: inherit; }
img { max-width: 100%; display: block; }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--rule); }
.site-header-inner { max-width: 1040px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; }
.site-header .logo img { height: 28px; width: auto; }
.site-header nav { display: flex; gap: 22px; margin-left: auto; align-items: center; font-size: 14px; font-weight: 500; }
.site-header nav a { text-decoration: none; color: var(--mid); }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--charcoal); }
.account { font-size: 13px; color: var(--mid); border-left: 1px solid var(--rule); padding-left: 18px; }

/* Layout */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--rule); }

/* Type */
.eyebrow { font-family: 'Playfair Display', serif; font-style: italic; font-size: 17px; color: var(--gold-ink); margin-bottom: 8px; }
h1 { font-family: 'Playfair Display', serif; font-weight: 700; font-size: clamp(34px, 6vw, 56px); line-height: 1.08; letter-spacing: -1px; }
h2 { font-family: 'Playfair Display', serif; font-weight: 700; font-size: clamp(26px, 4vw, 36px); line-height: 1.15; letter-spacing: -0.5px; margin-bottom: 14px; }
h3 { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 20px; line-height: 1.25; }
.lede { font-size: 18px; color: var(--mid); max-width: 560px; }
.small { font-size: 13px; color: var(--mid); }
.muted { color: var(--mid); }

/* Buttons: one primary per screen */
.btn { display: inline-block; background: var(--gold); color: var(--charcoal); font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 15px; padding: 13px 22px; border: 0; border-radius: 4px; text-decoration: none; cursor: pointer; }
.btn:hover { background: #B8973E; }
.btn.secondary { background: transparent; border: 1px solid var(--charcoal); }
.btn.secondary:hover { background: var(--charcoal); color: var(--white); }
.text-link { color: var(--gold-ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* Sales hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; padding: 64px 0 56px; }
.hero .lede { margin: 18px 0 26px; }
.hero-photo img { border-radius: 4px; width: 100%; height: auto; }
.hero-photo figcaption { font-size: 12px; color: var(--mid); margin-top: 8px; }
.price-line { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.price { font-family: 'Playfair Display', serif; font-size: 34px; font-weight: 700; }
.price-was { font-size: 15px; color: var(--mid); text-decoration: line-through; }
.price-note { font-size: 14px; color: var(--mid); }

/* Credential strip */
.creds { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--charcoal); border-bottom: 1px solid var(--rule); }
.creds div { padding: 16px 16px 16px 0; }
.creds div + div { border-left: 1px solid var(--rule); padding-left: 16px; }
.creds b { display: block; font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; }
.creds span { font-size: 13px; color: var(--mid); }

/* Comparison table */
.compare { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 15px; }
.compare th { text-align: left; font-weight: 500; font-size: 13px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--mid); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--charcoal); }
.compare td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare td:first-child { color: var(--mid); width: 22%; }
.compare td:last-child { font-weight: 500; }

/* Race-cost comparison */
.cost-list { list-style: none; border-top: 1px solid var(--charcoal); margin-top: 18px; }
.cost-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.cost-list span { color: var(--mid); }
.cost-list b { font-weight: 500; text-align: right; }
.cost-list .cost-total { border-top: 1px solid var(--charcoal); border-bottom: 0; margin-top: -1px; padding-top: 16px; }
.cost-list .cost-total span { color: var(--charcoal); font-weight: 500; }
.cost-list .cost-total b { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: var(--gold-ink); }

/* Ruled lists */
.ruled { list-style: none; border-top: 1px solid var(--charcoal); }
.ruled > li { border-bottom: 1px solid var(--rule); }
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 0; text-decoration: none; align-items: baseline; }
.cat-row:hover h3 { color: var(--gold-ink); }
.cat-row p { font-size: 15px; color: var(--mid); margin-top: 2px; }
.cat-count { font-size: 13px; color: var(--mid); white-space: nowrap; }

.item-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 18px; padding: 16px 0; text-decoration: none; align-items: center; }
.item-row:hover .item-title { color: var(--gold-ink); }
.item-title { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; line-height: 1.3; }
.item-summary { font-size: 14px; color: var(--mid); margin-top: 2px; }
.item-meta { font-size: 12px; color: var(--mid); letter-spacing: 0.3px; margin-top: 4px; }
.item-check { font-size: 12px; color: var(--mid); white-space: nowrap; }
.locked .item-check { color: var(--mid); }

/* Thumbnails: typographic, no stock photos */
.thumb { aspect-ratio: 16 / 9; border-radius: 4px; position: relative; display: flex; align-items: flex-end; padding: 6px 8px; font-size: 11px; letter-spacing: 0.3px; }
.thumb.video { background: var(--charcoal); color: #D8D4CA; }
.thumb.video::before { content: ""; position: absolute; left: 50%; top: 42%; transform: translate(-35%, -50%); border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent var(--gold); }
.thumb.card { background: var(--gold); color: var(--charcoal); }
.thumb.card::before { content: "Card"; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-family: 'Playfair Display', serif; font-style: italic; font-size: 16px; }
.thumb.article { background: var(--gold-pale); color: var(--gold-ink); border: 1px solid rgba(138,109,30,0.25); }
.thumb.article::before { content: "Read"; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-family: 'Playfair Display', serif; font-style: italic; font-size: 16px; }

/* Library home */
.welcome { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; padding: 44px 0 28px; }
.search { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 4px; background: var(--white); }
.search:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; }
.note { border-top: 1px solid var(--charcoal); padding-top: 18px; }
.note-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.note-head img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: top; }
.note p { font-size: 15px; }
.note p + p { margin-top: 10px; }
.col-label { font-size: 13px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--mid); font-weight: 500; margin-bottom: 10px; }

/* Member app shell: tabs on the left, page in the middle */
.app { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 28px 20px 28px 20px; border-right: 1px solid var(--rule); min-height: calc(100vh - 100px); }
.side-search { margin-bottom: 18px; }
.side-search .search { font-size: 14px; padding: 10px 12px; }
.side-nav { list-style: none; }
.side-nav a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 4px; text-decoration: none; font-size: 15px; color: var(--mid); border-left: 2px solid transparent; }
.side-nav a:hover { color: var(--charcoal); background: rgba(255,255,255,0.6); }
.side-nav a[aria-current="page"] { color: var(--charcoal); font-weight: 500; background: var(--white); border-left-color: var(--gold); border-radius: 0 4px 4px 0; }
.side-count { font-size: 12px; color: var(--mid); font-weight: 400; }
.side-label { font-size: 12px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--mid); font-weight: 500; padding: 22px 12px 6px; }
.app-main { min-width: 0; padding: 36px 20px 64px 44px; }
.narrow-main > * { max-width: 760px; }
.app-main .crumbs { padding-top: 0; }

/* Library home screen */
.home-title { margin-bottom: 28px; }
.feature { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; padding-bottom: 36px; border-bottom: 1px solid var(--rule); }
.feature-card { text-decoration: none; display: block; }
.feature-card:hover h2 { color: var(--gold-ink); }
.feature-card h2 { margin-bottom: 6px; }
.thumb.big { font-size: 13px; padding: 10px 12px; }
.thumb.big::before { border-width: 18px 0 18px 30px; }
.feature .note { align-self: start; }
.home-row { padding-top: 32px; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.card { text-decoration: none; display: block; }
.card .thumb { margin-bottom: 10px; }
.card .item-title { font-size: 16px; }
.card:hover .item-title { color: var(--gold-ink); }

/* Coaching CTA band */
.cta-band { background: var(--white); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cta-band .wrap { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding-top: 36px; padding-bottom: 36px; }
.cta-band p { color: var(--mid); margin-top: 4px; }

/* Watch / read page */
.crumbs { font-size: 13px; color: var(--mid); padding: 24px 0 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--charcoal); text-decoration: underline; }
.player { aspect-ratio: 16 / 9; max-width: 860px; background: var(--charcoal); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #A9A499; font-size: 13px; }
.player .play { width: 0; height: 0; border-style: solid; border-width: 22px 0 22px 36px; border-color: transparent transparent transparent var(--gold); }
.player.vertical { aspect-ratio: 9 / 16; max-width: 340px; }
/* Vertical videos sit beside their notes on wide screens instead of above them */
.app-main.is-vertical { display: grid; grid-template-columns: 300px minmax(0, 1fr); column-gap: 40px; align-items: start; }
.app-main.is-vertical .crumbs { grid-column: 1 / -1; }
.app-main.is-vertical .player { grid-column: 1; grid-row: 2 / span 2; max-width: none; }
.app-main.is-vertical .watch-head, .app-main.is-vertical .watch-body { grid-column: 2; }
.app-main.is-vertical .watch-head { padding-top: 0; }
.app-main.is-vertical .watch-body { grid-template-columns: 1fr; gap: 28px; }
.do-this { border-left: 3px solid var(--gold); background: var(--white); padding: 14px 16px; margin-bottom: 22px; font-size: 16px; font-weight: 500; }
.do-this span { display: block; font-size: 12px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 4px; }
.article-body ul { margin: 0 0 14px 20px; font-size: 17px; }
.article-body li { margin-bottom: 6px; }
.card-panel { max-width: 360px; background: var(--charcoal); color: #F2EEE6; border-radius: 4px; padding: 26px 22px 18px; }
.card-panel-title { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: var(--gold); margin-bottom: 14px; line-height: 1.2; }
.card-panel ul { list-style: none; border-top: 1px solid rgba(255,255,255,0.18); }
.card-panel li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 14px; }
.card-panel-foot { font-size: 11px; color: #A9A499; margin-top: 14px; letter-spacing: 0.3px; }
.watch-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; padding: 22px 0 18px; border-bottom: 1px solid var(--rule); }
.watch-head h1 { font-size: clamp(28px, 4.5vw, 40px); }
.watch-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; padding: 28px 0 56px; }
.notes-list { list-style: none; border-top: 1px solid var(--charcoal); }
.notes-list li { padding: 12px 0 12px 22px; border-bottom: 1px solid var(--rule); position: relative; }
.notes-list li::before { content: ""; position: absolute; left: 2px; top: 22px; width: 10px; height: 1px; background: var(--gold-ink); }
.article-body h2 { font-size: 24px; margin: 26px 0 8px; }
.article-body p { margin-bottom: 14px; font-size: 17px; }
.disclaimer { font-size: 13px; color: var(--mid); border-left: 2px solid var(--gold); padding: 4px 0 4px 12px; margin: 18px 0 0; }
.up-next .item-row { grid-template-columns: 88px 1fr; gap: 14px; padding: 12px 0; }
.up-next .item-title { font-size: 16px; }

/* Forms (login, admin) */
.auth { max-width: 420px; margin: 0 auto; padding: 72px 20px 96px; }
.auth h1 { font-size: 34px; margin-bottom: 10px; }
.field { margin: 22px 0 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field input, .field select { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 4px; background: var(--white); }
.field input:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.auth .btn { width: 100%; }
.auth-foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--mid); }
.auth-foot p + p { margin-top: 8px; }
[hidden] { display: none !important; }

.admin-grant { display: grid; grid-template-columns: 1fr 180px auto auto; gap: 12px; align-items: end; margin: 18px 0 8px; }
.admin-grant .field { margin: 0; }
.members { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 18px; }
.members th { text-align: left; font-weight: 500; font-size: 12px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--mid); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--charcoal); }
.members td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--rule); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--gold-pale); color: var(--gold-ink); }
.tag.paid { background: #ECEAE4; color: var(--charcoal); }

/* FAQ */
details { border-bottom: 1px solid var(--rule); }
details:first-of-type { border-top: 1px solid var(--charcoal); }
summary { cursor: pointer; padding: 16px 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--gold-ink); font-size: 20px; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { padding: 0 0 16px; color: var(--mid); max-width: 640px; }

.placeholder-box { border: 1px dashed var(--rule); border-radius: 4px; padding: 22px; color: var(--mid); font-size: 14px; text-align: center; }

/* Footer */
.site-footer { padding: 28px 0 40px; font-size: 13px; color: var(--mid); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .hero, .two-col, .watch-body, .feature { grid-template-columns: 1fr; gap: 32px; }
  .app { grid-template-columns: 1fr; }
  .app-main.is-vertical { display: block; }
  .app-main.is-vertical .player { max-width: 300px; margin: 0 auto; }
  .app-main.is-vertical .watch-head { padding-top: 22px; }
  .sidebar { position: static; max-height: none; min-height: 0; border-right: 0; border-bottom: 1px solid var(--rule); padding: 14px 20px 0; }
  .side-search { margin-bottom: 10px; }
  .side-nav { position: relative; display: flex; overflow-x: auto; gap: 4px; margin: 0 -20px; padding: 0 20px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav li { flex: 0 0 auto; }
  .side-nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 10px; }
  .side-nav a[aria-current="page"] { background: transparent; border-bottom-color: var(--gold); border-radius: 0; }
  .side-count, .side-label { display: none; }
  .app-main { padding: 28px 20px 48px; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .hero { padding-top: 40px; }
  .hero-photo { max-width: 220px; }
  .creds { grid-template-columns: 1fr 1fr; }
  .creds div:nth-child(3) { border-left: 0; padding-left: 0; }
  .creds div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .welcome { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 84px 1fr; gap: 14px; align-items: start; }
  .item-row .thumb { margin-top: 4px; }
  .account { display: none; }
  .item-row .item-check { grid-column: 2; }
  .cta-band .wrap { grid-template-columns: 1fr; }
  .watch-head { grid-template-columns: 1fr; }
  .admin-grant { grid-template-columns: 1fr; }
  .site-header nav { gap: 14px; }
  .site-header .nav-extra { display: none; }
  .compare td:first-child { width: 30%; }
  .members .hide-sm { display: none; }
}

/* Live portal additions */
.notice { background: var(--gold-pale); border-left: 3px solid var(--gold); padding: 14px 16px; margin: 18px 0; font-size: 15px; }
.notice.error { background: #FBEDEA; border-left-color: #B3412E; }
.link-btn { background: none; border: 0; font: inherit; color: var(--gold-ink); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
body.checking .app, body.checking .cta-band, body.checking > main { visibility: hidden; }
