/*
 * base.css — TCG Mart London Design System
 * Reset, body defaults, typography base, utilities.
 * Depends on tokens.css being loaded first.
 */

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

/*
 * Ohio sets background via two rules that both need overriding:
 *
 *   ohio/style.css:1606  .site-content { background-color: var(--clb-color-white) }
 *                        specificity 0,1,0,0 — light scheme
 *
 *   ohio/style.css:13578 .dark-scheme .site-content { background-color: var(--clb-dm-fill-color) }
 *                        specificity 0,2,0,0 — dark scheme (#111013 dark grey)
 *                        applied because wp_overrides.php adds .dark-scheme to <body>
 *
 * Rules below load after ohio/style.css (tcg-base depends on tcg-mart-style → ohio-style)
 * so source order wins for equal specificity, and body.dark-scheme (0,1,0,1) beats
 * the standalone .dark-scheme rule (0,1,0,0) on specificity alone.
 */
body,
body.dark-scheme,
.site-content,
.dark-scheme .site-content {
  background-color: var(--paper);
}

/*
 * Ohio's .dark-scheme { color: var(--clb-dm-color-white) } has class
 * specificity (0,1,0) which beats body's element-level (0,0,1) color.
 * This keeps our ink colour on text against the light background we force above.
 */
body.dark-scheme {
  color: var(--ink-2);
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

p,
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  overflow-wrap: break-word;
}

ul, ol {
  padding: 0;
  margin: 0;
}

button {
  cursor: pointer;
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--amber-soft);
  color: var(--ink);
}

/* ── Ohio parent isolation ────────────────────────────────── */

/*
 * Ohio targets h1-h6 with font-family:"DM Sans" at element specificity (0,0,1),
 * which beats body-level inheritance. Explicitly re-apply our --sans here so
 * Schibsted Grotesk wins for all headings, including those without utility classes.
 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--sans);
  color: var(--ink);
}

/*
 * Ohio: a:not(.-unlink):hover { color: var(--clb-link-hover-color) } — primary red.
 * Override to inherit so any <a> not covered by a component rule stays neutral.
 * Component rules (nav, footer, guide-body, etc.) refine colour from here.
 */
a:not(.-unlink):hover {
  color: inherit;
}

/*
 * Ohio: a:hover { transition: all 0.35s } — too broad; triggers layout/paint.
 * Narrow to colour only. Component rules may tighten further.
 */
a:hover {
  transition: color var(--t-micro);
}

/*
 * Ohio styles button[type="submit"] and input[type="submit"] like .button:
 *   base:  background dark-grey, colour white
 *   hover: background primary red
 * Override so any WP-generated submit buttons (search, comment forms) use
 * our on-system .btn baseline — dark fill, no colour change on hover.
 */
button[type="submit"],
input[type="submit"] {
  background-color: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r-pill);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--t-micro), border-color var(--t-micro), color var(--t-micro);
}

button[type="submit"]:hover,
button[type="submit"]:focus-visible,
input[type="submit"]:hover,
input[type="submit"]:focus-visible {
  background-color: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/*
 * Ohio applies transition:all to all native text inputs via a broad type selector.
 * Narrow to only the properties our .field__input actually animates.
 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea {
  transition: border-color var(--t-micro), box-shadow var(--t-micro);
}

/* ── Typography scale ─────────────────────────────────────── */

.t-display-1 {
  font-family: var(--sans);
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--ink);
  max-width: var(--col-tight);
}

.t-display-2 {
  font-family: var(--sans);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--ink);
  max-width: var(--col-tight);
}

/* Editorial italic accent — Instrument Serif */
.t-accent {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--amber-deep);
  letter-spacing: -0.01em;
}

.t-h1 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink);
}

.t-h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
}

.t-h3 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 600;
  color: var(--ink);
}

.t-body {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
}

.t-small {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* Eyebrow / micro label — JetBrains Mono */
.t-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Tabular numerals for prices, grades, dates */
.t-tabular {
  font-variant-numeric: tabular-nums;
}

/* Body link style */
.t-body a,
.prose a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-micro);
}

.t-body a:hover,
.prose a:hover {
  color: var(--amber-deep);
}

/* ── Layout utilities ─────────────────────────────────────── */

/* Centred content wrapper */
.wrap {
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

/* Prose reading column */
.prose {
  max-width: var(--col-prose);
}

/* Section default vertical rhythm */
.section {
  padding-block: var(--s-9);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 1023px) {
  .section {
    padding-block: 56px;
  }
}

@media (max-width: 767px) {
  .section {
    padding-block: 40px;
  }
  .wrap {
    padding-inline: 20px;
  }
}

/* Alternate section surface */
.section--alt {
  background: var(--paper-2);
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--s-5);
  z-index: 9999;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-2) var(--s-5);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  transition: top var(--t-micro);
}

.skip-link:focus {
  top: var(--s-2);
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

.divider--strong {
  border-top-color: var(--ink);
}

/* ── Focus ring (global) ──────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
