:root {
  --primary: #0077cc;
  --primary-dark: #005fa3;
  --bg: #ffffff;
  --section-bg: #f9f9f9;
  --card-bg: #ffffff;
  --muted: #555555;
  --text: #222;
  --hero-bg: linear-gradient(180deg, rgba(238,246,255,0.9), rgba(255,255,255,0.9));
  --max-width: clamp(920px, 90vw, 1400px); /* fluid site width */
  --content-max: clamp(680px, 64vw, 980px);
  --badge-size: 84px;
  --nav-font: 'Open Sans', sans-serif;
  --nav-padding-vertical: 0.9rem;
  --nav-padding-horizontal: 1.4rem;
  --nav-font-size: 1.06rem;
  --gap: 1.25rem;
  --card-radius: 10px;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--nav-font);
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  -webkit-font-feature-settings: "liga" 1;
  text-rendering: optimizeLegibility;
}

/* Homepage subtle background */
.home-bg {
  background-image:
    radial-gradient(circle at 10% 10%, rgba(0,119,204,0.03) 0px, transparent 40%),
    linear-gradient(180deg, rgba(245,249,255,0.6), rgba(255,255,255,0.6));
  background-color: #fbfdff;
}

/* Container: fluid but constrained */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem;
}

/* Header */
header { text-align: center; padding: 2rem 0 1rem 0; }

/* Header banner / logo — centered and responsive (larger) */
.logo {
  display: block;
  margin: 0 auto 0.6rem;
  width: min(1100px, 98%);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

header h1 { margin: 0.2rem 0; font-size: 1.5rem; font-weight: 800; }
.tagline { color: var(--muted); margin: 0.25rem 0 0.6rem 0; font-size: 1rem; }

/* Navigation */
nav { margin-bottom: 1.25rem; }
nav ul.nav {
  display:flex; flex-wrap:wrap; justify-content:center; gap:0.6rem;
  list-style:none; margin:0; padding:0; font-family:var(--nav-font);
}
nav ul.nav li { flex: 0 1 160px; display:flex; justify-content:center; }
nav ul.nav a {
  display:inline-flex; align-items:center; justify-content:center; width:100%;
  padding: var(--nav-padding-vertical) var(--nav-padding-horizontal);
  font-size: var(--nav-font-size); font-weight:800; color:var(--primary);
  text-decoration:none; border-radius: 10px; white-space:nowrap;
  transition: all 160ms ease;
}
nav ul.nav a:hover, nav ul.nav a:focus { background: rgba(0,119,204,0.08); color:var(--primary-dark); transform: translateY(-2px); }
nav ul.nav a.active { background:var(--primary); color:#fff; box-shadow: 0 6px 18px rgba(0,119,204,0.12); }

/* Hero */
.hero { background: var(--hero-bg); padding: 2.25rem; border-radius: var(--card-radius); margin-bottom: var(--gap); }
.hero-inner { max-width: var(--content-max); margin: 0 auto; text-align:center; }
.hero h2 { margin: 0 0 0.6rem 0; font-size: 1.6rem; }
.hero p { margin: 0 0 1rem 0; color:var(--muted); }
.hero-ctas { display:flex; gap:0.8rem; justify-content:center; flex-wrap:wrap; }
.button, .secondary { display:inline-block; padding:0.7rem 1.1rem; border-radius:8px; font-weight:700; text-decoration:none; }
.button { background:var(--primary); color:#fff; }
.secondary { background:transparent; color:var(--primary); border:1px solid rgba(0,119,204,0.12); }

/* Welcome box (orange background, red title, white body) */
.welcome-box {
  background: #ffba27;
  padding: 1.6rem;
  border-radius: 10px;
  max-width: 980px;
  margin: 1.25rem auto;
  box-shadow: 0 8px 30px rgba(15, 40, 60, 0.08);
}
.welcome-title { color: #c1002d; margin: 0 0 0.6rem 0; font-size: clamp(1.25rem, 2.4vw, 2rem); line-height:1.05; font-weight:800; }
.welcome-body p { color: #ffffff; margin: 0 0 0.75rem 0; font-size: clamp(0.98rem, 1.6vw, 1.05rem); line-height:1.5; }

/* What Makes Us Special section */
.special-section {
  background: #ffba27;
  padding: 2rem 1rem;
  border-radius: 10px;
  margin: 2rem 0;
  text-align: center;
}
.special-heading {
  color: #ffffff;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 1.5rem;
  font-weight: 800;
}
.special-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.special-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.special-image {
  overflow: hidden;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 3;
  margin-bottom: 1rem;
  background: #e9e2d0;
}
.special-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.special-image:hover img {
  transform: scale(1.08);
}
.special-title {
  color: #ffffff;
  font-size: 1.22rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  text-align: center;
}
.special-text {
  color: #ffffff;
  font-size: 0.98rem;
  max-width: 92%;
  text-align: center;
}

/* Trust logos block */
.trust-logos.compact { margin-bottom: var(--gap); }
.logo-block { max-width: 100%; margin: 0 auto; text-align: center; }
.logo-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}
.logo-row img {
  max-height: var(--badge-size);
  max-width: 160px;
  height: auto;
  width: auto;
  object-fit: contain;
  display: inline-block;
}

/* Utility: centre inline captions */
.text-center {
  text-align: center;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Layout (main + sidebar) — fluid columns */
.layout {
  display: grid;
  grid-template-columns: 1fr min(max(300px, 22vw), 420px);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.25rem;
}
.content { max-width: var(--content-max); }

/* Cards */
.card { background: var(--card-bg); border-radius: var(--card-radius); padding: 1.05rem; box-shadow: 0 6px 20px rgba(13,38,63,0.04); margin-bottom: var(--gap); }
.lead.card { padding: 1.25rem 1.25rem; }

/* Feature grid */
.feature-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.feature { padding:0.6rem; background:transparent; border-radius:8px; }
.feature h3 { margin:0 0 0.4rem 0; font-size:1rem; }
.feature p { margin:0; color:var(--muted); font-size:0.95rem; }

/* Testimonials + bottom image */
.testimonials { margin-bottom: var(--gap); }
.testimonials h2 { margin-bottom: 0.6rem; }
.slider { min-height:76px; }
.slider .slide { display:none; padding: 0.6rem 0; }
.slider .slide.active { display:block; }
.slider p { font-style:italic; margin:0 0 0.4rem 0; }
.slider small { color:var(--muted); font-weight:700; }

/* Image placed under testimonials (centered) */
.testimonials-image-bottom { margin-top:1rem; text-align:center; }
.testimonials-image-bottom img { width:100%; max-width:560px; border-radius:8px; object-fit:cover; display:inline-block; }

/* Compact popular courses (sidebar) */
.popular.compact-popular { padding:0.9rem; }
.popular.compact-popular h4 { margin:0 0 0.6rem 0; font-size:1rem; }
.popular-list { list-style:none; padding:0; margin:0; }
.popular-list li { padding:0.45rem 0; border-bottom:1px solid #f0f0f0; }
.popular-list li a { color:var(--primary); text-decoration:none; font-weight:700; }
.popular-list li a:hover { text-decoration:underline; }

/* Course list and groups */
.course-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.course { padding:0.8rem; border-radius:8px; background:transparent; }
.course h4 { margin:0 0 0.4rem 0; }
.course p { margin:0 0 0.6rem 0; color:var(--muted); }

/* Sidebar */
.sidebar .sticky { position:sticky; top:1.5rem; }
.button.full, .secondary.full { display:block; width:100%; text-align:center; padding:0.75rem; }

/* Newsletter small block */
.newsletter-card { padding:0.9rem; }
.newsletter-card h4 { margin:0 0 0.4rem 0; font-size:1rem; }
.newsletter-card .tiny { font-size:0.82rem; color:var(--muted); }
.newsletter-small-form { display:flex; flex-direction:column; gap:0.45rem; }
.newsletter-small-form input[type="text"], .newsletter-small-form input[type="email"] {
  padding:0.5rem 0.6rem;
  border:1px solid #e6e9ee;
  border-radius:8px;
  font-size:0.95rem;
}
.newsletter-small-form input::placeholder { color:#9aa6b8; }

/* Footer centered at end of content */
.site-footer {
  width: 100%;
  padding: 1.1rem 0;
  border-top: 1px solid #eee;
  margin-top: 1.5rem;
  text-align: center;
  background: transparent;
}
.site-footer .footer-inner p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Responsive adjustments */
@media (max-width: 1100px) {
  .special-grid { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr 300px; }
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
}
@media (max-width: 760px) {
  .special-grid { grid-template-columns: 1fr; }
  .special-image { max-width: 100%; }
  header h1 { font-size: 1.35rem; }
  .logo-row img { max-height: 64px; }
  .sidebar .sticky { position: static; }
  .popular.compact-popular { margin-bottom: 0.75rem; }
  .newsletter-card { padding:0.75rem; }
  .newsletter-small-form input[type="text"],
  .newsletter-small-form input[type="email"] { padding:0.55rem; font-size:0.95rem; }
}

/* Accessibility focus outlines */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(0,119,204,0.18);
  outline-offset: 2px;
}

/* Final nav font-size enforcement for total consistency */
nav a, nav ul.nav a { font-family: var(--nav-font) !important; font-size: var(--nav-font-size) !important; font-weight: 800 !important; line-height:1 !important; -webkit-font-smoothing:antialiased !important; }

.button.large {
  padding: 0.85rem 1.05rem;
  font-size: 1.05rem;
  border-radius: 10px;
}

/* ------------------------------------------------------------------
   Flip cards row (four cards, responsive layout)
   Robust: ensure front face has container and image fills it
   ------------------------------------------------------------------ */
.flip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: stretch;
  margin: 2rem 0;
}

/* Card shell */
.flip-card {
  perspective: 1200px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Inner 3D element — modern aspect and fallback height */
.flip-card-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 200px;
  transform-style: preserve-3d;
  transition: transform 600ms cubic-bezier(.2,.9,.3,1);
}

/* Provide fallback intrinsic height if aspect-ratio is ignored */
.flip-card-inner::before {
  content: "";
  display: block;
  width: 100%;
  padding-top: 75%;
  line-height: 0;
  pointer-events: none;
}

/* Flip triggers (hover, focus, and class-based for touch) */
.flip-card.is-flipped .flip-card-inner,
.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner,
.flip-card:focus .flip-card-inner {
  transform: rotateY(180deg);
}

/* Shared faces — fill the inner area and stack correctly */
.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 0;
  background-color: #fff;
}

/* Front side: image full-bleed with title overlay */
.flip-card-front {
  background-color: #111;
  color: white;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Make the image fill the front face reliably */
.flip-card-front img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  margin: 0;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* Centered H3 */
.front-title {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  background: rgba(0,0,0,0.45);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  display: inline-block;
  text-align: center;
}

/* Back side: orange background, white text, centered; h4 red */
.flip-card-back {
  background: #ffba27;
  color: #ffffff;
  transform: rotateY(180deg);
  text-align: center;
  justify-content: center;
  padding: 1.25rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.flip-card-back .back-inner {
  background: rgba(0,0,0,0.06);
  padding: 0.9rem;
  border-radius: 6px;
  color: #ffffff;
}
.flip-card-back h4 {
  color: #c1002d;
  margin: 0 0 0.6rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}
.flip-card-back p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Accessibility focus styles */
.flip-card:focus {
  box-shadow: 0 0 0 4px rgba(21,156,228,0.25);
  border-radius: 8px;
}

/* Responsive layout */
@media (max-width: 1100px) {
  .flip-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .flip-row { grid-template-columns: 1fr; }
  .flip-card-inner { min-height: 180px; aspect-ratio: 16 / 9; }
  .front-title { font-size: 1rem; padding: 0.45rem 0.75rem; }
}

/* Slight lift on hover/focus for the card shell */
.flip-card:hover,
.flip-card:focus {
  transform: translateY(-4px);
}