/* ==========================================================================
   Train Safe Academy — shared stylesheet
   Edit colours in :root to re-theme the whole site at once.
   ========================================================================== */

:root {
  --navy:        #16224b;   /* headings, nav, footer */
  --navy-deep:   #0f1836;
  --blue:        #2f4bde;   /* buttons, links, accents */
  --blue-dark:   #2338b0;
  --ink:         #1f2733;   /* body text */
  --muted:       #5b6472;   /* secondary text */
  --line:        #e4e8f0;   /* borders */
  --card:        #f1f3f9;   /* card background */
  --card-hover:  #ffffff;
  --bg:          #ffffff;
  --max:         1200px;    /* content max width */
  --radius:      16px;
  --shadow:      0 6px 24px rgba(22, 34, 75, 0.08);
  --shadow-lg:   0 14px 40px rgba(22, 34, 75, 0.14);
  --font:        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--navy); line-height: 1.15; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  text-align: center;
}
.btn:hover { background: var(--blue-dark); text-decoration: none; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-block { display: block; width: 100%; }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; color: var(--navy); font-size: 1.15rem;
}
.brand:hover { text-decoration: none; }
.brand .shield {
  width: 36px; height: 36px; flex: none;
  color: var(--blue);
}
/* two-line brand lockup: "TNC" + subtitle */
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand .brand-name { font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; }
.brand .brand-sub  { font-size: .66rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 420px) { .brand .brand-sub { display: none; } }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links > li { position: relative; }
.nav-links > li > a {
  display: block; padding: 10px 16px; color: var(--navy);
  font-weight: 600; border-radius: 8px;
}
.nav-links > li > a:hover { background: var(--card); text-decoration: none; }

/* dropdowns */
.has-dropdown > .dropdown-toggle::after {
  content: "▾"; margin-left: 6px; font-size: .8em; color: var(--muted);
}
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 240px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 8px; list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown,
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: block; padding: 10px 14px; border-radius: 8px;
  color: var(--ink); font-weight: 500; font-size: .95rem;
}
.dropdown a:hover { background: var(--card); text-decoration: none; }

.nav-cta { margin-left: 8px; }

/* mobile toggle */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--navy);
}
.nav-toggle svg { width: 28px; height: 28px; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); padding: 8px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links > li > a { padding: 14px 16px; }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; padding: 0 0 8px 16px; min-width: 0;
    display: none;
  }
  .dropdown.open { display: block; }
  .has-dropdown:hover > .dropdown { opacity: 1; } /* disable hover-open on mobile */
  .nav-cta { margin: 8px 0 0; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
}
.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--muted); max-width: 640px;
}
/* full-width intro (category landing pages) — spans the whole content column */
.hero-lead-wide { max-width: 900px; }
.hero-split {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.hero-split img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
@media (max-width: 800px) { .hero-split { grid-template-columns: 1fr; } }

/* ==========================================================================
   Card grids (category boxes & module boxes)
   ========================================================================== */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
/* force exactly 3 columns (drops to 1 on small screens) */
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 32px;
  display: flex; flex-direction: column;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.card:hover {
  background: var(--card-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--line);
}
.card h3 { margin-bottom: 10px; }
.card h3 a { color: var(--navy); }
.card h3 a:hover { color: var(--blue); text-decoration: none; }
.card p { color: var(--muted); flex: 1; }
.card .btn { margin-top: 18px; align-self: flex-start; }
.card .tag {
  display: inline-block; font-size: .78rem; font-weight: 700;
  color: var(--blue); background: #e8ecfd;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
  width: fit-content;
}

/* whole-card link variant (module boxes) */
.card-link { cursor: pointer; }
.card-link .arrow { margin-top: 16px; color: var(--blue); font-weight: 700; }
.card-link:hover .arrow { text-decoration: underline; }

/* ==========================================================================
   Module detail page (untitled-3 layout)
   ========================================================================== */
.breadcrumb { font-size: .9rem; color: var(--muted); margin: 24px 0 8px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }

.module {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px;
  padding: 24px 0 64px; align-items: start;
}
.module-main h1 { margin-bottom: 24px; }
.module-main h2 { font-size: 1.4rem; margin-top: 32px; }
.module-main h2:first-of-type { margin-top: 0; }
.module-main ul { padding-left: 20px; }
.module-main ul li { margin-bottom: 8px; }

.module-aside { position: sticky; top: 96px; }
.module-aside img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow);
  aspect-ratio: 4 / 3; object-fit: cover; background: var(--card);
}
.module-aside .btn { margin-top: 16px; }

/* facts row */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-top: 32px;
  border-top: 1px solid var(--line); padding-top: 28px;
}
.fact { }
.fact .label {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; margin-bottom: 4px;
}
.fact .value { color: var(--navy); font-weight: 600; }

@media (max-width: 820px) {
  .module { grid-template-columns: 1fr; }
  .module-aside { position: static; order: -1; }
}

/* ==========================================================================
   Contact / form
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 10px; font-family: inherit; font-size: 1rem; color: var(--ink);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--blue);
}
.form-field textarea { min-height: 140px; resize: vertical; }

.contact-methods { display: flex; flex-direction: column; gap: 16px; }
.contact-method {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; background: var(--card); border-radius: 12px;
}
.contact-method .ico {
  width: 44px; height: 44px; flex: none; border-radius: 10px;
  background: #e8ecfd; color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.contact-method .ico svg { width: 22px; height: 22px; }
.contact-method a { font-weight: 600; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--navy); color: #c8d0e4; margin-top: 40px;
  padding: 56px 0 32px;
}
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px;
}
.site-footer a { color: #c8d0e4; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 12px; }
.footer-brand .shield { width: 30px; height: 30px; color: #7d93ff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding-top: 24px;
  font-size: .88rem; color: #8b96b3;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Key Benefits (feature grid with icons)
   ========================================================================== */
.feature {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.feature:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.feature .ico {
  width: 48px; height: 48px; border-radius: 12px;
  background: #e8ecfd; color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature .ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { color: var(--muted); margin: 0; font-size: .96rem; }

/* ==========================================================================
   Process steps (numbered)
   ========================================================================== */
.steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px;
}
.step {
  position: relative; padding-top: 8px;
}
.step .num {
  font-size: 2.6rem; font-weight: 800; color: var(--blue);
  opacity: .25; line-height: 1; margin-bottom: 12px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); margin: 0; }
.steps--dark .step .num { color: #7d93ff; opacity: .5; }
.steps--dark .step h3 { color: #fff; }
.steps--dark .step p { color: #c8d0e4; }

/* ==========================================================================
   Testimonials
   ========================================================================== */
.testimonials {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px;
}
.testimonial {
  background: var(--card); border-radius: var(--radius); padding: 32px;
  display: flex; flex-direction: column;
}
.testimonial .quote { color: var(--ink); font-size: 1.05rem; line-height: 1.55; flex: 1; margin: 0 0 20px; }
.testimonial .quote::before { content: "\201C"; color: var(--blue); font-size: 2.4rem; line-height: 0; vertical-align: -0.35em; margin-right: 2px; }
.testimonial .who { display: flex; align-items: center; gap: 12px; }
.testimonial .avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--blue); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.testimonial .name { font-weight: 700; color: var(--navy); line-height: 1.2; }
.testimonial .role { font-size: .88rem; color: var(--muted); }

/* small helpers */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.badge-ofqual {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e8f7ee; color: #1a7a44; font-weight: 700; font-size: .82rem;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
