/* Doon Sainik School - Master Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --color-military-primary: #556B2F;
  --color-military-secondary: #6B8E23;
  --color-military-accent: #8F9779;
  --color-military-neutral: #A9A9A9;
  --color-military-bg: #FFFFFF;
  --color-military-white: #FFFFFF;
  --color-military-light: #F6F6F3;
  --color-military-surface: #F5F5F5;
  --color-military-surface2: #E8E8E8;
  --color-military-dark: #1A1A1A;
  --gold-accent: #D4AF37;
  --gold-light: #F5E27A;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-military-dark);
  background-color: var(--color-military-bg);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  min-width: 320px;
  width: 100%;
  max-width: 100%;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  object-fit: cover;
}

p, span, a, li, button, input, select, textarea {
  max-width: 100%;
}

input, select, textarea, button {
  font: inherit;
}

a, button {
  -webkit-tap-highlight-color: transparent;
}

main, section, article, div, nav, header, footer {
  max-width: 100%;
}

#main-nav {
  position: relative;
}

#mobile-menu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

#mobile-menu.open {
  max-height: 85vh;
  opacity: 1;
}

#site-header:empty {
  min-height: 104px;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.font-heading {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.05em;
}

/* Fluid Hero Typography */
.hero-title {
  font-size: clamp(2rem, 5vw + 1rem, 4.5rem);
  line-height: 1.05;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.35rem);
  line-height: 1.4;
}

/* Camouflage texture pattern */
.camo-texture {
  background-image: 
    radial-gradient(ellipse 60px 40px at 20% 20%, rgba(85,107,47,0.06) 0%, transparent 100%),
    radial-gradient(ellipse 80px 60px at 70% 60%, rgba(47,79,47,0.05) 0%, transparent 100%),
    radial-gradient(ellipse 40px 80px at 50% 10%, rgba(194,178,128,0.04) 0%, transparent 100%);
}

/* Gold shimmer animation */
@keyframes gold-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.gold-shimmer {
  background: linear-gradient(90deg, #D4AF37, #F5E27A, #D4AF37, #A88830, #D4AF37);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gold-shimmer 4s linear infinite;
}

/* Marquee ticker */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-inner {
  animation: marquee 25s linear infinite;
  display: flex;
  width: max-content;
}

.marquee-inner:hover {
  animation-play-state: paused;
}

/* Hover Lift */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #1C1F1A;
}
::-webkit-scrollbar-thumb {
  background: #D4AF37;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #F5E27A;
}

::selection {
  background: rgba(212,175,55,0.3);
  color: #1A1A1A;
}

/* Desktop Dropdown transitions */
.dropdown-menu {
  min-width: 220px;
  background: #ffffff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 18px 40px rgba(16, 40, 24, 0.16);
}
.dropdown-parent:hover .dropdown-menu,
.dropdown-parent:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-items:not(.dropdown-items-mega) {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.dropdown-heading {
  padding: 10px 16px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #14532d;
}

.dropdown-heading:first-child {
  padding-top: 4px;
}

.dropdown-menu-mega {
  position: absolute;
  left: max(12px, calc(50% - 520px));
  right: max(12px, calc(50% - 520px));
  width: auto;
  min-width: 0;
  max-width: 1040px;
  max-height: min(72vh, 480px);
  top: calc(100% - 4px);
  margin-top: 0;
  overflow: auto;
}

#main-nav {
  position: relative;
}

#main-nav .dropdown-parent[data-nav-key="resources"] {
  position: static;
}

.dropdown-items-mega {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 6px 8px 12px;
}

.dropdown-mega-col {
  padding: 4px 8px 8px;
  border-left: 1px solid #eef2ee;
}

.dropdown-mega-col:first-child {
  border-left: none;
}

.dropdown-mega-col .dropdown-heading {
  padding: 8px 8px 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid #e8efe8;
}

.dropdown-pdf-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  color: #1a2e24;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 8px;
  white-space: normal;
}

.dropdown-pdf-link:hover {
  background: #f0f7f1;
  color: #14532d;
}

@media (max-width: 1100px) {
  .dropdown-items-mega {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dropdown-mega-col:nth-child(2n + 1) {
    border-left: none;
  }
}

/* Mobile Drawer transitions */
#mobile-menu {
  transition: max-height 0.35s ease-in-out, opacity 0.3s ease;
}

/* Mobile Accordions */
.mobile-sub-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.mobile-sub-menu.open {
  max-height: 70vh;
  overflow-y: auto;
}

/* Modal Animations */
.modal-backdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
}
.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Accordion */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
}
.accordion-content.open {
  max-height: 600px;
}

/* Hero Slider */
.hero-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}
.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

/* CMS / rich-text content — long paragraphs wrap safely without breaking layout */
.cms-content,
.blog-content,
[data-profile-field] {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cms-content p,
.blog-content p,
.cms-content li,
.blog-content li {
  margin-bottom: 0.85em;
  line-height: 1.7;
}

.cms-content p:last-child,
.blog-content p:last-child {
  margin-bottom: 0;
}

.cms-content img,
.blog-content img,
.cms-content video,
.blog-content video,
.cms-content iframe,
.blog-content iframe {
  max-width: 100%;
  height: auto;
}

.cms-content table,
.blog-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}

.cms-content pre,
.blog-content pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
}

.cms-content a,
.blog-content a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Responsive Table Wrapper */
.responsive-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 1rem;
}
.responsive-table-wrapper::-webkit-scrollbar {
  height: 4px;
}
.responsive-table-wrapper::-webkit-scrollbar-thumb {
  background: #556B2F;
}

/* Floating Action Buttons */
.floating-actions-container {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.floating-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.floating-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.floating-btn-whatsapp {
  background-color: #25D366;
}

.floating-btn-call {
  background-color: #1E3A8A;
}

.floating-btn-top {
  background-color: #556B2F;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
}

.floating-btn-top.visible {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1024px) {
  body {
    min-width: 320px;
  }

  #main-nav > div {
    gap: 0.5rem;
  }

  #top-bar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (max-width: 767px) {
  #top-bar {
    height: 2.75rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #top-bar > div:first-child {
    max-width: 58%;
    min-width: 0;
  }

  #top-bar > div:first-child a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #top-bar > div:last-child {
    gap: 0.35rem;
  }

  #top-bar .bg-\[#f08519\] {
    display: none;
  }

  #main-nav > div {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #main-nav img {
    max-height: 2.5rem;
  }

  .floating-actions-container {
    bottom: 16px;
    right: 14px;
    gap: 10px;
  }

  .floating-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  #top-bar {
    min-height: 2.75rem;
    height: auto;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  #top-bar > div:first-child {
    max-width: 100%;
  }

  #top-bar > div:last-child a {
    font-size: 9px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #mobile-menu .flex-col {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #mobile-menu a,
  #mobile-menu button {
    word-break: break-word;
  }

  .floating-actions-container {
    bottom: 14px;
    right: 12px;
  }
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.gallery-filter {
  border: 1px solid #14532d;
  background: #fff;
  color: #14532d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.gallery-filter.active,
.gallery-filter:hover {
  background: #14532d;
  color: #fff;
}

.gallery-item.is-hidden {
  display: none;
}

#pay-buyer-modal.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
}
