/* =========================================================
   INVICtUS MUN — LOGO-PERFECT PURPLE THEME (CLEAN VERSION)
   - No duplicate selectors
   - Stable header/nav/logo behavior
   - Committees grid + fullscreen modal (scroll-enabled)
   - Responsive for mobile
   ========================================================= */

/* =============== RESET =============== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #1a0a24;
  color: #cbbfe0;
  line-height: 1.75;
}

/* =============== LAYOUT =============== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* =============== TYPOGRAPHY =============== */
h1 {
  font-size: 3.6rem;
  font-weight: 700;
  color: #cfa8ff;
  letter-spacing: -0.6px;
}

h2 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #cfa8ff;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #efe6ff;
}

p {
  font-size: 1.05rem;
  max-width: 980px;
  color: #cbbfe0;
}

/* =============== HEADER / NAV =============== */
/* Use ONE consistent system: header > .navbar > .nav-left + .nav-right */
header {
  background: #100014;
  border-bottom: 1px solid #3a1557;
  padding: 16px 24px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-left {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-left a {
  font-size: 15px;
  color: #cfa8ff;
  text-decoration: none;
  white-space: nowrap;
}

.nav-left a:hover {
  color: #ffffff;
}

.nav-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Logo image (single source of truth) */
.logo {
  width: 64px;
  height: auto;
  display: block;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

/* OPTIONAL: if you are using <a class="logo-link"><img class="logo" /></a> */
.logo-link {
  display: inline-flex;
  align-items: center;
}

/* =============== GLOBAL SECTIONS =============== */
section {
  padding: 120px 80px;
}

.section-dark {
  background: #0e0014;
}

/* =============== HERO =============== */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* =============== CARDS / GRID =============== */
.card {
  background: #14081e;
  border: 1px solid #3a1557;
  padding: 30px;
}

.grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 36px;
  margin-top: 64px;
}

/* =============== IMAGE PLACEHOLDER =============== */
.image-placeholder {
  margin-top: 46px;
  height: 280px;
  border: 2px dashed #3a1557;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(203, 191, 224, 0.5);
  font-style: italic;
}

/* =============== CONTACT BOX =============== */
.contact-box {
  margin-top: 40px;
  background: #14081e;
  padding: 44px;
  border-left: 6px solid #6f1bb3;
}

/* =============== FOOTER =============== */
footer {
  padding: 40px 80px;
  background: #0e0014;
  border-top: 1px solid #3a1557;
}

footer p {
  font-size: 14px;
  color: #b7a9d6;
}

/* =========================================================
   COMMITTEES PAGE
   ========================================================= */
.committee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
  margin-top: 60px;
}

.committee-card {
  position: relative;
  height: 340px;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid #3a1557;
  background-size: cover;
  background-position: center;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.committee-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(14, 0, 20, 0.95),
    rgba(14, 0, 20, 0.4)
  );
}

.committee-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.committee-card h3 {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 2;
  font-size: 1.4rem;
}

/* =========================================================
   FULLSCREEN MODAL (SCROLL ENABLED)
   - Background image on modal wrapper
   - Overlay dark layer
   - Content scrolls (full screen)
   ========================================================= */
.committee-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-size: cover;
  background-position: center;
  display: none;
}

.committee-modal.active {
  display: block;
}

.committee-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 0, 18, 0.94);
}

/* Fullscreen scroll container */
.modal-content {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow-y: auto;
  padding: 90px 10vw 80px;
  background: transparent;
  animation: slideUp 0.5s ease forwards;
}

/* Inner panel (so text has a premium container) */
.modal-panel {
  max-width: 980px;
  margin: 0 auto;
  background: rgba(20, 8, 30, 0.92);
  border: 1px solid #3a1557;
  padding: 56px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Close button fixed so it doesn't scroll away */
.modal-close {
  position: fixed;
  top: 28px;
  right: 40px;
  font-size: 34px;
  cursor: pointer;
  color: #cfa8ff;
  z-index: 1100;
  user-select: none;
}

/* Meta cards */
.modal-meta {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.modal-meta div {
  border: 1px solid #3a1557;
  padding: 16px;
  background: rgba(18, 0, 24, 0.85);
  transition: transform 0.3s ease;
}

.modal-meta div:hover {
  transform: translateY(-4px);
}

/* Links */
.modal-links {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.modal-links a {
  padding: 14px 24px;
  border: 1px solid #6f1bb3;
  text-decoration: none;
  color: #efe6ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.modal-links a:hover {
  background: #6f1bb3;
  transform: translateY(-2px);
}

/* Primary CTA emphasis */
.modal-links a.primary {
  background: #6f1bb3;
  border-color: #6f1bb3;
}

.modal-links a.primary:hover {
  background: #8d3fe0;
  border-color: #8d3fe0;
}

/* =========================================================
   PAGE HERO (for non-home pages if you use it)
   ========================================================= */
.page-hero {
  padding: 100px 0 60px;
}

.page-hero h1 {
  font-size: 3.2rem;
  line-height: 1.2;
}

.page-hero p {
  max-width: 720px;
  margin-top: 20px;
  font-size: 1.1rem;
  opacity: 0.9;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  .container {
    padding: 0 18px;
  }

  header {
    padding: 14px 16px;
  }

  .navbar {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .nav-left {
    justify-content: center;
    gap: 14px;
  }

  .nav-left a {
    font-size: 14px;
  }

  .logo {
    width: 56px;
  }

  section {
    padding: 64px 20px;
  }

  h1 {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.8rem;
  }

  p {
    font-size: 1rem;
  }

  .hero {
    min-height: auto;
    padding-top: 80px;
  }

  .grid,
  .stats-grid,
  .committee-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 100px 20px 60px;
  }

  .modal-panel {
    padding: 28px;
  }

  .modal-close {
    right: 18px;
    top: 18px;
  }
}
/* ================= Committees Page: spacing fix ================= */
body.committees-page section {
  padding: 64px 80px; /* was 120px 80px — too much */
}

body.committees-page .page-hero {
  padding: 70px 0 32px; /* tighten top area */
}

body.committees-page .page-hero p {
  margin-top: 14px;
}

/* Space between intro text and the committee cards */
body.committees-page .committee-grid {
  margin-top: 28px;
}

/* Modal/expanded committee view: remove that awkward empty gap */
body.committees-page .modal-content {
  padding: 72px 7vw 56px; /* was 90px 10vw 80px */
}

/* Make long mandate readable but not “floating in space” */
body.committees-page .modal-content p {
  margin: 0 0 16px;
  line-height: 1.75;
}

body.committees-page .modal-content h2 {
  margin: 26px 0 12px;
}

/* If you used <br><br> a lot in the mandate area, this prevents it from creating oceans */
body.committees-page .modal-content br {
  line-height: 0;
}
/* Register page: force the 3 cards to stack vertically */
/* ===== Register Page Enhancements ===== */

.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Button style consistent with Invictus theme */
.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--accent-color);
  color: #000;
}

.btn.primary {
  background: var(--accent-color);
  color: #000;
}

.btn.primary:hover {
  opacity: 0.9;
}
/* =========================================================
   MOBILE OPTIMIZATION — REGISTER PAGE ONLY
   Does NOT affect desktop or tablet landscape
   ========================================================= */

@media (max-width: 768px) {
  /* --- Global spacing fixes --- */
  main {
    overflow-x: hidden;
  }

  section {
    padding-left: 18px;
    padding-right: 18px;
  }

  /* --- Hero / Intro --- */
  .page-hero {
    padding-top: 70px;
    padding-bottom: 40px;
  }

  .hero-wrap h1 {
    font-size: 34px;
    line-height: 1.25;
  }

  .hero-sub {
    font-size: 16px;
    line-height: 1.6;
  }

  /* --- Kill desktop grids on mobile --- */
  .reg-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  /* --- Registration cards --- */
  .reg-card {
    padding: 20px;
    min-height: unset;
  }

  .reg-card h3 {
    font-size: 22px;
  }

  .price {
    font-size: 16px;
  }

  .reg-card ul {
    margin-left: 16px;
    font-size: 15px;
  }

  /* --- Buttons / CTAs --- */
  .modal-links a {
    padding: 14px 16px;
    font-size: 14px;
  }

  /* --- Accordions --- */
  .reg-accordion summary {
    font-size: 16px;
    padding: 16px;
  }

  .summary-meta {
    font-size: 12px;
  }

  .reg-accordion .panel {
    padding: 14px 16px 18px 16px;
    font-size: 15px;
  }

  .panel h4 {
    font-size: 18px;
  }

  /* --- Chips --- */
  .chip-row {
    gap: 8px;
  }

  .chip {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* --- Navbar sanity (if needed) --- */
  .navbar {
    flex-wrap: wrap;
  }

  .nav-left {
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
  }

  .nav-right img.logo {
    height: 36px;
  }
}
/* ===============================
   MOBILE SCROLL FIX — CRITICAL
   =============================== */

@media (max-width: 768px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 768px) {
  /* Kill fixed-height wrappers */
  .page-wrapper,
  .hero,
  .hero-wrap,
  .section-wrapper,
  main,
  section {
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
  }

  /* Disable sticky/fixed containers on mobile */
  .sticky,
  .is-sticky,
  .fixed,
  .sidebar,
  .nav-rail {
    position: static !important;
  }
}
@media (max-width: 768px) {
  .registration-layout,
  .registration-grid,
  .reg-grid,
  .three-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px;
  }

  .side-panel,
  .left-panel,
  .right-panel {
    display: none !important;
  }
}
@media (max-width: 768px) {
  .full-height,
  .vh-section {
    min-height: 100svh !important;
    height: auto !important;
  }
}
/* ================================
   HARD MOBILE SCROLL OVERRIDE
   DO NOT REMOVE
   ================================ */

@media (max-width: 768px) {
  /* Force document scrolling */
  html,
  body {
    position: relative !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100% !important;
    touch-action: pan-y !important;
  }

  /* Kill ALL fixed/sticky sections */
  section,
  main,
  div {
    position: relative !important;
  }
}
@media (max-width: 768px) {
  /* Registration Categories MUST NOT trap scroll */
  #registration-categories,
  .registration-categories,
  .registration-section,
  .categories-section {
    position: relative !important;
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
    max-height: none !important;
  }
}
@media (max-width: 768px) {
  html {
    scroll-snap-type: none !important;
  }

  * {
    scroll-snap-align: unset !important;
  }
}
