/* ==========================================================
   AnAwesomeGuide.com - main stylesheet
   Vanilla CSS, no frameworks. Targets WCAG 2.2 AA.

   Color note: the brand red #FF0000 is only 4.0:1 against
   white, which fails AA for normal-size text (needs 4.5:1).
   So #FF0000 is used for decorative accents (bars, borders,
   focus rings), where 3:1 is enough, and #CC0000 (5.9:1 on
   white) is used for red text, links and button backgrounds.
   ========================================================== */

:root {
  --brand-red: #FF0000;      /* accent: borders, bars, focus ring */
  --red-accessible: #CC0000; /* text, links, buttons (5.9:1 on white) */
  --red-dark: #A30000;       /* hover/active states */
  --text: #1A1A1A;           /* 17.4:1 on white */
  --text-muted: #555555;     /* 7.5:1 on white */
  --bg: #FFFFFF;
  --bg-alt: #F6F6F6;
  --border: #DDDDDD;
  --radius: 10px;
  --max-width: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img, iframe { max-width: 100%; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }

a { color: var(--red-accessible); text-underline-offset: 0.15em; }
a:hover { color: var(--red-dark); }

/* Visible keyboard focus everywhere (WCAG 2.4.7 / 2.4.11) */
:focus-visible {
  outline: 3px solid var(--brand-red);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container.narrow { max-width: 720px; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: #FFFFFF;
  border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; color: #FFFFFF; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-top: 4px solid var(--brand-red);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 0.75rem;
  min-height: 4rem;
}
.logo {
  font-size: 1.375rem; font-weight: 800;
  color: var(--text); text-decoration: none;
}
.logo span { color: var(--red-accessible); }
.logo:hover { color: var(--text); }

.nav-list {
  display: flex; flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-list a {
  display: inline-block;
  padding: 0.5rem 0.25rem;  /* touch target >= 24px (WCAG 2.5.8) */
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.nav-list a:hover { border-bottom-color: var(--brand-red); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--red-accessible);
  border-radius: var(--radius);
  font: inherit; font-weight: 700;
  text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--red-accessible); color: #FFFFFF; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #FFFFFF; }
.btn-outline { background: transparent; color: var(--red-accessible); }
.btn-outline:hover { background: var(--red-accessible); color: #FFFFFF; }
.btn-block { display: block; width: 100%; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(4rem, 10vw, 7rem) 0;
  background: linear-gradient(180deg, #FFF5F5 0%, var(--bg) 100%);
  text-align: center;
}
.hero h1::after {
  content: "";
  display: block;
  width: 80px; height: 6px;
  margin: 1.25rem auto 0;
  background: var(--brand-red);
  border-radius: 3px;
}
.lead {
  max-width: 40rem;
  margin: 0 auto 2rem;
  font-size: 1.25rem;
  color: var(--text-muted);
}
.hero-actions {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 1rem;
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { text-align: center; }
.section-intro {
  text-align: center;
  color: var(--text-muted);
  margin: 0 auto 2.5rem;
  max-width: 40rem;
}

/* ---------- Video grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 2rem;
}
.video-card h3 { margin-top: 1rem; }
.video-card p { margin: 0; color: var(--text-muted); }
.video-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000000;
  border-bottom: 4px solid var(--brand-red);
}
.video-wrapper iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  align-items: stretch;
}
.price-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 2rem 1.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.price-card.featured { border: 3px solid var(--brand-red); }
.badge {
  position: absolute; top: -0.9rem; left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.2rem 0.85rem;
  background: var(--red-accessible); color: #FFFFFF;
  border-radius: 999px;
  font-size: 0.875rem; font-weight: 700;
  white-space: nowrap;
}
.price { margin: 0 0 1rem; }
.price .amount { font-size: 2rem; font-weight: 800; }
.price .unit { color: var(--text-muted); }
.features {
  flex-grow: 1;
  list-style: none;
  margin: 0 0 1.5rem; padding: 0;
}
.features li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.5rem;
}
.features li::before {
  content: "";
  position: absolute; left: 0; top: 0.95em;
  width: 0.6rem; height: 0.6rem;
  background: var(--brand-red);
  border-radius: 50%;
}

/* ---------- Newsletter form ---------- */
.newsletter-form {
  padding: 2rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-left: 6px solid var(--brand-red);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid #767676;  /* 4.5:1 on white, meets 1.4.11 */
  border-radius: var(--radius);
}
.field input:focus-visible { border-color: var(--red-accessible); }
.optional, .hint { color: var(--text-muted); font-weight: 400; }
.hint { margin: 0.35rem 0 0; font-size: 0.9375rem; }
.required { color: var(--red-accessible); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 3rem 0 1.5rem;
  background: var(--text);
  color: #FFFFFF;
  border-top: 4px solid var(--brand-red);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-heading { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list a { display: inline-block; padding: 0.3rem 0; }
.site-footer a { color: #FFFFFF; }
.site-footer a:hover { color: #FFB3B3; }
.copyright {
  margin: 0; padding-top: 1.5rem;
  border-top: 1px solid #444444;
  font-size: 0.9375rem; color: #D0D0D0;  /* 11:1 on #1A1A1A */
}


/* ==========================================================
   Pages and posts (added for the converted WordPress content)
   ========================================================== */
.nav-list a[aria-current="page"] { border-bottom-color: var(--brand-red); }
.center { text-align: center; }
.lead a, .prose a { font-weight: 600; }

.page-header { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; }
.page-header .lead { margin: 0; max-width: 46rem; text-align: left; }
.post { padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: 3rem; }
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); }
.post-header h1::after {
  content: ""; display: block;
  width: 64px; height: 5px; margin-top: 1rem;
  background: var(--brand-red); border-radius: 3px;
}
.post-meta { margin: 0; color: var(--text-muted); font-size: 0.9375rem; }
.post-hero { display: block; width: 100%; height: auto; border-radius: var(--radius); margin-bottom: 2rem; }
.post-back { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Long-form text */
.prose { overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.25rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font-size: 1.625rem; margin-top: 2.5rem; }
.prose h3 { margin-top: 2rem; }
.prose li + li { margin-top: 0.35rem; }
.prose li > ul, .prose li > ol { margin-top: 0.35rem; }
.prose img { height: auto; border-radius: var(--radius); }
.prose figure { margin: 2rem 0; }
.prose figcaption { margin-top: 0.5rem; color: var(--text-muted); font-size: 0.9375rem; text-align: center; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose blockquote { margin: 1.5rem 0; padding: 0.5rem 1.25rem; border-left: 4px solid var(--brand-red); background: var(--bg-alt); }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; }
.embed-link { padding: 1rem 1.25rem; background: var(--bg-alt); border-radius: var(--radius); }
.embed-link p { margin: 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.download-callout {
  display: grid; grid-template-columns: minmax(0, 200px) 1fr; gap: 1.25rem; align-items: center;
  margin: 2rem 0; padding: 1.25rem;
  background: var(--bg-alt); border-left: 6px solid var(--brand-red); border-radius: var(--radius);
}
.download-callout img { width: 100%; height: auto; border-radius: 6px; }
.download-callout p { margin: 0 0 0.75rem; }
.callout-title { font-weight: 700; }
@media (max-width: 480px) { .download-callout { grid-template-columns: 1fr; } }

/* Post lists */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.75rem;
  list-style: none; margin: 0 0 2rem; padding: 0;
}
.post-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 4px solid var(--brand-red); }
.post-card h2, .post-card h3 { font-size: 1.125rem; margin: 1rem 1.25rem 0.25rem; }
.post-card h2 a, .post-card h3 a { color: var(--text); text-decoration: none; }
/* Whole card is clickable; the link text stays the accessible name */
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card:hover { border-color: var(--brand-red); }
.post-card:hover h2 a, .post-card:hover h3 a { color: var(--red-accessible); text-decoration: underline; }
.post-card:focus-within { outline: 3px solid var(--brand-red); outline-offset: 3px; }
.post-card a:focus-visible { outline: none; }
.post-card .post-meta { margin: 0 1.25rem; }
.post-card > p:last-child { margin: 0.5rem 1.25rem 1.25rem; color: var(--text-muted); font-size: 0.9375rem; }

.topic-nav ul {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  list-style: none; margin: 0 0 2rem; padding: 0;
}
.topic-nav a {
  display: inline-block; min-height: 44px; padding: 0.6rem 1rem;
  border: 2px solid var(--border); border-radius: 999px;
  color: var(--text); font-weight: 600; text-decoration: none;
}
.topic-nav a:hover { border-color: var(--red-accessible); color: var(--red-accessible); }
.topic-nav .count { color: var(--text-muted); font-size: 0.875rem; }
.blog-group { padding-top: 1rem; scroll-margin-top: 6rem; }
.blog-group h2 { scroll-margin-top: 6rem; }

/* Downloads */
.download {
  display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 1.75rem;
  padding: 2rem 0; border-top: 1px solid var(--border);
  scroll-margin-top: 6rem;
}
.download img { width: 100%; height: auto; border-radius: var(--radius); }
.download h2 { font-size: 1.5rem; }
.price-free { margin: 0 0 1rem; font-weight: 800; color: var(--red-accessible); }
.download-links { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
@media (max-width: 640px) { .download { grid-template-columns: 1fr; } }

/* Small screens: the wrapped menu is tall, so don't pin it */
@media (max-width: 640px) {
  .site-header { position: static; }
  :target, .blog-group h2, .download { scroll-margin-top: 1rem; }
}

/* Contact blocks in policies */
.prose address { font-style: normal; }

/* Downloads signup */
.signup-box { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); scroll-margin-top: 6rem; }
.signup-box .newsletter-form { margin-top: 1.5rem; }
.donate { margin: 2.5rem 0 3rem; color: var(--text-muted); }

/* Keep anchored headings clear of the sticky header (WCAG 2.4.11) */
:target { scroll-margin-top: 6rem; }
@media (max-width: 640px) { :target, .blog-group h2, .download { scroll-margin-top: 1rem; } }

/* ---------- Windows High Contrast / forced colors ---------- */
@media (forced-colors: active) {
  .btn { border: 2px solid ButtonText; }
  .features li::before { background: CanvasText; }
  .post-card, .topic-nav a { border: 1px solid CanvasText; }
}

/* ---------- Video previews (load the player on click) ---------- */
.video-facade { position: absolute; inset: 0; display: block; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-facade::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 76px; height: 54px; margin: -27px 0 0 -38px;
  border-radius: 14px; background: #CC0000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.video-facade::before {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: 1;
  margin: -12px 0 0 -8px;
  border-style: solid; border-width: 12px 0 12px 21px;
  border-color: transparent transparent transparent #FFFFFF;
}
.video-facade:hover::after { background: var(--red-dark); }
.video-facade:focus-visible { outline: 4px solid var(--brand-red); outline-offset: -4px; }

/* ---------- Keyboard shortcut chips ---------- */
kbd {
  display: inline-block;
  min-width: 1.75em;
  padding: 0.1em 0.45em;
  border: 1px solid #8A8A8A;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit; font-size: 0.9375em; font-weight: 700;
  text-align: center; white-space: nowrap;
}
.keys { white-space: normal; }
.keys span[aria-hidden] { margin: 0 0.2em; color: var(--text-muted); }
.shortcut-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  margin: 0 0 1.5rem; padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border-left: 6px solid var(--brand-red);
  border-radius: var(--radius);
  font-size: 1.125rem;
}
.shortcut-label { font-weight: 700; }

/* ---------- After each post ---------- */
.post-cta {
  margin: 3rem 0 0; padding: 1.5rem;
  border: 2px solid var(--border); border-top: 6px solid var(--brand-red);
  border-radius: var(--radius);
}
.post-cta h2 { margin-top: 0; font-size: 1.375rem; }
.post-cta p:last-child { margin-bottom: 0; }
.related { margin-top: 3rem; }
.related h2 { font-size: 1.375rem; }
.related .post-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

/* ---------- Search ---------- */
.search-form { margin: 0 0 1.5rem; max-width: 40rem; }
.search-form label { display: block; font-weight: 700; margin-bottom: 0.5rem; }
.search-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.search-row input {
  flex: 1 1 14rem; min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 2px solid #767676; border-radius: var(--radius);
  font: inherit;
}
.search-row input:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 2px; }
.search-status { min-height: 1.5em; color: var(--text-muted); }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.search-results h2 { font-size: 1.125rem; margin: 0 0 0.25rem; }
.search-results p { margin: 0.25rem 0 0; color: var(--text-muted); }
.search-results .keys { color: var(--text); }

/* ---------- Pagination ---------- */
.pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; list-style: none; padding: 0; margin: 2.5rem 0 0; }
.pagination a {
  display: inline-block; min-width: 44px; min-height: 44px;
  padding: 0.6rem 0.9rem; text-align: center;
  border: 2px solid var(--border); border-radius: var(--radius);
  color: var(--red-accessible); font-weight: 700; text-decoration: none;
}
.pagination a:hover { border-color: var(--red-accessible); }
.pagination a[aria-current="page"] { background: var(--red-accessible); border-color: var(--red-accessible); color: #FFFFFF; }
.page-num { color: var(--text-muted); font-weight: 400; }

/* ---------- Keyboard shortcut reference ---------- */
.key-group { margin-top: 2.5rem; }
.key-table { width: 100%; border-collapse: collapse; }
.key-table th, .key-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.key-table th { background: var(--bg-alt); }
.key-table td:first-child { width: 16rem; }
@media (max-width: 640px) {
  .key-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .key-table tr { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
  .key-table td { display: block; width: auto !important; padding: 0.25rem 0; border: 0; }
}
@media (forced-colors: active) {
  .video-facade::after { background: ButtonText; }
  kbd { border-color: CanvasText; }
}
/* Small screens: the menu wraps to three rows, so don't keep it pinned on top */
@media (max-width: 640px) { .site-header { position: static; } }

/* ---------- Training booking ---------- */
.booking-box {
  margin: 1.5rem 0 2rem; padding: 1.5rem;
  border: 2px solid var(--border); border-top: 6px solid var(--brand-red);
  border-radius: var(--radius);
}
.booking-box p { margin: 0 0 0.75rem; }
.booking-box p:last-child { margin-bottom: 0; }
.booking-price { font-size: 1.375rem; }
.booking-price strong { font-size: 2rem; color: var(--text); }
.booking-note { color: var(--text-muted); font-size: 0.9375rem; }
