/*
Theme Name: DrivingExam Canada
Theme URI: https://drivingexam.ca
Author: DrivingExam.ca
Description: Custom SEO/AEO-optimized theme for DrivingExam.ca — free Canadian driving knowledge test practice by province. Built for speed, clean semantic markup, and schema.org structured data.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: drivingexam
*/

/* =========================================================
   DESIGN TOKENS
   Concept: Canadian highway signage. Asphalt + guide-sign
   green + warning-sign yellow, condensed signage-style
   headings (Oswald) over a clean readable body face.
   Each province section can be tinted with its own plate color.
   ========================================================= */
:root{
  --asphalt: #1B1F23;
  --asphalt-soft: #262B31;
  --paper: #F9F7F5;
  --paper-dim: #F1E9E9;
  --sign-yellow: #FFC72C;
  --brand-red: #C8102E;       /* primary brand red — same family as the original site */
  --brand-red-dark: #8F0B1F;
  --brand-red-light: #F4D3D8;
  --ink: #1B1F23;
  --ink-muted: #5B6570;
  --white: #FFFFFF;
  --line: #E3D6D6;

  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sign: 6px;
  --shadow-card: 0 2px 10px rgba(27,31,35,.08);
  --shadow-lift: 0 10px 30px rgba(27,31,35,.16);
  --container: 1120px;
  --province-accent: var(--brand-red);
}

/* Every province keeps the same red brand identity — no per-province
   color swap, per your request. (Previously each province had its own
   accent; that logic is left here, commented, in case you want it back.) */
/*
body.province-ontario{ --province-accent:#00539B; }
body.province-alberta{ --province-accent:#005DAA; }
body.province-british-columbia{ --province-accent:#003DA5; }
body.province-manitoba{ --province-accent:#00563F; }
body.province-nova-scotia{ --province-accent:#00274D; }
body.province-saskatchewan{ --province-accent:#046A38; }
body.province-quebec{ --province-accent:#003DA5; }
*/

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--paper);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
img{ max-width:100%; height:auto; display:block; }
a{ color:var(--brand-red-dark); text-decoration:none; }
a:hover{ text-decoration:underline; }
:focus-visible{ outline:3px solid var(--sign-yellow); outline-offset:2px; }

h1,h2,h3,h4{
  font-family:var(--font-display);
  text-transform:uppercase;
  letter-spacing:.02em;
  line-height:1.15;
  margin:0 0 .5em;
  color:var(--asphalt);
}
h1{ font-size:clamp(2rem,4.5vw,3.4rem); }
h2{ font-size:clamp(1.5rem,3vw,2.2rem); }
h3{ font-size:1.25rem; }
p{ margin:0 0 1em; }

.container{ max-width:var(--container); margin:0 auto; padding:0 24px; }
.section{ padding:64px 0; }
.section--tight{ padding:40px 0; }
.section--dark{ background:var(--asphalt); color:var(--paper); }
.section--dark h2, .section--dark h3{ color:var(--white); }
.section--paper-dim{ background:var(--paper-dim); }

/* Skip link */
.skip-link{ position:absolute; left:-999px; top:auto; background:var(--sign-yellow); color:var(--asphalt); padding:12px 20px; z-index:10000; font-weight:700; }
.skip-link:focus{ left:12px; top:12px; }

/* =============== HEADER =============== */
.site-header{ background:var(--white); border-bottom:4px solid var(--brand-red); position:sticky; top:0; z-index:999; }
.site-header__inner{ display:flex; align-items:center; justify-content:space-between; padding:14px 24px; max-width:var(--container); margin:0 auto; }
.site-logo{ display:flex; align-items:center; gap:10px; font-family:var(--font-display); font-size:1.4rem; text-transform:uppercase; color:var(--asphalt); }
.site-logo .badge{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; background:var(--brand-red); color:var(--white);
  border-radius:var(--radius-sign); font-size:1rem; font-weight:700;
}
.site-logo:hover{ text-decoration:none; }

.primary-nav ul{ list-style:none; display:flex; gap:4px; margin:0; padding:0; align-items:center; }
.primary-nav li{ position:relative; }
.primary-nav a{
  display:block; padding:10px 14px; color:var(--asphalt); font-weight:600; font-size:.95rem;
  border-radius:4px;
}
.primary-nav a:hover{ background:var(--paper-dim); text-decoration:none; }
.primary-nav .sub-menu{
  list-style:none; margin:0; padding:8px; position:absolute; left:0; top:100%;
  background:var(--white); box-shadow:var(--shadow-lift); border-radius:8px; min-width:220px;
  display:none; border:1px solid var(--line);
}
.menu-item-has-children:hover .sub-menu,
.menu-item-has-children:focus-within .sub-menu{ display:block; }
.primary-nav .sub-menu a{ font-weight:500; }

.nav-toggle{ display:none; background:none; border:2px solid var(--asphalt); border-radius:6px; padding:8px 10px; font-size:1.2rem; cursor:pointer; }

@media (max-width:880px){
  .nav-toggle{ display:block; }
  .primary-nav{ display:none; width:100%; }
  .primary-nav.is-open{ display:block; }
  .site-header__inner{ flex-wrap:wrap; }
  .primary-nav ul{ flex-direction:column; align-items:stretch; padding:12px 0; }
  .primary-nav .sub-menu{ position:static; box-shadow:none; display:block; border:none; padding-left:16px; }
}

/* =============== BUTTONS =============== */
.btn{
  display:inline-block; font-family:var(--font-display); text-transform:uppercase; letter-spacing:.03em;
  font-weight:600; font-size:1rem; padding:14px 28px; border-radius:var(--radius-sign);
  border:2px solid transparent; cursor:pointer; transition:transform .15s ease, box-shadow .15s ease;
}
.btn:hover{ text-decoration:none; transform:translateY(-2px); box-shadow:var(--shadow-card); }
.btn--primary{ background:var(--sign-yellow); color:var(--asphalt); }
.btn--outline{ background:transparent; border-color:var(--white); color:var(--white); }
.btn--outline-dark{ background:transparent; border-color:var(--asphalt); color:var(--asphalt); }
.btn--red{ background:var(--brand-red); color:var(--white); }
.btn--red:hover{ background:var(--brand-red-dark); }

/* =============== HERO (homepage) =============== */
.hero{ background:linear-gradient(135deg,var(--asphalt) 0%, var(--asphalt-soft) 100%); color:var(--white); padding:80px 0; position:relative; overflow:hidden; }
.hero::after{
  content:""; position:absolute; right:-60px; bottom:-60px; width:320px; height:320px;
  background:var(--brand-red); opacity:.25; transform:rotate(45deg); border-radius:24px;
}
.hero__inner{ max-width:680px; position:relative; z-index:1; }
.hero .eyebrow{ display:inline-block; background:var(--sign-yellow); color:var(--asphalt); font-family:var(--font-display); text-transform:uppercase; padding:6px 14px; border-radius:4px; font-size:.85rem; margin-bottom:18px; letter-spacing:.05em; }
.hero p.lede{ font-size:1.15rem; color:#D8D6CC; max-width:56ch; }
.hero__cta{ margin-top:28px; display:flex; gap:14px; flex-wrap:wrap; }

/* =============== PROVINCE GRID =============== */
.province-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; margin-top:32px; }
.province-card{
  background:var(--white); border:1px solid var(--line); border-radius:10px; padding:22px;
  box-shadow:var(--shadow-card); border-top:6px solid var(--province-accent, var(--brand-red));
  transition:transform .15s ease;
}
.province-card:hover{ transform:translateY(-4px); }
.province-card h3{ margin-bottom:6px; }
.province-card .province-meta{ color:var(--ink-muted); font-size:.9rem; margin-bottom:12px; }
.province-card a.btn{ padding:10px 18px; font-size:.85rem; }

/* =============== SIGN / QUICK-FACTS PANEL =============== */
.fact-panel{
  background:var(--white); border:1px solid var(--line); border-radius:12px; padding:28px;
  box-shadow:var(--shadow-card); display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:20px;
}
.fact{ text-align:center; }
.fact .fact-num{
  font-family:var(--font-display); font-size:2.1rem; color:var(--province-accent,var(--brand-red));
  display:block; line-height:1;
}
.fact .fact-label{ font-size:.82rem; color:var(--ink-muted); text-transform:uppercase; letter-spacing:.04em; margin-top:6px; display:block; }

/* Pass-mark "speed limit sign" badge */
.limit-sign{
  width:110px; height:110px; border-radius:12px; border:6px solid var(--asphalt); background:var(--white);
  display:flex; flex-direction:column; align-items:center; justify-content:center; margin:0 auto 12px;
}
.limit-sign small{ font-family:var(--font-display); font-size:.7rem; letter-spacing:.05em; }
.limit-sign strong{ font-family:var(--font-display); font-size:1.8rem; line-height:1; }

/* =============== TOPIC LIST =============== */
.topic-list{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; }
.topic-list li{
  background:var(--white); border:1px solid var(--line); border-radius:8px; padding:16px 18px;
  display:flex; gap:12px; align-items:flex-start; box-shadow:var(--shadow-card);
}
.topic-list li::before{
  content:"›"; font-family:var(--font-display); font-weight:700; font-size:1.3rem; color:var(--brand-red);
}

/* =============== FAQ =============== */
.faq-list{ max-width:820px; }
.faq-item{ border-bottom:1px solid var(--line); padding:18px 0; }
.faq-item summary{
  cursor:pointer; font-family:var(--font-display); text-transform:uppercase; font-size:1.05rem;
  letter-spacing:.01em; list-style:none; display:flex; justify-content:space-between; align-items:center; gap:12px;
}
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-item summary::after{ content:"+"; font-size:1.4rem; color:var(--brand-red); flex-shrink:0; }
.faq-item[open] summary::after{ content:"–"; }
.faq-item .faq-answer{ padding-top:10px; color:var(--ink-muted); }

/* =============== BREADCRUMBS =============== */
.breadcrumbs{ font-size:.85rem; color:var(--ink-muted); padding:14px 0; }
.breadcrumbs a{ color:var(--ink-muted); }
.breadcrumbs span[aria-current]{ color:var(--ink); font-weight:600; }

/* =============== TESTIMONIALS =============== */
.testimonial-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:20px; }
.testimonial{ background:var(--white); border-radius:10px; padding:24px; box-shadow:var(--shadow-card); border-left:5px solid var(--sign-yellow); }
.testimonial .who{ font-family:var(--font-display); text-transform:uppercase; margin-top:12px; font-size:.85rem; color:var(--ink-muted); }

/* =============== QUIZ LINK GRID (real links, pulled from live site) =============== */
.quiz-group-label{
  font-family:var(--font-display); text-transform:uppercase; letter-spacing:.03em;
  font-size:.9rem; color:var(--brand-red); margin:24px 0 10px;
}
.quiz-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; margin-bottom:8px; }
.quiz-link{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:var(--white); border:1px solid var(--line); border-left:4px solid var(--brand-red);
  border-radius:8px; padding:14px 16px; font-weight:600; color:var(--ink); box-shadow:var(--shadow-card);
}
.quiz-link:hover{ background:var(--brand-red-light); text-decoration:none; }
.quiz-link::after{ content:"→"; color:var(--brand-red); font-weight:700; flex-shrink:0; }

/* =============== ABOUT / HOW-IT-WORKS (homepage) =============== */
.how-it-works-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:20px; counter-reset:step; }
.how-step{ background:var(--white); border-radius:10px; padding:24px; box-shadow:var(--shadow-card); border-top:4px solid var(--brand-red); position:relative; }
.how-step::before{
  counter-increment:step; content:counter(step);
  font-family:var(--font-display); font-size:1.6rem; color:var(--brand-red);
  display:block; margin-bottom:8px;
}
.gls-table{ width:100%; border-collapse:collapse; margin-top:16px; }
.gls-table th,.gls-table td{ text-align:left; padding:12px 14px; border-bottom:1px solid var(--line); }
.gls-table th{ font-family:var(--font-display); text-transform:uppercase; font-size:.85rem; color:var(--brand-red); }

/* =============== FOOTER =============== */
.site-footer{ background:var(--asphalt); color:#C9CAD1; padding:56px 0 24px; }
.site-footer h4{ color:var(--white); font-size:1rem; }
.footer-grid{ display:grid; grid-template-columns:2fr 1fr 1fr; gap:32px; margin-bottom:32px; }
.footer-grid a{ color:#C9CAD1; }
.footer-grid ul{ list-style:none; margin:0; padding:0; }
.footer-grid li{ margin-bottom:8px; }
.social-row{ display:flex; gap:12px; margin-top:14px; }
.social-row a{
  width:36px; height:36px; border-radius:50%; border:1px solid #45494F;
  display:flex; align-items:center; justify-content:center;
}
.footer-bottom{ border-top:1px solid #33373D; padding-top:20px; font-size:.85rem; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }
@media (max-width:720px){ .footer-grid{ grid-template-columns:1fr; } }

/* =============== UTIL =============== */
.visually-hidden{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.text-center{ text-align:center; }
.mt-lg{ margin-top:40px; }
