
/* ── GLOBAL TOUCH TARGET ─────────────────────────────────── */
@media (max-width: 768px) {
  .btn, button, a.nav-link, a.filter-chip {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 36px;
    padding: .45rem .875rem;
  }
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="date"],
  input[type="file"],
  select,
  textarea {
    font-size: 16px !important; /* prevent iOS zoom */
  }
}

/* ── NAVBAR ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .navbar-links { display: none !important; }
  .navbar-actions { display: none !important; }
  .hamburger { display: flex !important; }
  .navbar-inner { padding: 0 1rem; }
  .brand-name { font-size: 1.15rem; }
  .brand-sub { display: none; }
}

/* ── HERO ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { min-height: 90vh; }
  .hero-content { padding: 5rem 1.25rem 2rem; }
  .hero-title { font-size: clamp(3rem,15vw,5.5rem); line-height: .95; }
  .hero-title-italic { font-size: clamp(2.5rem,12vw,4.5rem); }
  .hero-college-name { font-size: .78rem; letter-spacing: .04em; }
  .hero-subtitle { font-size: .9rem; }
  .hero-cta { gap: .75rem; }
  .hero-cta .btn-lg { padding: .75rem 1.25rem; font-size: .875rem; }
  .hero-eyebrow { font-size: .65rem; }
  .eyebrow-line { max-width: 40px; }
  .countdown { gap: .35rem; }
  .countdown-item { padding: .625rem .875rem; min-width: 58px; }
  .countdown-num { font-size: 2rem; }
  .countdown-lbl { font-size: .58rem; }
}
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
}

/* ── STATS STRIP ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 1.25rem 1rem; border-right: none; border-bottom: 1px solid var(--border); }
  .stat-card:nth-child(odd) { border-right: 1px solid var(--border); }
  .stat-card:nth-last-child(-n+2) { border-bottom: none; }
  .stat-num { font-size: 2rem; }
}

/* ── NEWS TICKER ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .ticker-label { padding: .25rem .625rem; font-size: .62rem; }
  .ticker-more { padding: 0 .625rem; font-size: .68rem; }
}

/* ── PAGE HERO ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-hero { padding: 5.5rem 1.25rem 2.5rem; min-height: 22vh; }
  .page-hero-title { font-size: clamp(1.6rem,7vw,2.5rem); }
}

/* ── SECTIONS ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 3rem 1rem; }
  .section-header { margin-bottom: 2rem; }
  .section-title { font-size: clamp(1.5rem,6vw,2rem); }
  .section-desc { font-size: .875rem; }
}

/* ── EVENTS GRID ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .events-grid { grid-template-columns: 1fr; gap: 1rem; }
  .event-card-img { height: 180px; }
}

/* ── GALLERY MASONRY ─────────────────────────────────────── */
@media (max-width: 900px) { .gallery-masonry { columns: 3; } }
@media (max-width: 600px) { .gallery-masonry { columns: 2; } }
@media (max-width: 380px) { .gallery-masonry { columns: 1; } }

/* ── REMARKABLE ALUMNI GRID ──────────────────────────────── */
@media (max-width: 600px) {
  .remarkable-grid { grid-template-columns: 1fr; }
  .remarkable-card { flex-direction: column; align-items: center; text-align: center; }
  .remarkable-meta { justify-content: center; }
}

/* ── FOOTER ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-inner { padding: 2.5rem 1.25rem 1.5rem; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }
}

/* ── CTA SECTION ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .cta-section { padding: 3.5rem 1.25rem; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { justify-content: center; }
}

/* ── FILTER CHIPS ────────────────────────────────────────── */
@media (max-width: 600px) {
  .filter-chip { font-size: .72rem; padding: .35rem .7rem; }
}

/* ── MODE TOGGLE ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .mode-toggle span { display: none; }
  .mode-toggle { padding: .5rem; border-radius: 50%; width: 40px; height: 40px; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════
   ALUMNI PORTAL
═══════════════════════════════════════════════════════════ */

/* ── DASHBOARD ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard-wrap {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem;
    gap: 1rem;
  }
  .dash-sidebar {
    position: static !important;
    max-height: none;
  }
  /* Collapse sidebar nav to horizontal scroll on mobile */
  .dash-nav {
    display: flex;
    overflow-x: auto;
    padding: .5rem;
    gap: .25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .dash-nav::-webkit-scrollbar { display: none; }
  .dash-nav-section { display: none; }
  .dash-nav a {
    white-space: nowrap;
    border-left: none !important;
    border-bottom: 3px solid transparent;
    border-radius: var(--r);
    padding: .5rem .875rem;
    font-size: .8rem;
  }
  .dash-nav a:hover, .dash-nav a.active {
    border-bottom-color: var(--gold);
    border-left-color: transparent !important;
  }
  .dash-profile { padding: 1.25rem 1rem; }
  .admin-stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .admin-stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-stat-card { padding: 1rem; gap: .75rem; }
  .admin-stat-value { font-size: 1.35rem; }
}

/* ── PAYMENT PAGE ────────────────────────────────────────── */
@media (max-width: 900px) {
  /* The 1fr 1fr payment grid */
  .dash-content > div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:1.5rem"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── RECEIPT ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .receipt-row { flex-direction: column; gap: .25rem; }
  .receipt-head { padding: 1.5rem 1rem; }
  .receipt-row { padding: .75rem 1.25rem; }
}

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════════════════════════ */

/* ── SIDEBAR ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .admin-wrapper { grid-template-columns: 220px 1fr; }
}
@media (max-width: 900px) {
  .admin-wrapper { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 500;
    transition: left .3s cubic-bezier(.4,0,.2,1);
    width: 260px;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .admin-sidebar.open { left: 0; }
  .admin-mobile-bar { display: flex !important; }
  .admin-content { padding: 1rem; }
}

/* ── ADMIN STATS ROW ─────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-stats-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .admin-stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-stat-card { padding: .875rem; gap: .625rem; }
  .admin-stat-icon { width: 38px; height: 38px; font-size: 1rem; }
  .admin-stat-value { font-size: 1.3rem; }
  .admin-stat-label { font-size: .65rem; }
}

/* ── ADMIN TOPBAR ────────────────────────────────────────── */
@media (max-width: 600px) {
  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: 1rem;
  }
  .admin-page-title { font-size: 1.2rem; }
  .admin-topbar > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
  }
}

/* ── TABLES (scroll wrapper) ─────────────────────────────── */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  th, td { padding: .625rem .75rem; font-size: .8rem; }
  th { font-size: .65rem; }
}
@media (max-width: 600px) {
  /* Hide lower-priority columns on small screens */
  .table-hide-sm { display: none !important; }
}

/* ── ADMIN SECTION HEADER ────────────────────────────────── */
@media (max-width: 600px) {
  .admin-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
  }
  .admin-section-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
  }
}

/* ── MODALS ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .modal-overlay { padding: .75rem; align-items: flex-end; }
  .modal {
    max-width: 100% !important;
    max-height: 90vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .modal-header { padding: 1rem 1.25rem; }
  .modal > form, .modal > div:not(.modal-header) { padding: 1.25rem; }
}

/* ── FORM ROWS ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr !important; gap: 0 !important; }
}

/* ── ADMIN FORM BUILDER ──────────────────────────────────── */
@media (max-width: 1024px) {
  /* form-builder two-column becomes single column */
  form > div[style*="grid-template-columns:1fr 280px"] {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 600px) {
  .qblock { padding: 1rem; }
  .qblock-hdr { flex-wrap: wrap; }
}

/* ── SITE CONFIG GRID ────────────────────────────────────── */
@media (max-width: 900px) {
  /* reunion-edit two-column */
  div[style*="grid-template-columns:1fr 320px"] {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns:1fr 300px"] {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns:1fr 360px"] {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns:1fr 240px"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── GALLERY ADMIN GRID ──────────────────────────────────── */
@media (max-width: 600px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(180px,1fr))"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 380px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(180px,1fr))"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── SPONSORS GRID ───────────────────────────────────────── */
@media (max-width: 600px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(190px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fill,minmax(220px,1fr))"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── REMARKABLE / DEVELOPER CARDS ───────────────────────── */
@media (max-width: 600px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(260px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fill,minmax(280px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fill,minmax(300px,1fr))"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── FLASH MESSAGES ──────────────────────────────────────── */
@media (max-width: 600px) {
  .flash-container { top: .75rem; right: .75rem; left: .75rem; }
  .flash { max-width: 100%; font-size: .82rem; }
}

/* ── PUBLIC NOTICES PAGE ─────────────────────────────────── */
@media (max-width: 600px) {
  /* Notice card action row */
  div[style*="align-items:flex-start;justify-content:space-between"] {
    flex-direction: column !important;
    gap: .75rem !important;
  }
}

/* ── ALUMNI DIRECTORY ────────────────────────────────────── */
@media (max-width: 600px) {
  form[action="/alumni-directory"] {
    flex-direction: column !important;
  }
  form[action="/alumni-directory"] .form-control { min-width: 100% !important; }
  form[action="/alumni-directory"] .btn { width: 100%; justify-content: center; }
}

/* ── DONATION PAGE ───────────────────────────────────────── */
@media (max-width: 600px) {
  /* Preset amount buttons */
  #presetBtns { gap: .4rem !important; }
  #presetBtns .btn { flex: 1; min-width: calc(33% - .3rem); font-size: .75rem; padding: .4rem .5rem; }
  /* Info row */
  div[style*="display:flex;gap:1rem;align-items:center;flex-wrap:wrap"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .5rem !important;
  }
}

/* ── REUNION DETAIL (section map) ────────────────────────── */
@media (max-width: 600px) {
  div[style*="display:flex;align-items:flex-start;gap:.875rem"] {
    flex-direction: column !important;
    gap: .625rem !important;
  }
}

/* ── ABOUT PAGE COMMITTEE GRID ───────────────────────────── */
@media (max-width: 600px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(180px,1fr))"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── JOBS PAGE ───────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Job card flex row */
  .card-body[style*="display:flex;align-items:flex-start;justify-content:space-between"] {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  .card-body[style*="display:flex;align-items:flex-start;justify-content:space-between"] > a {
    width: 100%;
    justify-content: center;
  }
}

/* ── SPONSORS MARQUEE MOBILE ─────────────────────────────── */
@media (max-width: 600px) {
  .sponsor-tile { width: 130px; height: 70px; }
}

/* ── FEEDBACK FORM ───────────────────────────────────────── */
@media (max-width: 600px) {
  .card .card-body { padding: 1.25rem 1rem; }
}

/* ── ALUMNI MEETS GRID ───────────────────────────────────── */
@media (max-width: 600px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(280px,1fr))"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── VIDEO GRID ──────────────────────────────────────────── */
@media (max-width: 600px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(280px,1fr))"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── ADMIN VIDEO CARDS ───────────────────────────────────── */
@media (max-width: 600px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(300px,1fr))"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── HERO GALLERY STRIP ──────────────────────────────────── */
@media (max-width: 768px) {
  div[style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: auto !important;
    max-height: 250px !important;
  }
  /* Reset the special spanning items on mobile */
  div[style*="grid-row:span 2"] { grid-row: span 1 !important; }
  div[style*="grid-column:span 2"] { grid-column: span 1 !important; }
}
@media (max-width: 480px) {
  div[style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    max-height: 200px !important;
  }
}

/* ── BROCHURE CARDS ──────────────────────────────────────── */
@media (max-width: 480px) {
  div[style*="grid-template-columns:repeat(auto-fill,minmax(280px,1fr))"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── PRINT: hide nav/sidebar ─────────────────────────────── */
@media print {
  .navbar, .nav-spacer, .site-footer, .mode-toggle,
  .flash-container, .admin-sidebar, .admin-mobile-bar,
  .dash-sidebar, .sidebar-overlay, .nav-drawer, .nav-overlay,
  form[action*="logout"] { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .receipt-card { border: 1px solid #ccc !important; }
  .receipt-amount { color: #8a6e18 !important; }
}
