/* Zayan Training and Consultancy - Base Styles */
/* Colors */
:root {
  --color-primary: #162e5e;
  --color-accent: #b11c22;
  --color-text: #222222;
  --color-subtext: #6b7280;
  --color-bg: #ffffff;
  --color-muted: #f5f7fb;
}

/* Typography */
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Poppins", "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1 { font-size: 2.5rem; line-height: 1.2; color: var(--color-primary); margin: 0 0 16px; }
h2 { font-size: 1.8rem; line-height: 1.25; color: var(--color-primary); margin: 0 0 12px; }
h3 { font-size: 1.25rem; color: var(--color-primary); margin: 0 0 8px; }
p { font-size: 1rem; margin: 0 0 12px; }

img { max-width: 100%; height: auto; display: block; }
* { box-sizing: border-box; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-accent); }

/* Layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.grid { display: grid; gap: 24px; width: 100%; }
.grid > * { min-width: 0; max-width: 100%; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Header */
.topbar { background: var(--color-muted); color: var(--color-text); font-size: 0.9rem; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px; }
.topbar .contact { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.topbar .social { display: flex; gap: 12px; align-items: center; }
.topbar svg { width: 18px; height: 18px; fill: #000; }

/* Make header relative for dropdown positioning */
.header { position: relative; top: 0; z-index: 1000; background: var(--color-bg); border-bottom: 1px solid #e5e7eb; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--color-primary); }
.brand-logo { width: 36px; height: 36px; background: var(--color-primary); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.brand-logo-img { width: 120px; height: auto; }

.hamburger { display: none; background: transparent; border: 0; cursor: pointer; font-size: 24px; padding: 8px; }

.menu { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.menu > li { list-style: none; position: relative; }
.menu > li > a { color: var(--color-text); font-weight: 600; padding: 10px 8px; display: inline-block; }
.menu > li > a:hover, .menu > li > a:focus { color: var(--color-primary); }

.btn { display: inline-block; background: var(--color-primary); color: #fff; padding: 10px 16px; border-radius: 6px; font-weight: 700; transition: background .2s ease-in-out; }
.btn:hover, .btn:focus { background: #1e4a8a; color: #fff; }
.btn-outline { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
footer .btn { background: var(--color-accent); color: #fff; }
.menu > li > a.btn { color: #fff; }

/* Mega menu - Desktop */
.mega { position: fixed; top: auto; width: 720px; max-width: 95vw; background: #fff; box-shadow: 0 20px 40px rgba(0,0,0,.08); border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; display: grid; grid-template-columns: 240px 1fr; gap: 16px; opacity: 0; visibility: hidden; transition: all .18s ease; z-index: 1001; pointer-events: none; }
.mega .categories { border-right: 1px solid #e5e7eb; }
.mega .categories button { width: 100%; text-align: left; padding: 10px 12px; background: transparent; border: 0; border-radius: 6px; color: var(--color-text); font-weight: 600; cursor: pointer; }
.mega .categories button:hover, .mega .categories button[aria-selected="true"] { background: var(--color-muted); color: var(--color-primary); }
/* Allow categories as links for simple menus */
.mega .categories a { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 6px; color: var(--color-text); font-weight: 600; }
.mega .categories a:hover, .mega .categories a:focus { background: var(--color-muted); color: var(--color-primary); }
/* Single-column variant for Consultancy */
.mega.mega-consultancy { grid-template-columns: 1fr; width: fit-content; padding: 12px 16px; }
.mega.mega-consultancy .categories { border-right: 0; }
.mega .subcourses { display: flex; flex-direction: column; gap: 4px; padding-right: 6px; }
.mega .subcourses a { padding: 6px 0; color: var(--color-text); display: block; text-decoration: none; }
.mega .subcourses a:hover { 
  background: var(--color-primary);
  color: #fff;
  font-weight: bold;
}

.mega-toggle { display: none; background: none; border: none; cursor: pointer; padding: 5px; }
.mega-toggle svg { transition: transform 0.3s ease; width: 12px; height: 12px; }

/* Course Navigation Dropdown */
/* Position dropdown relative to header instead of course-nav */
.course-nav { position: static; }
.course-nav .dropdown {
  position: absolute;
  top: 100%; /* always below header */
  left: 0;
  width: 100%;
  max-width: 100vw;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,.08);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all .18s ease;
  z-index: 1001;
}

/* Show dropdown on hover/focus */
.course-nav:hover .dropdown,
.course-nav:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Responsive dropdown grid */
.course-nav .dropdown .grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ...The rest of your CSS remains unchanged below (Hero, Sections, Course List, Footer, Media Queries, etc.) */


/* Hero */
.hero { position: relative; padding: 64px 0; background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 100%); }
.hero .lead { color: var(--color-subtext); max-width: 800px; }
.hero .actions { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections */
main { min-height: calc(100vh - 300px); }
section { padding: 48px 0; }
.section-muted { background: var(--color-muted); }
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.card-body {
  padding: 16px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  min-width: 0;
  overflow: hidden;
}
.card h3 {
  margin-top: 6px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}
.card p {
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.card img {
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.card * {
  max-width: 100%;
  box-sizing: border-box;
}
.pill { display: inline-block; padding: 6px 10px; background: #eef1f6; color: var(--color-primary); border-radius: 999px; font-size: .85rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Course directory */
.course-index { padding: 48px 0 24px; }
.course-index-intro { max-width: 780px; }
.course-index-nav { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.course-index-nav a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #d9deeb;
  font-weight: 600;
  color: var(--color-primary);
  background: #f8faff;
  transition: all .2s ease;
}
.course-index-nav a:hover,
.course-index-nav a:focus {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.course-category { padding: 56px 0; }
.course-category-header { margin-bottom: 24px; max-width: 860px; }
.course-category-header h2 { margin-bottom: 8px; }

.course-list {
  display: grid;
  gap: 16px;
}

.course-list-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e4e8f2;
  border-left: 4px solid var(--color-primary);
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.course-list-item:hover,
.course-list-item:focus {
  border-left-color: var(--color-accent);
  border-color: rgba(17, 45, 89, 0.1);
  box-shadow: 0 12px 24px rgba(22, 46, 94, 0.08);
  background: var(--color-primary);
}

.course-list-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.course-list-item:hover .course-list-title,
.course-list-item:focus .course-list-title {
  color: #fff;
  font-weight: 700;
}

.course-list-summary {
  margin: 0;
  color: var(--color-text);
}

.course-list-item:hover .course-list-summary,
.course-list-item:focus .course-list-summary {
  color: #fff;
  font-weight: 600;
}

.course-list-meta {
  font-size: 0.95rem;
  color: var(--color-subtext);
  white-space: nowrap;
}

.course-list-item:hover .course-list-meta,
.course-list-item:focus .course-list-meta {
  color: #fff;
  font-weight: 600;
}

/* Course detail */
.course-section { padding: 56px 0; }
.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 32px;
  align-items: start;
}

.course-main > * + * { margin-top: 24px; }

.course-main h2 { margin-bottom: 12px; }
.course-main h3 { margin-top: 0; margin-bottom: 12px; }

.course-sidebar {
  display: grid;
  gap: 20px;
}

.info-card {
  background: #fff;
  border: 1px solid #e4e8f2;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 20px rgba(15, 35, 72, 0.05);
}

.info-card h3 { margin-bottom: 12px; }
.info-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.info-card ul li { display: flex; flex-direction: column; font-size: 0.95rem; color: var(--color-text); }
.info-card ul li strong { font-weight: 700; color: var(--color-primary); }

.course-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.course-badges .pill { background: #e6ebf9; color: var(--color-primary); }

.course-cta { display: grid; gap: 12px; }

.course-meta-grid { display: grid; gap: 16px; }
.course-meta-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.key-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.key-list li { display: flex; align-items: flex-start; gap: 10px; }
.key-list li::before { content: "•"; color: var(--color-accent); font-weight: 700; }

.course-section.section-muted { background: var(--color-muted); }

.course-section .accordion { margin-top: 24px; }

/* Lists */
.list { display: grid; gap: 10px; }
.list.check li { list-style: none; padding-left: 28px; position: relative; }
.list.check li::before { content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 4px; background: var(--color-primary); mask: url('#icon-check'); -webkit-mask: url('#icon-check'); mask-size: cover; -webkit-mask-size: cover; }

/* Forms */
form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
label { font-weight: 600; color: var(--color-text); }
input, select, textarea { padding: 12px 12px; border-radius: 8px; border: 1px solid #e5e7eb; font-size: 1rem; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-primary); border-color: var(--color-primary); }
.help { color: var(--color-subtext); font-size: .9rem; }
.error { color: var(--color-accent); font-size: .9rem; }

/* Footer */
footer { background: var(--color-primary); color: #eaf0ff; }
footer a { color: #eaf0ff; }
footer a:hover { color: #ffffff; }
footer .footer-top { padding: 40px 0; }
footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.18); padding: 14px 0; font-size: .95rem; color: #c9d6ff; }
footer .footer-credits { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
footer .footer-credits a { text-decoration: underline; }

/* Banners */
.banner { background: linear-gradient(90deg, #0f2348, #162e5e); color: #fff; padding: 48px 0; }
.banner h1, .banner p { color: #fff; }

/* Accordion */
.accordion { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.accordion .item + .item { border-top: 1px solid #e5e7eb; }
.accordion .header { background: #fff; padding: 14px 16px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.accordion .header span { transition: transform 0.3s ease; }
.accordion .item[aria-expanded="true"] .header span { transform: rotate(45deg); }
.accordion .panel { display: none; padding: 12px 16px; background: #fafbff; }
.accordion .item[aria-expanded="true"] .panel { display: block; }

/* Gallery */
.gallery { columns: 3; column-gap: 16px; }
.gallery img { width: 100%; margin: 0 0 16px; border-radius: 10px; }

/* Floating WhatsApp */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
}

/* Utilities */
.muted { color: var(--color-subtext); }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

.icon { width: 20px; height: 20px; fill: #000; }
.icon.accent { fill: var(--color-primary); }

.mobile-only { display: none; }
.desktop-only { display: block; }

/* DESKTOP FIRST - Keep desktop intact (1024px and up) */
@media (min-width: 1024px) {
  .hamburger { display: none !important; }
  .mobile-only { display: none !important; }
  .desktop-only { display: block !important; }

  .menu .has-mega:hover .mega, .menu .has-mega:focus-within .mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .course-nav:hover .dropdown, .course-nav:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* TABLET (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .gallery { columns: 2; }

  .topbar .contact { font-size: 0.85rem; gap: 12px; }
  .brand-logo-img { width: 100px; }

  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }

  .course-list-item {
    flex-direction: column;
    gap: 12px;
  }

  .course-list-meta {
    white-space: normal;
  }
}

/* MOBILE (below 1024px) - Navigation becomes off-canvas */
@media (max-width: 1023px) {
  .hamburger {
    display: inline-flex !important;
    z-index: 2001;
    position: relative;
  }

  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }

  .menu {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    bottom: 0 !important;
    left: auto !important;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 80px 20px 20px;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 2000;
    overflow-y: auto;
  }

  .menu.open {
    right: 0 !important;
  }

  .menu > li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .menu > li > a {
    width: 100%;
    display: block;
    padding: 14px 0;
  }

  .mega-toggle {
    display: inline-block;
    position: absolute;
    right: 0;
    top: 12px;
  }

  .has-mega.open .mega-toggle svg {
    transform: rotate(180deg);
  }

  .mega {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    opacity: 1;
    visibility: hidden;
    display: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 12px 0 12px 16px;
    margin: 8px 0;
    background: var(--color-muted);
    grid-template-columns: 1fr !important;
    max-height: none;
    overflow-y: visible;
    pointer-events: none;
  }

  .menu .has-mega.open .mega {
    display: grid;
    visibility: visible;
    pointer-events: auto;
  }

  .mega .categories {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .mega .subcourses {
    grid-template-columns: 1fr;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .course-nav .dropdown {
    position: static;
    width: 100%;
    max-width: 100%;
    opacity: 1;
    visibility: hidden;
    display: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 12px 0 12px 16px;
    margin: 8px 0;
    background: var(--color-muted);
  }

  .course-nav:hover .dropdown {
    display: none;
  }

  .course-nav.active .dropdown {
    display: block;
    visibility: visible;
    pointer-events: auto;
  }

  .course-nav .dropdown .grid {
    grid-template-columns: 1fr;
  }

  .course-index {
    padding: 32px 0 16px;
  }

  .course-index-nav {
    gap: 10px;
  }

  .course-index-nav a {
    width: 100%;
    justify-content: center;
  }

  .course-list-item {
    flex-direction: column;
    gap: 12px;
  }

  .course-list-meta {
    white-space: normal;
  }

  .course-layout {
    grid-template-columns: 1fr;
  }

  .course-meta-grid.two-cols {
    grid-template-columns: 1fr;
  }
}

/* MOBILE (below 768px) */
@media (max-width: 767px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100%;
  }

  .topbar .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }

  .topbar .contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.85rem;
  }

  .topbar .social {
    gap: 10px;
  }

  .brand-logo-img { width: 90px; }

  h1 { font-size: 1.75rem; word-wrap: break-word; }
  h2 { font-size: 1.4rem; word-wrap: break-word; }
  h3 { font-size: 1.1rem; word-wrap: break-word; }

  .hero { padding: 40px 0; }
  .hero .actions { flex-direction: column; width: 100%; }
  .hero .actions .btn { width: 100%; text-align: center; justify-content: center; }

  section { padding: 32px 0; }
  .course-section { padding: 32px 0; }

  .grid, .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 16px;
    width: 100%;
  }

  .grid > * {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .gallery { columns: 1; }

  footer .footer-top { padding: 32px 0; }
  footer .grid { gap: 24px; }
  footer .footer-credits {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  footer .footer-bottom {
    padding-bottom: 80px;
  }

  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }

  .whatsapp-float svg {
    width: 28px;
    height: 28px;
  }

  .menu {
    width: 90%;
    max-width: 280px;
    right: -100% !important;
  }

  .menu.open {
    right: 0 !important;
  }

  .card {
    max-width: 100%;
    width: 100%;
  }
}

/* SMALL MOBILE (below 480px) */
@media (max-width: 479px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .btn {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .card-body { padding: 14px; }

  .menu {
    width: 100%;
    max-width: 100%;
    right: -100% !important;
  }

  .menu.open {
    right: 0 !important;
  }

  .card, .card * {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}