/* =====================================================
   HORIZON INTERNATIONAL ACADEMY — FINAL 2026 UI SYSTEM
   Premium Dark Green + Gold Institutional Design
   ===================================================== */

   @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

   /* ===================================================================
      VARIABLES
      =================================================================== */
   :root {
     --green-900: #071f1b;
     --green-800: #0a2e28;
     --green-700: #0d3d34;
     --green-600: #0f4d42;
     --green-500: #136b5c;
     --green-400: #1a9980;
     --green-300: #22c9a5;
     --green-200: #6ee7d0;
     --green-100: #ccf5ee;
   
     --gold:       #c9a84c;
     --gold-light: #e8c97a;
   
     --white:     #f4f9f8;
     --gray-100:  #e8efed;
     --gray-400:  #9ab8b1;
     --gray-600:  #5a7a74;
   
     --text-dark: #0d1f1c;
     --text-body: #2c4a44;
   
     --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
     --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
     --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
   
     --radius-sm: 6px;
     --radius-md: 12px;
     --radius-lg: 20px;
   
     --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   
     --navbar-height: 72px;
     --social-bar-height: 38px;
   }
   
   /* ===================================================================
      RESET
      =================================================================== */
   *,
   *::before,
   *::after {
     box-sizing: border-box;
     margin: 0;
     padding: 0;
   }
   
   /* ===================================================================
      BASE
      =================================================================== */
   body {
     font-family: 'DM Sans', sans-serif;
     background: var(--white);
     color: var(--text-body);
     line-height: 1.7;
     overflow-x: hidden;
     animation: fadeIn 0.6s ease;
   }
   
   /* Safe text clamp – no Tailwind plugin needed */
   .clamp-2 {
     display: -webkit-box;
     -webkit-line-clamp: 2;
     -webkit-box-orient: vertical;
     overflow: hidden;
   }
   
   .clamp-3 {
     display: -webkit-box;
     -webkit-line-clamp: 3;
     -webkit-box-orient: vertical;
     overflow: hidden;
   }
   
   /* ===================================================================
      TYPOGRAPHY
      =================================================================== */
   h1, h2, h3, h4 {
     font-family: 'Playfair Display', serif;
     color: var(--green-800);
     letter-spacing: -0.02em;
   }
   
   a {
     text-decoration: none;
     color: var(--green-500);
     transition: all 0.25s ease;
   }
   
   a:hover  { color: var(--green-300); }
   a:active { transform: scale(0.97); }
   
   /* ===================================================================
      SITE HEADER WRAPPER - FIXED STACKING CONTEXT
      =================================================================== */
   .site-header {
     position: relative;  /* Changed from sticky to relative */
     z-index: 1000;
     width: 100%;
     background: var(--green-800);
   }
   
   /* ===================================================================
      NAVBAR - HIGHEST Z-INDEX
      =================================================================== */
   .navbar {
     background-color: #0a4d44;
     position: relative;
     z-index: 1002;
    
   }
   
   .navbar__inner {
     max-width: 1400px;
     margin: 0 auto;
     padding: 0 24px;
     height: var(--navbar-height);
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 16px;
   }
   
   /* ---- Logo ---- */
   .navbar__logo img {
     height: 56px;
     display: block;
     transition: opacity 0.3s ease;
   }
   
   .navbar__logo:hover img { opacity: 0.85; }
   
   /* ===================================================================
      NAV MENU — DESKTOP
      =================================================================== */
   .nav-menu {
     display: flex;
     list-style: none;
     align-items: center;
     gap: 4px;
     position: relative;
     z-index: 1003;
     margin: 0;
     padding: 0;
   }
   
   .nav-menu > li {
     position: relative;
   }
   
   .nav-menu > li > a {
     display: block;
     color: var(--gray-100);
     padding: 8px 14px;
     font-size: 14px;
     font-weight: 600;
     position: relative;
     border-radius: var(--radius-sm);
     transition: color 0.25s ease, background 0.25s ease;
     white-space: nowrap;
   }
   
   /* Underline animation */
   .nav-menu > li > a::after {
     content: '';
     position: absolute;
     bottom: 4px;
     left: 10px;
     width: 0;
     height: 2px;
     background: var(--green-300);
     transition: width 0.3s ease;
   }
   
   .nav-menu > li > a:hover { color: var(--white); }
   .nav-menu > li > a:hover::after { width: calc(100% - 20px); }
   
   /* ===================================================================
      DROPDOWN — COMPLETE FIX
      =================================================================== */
   .nav-dropdown { 
     position: relative;
   }
   
   .dropdown-arrow {
     font-size: 10px;
     margin-left: 4px;
     display: inline-block;
     transition: transform 0.25s ease;
   }
   
   .nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
   
   /* CRITICAL: Create bridge to eliminate gap */
   .nav-dropdown > a {
     display: block;
     position: relative;
   }
   
   /* Bridge from menu item down to dropdown */
   .nav-dropdown > a::after {
     content: '';
     position: absolute;
     bottom: -15px;
     left: 0;
     width: 100%;
     height: 15px;
     background: transparent;
     z-index: 1005;
   }
   
   /* Dropdown menu styling */
   .dropdown-menu {
     position: absolute;
     top: 100%;
     left: 0;
     list-style: none;
     background: #0d5a50;
     border-radius: 8px;
     min-width: 240px;
     box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.35);
     border: 1px solid rgba(255, 255, 255, 0.1);
     opacity: 0;
     visibility: hidden;
     transform: translateY(-5px);
     transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
     z-index: 10000 !important;
     margin: 0;
     padding: 8px 0;
     pointer-events: none;
   }
   
   /* Show dropdown on hover */
   .nav-dropdown:hover .dropdown-menu {
     opacity: 1;
     visibility: visible;
     transform: translateY(0);
     pointer-events: auto;
   }
   
   /* Keep dropdown visible when hovering over it */
   .dropdown-menu:hover {
     opacity: 1;
     visibility: visible;
     transform: translateY(0);
     pointer-events: auto;
   }
   
   /* Bridge from dropdown up to menu item */
   .dropdown-menu::before {
     content: '';
     position: absolute;
     top: -15px;
     left: 0;
     width: 100%;
     height: 15px;
     background: transparent;
     z-index: 1005;
   }
   
   .dropdown-menu li {
     list-style: none;
     margin: 0;
     padding: 0;
   }
   
   .dropdown-menu a {
     display: block;
     padding: 10px 18px;
     color: #e5e7eb;
     font-size: 14px;
     font-weight: 500;
     text-decoration: none;
     border-left: 3px solid transparent;
     transition: background 0.2s ease, padding-left 0.2s ease, border-color 0.2s ease;
     white-space: nowrap;
   }
   
   .dropdown-menu a:hover {
     background: #1a6b5e;
     padding-left: 24px;
     border-left-color: #c9a03d;
     color: white;
   }
   
   /* ===================================================================
      CTA BUTTON
      =================================================================== */
   .nav-cta > a {
     background: var(--gold) !important;
     color: var(--green-900) !important;
     font-weight: 700 !important;
     border-radius: 8px !important;
     padding: 8px 20px !important;
     transition: background 0.3s ease, box-shadow 0.3s ease !important;
   }
   
   .nav-cta > a::after { display: none !important; }
   
   .nav-cta > a:hover {
     background: var(--gold-light) !important;
     box-shadow: 0 0 20px rgba(201, 168, 76, 0.55) !important;
   }
   
   /* ===================================================================
      HAMBURGER TOGGLE BUTTON
      =================================================================== */
   .nav-toggle {
     display: none;
     flex-direction: column;
     justify-content: center;
     gap: 5px;
     background: transparent;
     border: none;
     cursor: pointer;
     padding: 6px;
     border-radius: var(--radius-sm);
     transition: background 0.2s ease;
     flex-shrink: 0;
   }
   
   .nav-toggle:hover { background: rgba(255, 255, 255, 0.08); }
   
   .nav-toggle__bar {
     display: block;
     width: 26px;
     height: 2px;
     background: var(--white);
     border-radius: 2px;
     transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
     transform-origin: center;
   }
   
   /* Animated X when open */
   .nav-toggle.is-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
   .nav-toggle.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
   .nav-toggle.is-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
   
   /* ===================================================================
      SOCIAL BAR — LOWER Z-INDEX (stays behind dropdown)
      =================================================================== */
   .social-bar {
     background: var(--green-900);
     border-bottom: 1px solid rgba(255, 255, 255, 0.06);
     padding: 0 24px;
     height: var(--social-bar-height);
     display: flex;
     align-items: center;
     position: relative;
     z-index: 5 !important;
   }
   
   .social-bar__inner {
     max-width: 1400px;
     width: 100%;
     margin: 0 auto;
     display: flex;
     align-items: center;
     gap: 14px;
     justify-content: flex-end;
   }
   
   .social-bar__label {
     color: var(--gray-400);
     font-size: 12px;
     font-weight: 500;
     white-space: nowrap;
     letter-spacing: 0.02em;
   }
   
   .social-links {
     display: flex;
     align-items: center;
     gap: 10px;
   }
   
   .social-link {
     display: flex;
     align-items: center;
     justify-content: center;
     width: 28px;
     height: 28px;
     border-radius: 50%;
     transition: background 0.25s ease, transform 0.25s ease;
   }
   
   .social-link:hover {
     background: rgba(255, 255, 255, 0.08);
     transform: translateY(-2px);
   }
   
   .social-bar img {
     width: 20px;
     height: 20px;
     object-fit: contain;
     opacity: 0.75;
     transition: opacity 0.25s ease;
     display: block;
   }
   
   .social-link:hover img { 
     opacity: 1; 
   }
   
   /* ===================================================================
      HERO / SLIDESHOW
      =================================================================== */
   .slideshow {
     position: relative;
     overflow: hidden;
     max-height: 580px;
   }
   
   .slideshow img {
     width: 100%;
     height: 580px;
     object-fit: cover;
   }
   
   .slideshow::after {
     content: '';
     position: absolute;
     inset: 0;
     background: linear-gradient(to bottom, rgba(7, 31, 27, 0.4), rgba(7, 31, 27, 0.85));
   }
   
   /* ===================================================================
      CARDS
      =================================================================== */
   .category-card,
   .course-card,
   .video-card,
   .post-card {
     transition: transform 0.35s ease, box-shadow 0.35s ease;
   }
   
   .category-card:hover,
   .course-card:hover,
   .video-card:hover,
   .post-card:hover {
     transform: translateY(-8px) scale(1.01);
     box-shadow: var(--shadow-lg);
   }


   /* ===================================================================
   EVENTS GRID & CARDS
   =================================================================== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.event-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #f0f0f0;
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(15,110,86,0.12);
  border-color: #d1fae5;
}

.event-img {
  width: 100%;
  height: 180px;
  overflow: hidden;
  position: relative;
  background: #e1f5ee;
}

.event-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.event-card:hover .event-img img {
  transform: scale(1.05);
}

.event-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #0F6E56;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.event-body {
  padding: 16px;
}

.event-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card:hover .event-title {
  color: #0F6E56;
}

.event-excerpt {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.event-meta-dot {
  width: 3px;
  height: 3px;
  background: #d1d5db;
  border-radius: 50%;
}

.event-readmore {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #0F6E56;
  text-decoration: none;
  transition: gap 0.2s;
}

.event-readmore:hover {
  gap: 8px;
  color: #085041;
}

/* ===================================================================
 SECTION HEADERS
 =================================================================== */
.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0F6E56;
  background: #E1F5EE;
  padding: 4px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 12px;
}

.section-rule {
  width: 60px;
  height: 4px;
  background: #C9A84C;
  border-radius: 2px;
  margin: 0 auto 16px;
}

.section-subtitle {
  color: #6b7280;
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ===================================================================
 VIEW ALL BUTTON
 =================================================================== */
.view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0F6E56;
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 32px;
  border-radius: 40px;
  text-decoration: none;
  margin-top: 40px;
  transition: all 0.2s;
}

.view-all-btn:hover {
  background: #085041;
  transform: translateY(-2px);
  color: white;
}

/* ===================================================================
 TAB BUTTONS (Programs Section)
 =================================================================== */
.tab-btn {
  transition: all 0.2s ease;
  cursor: pointer;
}

.tab-btn.active {
  background-color: #008060;
  color: white;
  border-color: #008060;
}

.tab-count {
  font-size: 0.65rem;
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 4px;
}

.tab-btn:not(.active) .tab-count {
  background: #e6f2ef;
  color: #008060;
}

/* ===================================================================
 COURSE CARDS (Additional styles)
 =================================================================== */
.course-card {
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -8px rgba(0,0,0,0.13);
}

.course-card .card-img {
  transition: transform 0.5s ease;
}

.course-card:hover .card-img {
  transform: scale(1.07);
}

.cat-badge {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

/* ===================================================================
 RATING STARS
 =================================================================== */
.rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-filled {
  color: #fbbf24;
}

.star-empty {
  color: #e5e7eb;
}

/* ===================================================================
 LINE CLAMP UTILITIES
 =================================================================== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===================================================================
 RESPONSIVE BREAKPOINTS FOR EVENTS GRID
 =================================================================== */
@media (max-width: 1200px) {
  .events-grid {
      grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .events-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
  }
  .section-title {
      font-size: 1.6rem;
  }
  .event-img {
      height: 150px;
  }
}

@media (max-width: 480px) {
  .events-grid {
      grid-template-columns: 1fr;
  }
}
   
   /* ===================================================================
      ANIMATIONS
      =================================================================== */
   @keyframes fadeIn {
     from { opacity: 0; transform: translateY(8px); }
     to   { opacity: 1; transform: translateY(0); }
   }
   
   @keyframes slideDown {
     from { opacity: 0; transform: translateY(-10px); }
     to   { opacity: 1; transform: translateY(0); }
   }
   
   /* ===================================================================
      MOBILE — max-width: 992px
      =================================================================== */
   @media (max-width: 992px) {
   
     /* Show hamburger */
     .nav-toggle { display: flex; }
   
     /* Hide desktop menu by default */
     .nav-menu {
       display: none;
       position: absolute;
       top: var(--navbar-height);
       left: 0;
       width: 100%;
       background: var(--green-900);
       flex-direction: column;
       align-items: stretch;
       gap: 0;
       padding: 8px 0 16px;
       border-bottom: 2px solid var(--green-700);
       box-shadow: var(--shadow-md);
       animation: slideDown 0.3s ease;
       z-index: 9999;
     }
   
     /* Show when toggled open */
     .nav-menu.open { display: flex; }
   
     /* Mobile nav links — full width, larger tap targets */
     .nav-menu > li > a {
       padding: 14px 24px;
       font-size: 15px;
       border-radius: 0;
       border-bottom: 1px solid rgba(255, 255, 255, 0.05);
       display: flex;
       align-items: center;
       justify-content: space-between;
     }
   
     .nav-menu > li > a::after { display: none; }
   
     /* Mobile dropdown — static, hidden by default */
     .dropdown-menu {
       position: static;
       opacity: 1;
       transform: none;
       pointer-events: auto;
       box-shadow: none;
       border-radius: 0;
       border: none;
       border-top: 1px solid rgba(255, 255, 255, 0.05);
       background: rgba(0, 0, 0, 0.25);
       display: none;
       padding: 4px 0;
       min-width: unset;
       width: 100%;
       z-index: auto;
     }
   
     /* Show dropdown when parent has .open */
     .nav-dropdown.open .dropdown-menu { display: block; }
   
     /* Rotate arrow when open on mobile */
     .nav-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
   
     .dropdown-menu a {
       padding: 11px 36px;
       font-size: 14px;
       border-left: none;
     }
   
     .dropdown-menu a:hover { padding-left: 44px; }
   
     /* CTA full width on mobile */
     .nav-cta { padding: 12px 16px; }
   
     .nav-cta > a {
       display: block;
       text-align: center;
       width: 100%;
       padding: 12px 20px !important;
       border-radius: var(--radius-sm) !important;
     }
   
     /* Social bar — hide label on small screens to save space */
     .social-bar__label { display: none; }
   
     .social-bar { padding: 0 16px; }
     
     /* Remove bridge elements on mobile */
     .nav-dropdown > a::after,
     .dropdown-menu::before {
       display: none;
     }
   }
   
   /* ===================================================================
      EXTRA SMALL — max-width: 480px
      =================================================================== */
   @media (max-width: 480px) {
     .navbar__inner { padding: 0 16px; }
   
     .navbar__logo img { height: 46px; }
   
     .social-bar img { width: 18px; height: 18px; }
   
     .social-links { gap: 6px; }
   }