/* ==========================================================================
   PAT Testing Course Portsmouth
   Palette "azure" baked from the Claude Design preview default.
   Interactivity is HTML/CSS-only (native <details>, :checked sibling
   selectors, :target lightbox, checkbox-hack nav). The only JavaScript on
   the site is the third-party Trustpilot widget bootstrap.
   The page markup keeps the design's inline styles, which reference
   var(--x, <azure fallback>); this file defines tokens, interactive state,
   semantic component styles and the responsive system.
   ========================================================================== */

:root {
  --ink: #0E3A52;
  --ink-2: #15506E;
  --primary: #1E6FE8;
  --primary-d: #1556C0;
  --soft: #E9F1FD;
  --success: #1E9E4A;
  --success-soft: #E7F5EA;
  --star: #00B67A;
  --bg: #FFFFFF;
  --bg-2: #F4F8FC;
  --border: #E3EAF3;
  --text: #142235;
  --muted: #5C6B80;
}

/* ----- base ----- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Hanken Grotesk', -apple-system, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }
input::placeholder, textarea::placeholder { color: #9aa7b8; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 111, 232, .14);
}
img { max-width: 100%; }
/* the brand lockup PNG is cropped to its mark by a fixed-size overflow:hidden
   wrapper, so it must be allowed to exceed that wrapper's width */
img[src$="pat-logo-dark.png"] { max-width: none; }
/* <picture> wraps (for WebP + JPEG fallback) must be layout-transparent so the
   inner <img> keeps behaving as the direct child of its sized container */
picture { display: contents; }

/* visible keyboard focus for accessibility */
a:focus-visible, button:focus-visible, summary:focus-visible, label:focus-within {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, #fff);
  outline-offset: 2px;
  border-radius: 6px;
}

@keyframes patFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes patPop  { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: scale(1) } }

/* visually hidden but available to assistive tech / keyboard */
.vh {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 0 0 10px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* shared container */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; width: 100%; }

/* reset list styling for semantic lists used as layout */
.plain-list { list-style: none; margin: 0; padding: 0; }

/* ==========================================================================
   HEADER / NAV  (mobile menu = checkbox hack, no JS)
   ========================================================================== */
.header-inner { position: relative; }

/* the real, keyboard-operable control is an (invisible) checkbox overlaid on the
   hamburger; the .nav-toggle label is purely decorative (aria-hidden) */
.nav-checkbox { display: none; }
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  background: none; border: none; padding: 0; pointer-events: none;
}
.nav-toggle span {
  width: 22px; height: 2px; border-radius: 2px;
  background: var(--ink); display: block; transition: .2s;
}

@media (max-width: 960px) {
  .nav-toggle { display: flex; }
  .nav-checkbox {
    display: block; position: absolute; top: 20px; right: 28px;
    width: 44px; height: 44px; margin: 0; padding: 0;
    opacity: 0; cursor: pointer; z-index: 5;
  }
  .nav-checkbox:focus-visible + .nav-toggle {
    outline: 3px solid color-mix(in srgb, var(--primary) 55%, #fff);
    outline-offset: 2px; border-radius: 8px;
  }
  .pat-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column !important; align-items: stretch !important;
    gap: 2px !important;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 10px 18px 16px !important;
    box-shadow: 0 24px 40px -24px rgba(16, 40, 80, .4);
    display: none !important;
  }
  #navcheck:checked ~ .pat-nav { display: flex !important; }
  #navcheck:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #navcheck:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
  #navcheck:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .pat-nav > a {
    padding: 12px 6px !important; border-bottom: 1px solid var(--border);
    justify-content: flex-start;
  }
  .pat-nav > a:last-child {
    border-bottom: none; justify-content: center;
    margin-top: 8px; padding: 13px !important;
  }
}

/* ==========================================================================
   ACCORDIONS — native <details> (course modules + FAQ)
   ========================================================================== */
.acc summary { list-style: none; cursor: pointer; }
.acc summary::-webkit-details-marker { display: none; }
.acc-sign { position: relative; }
.acc-sign::after { content: "+"; }
.acc[open] .acc-sign::after { content: "\2013"; } /* – */
.acc[open] > summary { animation: none; }
.acc > div[class*="acc-body"] { animation: patFade .18s ease; }

/* ==========================================================================
   BOOKING CARD — For-Me/Teams tabs + VAT toggle, CSS-only (:checked)
   ========================================================================== */
.book-tabs {
  display: flex; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 4px; gap: 4px; margin-bottom: 18px;
}
.book-tab {
  flex: 1; text-align: center; padding: 11px 8px; border-radius: 8px;
  font-weight: 700; font-size: 13.5px; cursor: pointer;
  color: var(--muted); transition: .15s; user-select: none;
}
.book-tab:hover { color: var(--ink); }
#aud-me:checked ~ .book-tabs .book-tab-me,
#aud-teams:checked ~ .book-tabs .book-tab-teams {
  background: var(--primary); color: #fff; box-shadow: 0 6px 14px -8px var(--primary);
}

.teams-note {
  display: none; background: var(--soft); border-radius: 11px;
  padding: 12px 14px; margin-bottom: 16px; font-size: 13px;
  line-height: 1.5; color: var(--ink); font-weight: 600;
}
#aud-teams:checked ~ .teams-note { display: block; }

.amt-vat, .suf-vat { display: none; }
#vat-toggle:checked ~ .price-row .amt-novat,
#vat-toggle:checked ~ .price-row .suf-novat { display: none; }
#vat-toggle:checked ~ .price-row .amt-vat { display: inline; }
#vat-toggle:checked ~ .price-row .suf-vat { display: inline; }

.vat-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
.vat-track {
  width: 40px; height: 23px; flex: none; border-radius: 99px;
  background: #cbd5e1; position: relative; transition: .18s; display: inline-block;
}
.vat-knob {
  position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; transition: .18s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28);
}
#vat-toggle:checked ~ .price-row .vat-track { background: var(--primary); }
#vat-toggle:checked ~ .price-row .vat-knob { left: 19px; }

.cta-me-link { display: flex; }
.cta-teams-link { display: none; }
#aud-teams:checked ~ .cta-me-link { display: none; }
#aud-teams:checked ~ .cta-teams-link { display: flex; }

/* focus rings for the visually-hidden controls (shown on their visible labels) */
#aud-me:focus-visible ~ .book-tabs .book-tab-me,
#aud-teams:focus-visible ~ .book-tabs .book-tab-teams,
#vat-toggle:focus-visible ~ .price-row .vat-track {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, #fff);
  outline-offset: 2px;
}

/* ==========================================================================
   GALLERY LIGHTBOX — CSS-only via :target
   ========================================================================== */
.pat-lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center; padding: 32px;
}
.pat-lightbox:target { display: flex; animation: patFade .18s ease; }
.lb-backdrop {
  position: absolute; inset: 0; cursor: zoom-out;
  background: rgba(8, 18, 34, .84);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.lb-inner { position: relative; z-index: 1; width: 100%; max-width: 880px; animation: patPop .2s ease; }
.lb-inner img {
  width: 100%; max-height: 76vh; object-fit: contain; border-radius: 14px;
  display: block; background: #0d2138; border: 1px solid rgba(255, 255, 255, .16);
}
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.lb-close {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; font-weight: 700; font-size: 13px; padding: 9px 15px;
  border-radius: 10px; cursor: pointer;
}

/* ==========================================================================
   RESPONSIVE — inline styles carry the desktop layout; these override at
   each breakpoint (!important to beat the element's inline declaration).
   ========================================================================== */
@media (max-width: 600px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .nav-checkbox { right: 18px; }
}

/* hero */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr !important; gap: 34px !important; }
  .hero-images { max-width: 540px; }
}
@media (max-width: 760px) {
  .hero-sec { padding: 54px 0 50px !important; }
  .t-hero { font-size: 38px !important; }
  .t-hero-page { font-size: 40px !important; }
}
@media (max-width: 460px) {
  .t-hero { font-size: 30px !important; }
  .t-hero-page { font-size: 31px !important; }
  .guarantee-bar { flex-direction: column !important; text-align: center; align-items: center !important; }
}

/* main + sticky booking aside */
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .book-card { position: static !important; }
  .book-aside { order: -1; }
}

/* generic 2-col content grids */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr !important; }
  .feature-grid { grid-template-columns: 1fr !important; }
}

/* training-you-can-trust */
@media (max-width: 720px) {
  .trust-grid { grid-template-columns: 1fr !important; gap: 22px !important; }
}

/* assessment + find-us two-up */
@media (max-width: 840px) {
  .assess-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
  .find-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
}

/* suitable-for */
@media (max-width: 600px) { .suitable-grid { grid-template-columns: 1fr !important; } }

/* gallery */
@media (max-width: 820px) { .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 480px) { .gallery-grid { grid-template-columns: 1fr !important; } }

/* in-house CTA banner */
@media (max-width: 720px) {
  .inhouse-cta { grid-template-columns: 1fr !important; text-align: center; gap: 18px !important; justify-items: center; }
}

/* other venues */
@media (max-width: 720px) { .venues-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 440px) { .venues-grid { grid-template-columns: 1fr !important; } }

/* why-train / highly-rated two-up (home + about + contact) */
@media (max-width: 700px) { .twoup-grid { grid-template-columns: 1fr !important; } }

/* about: intro + stats */
@media (max-width: 820px) {
  .about-intro { grid-template-columns: 1fr !important; gap: 28px !important; padding: 28px !important; }
}
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 380px) { .stats-grid { grid-template-columns: 1fr !important; } }

/* contact: form + aside, hero */
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr !important; gap: 38px !important; } }
@media (max-width: 820px) { .contact-hero { grid-template-columns: 1fr !important; gap: 28px !important; } }

/* legal / prose pages */
.prose { color: var(--text); font-size: 15.5px; line-height: 1.75; }
.prose h2 {
  font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 22px;
  letter-spacing: -.01em; color: var(--ink); margin: 34px 0 12px;
}
.prose h3 {
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px;
  color: var(--ink); margin: 24px 0 8px;
}
.prose p { margin: 0 0 14px; color: var(--muted); }
.prose ul { margin: 0 0 14px; padding-left: 22px; color: var(--muted); }
.prose li { margin: 0 0 7px; }
.prose a { color: var(--primary); font-weight: 600; }
.prose strong { color: var(--ink); }
@media (max-width: 600px) { .prose { font-size: 15px; } }

/* footer */
@media (max-width: 840px) { .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 26px !important; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr !important; } }

/* section heading scaling */
@media (max-width: 600px) { .t-h2 { font-size: 25px !important; } }

/* ==========================================================================
   STICKY BOTTOM CTA — slides up once the booking card scrolls out of view.
   Toggled by a small IntersectionObserver (see index.html); hidden + inert
   by default, so the page is fully functional without JavaScript.
   ========================================================================== */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 34px -18px rgba(16, 40, 80, .45);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateY(115%); opacity: 0; pointer-events: none;
  transition: transform .28s ease, opacity .28s ease;
}
.sticky-cta.is-shown { transform: translateY(0); opacity: 1; pointer-events: auto; }
.sticky-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sticky-cta-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sticky-cta-title {
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 14px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sticky-cta-price { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sticky-cta-price strong { color: var(--ink); }
.sticky-cta-btn {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14.5px;
  padding: 12px 20px; border-radius: 11px; box-shadow: 0 10px 20px -13px var(--primary);
}
@media (max-width: 430px) {
  .sticky-cta-title { display: none; }
  .sticky-cta-btn { padding: 11px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
