@import "tailwindcss";

:root {
  --primary: #0d5c63;
  --primary-dark: #084347;
  --accent: #f9a826;
  --accent-hover: #d4860a;
  --cream: #fbf8f3;
  --beige: #f5f1e8;
  --dark: #0f1419;
  --text: #1a1a1a;
  --text-muted: #5f6368;
  --white: #ffffff;
  --heading: "Playfair Display", Georgia, serif;
  --body: "Rubik", system-ui, sans-serif;
  --numbers: "Outfit", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--heading);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Layout */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .wrap {
    padding: 0 2.5rem;
  }
}

@media (min-width: 1024px) {
  .wrap {
    padding: 0 2rem;
  }
}

@media (min-width: 1280px) {
  .wrap {
    padding: 0 3rem;
  }
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 92, 99, 0.95);
  /* Semi-transparent Primary */
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.nav-logo {
  font-family: var(--heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .nav-logo {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .nav-logo {
    font-size: 1.25rem;
  }
}


.nav-links {
  display: none;
  align-items: center;
  gap: 1.25rem;
  font-weight: 500;
}

@media (min-width: 1200px) {
  .nav-links {
    gap: 2rem;
  }
}

.nav-links a {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  position: relative;
  padding: 0.5rem 0;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .nav-links a {
    font-size: 0.875rem;
  }
}

.nav-links a:not([href="donate.html"])::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:not([href="donate.html"]):hover::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

/* Donate Button Style in Nav */
.nav-links a[href="donate.html"] {
  background: var(--accent);
  color: var(--white);
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  box-shadow: 0 4px 15px rgba(249, 168, 38, 0.3);
  transition:
    transform 0.2s,
    background 0.2s;
}

@media (min-width: 1200px) {
  .nav-links a[href="donate.html"] {
    font-size: 0.8rem;
    padding: 0.6rem 1.5rem;
  }
}

.nav-links a[href="donate.html"]:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
    margin-left: auto;
    margin-right: 1.25rem;
  }
}

@media (min-width: 1200px) {
  .nav-links {
    margin-right: 2rem;
  }
}


.nav-toggle {
  display: flex;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .nav-actions {
    gap: 1.25rem;
  }
}

@media (min-width: 1200px) {
  .nav-actions {
    gap: 1.75rem;
  }
}



/* --- Mobile Menu Reimagined --- */
.mob-menu {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 2100;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.mob-menu.open {
  display: flex;
}

.mob-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: var(--white);
}

.mob-logo-box {
  font-family: var(--heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.mob-close {
  background: none;
  border: none;
  color: var(--text);
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mob-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mob-link {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  transition: all 0.2s;
}

.mob-link svg {
  width: 20px;
  height: 20px;
  opacity: 0.5;
  stroke-width: 2;
}

.mob-link.active {
  background: rgba(13, 92, 99, 0.05);
  color: var(--primary);
  font-weight: 600;
}

.mob-link.active svg {
  opacity: 1;
  color: var(--primary);
}

.mob-footer {
  padding: 1.5rem;
  background: var(--white);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mob-action-btn {
  width: 100%;
  padding: 1.125rem;
  border-radius: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1rem;
  border: none;
  transition: all 0.2s;
}

.mob-action-btn:active {
  transform: scale(0.98);
}

.mob-action-btn.primary {
  background: var(--primary);
  color: var(--white);
}

.mob-action-btn.secondary {
  background: transparent;
  border: 1.5px solid rgba(13, 92, 99, 0.1);
  color: var(--primary);
}

.mob-action-btn.danger {
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
}

/* Profile Dropdown */
.profile-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}



.profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #f59e0b 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
  font-family: var(--body);
}

.profile-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(249, 168, 38, 0.35);
}

@media (max-width: 480px) {
  .profile-btn {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
    border-width: 1.5px;
  }
}


.profile-btn svg {
  width: 20px;
  height: 20px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 200px;
  background: var(--white);
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.25s ease 0.15s,
    visibility 0.25s ease 0.15s,
    transform 0.25s ease 0.15s;
  z-index: 300;
  overflow: hidden;
  pointer-events: none;
}

/* Hover bridge - invisible area to maintain hover state */
.profile-dropdown::after {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 15px;
  background: transparent;
}

/* Show dropdown on hover over parent wrapper */
.profile-wrapper:hover .profile-dropdown,
.profile-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
  pointer-events: auto;
}

.dropdown-header {
  padding: 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
}

.dropdown-user-details h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0;
}

.dropdown-user-details p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-menu {
  padding: 0.375rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  color: #111827 !important;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: background 0.15s;
  text-decoration: none !important;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--body);
  opacity: 1 !important;
}

.dropdown-item:hover {
  background: #f3f4f6;
  color: #111827 !important;
}

.dropdown-item svg {
  width: 18px;
  height: 18px;
  color: #111827 !important;
  opacity: 1 !important;
}

.dropdown-item.danger {
  color: #dc2626;
}

.dropdown-item.danger svg {
  color: #dc2626;
}

.dropdown-item.danger:hover {
  background: #fef2f2;
}

.dropdown-divider {
  height: 1px;
  background: #eee;
  margin: 0.375rem 0;
}

/* Guest menu styles */
.guest-menu .dropdown-menu {
  padding: 0.5rem;
}

.guest-menu .dropdown-item {
  justify-content: center;
  font-weight: 500;
  padding: 0.625rem 1rem;
}

.guest-menu .dropdown-item.primary {
  background: var(--primary);
  color: var(--white);
  margin-top: 0.25rem;
}

.guest-menu .dropdown-item.primary:hover {
  background: var(--primary-dark);
  color: var(--white) !important;
}

.guest-menu .dropdown-item.primary svg {
  color: var(--white);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 0.75rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(13, 92, 99, 0.2);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(13, 92, 99, 0.3);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(249, 168, 38, 0.2);
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(249, 168, 38, 0.3);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-3px);
}

.btn-white {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.btn-white:hover {
  background: var(--beige);
  transform: translateY(-3px);
}

.btn-sm {
  padding: 0.6rem 1.75rem;
  font-size: 0.875rem;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(13, 92, 99, 0.1);
  color: var(--primary);
  border-radius: 100px;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.card-img {
  width: 100%;
  height: 240px;
  /* Slight increase for better ratio */
  object-fit: cover;
}

.card-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: flex-start;
  /* Align textual content to the left */
}

/* Push the last element (usually the button) to the bottom */
.card-body>*:last-child {
  margin-top: auto;
  width: 100%;
  /* Full width buttons look better in cards */
}

/* Progress */
.progress {
  height: 6px;
  background: rgba(13, 92, 99, 0.12);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #1a8a94);
  border-radius: 100px;
}

/* Stat */
.stat-num {
  font-family: var(--numbers);
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--white);
}

.stat-label {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.5rem;
}

/* Portrait */
.portrait {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 3/4;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portrait:hover img {
  transform: scale(1.04);
}

.portrait-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  color: var(--white);
}

/* Section - base padding now set in refactored section below */
/* .sec and .sec-sm padding defined in MASTER LAYOUT REFACTOR block */

.sec-white {
  background: var(--white);
}

.sec-cream {
  background: var(--cream);
}

.sec-dark {
  background: var(--dark);
  color: var(--white);
}

.sec-dark h2,
.sec-dark h3,
.sec-dark p {
  color: var(--white);
}

.sec-primary {
  background: var(--primary);
  color: var(--white);
}

.sec-accent {
  background: var(--accent);
}

.sec-beige {
  background: var(--beige);
}

/* Grid - now defined in MASTER LAYOUT REFACTOR block */
.g4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (min-width: 1024px) {
  .g4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Footer Grid - 5 equal columns */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 2.5rem;
  }
}

/* Utilities */
.aic {
  align-items: center;
}

.jcc {
  justify-content: center;
}

.tac {
  text-align: center;
}

.tal {
  text-align: left;
}

.mxa {
  margin-left: auto;
  margin-right: auto;
}

.mw-prose {
  max-width: 65ch;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.25rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mb-5 {
  margin-bottom: 2rem;
}

.mb-6 {
  margin-bottom: 2.25rem;
}

.mb-8 {
  margin-bottom: 3rem;
}

.mb-10 {
  margin-bottom: 3.75rem;
}

.mb-12 {
  margin-bottom: 4.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.mt-6 {
  margin-top: 2rem;
}

.mt-8 {
  margin-top: 3rem;
}

.mt-10 {
  margin-top: 3.75rem;
}

.mt-12 {
  margin-top: 4.5rem;
}

.py-16 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.py-20 {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.py-24 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-4 {
  gap: 1.5rem;
}

.gap-6 {
  gap: 2rem;
}

.gap-8 {
  gap: 3rem;
}

.w-full {
  width: 100%;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.shrink-0 {
  flex-shrink: 0;
}

/* Hero, Overlap Frame, Overlap Image - now defined in MASTER LAYOUT REFACTOR block */

.hero-blob {
  position: absolute;
  width: 600px;
  height: 600px;
  background: var(--primary);
  opacity: 0.04;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-blob-1 {
  top: -200px;
  right: -100px;
}

.hero-blob-2 {
  bottom: -300px;
  left: -200px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Stagger delays */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-150 {
  animation-delay: 0.15s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

/* Horizontal Card Variant */
.card-side {
  flex-direction: row;
}

.card-side .card-img {
  width: 45%;
  height: 100%;
  min-height: 280px;
}

.card-side .card-body {
  width: 55%;
  padding: 2.5rem;
  justify-content: center;
  align-items: flex-start;
}

@media (max-width: 768px) {
  .card-side {
    flex-direction: column;
  }

  .card-side .card-img {
    width: 100%;
    height: 250px;
  }

  .card-side .card-body {
    width: 100%;
    padding: 2rem;
  }
}

/* Footer Styles - .footer-sec and .footer-top grid now defined in MASTER LAYOUT REFACTOR block */
.footer-sec {
  background-color: var(--dark);
  color: #e2e8f0;
  font-family: var(--body);
  border-top: 5px solid var(--accent);
  margin-top: 0;
  position: relative;
  z-index: 10;
}

/* Reduced size for footer brand/logo */
.footer-logo {
  font-family: var(--heading);
  font-size: 1.5rem;
  /* Reduced by ~10% */
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
}

.footer-desc {
  color: #94a3b8;
  line-height: 1.8;
  /* Increased line-height */
  margin-bottom: 1.5rem;
  max-width: 35ch;
  font-size: 0.95rem;
  /* Slightly muted body text */
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  /* Tighter gap */
  margin-bottom: 2rem;
  margin-top: 1.5rem;
}

.footer-social a {
  width: 36px;
  /* Smaller icons */
  height: 36px;
  background: transparent;
  /* Subtle */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #cbd5e1;
  /* Muted icon color */
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-social a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.footer-contact-info p {
  color: #cbd5e1;
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-links-col h4,
.footer-newsletter h4 {
  color: var(--white);
  font-size: 1rem;
  /* Smaller heading size */
  font-weight: 700;
  margin-bottom: 1.75rem;
  /* Increased spacing */
  text-transform: uppercase;
  /* Institutional feel */
  letter-spacing: 0.5px;
}

.footer-links-col ul {
  list-style: none;
  padding: 0;
}

.footer-links-col li {
  margin-bottom: 0.5rem;
  /* Reduced internal spacing */
}

.footer-links-col a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links-col a:hover {
  color: var(--accent);
  /* Hover color only */
}

.footer-newsletter p {
  color: #94a3b8;
  margin-bottom: 1.5rem;
  /* Increased spacing */
  font-size: 0.9375rem;
  line-height: 1.6;
}

.footer-form {
  display: flex;
  gap: 0.75rem;
  /* Increased gap */
  margin-bottom: 0.75rem;
}

.footer-form input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  /* More standard */
  padding: 0.75rem 1rem;
  color: white;
  font-family: inherit;
  flex: 1;
  /* Allow input to fill available space */
  min-width: 0;
  /* Prevent overflow */
  outline: none;
  transition: border-color 0.2s;
  font-size: 0.9rem;
}

.footer-form input:focus {
  border-color: var(--primary);
}

.btn-footer {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1.25rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9rem;
  white-space: nowrap;
  /* Prevent button text wrapping */
}

.btn-footer:hover {
  background: var(--primary-dark);
}

.footer-micro {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.75rem;
  /* Increased margin */
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: #64748b;
  font-size: 0.875rem;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  color: #64748b;
  transition: color 0.2s;
  text-decoration: none;
}

.footer-bottom-links a:hover {
  color: var(--white);
}

/* ==========================================================================
   MASTER LAYOUT REFACTOR & ALIGNMENT FIXES
   ========================================================================== */

/* 1. Global Reset & Container */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
html {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* 2. Standardized Section Spacing */
.sec {
  padding-block: clamp(4rem, 8vw, 6rem);
}

.sec-sm {
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}

/* 3. Responsive Grid System (The Senior Engineer Way) */
.g1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.g2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
}

.g3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}


@media (min-width: 1024px) {
  .g2 {
    grid-template-columns: 1fr 1fr;
  }

  .g3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 4. Hero Section Alignment (No Overlap) */
.hero {
  position: relative;
  padding-top: calc(var(--nav-height, 80px) + 3rem);
  padding-bottom: 4rem;
  background: var(--cream);
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 70vh;
}

.hero-content {
  position: relative;
  z-index: 10;
}

.hero-image-modern {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
}

.hero-image-modern img {
  width: 100%;
  max-width: 550px;
  border-radius: 2rem;
  transform: rotate(-2deg);
  box-shadow: 20px 40px 80px rgba(0, 0, 0, 0.1);
  transition: transform 0.5s ease;
}

.hero-image-modern::after {
  content: "";
  position: absolute;
  inset: -15px;
  border: 2px solid var(--primary);
  border-radius: 2.5rem;
  z-index: -1;
  transform: rotate(4deg);
  opacity: 0.15;
  pointer-events: none;
}

/* 5. Floating Elements & Overlap Fixes */
.overlap-frame {
  position: relative;
  z-index: 5;
}

.overlap-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1.5rem;
}

.floating-stat-card {
  position: absolute;
  bottom: -20px;
  right: -20px;
  z-index: 20;
  transition: transform 0.3s ease;
}

/* Prevent Collisions - Mobile Responsive Behavior */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    text-align: center;
  }

  .hero .g2 {
    gap: 4rem;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-image-modern img {
    transform: rotate(0);
  }

  .hero-image-modern::after {
    transform: rotate(0);
  }

  .floating-stat-card {
    position: relative;
    bottom: 0;
    right: 0;
    margin: -30px auto 0;
    transform: none !important;
    width: fit-content;
  }
}

/* 6. Card Consistency (Equal Height) */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-body>*:last-child {
  margin-top: auto;
}

/* 7. Footer Alignment */
.footer-sec {
  padding-block: 5rem 3rem;
  background: var(--dark);
  color: white;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
}

@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .footer-social,
  .footer-form,
  .footer-bottom {
    justify-content: center;
  }

  .footer-brand-col {
    align-items: center;
  }

  .footer-contact-info p {
    justify-content: center;
  }
}

/* 8. Utility Overrides */
.aic {
  align-items: center;
}

.jcc {
  justify-content: center;
}

.tac {
  text-align: center;
}

.mxa {
  margin-left: auto;
  margin-right: auto;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mb-6 {
  margin-bottom: 2.25rem;
}

.mb-8 {
  margin-bottom: 3rem;
}

.mb-12 {
  margin-bottom: 4.5rem;
}

/* 9. Stories Page Specifics */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-block: 1px solid var(--beige);
  gap: 1.5rem;
}

.filter-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .filter-bar {
    justify-content: center;
    text-align: center;
  }

  .filter-links {
    justify-content: center;
    gap: 1rem;
  }
}

/* 10. Missing Utility Classes */
.jcsb {
  justify-content: space-between;
}

.justify-between {
  justify-content: space-between;
}

.gap-12 {
  gap: 4rem;
}

.tal {
  text-align: left;
}

.mw-prose {
  max-width: 65ch;
}

.w-full {
  width: 100%;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.shrink-0 {
  flex-shrink: 0;
}

.dn-mobile {
  display: block;
}

/* 11. Responsive Media Queries */

/* -- Global media baseline -- */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* -- Large Tablets (1200px) -- */
@media (max-width: 1199px) {
  .wrap {
    max-width: 960px;
  }
}

/* -- Tablets (991px) -- */
@media (max-width: 991px) {
  .wrap {
    max-width: 720px;
  }

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.75rem;
  }

  .g2,
  .g3,
  .g4 {
    gap: 2.5rem;
  }
}

/* -- Small Tablets & Mobile (767px) -- */
@media (max-width: 767px) {
  .wrap {
    max-width: 100%;
    padding: 0 1.25rem;
    /* Slightly tighter for mobile */
  }

  /* All grids stack to single column - robust override */
  .g2,
  .g3,
  .g4,
  .mission-grid,
  .footer-top,
  .footer-grid,
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Navigation */
  .nav-links {
    display: none !important;
  }

  .nav-toggle {
    display: flex !important;
    color: white !important;
  }

  /* Section Padding */
  .sec,
  [style*="padding: 120px 0"] {
    padding: 2.5rem 0 !important;
  }

  .sec-sm {
    padding: 1.75rem 0 !important;
  }

  /* Typography Scale */
  h1,
  [style*="font-size: 3.5rem"],
  [style*="font-size: 3rem"] {
    font-size: 1.85rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 1.25rem !important;
  }

  p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  /* Hero Fixes */
  .hero {
    padding-top: 100px;
    text-align: center;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-image-modern {
    margin-top: 2.5rem;
    max-width: 100%;
  }

  /* Buttons full width on mobile */
  .btn {
    width: 100%;
    min-height: 52px;
    padding: 0.875rem 1.5rem;
  }

  /* Flex stacks on mobile - targeted to avoid breaking small elements */
  .flex:not(.nav-actions):not(.profile-wrapper):not(.dropdown-user-info) {
    flex-direction: column;
  }

  .flex.gap-4 {
    gap: 1rem;
  }

  /* Global Gap Fixes for large inline styles */
  [style*="gap: 4rem"],
  [style*="gap: 5rem"],
  [style*="gap: 6rem"] {
    gap: 1.5rem !important;
  }

  /* Hide desktop-only elements */
  .dn-mobile {
    display: none !important;
  }

  /* Form inputs full width */
  input,
  select,
  textarea {
    width: 100% !important;
    min-height: 48px;
  }

  /* Card adjustments */
  .card {
    max-width: 100%;
  }

  /* Footer mobile center alignment */
  .footer-top {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-contact-info p {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
  }

  .footer-form {
    flex-direction: column;
  }
}

/* -- Extra Small Mobile (Ultra-Mobile 360px - 400px) -- */
@media (max-width: 400px) {
  .wrap {
    padding: 0 1rem !important;
  }

  .nav-logo {
    font-size: 1.15rem !important;
    letter-spacing: -0.5px;
  }

  .nav-inner {
    height: 70px;
  }

  .nav-actions {
    gap: 0.75rem;
  }

  .sec {
    padding: 2rem 0 !important;
  }

  h1 {
    font-size: 1.65rem !important;
  }

  h2 {
    font-size: 1.35rem !important;
  }
}


/* -- Mobile (575px) -- */
@media (max-width: 575px) {
  h1 {
    font-size: 2.25rem !important;
  }

  h2 {
    font-size: 1.75rem !important;
  }

  .sec {
    padding: 3.5rem 0 !important;
  }

  .badge {
    font-size: 0.65rem;
    padding: 0.4rem 0.8rem;
  }

  /* Stats Grid stays 2 columns */
  .md\:grid-cols-3,
  .lg\:grid-cols-6 {
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
  }

  .stat-num {
    font-size: 2.8rem !important;
  }
}

/* -- Tiny Mobile (419px) -- */
@media (max-width: 419px) {
  h1 {
    font-size: 2rem !important;
  }

  .wrap {
    padding: 0 1rem;
  }

  .stat-num {
    font-size: 2.1rem !important;
  }

  /* Stats Grid 1 column on tiny screens */
  .md\:grid-cols-3,
  .lg\:grid-cols-6 {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* 12. Horizontal Scroll Prevention */
[class*="transform"] {
  will-change: transform;
}

/* 13. Improved Tap Targets */
a,
button,
input[type="submit"],
input[type="button"] {
  min-height: 44px;
  touch-action: manipulation;
}



/* ========================================================================== 
   14. STORIES PAGE (BLOG) SPECIFIC STYLES 
   ========================================================================== */
.stories-page {
  overflow-x: hidden;
  width: 100%;
}

.stories-page .g3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.5rem;
  align-items: stretch;
}

@media (max-width: 640px) {
  .stories-page .g3 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .stories-page .g3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stories-page .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border-radius: 1.5rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.stories-page .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.stories-page .card-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.stories-page .card:hover .card-img {
  transform: scale(1.05);
}

.stories-page .card-body {
  padding: 2.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stories-page .card-body .badge {
  align-self: flex-start;
  margin-bottom: 1.25rem;
}

.stories-page .card-body h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.stories-page .card-body p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  flex-grow: 1;
}

.stories-page .card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--beige);
}

.stories-page .card-author {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stories-page .card-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stories-page .card-link:hover {
  color: var(--accent-hover);
}

.stories-page section {
  width: 100%;
  box-sizing: border-box;
}


/* Further refinements for Stories Page responsiveness */
@media (max-width: 768px) {
  .stories-page .sec-dark {
    padding: 3rem 1.5rem !important;
    margin: 4rem 0 !important;
    border-radius: 1.5rem !important;
  }

  .stories-page .sec-dark h2 {
    font-size: 2rem !important;
  }

  .stories-page .overlap-frame {
    margin-bottom: 2rem;
  }

  .stories-page .hero {
    padding-top: 100px;
    min-height: auto;
  }

  .stories-page .hero h1 {
    font-size: 2.5rem !important;
  }
}



/* ========================================================================== 
   15. NAVIGATION ACTIVE STATE STYLES 
   ========================================================================== */

/* Desktop Active State */
.nav-links a.active {
  color: var(--white) !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

.nav-links a.active::after {
  width: 100% !important;
  height: 3px !important;
  background: var(--accent) !important;
  box-shadow: 0 2px 10px rgba(249, 168, 38, 0.4);
}

/* Mobile Active State */
.mob-link.active {
  background: rgba(13, 92, 99, 0.08) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
  border-left: 4px solid var(--primary) !important;
  border-radius: 0 12px 12px 0 !important;
  padding-left: calc(1.25rem - 4px) !important;
}

.mob-link.active svg {
  opacity: 1 !important;
  color: var(--primary) !important;
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* Accessibility Support */
[aria-current="page"] {
  pointer-events: none;
}