@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette - Inspired by Malala.org with Himalayan touches */
  --bg-color: #ffffff;
  --bg-secondary: #f8f6f4;
  --text-main: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #666666;

  /* Primary Brand Colors */
  --primary-navy: #111E47;
  --primary-blue: #2d3e76;
  --accent-warm: #d4a574;
  --accent-earth: #8c7e74;

  /* Borders & Dividers */
  --border-light: #e8e8e8;
  --border-medium: #d0d0d0;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);

  /* Typography */
  --font-heading: 'Lora', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Utility Classes */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

.section {
  padding: clamp(60px, 10vw, 100px) 0;
}

.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

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

.items-center {
  align-items: center;
}

.gap-4 {
  gap: 1.5rem;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid transparent;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

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

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-outline:hover {
  background-color: var(--text-main);
  color: white;
}

/* Header */
header {
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  background-color: rgba(42, 42, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.home-page header {
  background-color: transparent;
  border-bottom: none;
}

body.home-page header.scrolled {
  background-color: rgba(42, 42, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .container {
  width: 100%;
}

header .logo img {
  height: 50px;
  width: auto;
}

header nav ul {
  display: flex;
  list-style: none;
  gap: 36px;
  align-items: center;
}

header nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: white;
  position: relative;
  letter-spacing: -0.01em;
}

body.home-page header nav a {
  color: white;
}

header.scrolled {
  background-color: rgba(42, 42, 42, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-sm);
}

header.scrolled nav a {
  color: white !important;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-warm);
  transition: width 0.3s ease;
}

header nav a:hover::after,
header nav a.active::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 26px;
  height: 2px;
  background-color: white;
  transition: 0.3s;
}

body.home-page .mobile-menu-toggle span {
  background-color: white;
}

header.scrolled .mobile-menu-toggle span {
  background-color: white !important;
}

/* Main Content Spacing */
main {
  margin-top: 0;
}

body:not(.home-page) main {
  margin-top: var(--header-height);
}

/* Hero Section Improved */
.hero-section {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: clamp(80px, 15vh, 120px) 0 clamp(60px, 10vh, 100px);
}

.hero-section h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.2;
  margin-bottom: 24px;
  font-weight: 700;
}

.hero-section p {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.6;
  opacity: 0.95;
}

/* Card Styles */
.card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  width: 100%;
  height: 280px;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-content {
  padding: 32px;
}

.card-content h3 {
  margin-bottom: 12px;
  color: var(--text-main);
}

.card-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

/* Journey Cards */
.journey-timeline {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 40px 0;
}

.journey-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.4s ease;
  border: 1px solid var(--border-light);
}

.journey-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.journey-card-image {
  width: 100%;
  height: 320px;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.journey-card-image img,
.journey-card-image iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journey-card-info {
  padding: 36px;
}

.journey-card-info .label {
  color: var(--accent-warm);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  display: block;
}

.journey-card-info h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

.journey-card-info .content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Footer */
footer {
  background-color: #1a1612;
  color: white;
  padding: 60px 0 30px;
}

footer h4 {
  color: white;
  font-size: 1.0625rem;
  margin-bottom: 20px;
  font-weight: 600;
}

footer a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9375rem;
  transition: color 0.3s ease;
}

footer a:hover {
  color: white;
}

footer .footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 50px;
}

footer .copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 1024px) {
  footer .footer-content {
    grid-template-columns: 1fr 1fr;
  }

  /* Adjust grid gaps for tablets */
  div[style*="gap: 50px"],
  div[style*="gap: 60px"],
  div[style*="gap: 70px"] {
    gap: 40px !important;
  }

  /* Episode/video sections */
  section div[style*="grid-template-columns: 1fr 1fr"] {
    gap: 40px !important;
  }

  /* Gallery grid - 3 columns on tablets */
  div[id$="-gallery"][style*="grid-template-columns"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
  }

  /* Journey card */
  .journey-card-info {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  /* Mobile header - same behavior as desktop */
  body.home-page header {
    background-color: transparent;
    border-bottom: none;
  }

  body.home-page header.scrolled {
    background-color: rgba(42, 42, 42, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Non-homepage headers stay dark on mobile */
  body:not(.home-page) header {
    background-color: rgba(42, 42, 42, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  header .logo img {
    height: 42px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  header nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: rgba(42, 42, 42, 0.98);
    backdrop-filter: blur(10px);
    padding: 40px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  header nav.active {
    transform: translateX(0);
  }

  header nav ul {
    flex-direction: column;
    gap: 32px;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
  }

  header nav a {
    font-size: 1.25rem;
    color: white !important;
    text-align: center;
  }

  header nav a::after {
    left: 50%;
    transform: translateX(-50%);
  }

  header nav a:hover::after,
  header nav a.active::after {
    width: 80%;
  }

  .hero-section {
    min-height: 70vh;
  }

  .card-img {
    height: 220px;
  }

  footer .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .journey-card-image {
    height: 240px;
  }

  /* Stack two-column sections on mobile */
  .container > div[style*="grid-template-columns: 1fr 1fr"],
  .section > div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="display: grid"][style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 30px !important;
  }

  /* Ensure video embeds are visible and responsive on mobile */
  div[style*="padding-bottom: 56.25%"] {
    width: 100% !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    position: relative !important;
    display: block !important;
  }

  div[style*="padding-bottom: 56.25%"] iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Contact form - stack name/email fields */
  form div[style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }

  /* Blog grid - single column on mobile */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(320px, 1fr))"],
  div[style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Gallery grid - 2 columns on mobile */
  div[id$="-gallery"][style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }

  /* Journey/About section image-text layout */
  .container > div[style*="display: grid"] {
    gap: 30px !important;
  }

  /* Episodes section - video first, then text */
  section[style*="padding: 100px 0"][style*="background-color: white"] > .container > div {
    flex-direction: column !important;
  }

  /* Adjust padding for mobile */
  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  section[style*="padding"] {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }

  /* Video container border radius */
  div[style*="border-radius: 12px"][style*="box-shadow"][style*="padding-bottom: 56.25%"] {
    border-radius: 8px !important;
    margin-bottom: 20px;
  }

  /* Footer grid fix */
  footer .footer-content {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 2rem;
  }

  .btn {
    width: 100%;
    padding: 16px 24px;
  }

  .card-content {
    padding: 24px;
  }

  /* Gallery - single column on very small screens */
  div[id$="-gallery"][style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Journey card padding */
  .journey-card-info {
    padding: 24px !important;
  }

  /* Hero section padding */
  .hero-section {
    padding-top: 60px !important;
    padding-bottom: 40px !important;
  }

  /* Contact form elements */
  form input,
  form textarea,
  form button {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }

  /* Support/Donate section */
  div[style*="background: linear-gradient(135deg, #111E47"] {
    padding: 40px 24px !important;
  }

  /* Blog post cards */
  div[style*="background: white; border-radius: 12px"] > div {
    padding: 28px !important;
  }

  /* Social media circles */
  a[style*="width: 80px; height: 80px"] {
    width: 70px !important;
    height: 70px !important;
    font-size: 0.75rem !important;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background-color: var(--accent-warm);
  color: white;
}

/* Focus States */
a:focus,
button:focus,
.btn:focus {
  outline: 2px solid var(--accent-warm);
  outline-offset: 2px;
}

/* Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets on mobile */
  a, button, .btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  /* Improve tap highlight */
  a, button, input, textarea {
    -webkit-tap-highlight-color: rgba(212, 165, 116, 0.2);
  }
}

/* Prevent text size adjustment on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Improve video/iframe responsiveness */
iframe {
  max-width: 100%;
  border: none;
}
