/*
Theme Name: Motor Claim Expert
Theme URI: https://motorclaimexpert.com
Author: Motor Claim Expert
Description: Lightweight, SEO-first educational theme for Motor Claim Expert. Built from the approved Design System. RankMath-compatible, accessibility- and performance-minded.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: motor-claim-expert
*/

/* =========================================================
   1. DESIGN TOKENS (frozen Design System → CSS variables)
   ========================================================= */
:root {
  /* Colour */
  --navy: #1F3864;
  --navy-dark: #14264A;
  --slate-blue: #3B6FB6;
  --ink: #1A1A1A;
  --muted: #5B6470;
  --line: #E3E6EB;
  --surface: #F5F7FA;
  --white: #FFFFFF;
  --success: #1E7A46;
  --warning-amber: #B45309;

  /* Typography */
  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Fluid type scale (mobile → desktop via clamp) */
  --fs-h1: clamp(2rem, 1.4rem + 2.6vw, 2.75rem);   /* 32 → 44 */
  --fs-h2: clamp(1.625rem, 1.3rem + 1.4vw, 2rem);  /* 26 → 32 */
  --fs-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); /* 20 → 24 */
  --fs-h4: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem); /* 18 → 20 */
  --fs-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --fs-body: clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem); /* 17 → 18 */
  --fs-small: 0.9375rem; /* 15 */
  --fs-eyebrow: 0.8125rem; /* 13 */

  /* Spacing scale (8px base) */
  --sp-1: 8px;  --sp-2: 16px; --sp-3: 24px; --sp-4: 32px;
  --sp-6: 48px; --sp-8: 64px; --sp-12: 96px;

  /* Layout */
  --container: 1200px;
  --reading: 720px;
  --gutter: 24px;

  /* Radius & shadow */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 3px rgba(20,38,74,.06);
  --shadow-card-hover: 0 4px 14px rgba(20,38,74,.10);

  --section-pad: clamp(56px, 4vw + 32px, 96px);
}

/* =========================================================
   2. RESET (lightweight)
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
ul, ol { padding-left: 1.25em; }

/* =========================================================
   3. TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--navy); line-height: 1.2; font-weight: 600; }
h1 { font-size: var(--fs-h1); line-height: 1.15; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { margin-block: 0 var(--sp-3); }
a { color: var(--slate-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.eyebrow { font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--slate-blue); }
.lead { font-size: var(--fs-lead); color: var(--ink); }
.text-muted { color: var(--muted); }

/* =========================================================
   4. LAYOUT
   ========================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.reading { max-width: var(--reading); margin-inline: auto; }
.section { padding-block: var(--section-pad); }
.section--surface { background: var(--surface); }
.grid { display: grid; gap: var(--sp-3); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

/* =========================================================
   5. BUTTONS
   ========================================================= */
.btn { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; font-size: 1rem;
  padding: 14px 28px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: background-color .15s, color .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn--primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: var(--white); }
.btn--secondary { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn--secondary:hover { background: var(--surface); }
.btn--text { color: var(--slate-blue); font-weight: 600; padding: 0; }
.btn--text:hover { text-decoration: underline; }

/* =========================================================
   6. ACCESSIBILITY
   ========================================================= */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: 12px 20px; z-index: 1000; border-radius: 0 0 var(--radius-sm) 0; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* =========================================================
   7. SITE HEADER
   ========================================================= */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: relative; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding-block: var(--sp-2); }
.site-brand { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 600; color: var(--navy); text-decoration: none; }
.site-brand img { max-height: 44px; width: auto; }
.primary-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-3); padding: 0; margin: 0; }
.primary-nav a { color: var(--navy); font-weight: 500; }
.primary-nav .current-menu-item > a { text-decoration: underline; text-underline-offset: 4px; }
.header__actions { display: flex; align-items: center; gap: var(--sp-2); }
.nav-toggle, .search-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--navy); cursor: pointer; }
.header-search { display: none; }
.header-search.is-open { display: block; position: absolute; inset: 100% 0 auto 0; background: #fff;
  border-bottom: 1px solid var(--line); padding: var(--sp-2) 0; z-index: 50; }

@media (max-width: 860px) {
  .nav-toggle, .search-toggle { display: inline-flex; }
  .primary-nav { display: none; position: absolute; inset: 100% 0 auto 0; background: #fff;
    border-bottom: 1px solid var(--line); z-index: 50; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav li { border-top: 1px solid var(--line); }
  .primary-nav a { display: block; padding: var(--sp-2) var(--gutter); }
  .header-cta { display: none; } /* CTA stays accessible via mobile menu */
}

/* =========================================================
   8. SEARCH FORM
   ========================================================= */
.search-form { display: flex; gap: var(--sp-1); }
.search-form input[type="search"] { flex: 1; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 1rem; }

/* =========================================================
   9. ARTICLE CARD (approved component)
   ========================================================= */
.card { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-card); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow-card-hover); }
.card__media { aspect-ratio: 16/9; background: var(--surface); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-1); flex: 1; }
.card__title { font-size: var(--fs-h4); }
.card__title a { color: var(--navy); }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* whole-card click target */
.card__excerpt { color: var(--muted); font-size: var(--fs-small); margin: 0; }
.card__meta { margin-top: auto; color: var(--muted); font-size: var(--fs-small); display: flex; gap: var(--sp-1); flex-wrap: wrap; }

/* =========================================================
   10. SITE FOOTER
   ========================================================= */
.site-footer { background: var(--navy); color: #cdd6e6; padding-block: var(--sp-8) var(--sp-3); margin-top: var(--sp-12); }
.site-footer a { color: #e6ecf6; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
@media (max-width: 860px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-col h2 { color: #fff; font-size: 1rem; margin-bottom: var(--sp-2); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-social { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.footer-social a { display: inline-flex; }
.footer-social svg { width: 22px; height: 22px; fill: currentColor; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: var(--sp-4); padding-top: var(--sp-3);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-small); }
.footer-disclaimer { color: #9fb0cc; }

/* =========================================================
   11. UTILITIES
   ========================================================= */
.is-hidden { display: none !important; }
main { display: block; }

/* =========================================================
   12. SHARED COMPONENTS (used across homepage, archives, single)
   ========================================================= */
.section-header { max-width: var(--reading); margin-bottom: var(--sp-4); }
.section-header h2 { margin-bottom: var(--sp-1); }
.section-header--row { max-width: none; display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }

.trust-bar { padding-block: var(--sp-3); }
.trust-bar__list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); justify-content: center; }
.trust-bar__item { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-small); color: var(--muted); }
.trust-bar__tick { width: 18px; height: 18px; color: var(--success); flex: none; }

.cta-band { background: var(--navy); color: #fff; }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding-block: var(--sp-8); flex-wrap: wrap; }
.cta-band__heading { color: #fff; margin: 0; max-width: 30ch; }
.cta-band__text { color: #c3d0e6; margin: 8px 0 0; }
.btn--on-navy { background: #fff; color: var(--navy); border-color: #fff; }
.btn--on-navy:hover { background: var(--surface); color: var(--navy); }

/* Author box (shared: single, resource, about) */
.author-box { display: flex; gap: var(--sp-3); background: var(--surface); border-radius: var(--radius-md); padding: var(--sp-4); margin: var(--sp-6) 0; }
.author-box__media img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-box__eyebrow { font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.author-box__name { font-family: var(--font-heading); font-size: var(--fs-h4); color: var(--navy); font-weight: 600; margin: 2px 0; }
.author-box__role { color: var(--muted); font-size: var(--fs-small); margin: 0 0 var(--sp-1); }
.author-box__bio { margin: 0 0 var(--sp-1); }
@media (max-width: 560px) { .author-box { flex-direction: column; } }
