/*
Theme Name: Digital Horizons Foundation
Theme URI: https://dhf-india.org
Author: Digital Horizons Foundation
Author URI: https://dhf-india.org
Description: Official WordPress theme for Digital Horizons Foundation — a Section 8 nonprofit delivering AI literacy and digital education across India.
Version: 1.0.9
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dhf
Tags: nonprofit, education, responsive, custom-menu, featured-images, full-width-template
*/

/* ── Fix top blank space (header is sticky, not fixed) ───────────────────── */
.page-hero {
  margin-top: 0 !important;
  padding: 72px 0 96px !important;
}

/* ── Wave shape at bottom of every page hero ─────────────────────────────── */
.page-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 64px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,32 C180,64 360,0 540,28 C720,56 900,10 1080,32 C1260,54 1380,20 1440,36 L1440,64 L0,64 Z' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat bottom center / cover;
  z-index: 3;
  pointer-events: none;
}

/* ── Paper plane decoration on CTA banner ────────────────────────────────── */
.cta-banner {
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-60%) rotate(-10deg);
  width: 140px;
  height: 120px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 170' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='185,18 75,82 96,104' fill='%23ffffff' opacity='0.18'/%3E%3Cpolygon points='185,18 96,104 80,78' fill='%23ffffff' opacity='0.1'/%3E%3Cpath d='M96,104 C76,128 50,140 28,128 C8,116 2,92 14,68 C24,48 58,52 68,36' stroke='%23ffffff' stroke-width='2.5' stroke-dasharray='7,5' fill='none' opacity='0.3'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}

/* ── Partnerships dropdown (nav) ─────────────────────────────────────────── */
.dhf-nav-menu .menu-item-has-children .dhf-sub-menu,
.dhf-nav-menu .nav-dropdown .dhf-sub-menu { display: none; }
.dhf-nav-menu .menu-item-has-children:hover .dhf-sub-menu,
.dhf-nav-menu .nav-dropdown:hover .dhf-sub-menu { display: block; }

/* ── Clean eyebrow (no emoji padding needed) ─────────────────────────────── */
.page-hero-eyebrow { letter-spacing: 1px; }

/* ── Footer logo fix ─────────────────────────────────────────────────────── */
.site-footer .dhf-logo-link img {
  height: 40px !important;
  width: auto !important;
  border-radius: 0 !important;
  object-fit: contain !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PARTNERSHIP PAGE GRID
   ═══════════════════════════════════════════════════════════════════════════ */
.partner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.partner-banner-img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(13,43,94,.14);
  display: block;
}
.partner-img-col {
  display: flex;
  align-items: flex-start;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DROPDOWN NAV — IMPROVED HOVER + FOCUS + MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */
.dhf-nav-menu > li.menu-item-has-children { position: relative; }

.dhf-nav-menu > li.menu-item-has-children ul.dhf-sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(13,43,94,.14);
  padding: 8px 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
}

.dhf-nav-menu > li.menu-item-has-children:hover ul.dhf-sub-menu,
.dhf-nav-menu > li.menu-item-has-children:focus-within ul.dhf-sub-menu,
.dhf-nav-menu > li.menu-item-has-children.open ul.dhf-sub-menu {
  display: flex;
}

ul.dhf-sub-menu > li > a {
  display: block;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #0D2B5E;
  white-space: nowrap;
  transition: background .15s, color .15s;
  text-decoration: none;
}
ul.dhf-sub-menu > li > a:hover { background: #EEF4FF; color: #1661be; }

/* Arrow indicator on parent */
.dhf-nav-menu > li.menu-item-has-children > div.nav-dropdown > a::after {
  content: ' ▾';
  font-size: 10px;
  opacity: .7;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE NAV — open state
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    overflow-y: auto;
    padding: 16px 0 40px;
    z-index: 9998;
    box-shadow: 0 8px 32px rgba(13,43,94,.12);
  }
  .main-nav.open { display: block; }

  .dhf-nav-menu {
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .dhf-nav-menu > li { border-bottom: 1px solid #f0f4fa; }

  .dhf-nav-menu > li > a,
  .dhf-nav-menu > li > div.nav-dropdown > a {
    display: block;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
  }

  /* Dropdown: stacked under parent on mobile */
  .dhf-nav-menu > li.menu-item-has-children ul.dhf-sub-menu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    border-top: 1px solid #f0f4fa;
    background: #F7FAFF;
    padding: 4px 0;
    display: none;
  }
  .dhf-nav-menu > li.menu-item-has-children.open ul.dhf-sub-menu,
  .dhf-nav-menu > li.menu-item-has-children > div.nav-dropdown.open ~ ul.dhf-sub-menu,
  .dhf-nav-menu > li.menu-item-has-children > div.nav-dropdown.open + ul.dhf-sub-menu {
    display: flex;
  }

  ul.dhf-sub-menu > li > a { padding: 11px 32px; font-size: 14px; }

  .hdr-cta { display: none; }
  .hamburger { display: flex !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 900 px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .partner-grid,
  .partner-grid.partner-grid-reverse {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  /* On mobile image always comes first */
  .partner-img-col { order: -1; }

  .page-hero { padding: 56px 0 72px !important; }

  .h-stats { flex-wrap: wrap; gap: 16px; }
  .h-stat  { flex: 1 1 calc(50% - 8px); min-width: 140px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 640 px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .partner-grid { gap: 24px; }
  .partner-banner-img { border-radius: 14px; }

  .page-hero h1 { font-size: clamp(1.8rem, 7vw, 2.6rem) !important; }
  .page-hero p  { font-size: 15px !important; }

  .wrap { padding-left: 16px !important; padding-right: 16px !important; }

  .section { padding: 40px 0 !important; }

  .btn-lg { padding: 13px 22px !important; font-size: 14px !important; }

  .cta-banner { padding: 40px 0 !important; }
  .cta-banner::before { display: none; }

  .h-stat { flex: 1 1 100%; }

  /* SDG grid — 2 columns on small screens */
  .sdg-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .sdg-card { padding: 14px !important; }
  .sdg-num  { font-size: 13px !important; }

  /* Footer columns stack */
  .footer-cols { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Testimonial */
  .testi-card { padding: 24px 18px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVBAR — ATTRACTIVE REDESIGN
   ═══════════════════════════════════════════════════════════════════════════ */

/* Top accent ticker bar */
.hdr-accent-bar {
  background: linear-gradient(90deg, #0D2B5E 0%, #1661be 50%, #0D2B5E 100%);
  background-size: 200% 100%;
  animation: accentShift 6s linear infinite;
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .5px;
  text-align: center;
  padding: 6px 16px;
  overflow: hidden;
  white-space: nowrap;
}
.hdr-accent-text { opacity: .92; }
@keyframes accentShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Main header row */
.hdr-main-row {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(22,97,190,.1);
  transition: box-shadow .3s ease, background .3s ease;
}
.site-header.scrolled .hdr-main-row {
  box-shadow: 0 4px 32px rgba(13,43,94,.13);
  background: rgba(255,255,255,.99);
}

/* Remove old site-header padding so accent bar shows */
.site-header { top: 0 !important; }

/* Logo area */
.dhf-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dhf-logo-img {
  height: 42px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(22,97,190,.18));
  transition: transform .3s ease;
}
.dhf-logo-link:hover .dhf-logo-img { transform: scale(1.06) rotate(-3deg); }
.dhf-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.dhf-logo-name {
  font-size: 15px;
  font-weight: 800;
  color: #0D2B5E;
  letter-spacing: -.2px;
}
.dhf-logo-sub {
  font-size: 10px;
  font-weight: 600;
  color: #1661be;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Nav links — animated underline */
.dhf-nav-menu { gap: 2px !important; }

.dhf-nav-menu > li > a.nav-link,
.dhf-nav-menu > li > .nav-dropdown > a.nav-link {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  color: #2d3a50;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color .22s ease, background .22s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.dhf-nav-menu > li > a.nav-link::after,
.dhf-nav-menu > li > .nav-dropdown > a.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 14px;
  right: 14px;
  height: 2.5px;
  background: linear-gradient(90deg, #1661be, #00b9f2);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.dhf-nav-menu > li > a.nav-link:hover,
.dhf-nav-menu > li > .nav-dropdown > a.nav-link:hover {
  color: #1661be;
  background: rgba(22,97,190,.06);
}
.dhf-nav-menu > li > a.nav-link:hover::after,
.dhf-nav-menu > li > .nav-dropdown > a.nav-link:hover::after,
.dhf-nav-menu > li.current-menu-item > a.nav-link::after {
  transform: scaleX(1);
}
.dhf-nav-menu > li.current-menu-item > a.nav-link {
  color: #1661be;
}

/* Chevron rotation on open */
.nav-chevron {
  transition: transform .25s ease;
  flex-shrink: 0;
}
.menu-item-has-children.open .nav-chevron,
.nav-dropdown.open .nav-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel — polished card */
.dhf-nav-menu > li.menu-item-has-children ul.dhf-sub-menu {
  min-width: 210px;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(13,43,94,.16), 0 2px 8px rgba(13,43,94,.06);
  border: 1px solid rgba(22,97,190,.1);
  overflow: hidden;
  padding: 8px;
  gap: 2px;
}
ul.dhf-sub-menu > li > a {
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
ul.dhf-sub-menu > li > a:hover {
  background: linear-gradient(90deg,rgba(22,97,190,.08),rgba(0,185,242,.05));
  color: #1661be;
  transform: translateX(3px);
  transition: all .18s ease;
}
.submenu-icon { font-size: 16px; flex-shrink: 0; }

/* Right side controls */
.hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hdr-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a5568;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.hdr-icon-btn:hover { background: rgba(22,97,190,.08); color: #1661be; }

/* CTA button — gradient pill with shimmer */
.hdr-cta-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 50px;
  background: linear-gradient(135deg, #0D2B5E 0%, #1661be 60%, #00b9f2 100%);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .2px;
  text-decoration: none;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 16px rgba(22,97,190,.35);
  white-space: nowrap;
}
.hdr-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(22,97,190,.45);
}
.hdr-cta-shine {
  position: absolute;
  top: 0; left: -75%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.28) 50%, transparent 100%);
  transform: skewX(-20deg);
  animation: btnShine 3.5s ease-in-out infinite;
}
@keyframes btnShine {
  0%   { left: -75%; }
  40%  { left: 130%; }
  100% { left: 130%; }
}

/* Scroll progress bar */
.hdr-scroll-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #1661be, #00b9f2, #ffcb05);
  border-radius: 0 2px 2px 0;
  transition: width .1s linear;
  z-index: 10;
}

/* Hamburger update for new layout */
.hdr-inner { padding: 10px 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   PAPER PLANE — PROGRAMS SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.sec-programs-bg { position: relative; overflow: hidden; }

.programs-plane-wrap {
  position: absolute;
  top: 32px;
  right: 5%;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.programs-plane {
  width: 220px;
  height: auto;
  animation: planeFly 5s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(0,185,242,.2));
  transform-origin: center center;
}

@keyframes planeFly {
  0%   { transform: translate(0, 0) rotate(-8deg); }
  25%  { transform: translate(-12px, -18px) rotate(-5deg); }
  50%  { transform: translate(-6px, -28px) rotate(-10deg); }
  75%  { transform: translate(-18px, -14px) rotate(-6deg); }
  100% { transform: translate(0, 0) rotate(-8deg); }
}

/* Ensure content sits above the plane */
.sec-programs-bg .wrap { position: relative; z-index: 2; }

@media (max-width: 900px) {
  .hdr-accent-bar { font-size: 10px; padding: 5px 12px; }
  .dhf-logo-text { display: none; }
  .hdr-icon-btn  { display: none; }
  .hdr-cta-btn   { display: none; }
  .programs-plane { width: 130px; }
  .programs-plane-wrap { top: 16px; right: 2%; }
}

@media (max-width: 640px) {
  .programs-plane { width: 90px; }
  .programs-plane-wrap { top: 8px; right: 1%; }
  .hdr-accent-bar { display: none; }
}
