/* Cambridge TradFest — main stylesheet
   1. Design tokens (custom properties)  2. Base  3. Layout  4. Components  5. Page sections */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('../assets/fonts/inter-latin-variable.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 400 600; font-display: swap; src: url('../assets/fonts/inter-latin-italic-variable.woff2') format('woff2'); }

/* 1. TOKENS ------------------------------------------------------------ */
:root {
  /* Core — from the logo */
  --tf-red: #E62B1A;
  --tf-red-deep: #C2200F;      /* hover/pressed; red text below 24px */
  --tf-red-tint: #FBE4DF;
  --tf-ink: #2F2E2C;
  --tf-white: #FFFFFF;

  /* Support — charcoal & white */
  --tf-grey: #F3F2F0;
  --tf-ink-deep: #1C1B1A;

  /* Ink neutrals (warm) */
  --tf-ink-80: #55524D;
  --tf-ink-60: #6E6B66;
  --tf-ink-40: #9C988F;
  --tf-ink-20: #D6D4D0;
  --tf-ink-10: #E9E8E6;

  /* Semantic — text */
  --text-1: var(--tf-ink);
  --text-2: var(--tf-ink-80);
  --text-3: var(--tf-ink-60);
  --text-accent: var(--tf-red-deep);
  --text-on-dark: var(--tf-white);
  --text-on-dark-2: #CFCAC1;
  --text-link: var(--tf-red-deep);

  /* Semantic — surfaces */
  --surface-page: var(--tf-white);
  --surface-card: var(--tf-white);
  --surface-sunken: var(--tf-grey);
  --surface-inverse: var(--tf-ink);
  --surface-feature: var(--tf-ink);
  --surface-accent: var(--tf-red);

  /* Semantic — lines + states */
  --border-1: var(--tf-ink-20);
  --border-2: var(--tf-ink-10);
  --border-strong: var(--tf-ink);
  --focus-ring: var(--tf-ink);
  --state-success: var(--tf-ink);
  --state-success-bg: var(--tf-grey);
  --state-error: var(--tf-red-deep);
  --state-error-bg: var(--tf-red-tint);

  /* Actions */
  --action-primary: var(--tf-red);
  --action-primary-hover: var(--tf-red-deep);
  --action-secondary: var(--tf-ink);
  --action-secondary-hover: var(--tf-ink-deep);
}

:root {
  --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;

  /* Scale */
  --text-display: 80px;
  --text-h1: 56px;
  --text-h2: 36px;
  --text-h3: 24px;
  --text-h4: 19px;
  --text-lead: 20px;
  --text-body: 16px;
  --text-small: 14px;
  --text-caption: 12px;

  --leading-tight: 1.0;
  --leading-heading: 1.12;
  --leading-body: 1.55;

  --tracking-display: -0.035em;
  --tracking-heading: -0.02em;
  --tracking-body: -0.006em;
  --tracking-eyebrow: 0.08em;
}

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Shape — gentle corners picked up from the sign */
  --radius-0: 0;
  --radius-tag: 4px;
  --radius-control: 6px;
  --radius-card: 8px;
  --radius-pill: 999px;
  --border-hair: 1px;
  --border-bold: 2px;

  /* Elevation — flat by default; one overlay shadow for menus/dialogs */
  --shadow-none: none;
  --shadow-overlay: 0 12px 32px rgba(47, 46, 44, 0.18);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;

  /* Layout */
  --container: 1200px;
  --gutter: 24px;
  --header-h: 80px;
}

/* 2. BASE -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface-page); color: var(--text-1); font-family: var(--font-sans); font-size: var(--text-body); line-height: var(--leading-body); letter-spacing: var(--tracking-body); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--text-link); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--tf-ink); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
.icon { flex: none; display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* 3. LAYOUT ------------------------------------------------------------ */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-3); }
.h1 { font-size: var(--text-h1); font-weight: 800; letter-spacing: var(--tracking-heading); line-height: 1.05; }
.h2 { font-size: var(--text-h2); font-weight: 800; letter-spacing: var(--tracking-heading); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }

/* 4. COMPONENTS -------------------------------------------------------- */
/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; font-family: var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; border: var(--border-bold) solid transparent; border-radius: var(--radius-control); cursor: pointer; text-decoration: none; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.btn .icon { width: 18px; height: 18px; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn--sm .icon { width: 17px; height: 17px; }
.btn--lg { height: 56px; padding: 0 28px; font-size: 17px; }
.btn--lg .icon { width: 20px; height: 20px; }
.btn--full { display: flex; width: 100%; }
.btn--primary { background: var(--action-primary); color: var(--tf-white); }
.btn--primary:hover { background: var(--action-primary-hover); color: var(--tf-white); }
.btn--secondary { background: var(--action-secondary); color: var(--tf-white); }
.btn--secondary:hover { background: var(--action-secondary-hover); color: var(--tf-white); }
.btn--outline { background: transparent; color: var(--tf-ink); border-color: var(--tf-ink); }
.btn--outline:hover { background: var(--tf-ink); color: var(--tf-white); }
.btn--ghost { background: transparent; color: var(--tf-ink); }
.btn--ghost:hover { background: var(--surface-sunken); color: var(--tf-ink); }
.btn--inverse { background: var(--tf-white); color: var(--tf-ink); }
.btn--inverse:hover { background: var(--tf-grey); color: var(--tf-ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.btn--primary:disabled:hover { background: var(--action-primary); }

/* Badge */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; line-height: 1; white-space: nowrap; border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--tf-ink-10); color: var(--tf-ink); }
.badge--square { border-radius: var(--radius-tag); }
.badge--red { background: var(--tf-red); color: var(--tf-white); }
.badge--ink { background: var(--tf-ink); color: var(--tf-white); }
.badge--grey { background: var(--tf-ink-10); color: var(--tf-ink); }
.badge--outline { background: transparent; color: var(--tf-ink); border-color: var(--tf-ink); }
.badge--soldout { background: var(--tf-ink); color: var(--tf-white); }

/* Site header */
.site-header { background: var(--surface-inverse); color: var(--text-on-dark); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 32px; }
.site-header__logo { display: flex; flex: none; }
.site-header__logo img { height: 40px; width: auto; display: block; }
.site-nav { display: flex; gap: 28px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { font-size: 15px; font-weight: 600; color: var(--text-on-dark); text-decoration: none; padding: 6px 0 4px; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--tf-red); }

@media (max-width: 700px) {
  .site-header__inner { gap: 16px; }
  .site-header__logo { flex-shrink: 1; min-width: 0; }
  .site-header__logo img { width: 185px; height: auto; }
  .site-header__inner > .btn { margin-left: auto; flex-shrink: 0; }
  .site-nav { display: none; }
}

/* Site footer */
.site-footer { background: var(--surface-inverse); color: var(--text-on-dark); }
.site-footer__grid { padding-top: 64px; padding-bottom: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 40px; }
.site-footer__logo { width: 140px; height: auto; display: block; }
.site-footer h2, .site-footer h4 { font-size: 12px; font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-on-dark-2); margin: 0 0 12px; }
.site-footer__links { display: flex; flex-direction: column; gap: 8px; }
.site-footer__links a { color: var(--text-on-dark); font-size: 15px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.site-footer__links .icon { width: 16px; height: 16px; }
.site-footer__partners { padding-bottom: 32px; }
.site-footer__partners p { font-size: 14px; color: var(--text-on-dark-2); line-height: 1.6; }
.site-footer__base { border-top: 1px solid rgba(255, 255, 255, 0.14); }
.site-footer__base p { padding-top: 20px; padding-bottom: 20px; font-size: 13px; color: var(--text-on-dark-2); }

/* Image frame */
.frame { position: relative; overflow: hidden; background: var(--tf-grey); width: 100%; border-radius: var(--radius-card); }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.frame--4x5 { aspect-ratio: 4 / 5; }
.frame--3x2 { aspect-ratio: 3 / 2; }

/* Event card */
.event-card { background: var(--surface-card); border: var(--border-hair) solid var(--border-1); border-bottom: var(--border-bold) solid var(--tf-ink); border-radius: var(--radius-card); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.event-card__tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.event-card h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.event-card__meta { display: flex; flex-direction: column; gap: 6px; }
.event-card__meta div { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); }
.event-card__meta .icon { width: 16px; height: 16px; }
.event-card p { font-size: 15px; line-height: 1.55; color: var(--text-2); text-wrap: pretty; }
.event-card__action { margin-top: auto; padding-top: 4px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

/* Session row */
.session-row { display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr) minmax(0, 1.6fr); gap: 4px 24px; padding: 16px 0; border-bottom: var(--border-hair) solid var(--border-1); align-items: baseline; }
.session-row__time { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.session-row__venue { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.session-row__musicians { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.session-row__musicians span { color: var(--text-3); }

/* Day tabs */
.day-tabs { display: flex; border-bottom: var(--border-bold) solid var(--tf-ink); overflow-x: auto; }
.day-tabs button { flex: 1 0 auto; min-width: 120px; padding: 14px 20px; border: none; border-radius: var(--radius-control) var(--radius-control) 0 0; cursor: pointer; text-align: left; font-family: var(--font-sans); background: transparent; color: var(--tf-ink); display: flex; flex-direction: column; gap: 2px; transition: background var(--dur-fast); }
.day-tabs button[aria-selected="true"] { background: var(--tf-ink); color: var(--tf-white); }
.day-tabs__label { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.day-tabs__date { font-size: 13px; opacity: 0.75; }

/* Notice */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--tf-grey); color: var(--text-1); border-radius: var(--radius-card); }
.notice .icon { width: 20px; height: 20px; margin-top: 1px; }
.notice__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notice__title { font-size: 15px; font-weight: 700; }
.notice__text { font-size: 14px; line-height: 1.5; }
.notice--success { background: var(--state-success-bg); color: var(--state-success); }
.notice--error { background: var(--state-error-bg); color: var(--state-error); }
.notice--announce { background: var(--tf-ink); color: var(--tf-white); }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text-1); }
.field label span { color: var(--text-3); font-weight: 400; }
.field input { height: 48px; padding: 0 14px; font-family: var(--font-sans); font-size: 16px; color: var(--text-1); background: var(--surface-card); border: var(--border-hair) solid var(--border-1); border-radius: var(--radius-control); outline: none; width: 100%; transition: border-color var(--dur-fast); }
.field input:focus { border-color: var(--tf-ink); box-shadow: 0 0 0 1px var(--tf-ink); }
.checkbox { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; position: relative; }
.checkbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox__box { width: 22px; height: 22px; flex: none; margin-top: 1px; display: flex; align-items: center; justify-content: center; background: var(--surface-card); border: var(--border-bold) solid var(--tf-ink); border-radius: var(--radius-tag); color: var(--tf-white); transition: background var(--dur-fast); }
.checkbox__box .icon { width: 16px; height: 16px; visibility: hidden; }
.checkbox input:checked + .checkbox__box { background: var(--tf-ink); }
.checkbox input:checked + .checkbox__box .icon { visibility: visible; }
.checkbox input:focus-visible + .checkbox__box { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.checkbox__text { display: flex; flex-direction: column; gap: 2px; }
.checkbox__label { font-size: 15px; font-weight: 500; color: var(--text-1); line-height: 1.4; }
.checkbox__desc { font-size: 13px; color: var(--text-3); line-height: 1.4; }

/* Quantity stepper + ticket option */
.stepper { display: inline-flex; align-items: center; border: var(--border-hair) solid var(--tf-ink); border-radius: var(--radius-control); overflow: hidden; background: var(--surface-card); }
.stepper button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--tf-ink); cursor: pointer; }
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.stepper .icon { width: 18px; height: 18px; }
.stepper output { min-width: 32px; text-align: center; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 20px; background: var(--surface-card); border: var(--border-hair) solid var(--border-1); border-radius: var(--radius-card); }
.ticket.is-active { border-color: var(--tf-ink); box-shadow: inset 4px 0 0 var(--tf-red); }
.ticket--soldout { opacity: 0.6; }
.ticket__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ticket__name-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ticket__name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.ticket__details { font-size: 14px; color: var(--text-2); }
.ticket__price { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ticket__price span { font-weight: 400; color: var(--text-3); }

/* 5. PAGE SECTIONS ----------------------------------------------------- */
/* Home */
.hero__grid { padding-top: 72px; padding-bottom: 88px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 56px; align-items: center; }
.hero__text { display: flex; flex-direction: column; gap: 28px; }
.hero__text .eyebrow { color: var(--text-accent); }
.hero__title { font-size: clamp(44px, 6vw, 80px); font-weight: 800; letter-spacing: var(--tracking-display); line-height: 1; text-wrap: balance; }
.hero__lead { font-size: 20px; line-height: 1.5; color: var(--text-2); max-width: 520px; text-wrap: pretty; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.artists-band { background: var(--surface-feature); color: var(--text-on-dark); }
.artists-band p a { color: inherit; }
.artists-band__inner { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 36px; }
.artists-band .eyebrow { color: var(--text-on-dark-2); }
.artists-band__heading { display: flex; flex-direction: column; gap: 10px; }
.artists-band__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.artist-tile { display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; }
.artist-tile:hover { color: inherit; }
.artist-tile__name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.artist-tile__inst { font-size: 15px; color: var(--text-on-dark-2); margin-top: -6px; }
@media (max-width: 400px) {
  .artists-band__heading .h1 { font-size: var(--text-h2); }
}
.highlights { background: var(--surface-sunken); }
.highlights__inner { padding-top: 80px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 32px; }
.highlights__inner .video__title { margin-top: 0; }
.tickets__intro { display: flex; flex-direction: column; gap: 16px; }
.mailing { background: var(--surface-page); border-top: var(--border-hair) solid var(--border-1); }
.mailing__grid { padding-top: 64px; padding-bottom: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 40px; align-items: center; }
.mailing__embed { min-height: 120px; } /* reserves the EmailOctopus form height (~117px) to avoid layout shift */
.mailing__text { display: flex; flex-direction: column; gap: 10px; }
.mailing__text p { font-size: 17px; color: var(--text-2); line-height: 1.5; }
.mailing__form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.mailing__form .field { flex: 1 1 240px; }
.mailing__form .btn { height: 48px; }

/* Programme */
.programme__intro { padding-top: 56px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.programme__intro > p { font-size: 18px; color: var(--text-2); }
.programme__tabs { position: sticky; top: 0; background: var(--surface-page); z-index: 2; padding-top: 8px; }
.programme__body { padding-top: 32px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 48px; }
.programme__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.trail { display: flex; flex-direction: column; gap: 8px; }
.trail > p { margin-bottom: 8px; font-size: 15px; color: var(--text-2); }

/* Artist */
.artist__back { padding-top: 32px; }
.artist__grid { padding-top: 24px; padding-bottom: 80px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 56px; align-items: start; }
.artist__info { display: flex; flex-direction: column; gap: 24px; }
.artist__badges { display: flex; gap: 8px; }
.artist__name { display: flex; flex-direction: column; gap: 6px; }
.artist__name h1 { text-wrap: balance; }
.artist__inst { font-size: 20px; color: var(--text-2); }
.artist__bio { font-size: 18px; line-height: 1.6; max-width: 560px; text-wrap: pretty; }
.appearances { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.appearances h2 { font-size: var(--text-h4); font-weight: 700; }
.appearance { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border-1); }
.appearance__day { font-weight: 600; }
.appearance__meta { font-size: 14px; color: var(--text-3); }

/* Tickets */
.tickets__grid { padding-top: 56px; padding-bottom: 80px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: start; }
.tickets__main { display: flex; flex-direction: column; gap: 24px; }
.tickets__main > p { font-size: 17px; color: var(--text-2); }
.tickets__list { display: flex; flex-direction: column; gap: 10px; }
.checkout { background: var(--surface-card); border: var(--border-hair) solid var(--border-1); border-radius: var(--radius-card); padding: 28px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 24px; }
.checkout h2 { font-size: var(--text-h3); font-weight: 700; letter-spacing: -0.02em; }
.checkout__total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--tf-ink); padding-top: 16px; }
.checkout__count { font-weight: 600; }
.checkout__sum { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.confirm { max-width: 640px; padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 24px; }
.confirm p { font-size: 18px; color: var(--text-2); line-height: 1.5; }

/* YouTube embeds (16:9) */
.video { width: 100%; aspect-ratio: 16 / 9; margin-top: var(--space-6); background: var(--tf-ink); border-radius: var(--radius-card); overflow: hidden; }
.video iframe { display: block; width: 100%; height: 100%; border: 0; }
.video__title { margin-top: var(--space-7); font-size: var(--text-h3); font-weight: 700; letter-spacing: -0.02em; }
.video__title + .video { margin-top: var(--space-4); }
.tt-widget { width: 100%; }
