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

/* Make all blog article text larger */
.content-wrapper,
.content-wrapper p,
.content-wrapper li,
.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4 {
  font-size: 1.18em;
}

/* Make the 'Submit My Story' button on the story submission page 2.5x bigger */
.story-submission-form-btn {
  padding: 31.5px 63px !important;
  /* 10% smaller than before */
  font-size: 2.25rem !important;
  /* 10% smaller than before */
  border-radius: 32px !important;
  /* More rounded corners */
}

:root {
  /* Color Palette */
  --color-bg: #F3E9DC;
  /* Warm Sand */
  --color-text: #2B2B2B;
  /* Dark Charcoal */
  --color-heading: #1E2D3A;
  /* Darker Blue/Charcoal */
  --color-primary: #426992;
  /* Further deepened for definitive 5:1+ contrast */
  --color-primary-dark: #355475;
  --color-accent: #4A6D51;
  /* Further deepened for definitive 5:1+ contrast */
  --color-accent-dark: #3C5841;
  --color-muted: #6B6B6B;
  --color-border: #E2D5C3;
  /* Soft border */
  --color-white: #FFFFFF;

  /* Typography */
  --font-heading: 'Inter', sans-serif;
  --font-body: 'Merriweather', serif;

  /* Layout & Sizing */
  --max-width: 900px;
  --radius-lg: 16px;
  --radius-md: 8px;
}

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

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  overflow-x: hidden;
  /* Critical Fix: Prevent horizontal scroll from mobile menu */
  width: 100%;
}

body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 20% 50%, rgba(126, 167, 216, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(156, 199, 166, 0.03) 0%, transparent 50%);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.8;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.25rem;
}

h3 {
  font-size: 1.75rem;
}

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover,
a:focus {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

ul,
ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-header {
  padding: 1.25rem 0;
}

.main-footer {
  padding: 1.2rem 0;
}

main {
  padding-top: 4rem;
  padding-bottom: 4rem;
  position: relative;
}

/* Color accent bar at top of all pages */
main::before {
  content: '';
  display: block;
  height: 6px;
  background: linear-gradient(to right, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: 0;
  /* Removed border-radius so it goes edge-to-edge */
  margin-bottom: 3rem;
  box-shadow: 0 2px 8px rgba(126, 167, 216, 0.3);
  position: absolute;
  top: 0;
  left: 0;
  /* Changed from 1.5rem to 0 - all the way to left edge */
  right: 0;
  /* Changed from 1.5rem to 0 - all the way to right edge */
}

section {
  margin-bottom: 5rem;
  /* 80px */
}

/* Section dividers */
.home-features::before {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: 0 auto 4rem auto;
}

/* Site Grid for Cards */
.site-grid {
  display: grid;
  gap: 2.5rem;
}

/* Kintsugi Divider */
.kintsugi-divider {
  width: 100%;
  text-align: center;
  margin: 4rem auto;
  overflow: hidden;
  line-height: 0;
}

.kintsugi-divider svg {
  width: 600px;
  height: 40px;
  max-width: 90%;
  margin: 0 auto;
  display: block;
}

.kintsugi-divider path {
  fill: none;
  stroke: #C5A059;
  /* Gold */
  stroke-width: 2px;
  filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.1));
}

@media (max-width: 768px) {
  .kintsugi-divider {
    margin: 2rem auto;
  }

  .kintsugi-divider svg {
    height: 20px;
    width: 90%;
  }
}

@media (min-width: 768px) {
  .site-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Header & Navigation */
.main-header {
  background: linear-gradient(to right, rgba(126, 167, 216, 0.08) 0%, rgba(255, 255, 255, 0.5) 30%, rgba(156, 199, 166, 0.08) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(to right, var(--color-primary) 0%, var(--color-border) 50%, var(--color-accent) 100%) 1;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4rem;
  max-width: 100%;
  /* Override container max-width for header */
  padding-left: 3rem;
  /* Much more padding on left */
  padding-right: 3rem;
  /* Much more padding on right */
}

.site-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  /* Made even bigger for more impact (was 1.875rem) */
  font-weight: 700;
  color: var(--color-heading);
  text-decoration: none;
  white-space: nowrap;
  /* Prevent wrapping */
  flex-shrink: 0;
  /* Don't shrink */
  margin-right: auto;
  /* Push nav all the way to the right */
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.header-logo {
  height: 2rem;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .header-logo {
    height: 1.6rem;
  }
}

.site-title:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  /* Increased spacing */
  margin: 0;
  margin-left: auto;
  /* Push to the right */
}

@media (max-width: 768px) {
  .main-nav ul {
    gap: 1rem;
    width: 100%;
  }
}

.main-nav a {
  font-family: var(--font-heading);
  color: var(--color-muted);
  font-weight: 500;
  font-size: 1.15rem;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-heading);
  text-decoration: none;
  border-bottom-color: var(--color-primary);
}

/* Footer */
.main-footer {
  border-top: 1px solid var(--color-border);
  font-size: 1.15rem;
  color: var(--color-heading);
  text-align: center;
  background: linear-gradient(180deg, rgba(126, 167, 216, 0.07) 0%, rgba(226, 213, 195, 0.18) 100%);
  padding-top: 1.26rem;
  padding-bottom: 1.08rem;
  letter-spacing: 0.01em;
  box-shadow: 0 -2px 16px rgba(126, 167, 216, 0.06);
}

.main-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
  max-width: 900px;
}

.footer-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.footer-nav a {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.footer-nav a:hover,
.footer-nav a:focus {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

.main-footer p {
  color: var(--color-muted);
  font-size: 1.02em;
  margin-top: 0.5rem;
  margin-bottom: 0;
  letter-spacing: 0.01em;
}



.footer-donate {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 1rem !important;
  margin-bottom: 1.5rem !important;
}

.footer-donate p {
  margin: 0 !important;
  white-space: nowrap !important;
}

.footer-donate .btn {
  white-space: nowrap !important;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 1rem;
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

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

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

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

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--color-accent-dark);
  color: var(--color-white);
}

/* Cards */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(226, 213, 195, 0.3);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
  border-color: rgba(126, 167, 216, 0.2);
}

/* Third card (downloads) gets green accent on hover */
.card:nth-child(3):hover {
  border-color: rgba(156, 199, 166, 0.4);
}

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

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

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.card-content h3 a {
  color: var(--color-heading);
  text-decoration: none;
}

.card-content h3 a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.card-excerpt {
  color: var(--color-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-family: var(--font-heading);
  margin-top: auto;
}

/* Reading time badge */
.reading-time {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-family: var(--font-heading);
  margin-bottom: 0.75rem;
  display: inline-block;
}





/* Hero Section */
.hero {
  text-align: center;
  padding: 2rem 2rem 1.5rem 2rem;
  margin-bottom: 0;
  position: relative;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-style: italic;
  max-width: 600px;
  margin: 1rem auto 0 auto;
  color: var(--color-text);
  position: relative;
  z-index: 1;
}

@media (min-width: 769px) {
  .hero-tagline {
    max-width: none;
    white-space: nowrap;
  }
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-heading);
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(126, 167, 216, 0.15);
}

textarea.form-control {
  min-height: 300px;
  resize: vertical;
}

/* Hero Mobile Optimizations */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1.5rem;
    /* Reduced padding (was 5rem 2rem) */
    margin-bottom: 2rem;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 8.5vw, 2.25rem) !important;
    white-space: nowrap;
    letter-spacing: -0.01em;
  }

  .hero-tagline {
    font-size: 1rem;
    /* Smaller tagline (was 1.25rem) */
    margin-top: 0.75rem;
  }
}

.checkbox-group,
.radio-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-group input,
.radio-group input {
  width: 1.2em;
  height: 1.2em;
  accent-color: var(--color-primary);
}

.form-note {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 1.5rem;
}

fieldset.form-group {
  border: none;
  padding: 0;
  margin-top: 2rem;
}

legend {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 1rem;
  padding: 0;
  font-size: 1.1rem;
  color: var(--color-heading);
}

/* Hidden field for Netlify honeypot */
.hidden-field {
  position: absolute;
  left: -5000px;
}

/* Special Notices */
.crisis-notice {
  background: linear-gradient(135deg, rgba(126, 167, 216, 0.12) 0%, rgba(126, 167, 216, 0.18) 100%);
  border: 1.5px solid rgba(126, 167, 216, 0.35);
  color: var(--color-heading);
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  margin: 3rem auto;
  max-width: var(--max-width);
  box-shadow: 0 2px 12px rgba(126, 167, 216, 0.12);
}

.crisis-notice p {
  margin: 0;
  line-height: 1.7;
}

.crisis-notice strong {
  color: var(--color-primary-dark);
  font-weight: 700;
}

.crisis-notice a {
  color: #004085;
  text-decoration: underline;
  font-weight: 600;
}





/* Grief Type Selector */
#grief-type-selector {
  text-align: center;
  margin: 4rem auto;
  max-width: 800px;
}

#grief-type-selector h2 {
  margin-bottom: 0.5rem;
}

#grief-type-selector p {
  color: var(--color-muted);
  margin-bottom: 2rem;
}

#grief-type-selector>div:first-of-type {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.grief-type-btn {
  background-color: var(--color-white);
  color: var(--color-heading);
  border: 1px solid var(--color-border);
}

#grief-type-response {
  display: none;
  padding: 2rem;
  background: rgba(126, 167, 216, 0.05);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  color: var(--color-heading);
}


/* Daily Reflection Card */
.daily-reflection-card {
  max-width: 800px;
  margin: 4rem auto;
  padding: 4rem 3rem;
  text-align: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(126, 167, 216, 0.08) 100%);
  border: 1px solid rgba(126, 167, 216, 0.2);
}

.daily-reflection-card .reflection-label {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  color: var(--color-primary);
}

.daily-reflection-card blockquote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.75rem;
  color: var(--color-heading);
  line-height: 1.6;
  margin: 1.5rem 0 0 0;
  border: none;
  background: transparent;
  padding: 0;
}


/* Content (Blog Post & Story) Styles */
.content-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.content-wrapper .hero-image {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.content-wrapper .post-meta {
  color: var(--color-muted);
  font-family: var(--font-heading);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.content-wrapper blockquote {
  border-left: 4px solid var(--color-primary);
  background: rgba(126, 167, 216, 0.05);
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  margin: 2.5rem 0;
  font-style: italic;
  color: var(--color-heading);
  font-size: 1.1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-heading);
  color: var(--color-white);
  padding: 1rem;
  z-index: 1000;
  display: none;
  /* Hidden by default, shown by JS */
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
  flex-wrap: wrap;
}

.cookie-banner.show {
  display: flex;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.9rem;
}

.cookie-banner a {
  color: var(--color-white);
  text-decoration: underline;
}

.cookie-banner .btn {
  padding: 8px 16px;
  flex-shrink: 0;
}

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

/* Ad Placeholders */


/* Newsletter & Email Forms */
input[type="email"] {
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="email"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(156, 199, 166, 0.15);
}

/* Newsletter sections get green theme */


/* Accessibility */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
  border-radius: 4px;
  /* Ensure focus outline is visible on rounded elements */
}

/* Remove default focus for non-keyboard users on elements that have :focus-visible */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Mobile Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 102;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--color-heading);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 2.5rem;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero {
    padding: 3rem 1.5rem 4rem 1.5rem;
  }

  .hero::before,
  .hero::after {
    opacity: 0.6;
  }

  h2 {
    font-size: 2rem;
  }

  /* Mobile Header */
  .main-header .container {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .site-title {
    font-size: 1.5rem;
  }

  /* Show hamburger on mobile */
  .hamburger {
    display: flex;
  }

  /* Hide main nav by default on mobile */
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(243, 233, 220, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease-in-out;
    z-index: 101;
    padding: 5rem 2rem 2rem 2rem;
    overflow-y: auto;
  }

  .main-nav.active {
    right: 0;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .main-nav li {
    border-bottom: 1px solid var(--color-border);
  }

  .main-nav a {
    display: block;
    padding: 1.25rem 0;
    font-size: 1.15rem;
    border-bottom: none;
  }

  .main-nav a:hover,
  .main-nav a.active {
    color: var(--color-primary);
    border-bottom: none;
    padding-left: 0.5rem;
  }

  main {
    padding: 2rem 0;
  }

  section {
    margin-bottom: 3rem;
  }

  .crisis-notice {
    padding: 1.25rem 1.5rem;
    font-size: 0.95rem;
  }

  .journal-prompt {
    padding: 1.25rem 1.5rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }

  .card-content {
    padding: 1.25rem;
  }

  .site-grid {
    gap: 2rem;
  }
}

/* Light a Candle Section */
.candle-section {
  background-color: #1E2D3A;
  /* Dark slate */
  color: var(--color-white);
  padding: 4rem 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: 5rem;
  padding: 2rem 1.5rem;
  /* Reduced Padding */
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}

.candle-content {
  max-width: 900px;
  /* Use full width for banner feel */
  margin: 0 auto;
}

/* Default Mobile Stack (implied block flow) */
.candle-text-col {
  margin-bottom: 2rem;
  text-align: center;
}

.candle-visual-col {
  text-align: center;
}

/* Ensure nice stacking on mobile explicitly if needed, though default is block */
@media (max-width: 768px) {
  .candle-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Already Lit State (Badge Logic) */
.candle-section.already-lit {
  padding: 1.5rem;
  margin-bottom: 3rem;
  background: #fcfbf9;
  /* Lighter background for status feel */
  border: 1px solid var(--color-border);
}

.candle-section.already-lit #candle-form-container,
.candle-section.already-lit #candle-form {
  display: none !important;
}

.candle-section.already-lit .candle-text-col {
  display: none;
  /* Optional: Hide the intro text "Light a Candle" if we just want status */
  /* Or keep it? User asked to reduce focus. Let's hide intro text to declutter. */
}

/* On mobile, ensure horizontal layout for badge feel if possible, or tight stack */
.candle-section.already-lit .candle-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-direction: row;
  /* Force row even on mobile for badge */
  text-align: left;
}

@media (max-width: 768px) {
  .candle-section.already-lit .candle-content {
    flex-direction: row;
    /* Keep row for icon + text */
    gap: 1rem;
  }

  .candle-section.already-lit .candle-wrapper {
    transform: scale(0.5);
    /* Tiny candle icon */
    margin: 0;
    height: 100px;
    width: 60px;
  }

  .candle-section.already-lit .candle-visual-col {
    width: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
  }
}

/* Desktop Banner Layout */
@media (min-width: 768px) {
  .candle-content {
    display: flex;
    align-items: center;
    /* Center Vertically */
    justify-content: space-between;
    text-align: left;
    gap: 3rem;
    /* Add gap */
  }

  .candle-text-col {
    width: 60%;
    margin-bottom: 0;
    text-align: left;
    padding-right: 0;
    /* Remove padding if gap handles spacing */
  }


  .candle-visual-col {
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center candle in its column */
  }
}

.candle-wrapper {
  position: relative;
  width: 120px;
  height: 160px;
  margin: 0 auto 2rem auto;
  /* Scale down for banner feel on desktop, maybe keeps same on mobile */
  transform: scale(0.8);
  transform-origin: center center;
}

@media (min-width: 768px) {
  .candle-wrapper {
    margin: 0 auto 1rem auto;
    /* Less margin on desktop banner */
    transform: scale(0.7);
    /* Smaller candle as requested */
  }
}

.candle {
  width: 80px;
  height: 120px;
  background: linear-gradient(#e8e8e8, #ffffff);
  border-radius: 4px;
  box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.05), 5px 5px 15px rgba(0, 0, 0, 0.1);
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.wick {
  width: 4px;
  height: 15px;
  background: #333;
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
}

.flame {
  width: 16px;
  height: 30px;
  background: radial-gradient(ellipse at bottom, #ffeb3b, #ff9800);
  border-radius: 50% 50% 20% 20%;
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px #ff9800, 0 0 20px #ffeb3b;
  animation: flicker 1s infinite alternate;
  opacity: 0.6;
  /* Dim by default */
  transition: opacity 1s;
}

/* Lit State */
.candle.lit .flame {
  opacity: 1;
  box-shadow: 0 0 20px #ff9800, 0 0 40px #ffeb3b, 0 0 60px #ffeb3b;
}

@keyframes flicker {
  0% {
    transform: translateX(-50%) skewX(2deg) scaleY(1);
    opacity: 0.8;
  }

  25% {
    transform: translateX(-50%) skewX(-2deg) scaleY(1.1);
    opacity: 1;
  }

  50% {
    transform: translateX(-50%) skewX(1deg) scaleY(0.9);
    opacity: 0.8;
  }

  75% {
    transform: translateX(-50%) skewX(-1deg) scaleY(1.05);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) skewX(2deg) scaleY(1);
    opacity: 0.8;
  }
}

#candle-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 300px;
  margin: 0 auto;
  width: 100%;
  /* Ensure form takes space */
}

input#dedication-name {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  /* Match button radius */
  font-family: var(--font-body);
  text-align: center;
  width: 100%;
  /* Full width */
  box-sizing: border-box;
  /* padding inside width */
}

#candle-message-container p {
  text-align: center;
  font-style: italic;
  color: var(--color-accent-dark);
  font-weight: 500;
  margin-top: 1rem;
}

#candle-form input::placeholder {
  color: var(--color-muted);
}

/* Dedication Message */
.dedication-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #945600;
  /* Further deepened to exceed 5:1 contrast on Sand */
  margin: 0;
  animation: fadeIn 1s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media (max-width: 480px) {
  #candle-form {
    flex-direction: column;
  }

  #candle-form button {
    width: 100%;
  }
}

/* Physiological Anchor (Breathe) */
.breathe-fab {
  position: fixed !important;
  /* Force Fixed */
  bottom: 2rem;
  right: 2rem;
  background-color: var(--color-accent);
  color: var(--color-white);
  border: none;
  padding: 12px 20px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  /* Stronger shadow */
  z-index: 10000;
  /* Top of everything */
  /* Ensure it's above content AND mobile menu */
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.breathe-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(156, 199, 166, 0.5);
  background-color: var(--color-accent-dark);
}

.breathe-fab svg {
  width: 20px;
  height: 20px;
}

/* Breathe Overlay */
.breathe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 45, 58, 0.9);
  /* Slightly darker */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  /* Above everything */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.breathe-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Breathing Animation Container */
.breathe-container {
  position: relative;
  width: 300px;
  /* Bigger Base */
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 3rem;
}

.breathing-circle {
  position: absolute;
  width: 300px;
  /* Bigger Base */
  height: 300px;
  background-color: rgba(156, 199, 166, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(156, 199, 166, 0.3);
  transform: scale(1);
}

@media (max-width: 600px) {

  .breathe-container,
  .breathing-circle {
    width: 80vw;
    height: 80vw;
    max-width: 300px;
    max-height: 300px;
  }
}

/* Animation classes applied when active */
.breathe-overlay.active .breathing-circle {
  animation: breathe-circle 8s infinite ease-in-out;
}

.breathing-text {
  position: relative;
  z-index: 10;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  /* Bigger Text */
  font-weight: 600;
  letter-spacing: 2px;
  /* Bigger Spacing */
  text-transform: uppercase;
  text-align: center;
  min-width: 120px;
}

/* Close Button */
.close-breathe-btn {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  padding: 12px 32px;
  margin-top: 2rem;
  transition: background-color 0.2s;
  color: white;
  cursor: pointer;
  border-radius: 4px;

  .breathe-fab {
    padding: 12px;
    border-radius: 50%;
  }
}

/* Contextual Prompt (Freeze State) */
.breathe-fab.gentle-pulse {
  animation: gentle-fab-pulse 3s infinite ease-in-out;
  background-color: var(--color-accent-dark);
  /* Subtle Highlight */
  box-shadow: 0 0 0 0 rgba(156, 199, 166, 0.7);
}

@keyframes gentle-fab-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(156, 199, 166, 0.7);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(156, 199, 166, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(156, 199, 166, 0);
  }
}

.close-breathe-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

/* Animations: Simple 4s In / 4s Out */
@keyframes breathe-circle {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.5);
    /* Massive Expansion */
    opacity: 0.8;
  }

  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
}



@keyframes breathe-text {
  0% {
    content: "Inhale...";
    opacity: 0;
  }

  2% {
    content: "Inhale...";
    opacity: 1;
  }

  20% {
    content: "Inhale...";
    opacity: 1;
  }

  21% {
    content: "Hold...";
    opacity: 0.5;
  }

  /* Creating a conscious switch */
  23% {
    content: "Hold...";
    opacity: 1;
  }

  56% {
    content: "Hold...";
    opacity: 1;
  }

  58% {
    content: "Exhale...";
    opacity: 0.5;
  }

  60% {
    content: "Exhale...";
    opacity: 1;
  }

  98% {
    content: "Exhale...";
    opacity: 1;
  }

  100% {
    content: "Inhale...";
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .breathe-fab {
    display: flex !important;
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 2147483647 !important;
    /* Max Z-Index */
    background-color: #4A6D51 !important;
    /* Matched to new deepened accent for contrast */
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    opacity: 1 !important;
    visibility: visible !important;
    /* Removed transform: scale(0.9) to avoid stacking context bugs */
    padding: 10px 18px !important;
    /* Smaller padding instead of scale */
    border-radius: 50px !important;
  }
}

/* Unsent Letter Modal (V2 Immersive Upgrade) */
.letter-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100dvh;
  /* Modern mobile fix */
  z-index: 2000;
  display: flex !important;
  /* Force flex centering */
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.letter-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.letter-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 20, 30, 0.6);
  /* Slightly darker for focus */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.letter-paper {
  position: relative;
  width: 90vw;
  /* Immersive Width */
  max-width: 900px;
  height: 85vh;
  /* Immersive Height */
  background-color: #fcfbf9;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  z-index: 2001;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.letter-modal.active .letter-paper {
  transform: translateY(0);
}

.letter-content {
  flex: 1;
  padding: 3rem 4rem;
  /* More breathing room */
  /* Lined Paper Pattern: Synced to 3rem line-height */
  background-image: repeating-linear-gradient(transparent, transparent calc(3rem - 1px), #d0cfcd calc(3rem - 1px), #d0cfcd 3rem);
  background-attachment: local;
  overflow-y: auto;
  /* Allow scrolling for long letters */
}

.lined-textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  /* Larger, more legible */
  line-height: 3rem;
  /* Matches gradient */
  color: #2c3e50;
  padding: 0;
  margin: 0;
  /* Shift slightly to sit on the line */
  padding-top: 0.2rem;
}

.lined-textarea::placeholder {
  color: rgba(44, 62, 80, 0.3);
}

.letter-footer {
  padding: 2rem;
  text-align: center;
  background-color: #fcfbf9;
  /* No top border for cleaner look, just whitespace */
  z-index: 5;
  /* Keep above content if desired */
}

.btn-text {
  background: none;
  border: 2px solid var(--color-border);
  border-radius: 50px;
  color: var(--color-muted);
  font-family: var(--font-heading);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.2s;
  padding: 12px 32px;
  /* Larger button */
  display: inline-block;
}

.btn-text:hover {
  border-color: #ff4500;
  color: #c0392b;
  background: rgba(255, 69, 0, 0.05);
}

.privacy-note {
  font-size: 0.8rem;
  color: #999;
  margin-top: 1rem;
  margin-bottom: 0;
  font-style: italic;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .letter-paper {
    width: 94vw;
    /* Slightly less than full width */
    height: 90vh;
    max-width: 100%;
    margin: 0 auto;
    /* Ensure centering */
  }

  .letter-content {
    padding: 1.5rem 1.25rem;
    /* Much tighter padding */
    /* Adjust line height pattern for mobile */
    background-image: repeating-linear-gradient(transparent, transparent calc(2.5rem - 1px), #d0cfcd calc(2.5rem - 1px), #d0cfcd 2.5rem);
  }

  .lined-textarea {
    font-size: 1.4rem;
    /* Readable but smaller */
    line-height: 2.5rem;
    /* Synced with new gradient */
    padding-top: 0.4rem;
    /* Minor align adjustment */
  }

  .btn-text {
    padding: 10px 20px;
    font-size: 1rem;
  }
}

/* Burn Animation */
.letter-paper.burning {
  /* Mask: Bottom half is visible content (black), top half is transparent */
  -webkit-mask-image: linear-gradient(to top, black 50%, transparent 50%);
  mask-image: linear-gradient(to top, black 50%, transparent 50%);
  -webkit-mask-size: 100% 200%;
  mask-size: 100% 200%;
  -webkit-mask-position: bottom;
  mask-position: bottom;
  animation: burnMask 5s forwards linear, paper-rumble 0.1s infinite;
  /* Added Rumble + Slower burn */
  position: relative;
  overflow: hidden;
  /* Contain the edge */
}

/* Simulated Glowing Charred Edge */
.letter-paper.burning::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 15px;
  /* Thicker charred strip */
  /* Gradient: Transparent -> Dark Charcoal -> Bright Orange/Yellow -> Transparent */
  background: linear-gradient(to top, transparent, #333 10%, #ff4500 50%, #ffcc00 80%, transparent);
  box-shadow: 0 0 20px #ff4500, 0 0 40px #ff8800;
  /* Stronger Fire Glow */
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  animation: burnLine 5s forwards linear;
}

@keyframes burnMask {
  0% {
    -webkit-mask-position: bottom;
    mask-position: bottom;
  }

  100% {
    -webkit-mask-position: top;
    mask-position: top;
    opacity: 0;
  }
}

@keyframes burnLine {
  0% {
    bottom: -2%;
    opacity: 1;
  }

  98% {
    opacity: 1;
  }

  100% {
    bottom: 102%;
    opacity: 0;
  }
}

@keyframes paper-rumble {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(1px, 0px);
  }

  50% {
    transform: translate(-1px, 0);
  }

  75% {
    transform: translate(0, 1px);
  }

  100% {
    transform: translate(0, -1px);
  }
}

/* Smoke Effect (Text fading ahead of burn) */
.burning .letter-content,
.burning .letter-footer {
  transition: opacity 2s ease;
  /* We can't easily animate text color locally per line without complex JS, 
       but we can darken the whole container as it burns */
  filter: sepia(100%) hue-rotate(-30deg) saturate(300%) contrast(1.2);
}

/* Released Message */
.released-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 1999;
  letter-spacing: 0.1em;
  transition: opacity 1s ease 1s;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.letter-modal.releasing .released-message {
  opacity: 1;
  transition-delay: 3s;
}

/* Yellow Heart Signal */
.yellow-heart-card {
  margin-top: 4rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  background: white;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.yellow-heart-card h3 {
  margin-bottom: 1rem;
  color: var(--color-heading);
}

.yellow-heart-card p {
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.heart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2.5rem 0;
  height: 100px;
}

.yellow-heart {
  position: relative;
  width: 100px;
  height: 90px;
  animation: gentlePulse 3s infinite ease-in-out;
}

.yellow-heart::before,
.yellow-heart::after {
  content: "";
  position: absolute;
  top: 0;
  width: 52px;
  height: 80px;
  border-radius: 50px 50px 0 0;
  background: #F4D03F;
  /* Soft Warm Yellow */
}

.yellow-heart::before {
  left: 50px;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}

.yellow-heart::after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}

@keyframes gentlePulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* Share Buttons */
.share-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-share {
  display: inline-block;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 50px;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-share:hover {
  border-color: #F4D03F;
  color: #bfa025;
  background: rgba(244, 208, 63, 0.1);
}

/* Specific styling for copy success state */
.btn-share.copied {
  border-color: #9CC7A6;
  color: #9CC7A6;
  background: rgba(156, 199, 166, 0.1);
}



/* Sanctuary Bar (Persistent) */
/* Sanctuary Bar (Persistent) */
#sanctuary-bar {
  background-color: #2c3e50;
  /* Dark Charcoal */
  color: #fff;
  text-align: center;
  padding: 0.4rem 1rem;
  /* Slimmer Padding */
  font-size: 0.85rem;
  /* Smaller Font */
  position: sticky;
  top: 0;
  z-index: 10000;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.5s ease-out;
}

#sanctuary-bar strong {
  color: #F4D03F;
  /* Warm Yellow for Name */
}

/* Mobile Adjustments for Sanctuary Bar */
@media (max-width: 480px) {
  #sanctuary-bar {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    line-height: 1.2;
    /* Tighter leading for wrapping */
  }

  #sanctuary-bar .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
  }

  /* Reset container width if needed */
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

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

/* PWA Interaction */
.install-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.install-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;
  border-color: var(--color-accent);
}

.install-card:active {
  transform: translateY(0);
}



/* Optional: Shift body/header if needed when active, though relative positioning usually handles it. */
body.sanctuary-active .main-header {
  /* Ensure header sticks properly if it was sticky, otherwise flow is natural */
}

/* Night Vigil (Night Mode) */
body.night-vigil,
body.night-vigil main {
  background-color: #1E2D3A !important;
  color: #F3E9DC !important;
  background-image: none !important;
}

body.night-vigil .main-header,
body.night-vigil .main-footer,
body.night-vigil .card,
body.night-vigil .candle-section,
body.night-vigil .yellow-heart-card,
body.night-vigil .crisis-notice,
body.night-vigil .letter-paper,
body.night-vigil .letter-footer,
body.night-vigil .letter-content {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #F3E9DC !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  background-image: none !important;
}

body.night-vigil h1,
body.night-vigil h2,
body.night-vigil h3,
body.night-vigil h4,
body.night-vigil p,
body.night-vigil li,
body.night-vigil .site-title,
body.night-vigil .main-nav a,
body.night-vigil .footer-nav a,
body.night-vigil .lined-textarea {
  color: #F3E9DC !important;
}

body.night-vigil a {
  color: #7EA7D8 !important;
}

body.night-vigil .btn-primary,
body.night-vigil .btn-secondary {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

body.night-vigil .main-header {
  border-image: linear-gradient(to right, #426992 0%, rgba(255, 255, 255, 0.1) 50%, #4A6D51 100%) 1 !important;
}