/*
 * Dalton DeHart Photographic Foundation - Main Stylesheet
 *
 * Design language: "The Living Archive" — a museum wall for Houston's LGBTQ+
 * photographic history. Apple-style chassis: flat chrome, hairline borders,
 * alternating light/dark full-bleed tiles, a single Action Blue accent, and
 * one drop-shadow reserved for photography. The pride rainbow appears in
 * exactly three fixed structural places: the hairline under the global nav,
 * the stripe under page titles, and the top edge of the footer. Everywhere
 * else the chrome stays quiet so the photographs can speak.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

/* ===== CSS variables (OKLCH design tokens with hex fallbacks) ===== */
:root {
  /* Pride Rainbow — used only inside --rainbow-gradient structural hairlines */
  --rainbow-red: oklch(62% 0.22 28);       /* #d32f2f */
  --rainbow-orange: oklch(71% 0.20 54);    /* #f57c00 */
  --rainbow-yellow: oklch(82% 0.19 86);    /* #fbc02d */
  --rainbow-green: oklch(61% 0.16 142);    /* #388e3c */
  --rainbow-blue: oklch(52% 0.19 253);     /* #1976d2 */
  --rainbow-purple: oklch(47% 0.21 306);   /* #7b1fa2 */

  /* Action Blue — the single interactive accent */
  --primary-color: #0066cc;
  --primary-dark: #004d99;
  --primary-light: #0071e3;                /* hover / focus */
  --link-on-dark: #2997ff;                 /* links on dark tiles */
  --secondary-color: #f5f5f7;

  /* Light surfaces */
  --bg-color: #ffffff;
  --bg-surface: #f5f5f7;                   /* Parchment */
  --border-color: #e0e0e0;                 /* Hairline */

  /* Dark tiles */
  --tile-dark: #272729;
  --tile-dark-2: #2a2a2c;
  --surface-black: #000000;

  /* Text */
  --text-color: #1d1d1f;                   /* Ink */
  --text-light: #6e6e73;
  --text-on-dark: #f5f5f7;
  --text-muted-on-dark: #a1a1a6;
  --white: #ffffff;

  /* The one shadow in the system — photography resting on a surface.
     Never on cards, buttons, or chrome. */
  --shadow-photo: 3px 5px 30px rgba(0, 0, 0, 0.16);
  /* Floating UI (dropdowns, overlays) — functional separation, not decor */
  --shadow-overlay: 0 10px 40px rgba(0, 0, 0, 0.12);

  /* Corner radii */
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  /* Easing curves */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Transitions */
  --transition-fast: 0.18s var(--ease-out-quart);
  --transition-medium: 0.35s var(--ease-out-quart);
  --transition-slow: 0.75s var(--ease-out-quart);

  /* The pride stripe — static, precise, structural */
  --rainbow-gradient: linear-gradient(
    to right,
    var(--rainbow-red),
    var(--rainbow-orange),
    var(--rainbow-yellow),
    var(--rainbow-green),
    var(--rainbow-blue),
    var(--rainbow-purple)
  );
}

/* ===== Base Styles ===== */
html {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  font-size: 1.0625rem;                    /* 17px — reading, not scanning */
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.47;
  letter-spacing: -0.022em;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

h1, h2, h3 {
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  letter-spacing: -0.022em;
  position: relative;
  display: inline-block;
}

/* Fixed rainbow moment #2: the stripe under page titles */
h1::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 72px;
  height: 3px;
  background: var(--rainbow-gradient);
  border-radius: 1.5px;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-color);
  max-width: 72ch;
  text-wrap: pretty;
}

/* ===== Layout Structure ===== */
.main-content {
  flex: 1 0 auto;
  padding-top: 52px; /* Account for fixed global nav */
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ===== Alert Banner ===== */
.alert-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  border-radius: 0;
  border: none;
  margin-bottom: 0;
  padding: 10px 0;
  font-weight: 500;
}

.alert-banner.alert-warning {
  background: oklch(96% 0.04 86);
  border-bottom: 1px solid var(--rainbow-yellow);
  color: oklch(35% 0.07 86);
}

.alert-banner.alert-danger {
  background: oklch(95% 0.04 28);
  border-bottom: 1px solid var(--rainbow-red);
  color: oklch(35% 0.07 28);
}

.alert-banner.alert-info {
  background: oklch(95% 0.04 253);
  border-bottom: 1px solid var(--rainbow-blue);
  color: oklch(35% 0.07 253);
}

.alert-banner.alert-success {
  background: oklch(95% 0.04 142);
  border-bottom: 1px solid var(--rainbow-green);
  color: oklch(35% 0.07 142);
}

body.has-alert-banner .navbar {
  top: 48px;
}

body.has-alert-banner .main-content {
  padding-top: 100px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Global Navigation (slim black bar) ===== */
.navbar {
  background-color: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: none;
  padding: 6px 0;
  min-height: 50px;
  z-index: 1000;
  transition: background-color var(--transition-fast);
}

/* Fixed rainbow moment #1: the hairline under the global nav */
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--rainbow-gradient);
}

.navbar.scrolled {
  background-color: rgba(0, 0, 0, 0.94) !important;
}

.navbar-logo {
  height: 32px;
  width: auto;
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  padding: 8px 14px !important;
  transition: color var(--transition-fast);
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--white) !important;
}

/* User Menu & Dropdown */
.user-menu {
  display: flex;
  align-items: center;
}

.user-menu::after {
  display: none !important;
}

.dropdown-menu {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
  border: 1px solid var(--border-color);
  padding: 8px 0;
  min-width: 220px;
  margin-top: 10px;
  animation: fadeIn 0.2s ease;
  background-color: var(--white);
}

.dropdown-item {
  padding: 9px 20px;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-color);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--bg-surface);
  color: var(--text-color);
}

.dropdown-item button {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-weight: inherit;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.dropdown-divider {
  margin: 8px 0;
  border-top: 1px solid var(--border-color);
  opacity: 1;
}

.login-link {
  display: flex;
  align-items: center;
}

/* Donate — the persistent primary CTA, Apple "Buy" grammar */
.navbar .donate-btn {
  background: var(--primary-color);
  color: var(--white) !important;
  font-size: 0.875rem;
  padding: 6px 18px !important;
  border-radius: var(--radius-pill);
  margin-left: 10px;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.navbar .donate-btn:hover {
  background: var(--primary-light);
  color: var(--white) !important;
}

.navbar .donate-btn:active {
  transform: scale(0.96);
}

/* ===== Buttons (pill grammar, flat, scale on press) ===== */
.btn {
  border-radius: var(--radius-pill);
  font-weight: 400;
  padding: 10px 22px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
              color var(--transition-fast), transform var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--primary-color);
  border: none;
  color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-light);
  color: var(--white);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-pill);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

/* ===== Bootstrap component alignment =====
   Keeps stock Bootstrap components (profile page cards/pills, list groups)
   on the system tokens instead of Bootstrap's own blue and radii. */
.card {
  border-color: var(--border-color);
  border-radius: var(--radius-lg);
}

.card .card-body {
  padding: 20px 24px;
}

.nav-pills .nav-link {
  color: var(--text-color);
  border-radius: var(--radius-pill);
}

.nav-pills .nav-link:hover {
  color: var(--primary-color);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: var(--primary-color);
  color: var(--white);
}

.list-group-item {
  border-color: var(--border-color);
}

/* ===== Hero Section (white canvas) ===== */
.hero-section {
  position: relative;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 104px 0 80px;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 950px;
  margin: 0 auto;
  text-align: center;
  animation: fadeIn var(--transition-slow);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.3rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.07;
  margin-bottom: 28px;
  display: inline-block;
  text-wrap: balance;
}

.hero-title::after {
  left: 50%;
  transform: translateX(-50%);
  bottom: -16px;
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 auto 44px;
  color: var(--text-light);
  line-height: 1.45;
  max-width: 56ch;
  text-wrap: pretty;
}

.cta-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--white);
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-size: 1.0625rem;
  font-weight: 400;
  text-decoration: none;
  border: none;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.cta-button:hover {
  background-color: var(--primary-light);
  color: var(--white);
}

.cta-button:active {
  transform: scale(0.97);
}

/* ===== Search Widget (flat hairline card) ===== */
.search-widget {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-top: 8px;
  width: 100%;
  position: relative;
  text-align: left;
}

.search-widget h3 {
  color: var(--text-color);
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.search-widget .form-label {
  color: var(--text-color);
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

.search-widget .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  padding: 10px 15px;
  background-color: var(--bg-color);
  color: var(--text-color);
  height: auto;
}

.search-widget .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Custom styles for Select2 inside search widget */
.search-widget .select2-container--default .select2-selection--single {
  background-color: var(--bg-color) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  height: 48px !important;
  display: flex !important;
  align-items: center !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast) !important;
}

.search-widget .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-color) !important;
  padding-left: 15px !important;
  line-height: 48px !important;
}

.search-widget .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18) !important;
}

.search-widget .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 46px !important;
}

.search-widget .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: rgba(29, 29, 31, 0.6) transparent transparent transparent !important;
}

.search-widget .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent rgba(29, 29, 31, 0.6) transparent !important;
}

/* ===== Stats Section (dark tile — the museum wall) ===== */
.stats-section {
  padding: 80px 0 56px;
  background-color: var(--tile-dark);
}

.stats-section .stat-card {
  text-align: center;
  padding: 8px 16px;
  margin-bottom: 24px;
  background: none;
  border: none;
}

.stats-section .col-md-3 + .col-md-3 .stat-card {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.stats-section .stat-number {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  font-size: clamp(2.4rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--text-on-dark);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stats-section .stat-label {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted-on-dark);
  letter-spacing: -0.01em;
}

/* ===== Featured Events Section (parchment tile) ===== */
.featured-section {
  padding: 88px 0;
  background-color: var(--bg-surface);
}

.featured-section > .container > .featured-title {
  display: block;
  text-align: center;
  margin-bottom: 48px;
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* Featured items ARE photography — they carry the system's one shadow */
.featured-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-photo);
}

.featured-item .image-container {
  position: relative;
  width: 100%;
  padding-top: 66.67%; /* 3:2 aspect ratio */
  overflow: hidden;
  background-color: var(--tile-dark-2);
}

.featured-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--transition-medium);
}

.featured-item:hover img {
  transform: scale(1.04);
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
  padding: 24px;
  color: var(--white);
}

.featured-overlay .featured-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--white);
  text-align: left;
}

.featured-date {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 2px;
}

.featured-org {
  font-size: 0.85rem;
  opacity: 0.75;
  font-weight: 500;
}

/* ===== Events Section (white tile, hairline cards) ===== */
.events-section {
  padding: 56px 0;
}

.events-section h2 {
  font-weight: 600;
  font-size: 1.6rem;
  margin-bottom: 28px;
}

.event-card {
  background: var(--bg-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast);
}

.event-card:hover {
  border-color: #c7c7cc;
}

.event-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background-color: var(--bg-surface);
  transition: transform var(--transition-medium);
}

.event-card:hover .event-image {
  transform: scale(1.03);
}

.event-content {
  padding: 24px;
}

.event-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.35;
}

.event-meta {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 18px;
  line-height: 1.5;
}

.event-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Top Organizations Link Lists */
.org-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
}

.org-link:hover {
  text-decoration: none;
}

.org-stats {
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast);
}

.org-stats:hover {
  border-color: #c7c7cc;
}

.org-name {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 3px;
  color: var(--text-color);
  transition: color var(--transition-fast);
}

.org-count {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 400;
}

.org-stats:hover .org-name {
  color: var(--primary-color);
}

/* Browse All Events button */
.btn-outline-primary.browse-events {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  font-weight: 400;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-outline-primary.browse-events:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-outline-primary.browse-events i {
  margin-right: 8px;
}

/* ===== Photo Grid / Masonry ===== */
.grid-sizer,
.photo {
  width: 33.333%;
}

.photo {
  float: left;
  padding: 10px;
}

.photo img {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-medium), opacity var(--transition-fast);
  box-shadow: var(--shadow-photo);
}

.photo img:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

/* ===== Like Button Animation ===== */
.like-button-image {
  transition: all 0.3s var(--ease-out-quart);
}

.like-button-image:hover {
  animation: pulse 1s infinite;
}

.like-button-image.down {
  animation: rotate 0.5s ease;
}

/* ===== Scroll Animations (progressive enhancement) =====
   Hidden states only apply once JS stamps .js-reveal on <html>
   (animations.js) — no-JS users and crawlers see everything. */
.js-reveal .scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-medium), transform var(--transition-medium);
}

.js-reveal .scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Lazy Loading Transition */
.js-reveal .lazy-load {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out-quart), transform 0.5s var(--ease-out-quart);
}

.js-reveal .lazy-load.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Sibling stagger delays for home page cards and organizations list */
.featured-grid .featured-item:nth-child(1) { transition-delay: 0.05s; }
.featured-grid .featured-item:nth-child(2) { transition-delay: 0.1s; }
.featured-grid .featured-item:nth-child(3) { transition-delay: 0.15s; }
.featured-grid .featured-item:nth-child(4) { transition-delay: 0.2s; }

.events-section .col-md-6:nth-child(1) .event-card { transition-delay: 0.05s; }
.events-section .col-md-6:nth-child(2) .event-card { transition-delay: 0.1s; }
.events-section .col-md-6:nth-child(3) .event-card { transition-delay: 0.15s; }
.events-section .col-md-6:nth-child(4) .event-card { transition-delay: 0.2s; }

.org-link:nth-child(1) .org-stats { transition-delay: 0.05s; }
.org-link:nth-child(2) .org-stats { transition-delay: 0.1s; }
.org-link:nth-child(3) .org-stats { transition-delay: 0.15s; }
.org-link:nth-child(4) .org-stats { transition-delay: 0.2s; }

/* ===== Loading State Placeholders ===== */
.loading-placeholder {
  background: linear-gradient(90deg, oklch(94% 0 0) 25%, oklch(90% 0 0) 50%, oklch(94% 0 0) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-md);
  height: 100px;
  margin-bottom: 30px;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 102, 204, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

.loading-text {
  text-align: center;
  color: var(--text-light);
  font-size: 1.05rem;
  margin-top: 10px;
}

.featured-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.featured-loading-item {
  background: linear-gradient(90deg, oklch(94% 0 0) 25%, oklch(90% 0 0) 50%, oklch(94% 0 0) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-md);
  height: 250px;
}

/* ===== Footer (parchment, dense-link columns) ===== */
.footer {
  flex-shrink: 0;
  background-color: var(--bg-surface);
  width: 100%;
  padding: 3.5rem 0 2.5rem;
  position: relative;
  z-index: 10;
  margin-top: auto;
}

/* Fixed rainbow moment #3: the top edge of the footer */
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--rainbow-gradient);
}

.footer h5 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.footer p {
  font-size: 0.875rem;
  color: #515154;
  line-height: 1.6;
}

.footer ul li a,
.footer .social-links a {
  font-size: 0.875rem;
  color: #515154;
  line-height: 2.2;
  transition: color var(--transition-fast);
}

.footer ul li a:hover {
  color: var(--text-color);
  text-decoration: underline;
}

.footer .social-links a {
  font-size: 1.25rem;
  color: #515154;
}

.footer .social-links a:hover {
  color: var(--text-color);
}

.footer hr {
  border-top: 1px solid var(--border-color);
  opacity: 1;
  margin: 28px 0 20px;
}

.footer .text-center p {
  font-size: 0.75rem;
  color: var(--text-light);
  max-width: none;
}

.footer .donate-link {
  color: var(--primary-color);
  font-weight: 600;
}

.footer .donate-link:hover {
  color: var(--primary-light);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .scroll-reveal,
  .lazy-load {
    opacity: 1;
    transform: none;
  }
}

/* ===== Responsive adjustments ===== */
@media (max-width: 992px) {
  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  /* In the collapsed mobile menu the Donate pill should hug its label,
     not stretch into a full-width bar */
  .navbar .donate-btn {
    display: inline-block;
    width: fit-content;
    margin: 8px 0;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 72px 0 56px;
  }

  .search-widget {
    padding: 22px;
  }

  .stats-section {
    padding: 56px 0 40px;
  }

  .stats-section .col-md-3 + .col-md-3 .stat-card {
    border-left: none;
  }

  .featured-section {
    padding: 64px 0;
  }

  .photo {
    width: 50%;
  }
}

@media (max-width: 480px) {
  .photo {
    width: 100%;
  }
}
