/* ============================================
   Shared Components
   ============================================ */

/* --- Skip to Content --- */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--ink-black);
  color: var(--rice-paper);
  font-weight: 600;
  z-index: calc(var(--z-nav) + 1);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--duration-fast) var(--ease-out-quart);
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--space-5) 0;
  transition: background-color var(--duration-normal) var(--ease-in-out-soft),
              padding var(--duration-normal) var(--ease-in-out-soft),
              box-shadow var(--duration-normal) var(--ease-in-out-soft);
}

.nav--scrolled {
  background-color: rgba(245, 240, 232, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-3) 0;
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink-black);
  letter-spacing: var(--tracking-wide);
  z-index: calc(var(--z-nav) + 1);
}

.nav__logo-mark {
  width: 44px;
  height: 44px;
  transition: transform var(--duration-normal) var(--ease-out-expo);
  color: var(--vermillion-deep, #A63A2E);
  overflow: visible;
}

.nav__logo:hover .nav__logo-mark {
  transform: rotate(12deg);
}

/* --- Lotus mark (nav + footer shared SVG structure) --- */

.nav__logo-mark .lotus-mark__petal,
.nav__logo-mark .lotus-mark__center,
.footer__logo-mark .lotus-mark__petal,
.footer__logo-mark .lotus-mark__center {
  transform-origin: 50px 50px;
  transform-box: view-box;
}

/* Animated bloom on every page load in nav */
.nav__logo-mark .lotus-mark__petal {
  opacity: 0;
  transform: rotate(var(--r, 0deg)) scale(0.1);
  animation: navPetalBloom 0.9s cubic-bezier(0.22, 1.15, 0.46, 1) forwards;
  animation-delay: var(--d, 0s);
}

.nav__logo-mark .lotus-mark__center {
  opacity: 0;
  transform: scale(0);
  animation: navCenterBloom 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards;
}

@keyframes navPetalBloom {
  0%   { opacity: 0; transform: rotate(var(--r, 0deg)) scale(0.1); }
  55%  { opacity: var(--o, 0.55); }
  100% { opacity: var(--o, 0.55); transform: rotate(var(--r, 0deg)) scale(1); }
}

@keyframes navCenterBloom {
  0%   { opacity: 0; transform: scale(0); }
  60%  { opacity: 0.32; transform: scale(1.2); }
  100% { opacity: 0.32; transform: scale(1); }
}

/* Footer mark — same shape, static */
.footer__logo-mark .lotus-mark__petal { opacity: var(--o, 0.55); }
.footer__logo-mark .lotus-mark__center { opacity: 0.3; }

@media (prefers-reduced-motion: reduce) {
  .nav__logo-mark .lotus-mark__petal,
  .nav__logo-mark .lotus-mark__center {
    animation: none !important;
    opacity: var(--o, 0.32) !important;
    transform: rotate(var(--r, 0deg)) scale(1) !important;
  }
}

.nav__links {
  display: none;
  gap: var(--space-1);
}

@media (min-width: 1024px) {
  .nav__links {
    display: flex;
    align-items: center;
  }
}

.nav__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  color: var(--ink-medium);
  position: relative;
  transition: color var(--duration-fast) var(--ease-in-out-soft);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-4);
  right: var(--space-4);
  height: 2px;
  background: var(--vermillion);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.nav__link:hover,
.nav__link--active {
  color: var(--ink-black);
}

.nav__link:hover::after,
.nav__link--active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__cta {
  margin-left: var(--space-4);
}

/* --- Mobile Nav Toggle --- */

.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 32px;
  z-index: calc(var(--z-nav) + 2);
  padding: 4px;
}

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

.nav__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink-black);
  border-radius: 2px;
  transition: transform var(--duration-normal) var(--ease-out-expo),
              opacity var(--duration-fast) var(--ease-in-out-soft);
  transform-origin: center;
}

.nav__toggle--open .nav__toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav__toggle--open .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle--open .nav__toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- Mobile Nav Panel --- */

.nav__mobile {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  width: min(380px, 85vw);
  background: var(--rice-paper-white);
  z-index: calc(var(--z-nav) + 1);
  padding: var(--space-20) var(--space-8) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out-expo);
  box-shadow: -8px 0 40px rgba(26, 26, 26, 0.15);
}

.nav__mobile--open {
  transform: translateX(0);
}

.nav__mobile-link {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--ink-black);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  transition: color var(--duration-fast) var(--ease-in-out-soft),
              padding-left var(--duration-normal) var(--ease-out-expo);
}

.nav__mobile-link:hover {
  color: var(--vermillion);
  padding-left: var(--space-4);
}

.nav__mobile-footer {
  margin-top: auto;
  padding-top: var(--space-8);
  display: flex;
  gap: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.nav__mobile-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--ink-medium);
  border-radius: 50%;
  transition: color var(--duration-fast) var(--ease-in-out-soft),
              background var(--duration-fast) var(--ease-in-out-soft),
              transform var(--duration-normal) var(--ease-out-expo);
}

.nav__mobile-footer a:hover {
  color: var(--vermillion);
  background: var(--rice-paper-warm);
  transform: translateY(-2px);
}

.nav__mobile-footer svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.nav__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.3);
  z-index: calc(var(--z-nav) - 1);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-in-out-soft),
              visibility var(--duration-normal);
}

.nav__backdrop--visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--vermillion);
  color: var(--rice-paper-white);
  box-shadow: 0 2px 8px rgba(194, 58, 43, 0.25);
}

.btn--primary:hover {
  background: var(--vermillion-deep);
  box-shadow: 0 4px 16px rgba(194, 58, 43, 0.35);
  transform: translateY(-2px);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--ghost {
  border: 1.5px solid var(--ink-black);
  color: var(--ink-black);
  background: transparent;
}

.btn--ghost:hover {
  background: var(--ink-black);
  color: var(--rice-paper);
  transform: translateY(-2px);
}

.btn--ghost-light {
  border: 1.5px solid var(--rice-paper);
  color: var(--rice-paper);
  background: transparent;
}

.btn--ghost-light:hover {
  background: var(--rice-paper);
  color: var(--ink-black);
  transform: translateY(-2px);
}

.btn--sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-5);
}

.btn--lg {
  font-size: var(--text-base);
  padding: var(--space-5) var(--space-10);
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  transition: transform var(--duration-normal) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo);
  position: relative;
}

.card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--vermillion);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transform: scaleX(0);
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

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

.card:hover::after {
  transform: scaleX(1);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-5);
  color: var(--vermillion);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.card__text {
  color: var(--ink-medium);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--vermillion);
  letter-spacing: var(--tracking-wide);
  transition: gap var(--duration-normal) var(--ease-out-expo);
}

.card__link:hover {
  gap: var(--space-4);
}

.card__link-arrow {
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.card__link:hover .card__link-arrow {
  transform: translateX(4px);
}

/* ============================================
   Event Cards
   ============================================ */

.event-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--rice-paper-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: border-color var(--duration-normal) var(--ease-in-out-soft),
              box-shadow var(--duration-normal) var(--ease-in-out-soft);
}

.event-card:hover {
  border-color: var(--vermillion);
  box-shadow: var(--shadow-md);
}

.event-card__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: var(--space-3);
  background: var(--rice-paper-warm);
  border-radius: var(--radius-sm);
}

.event-card__month {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--vermillion);
}

.event-card__day {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--ink-black);
}

.event-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

.event-card__location {
  font-size: var(--text-sm);
  color: var(--ink-light);
  margin-bottom: var(--space-2);
}

.event-card__desc {
  font-size: var(--text-sm);
  color: var(--ink-medium);
  line-height: var(--leading-relaxed);
}

/* ============================================
   Placeholder Images
   ============================================ */

.placeholder-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  display: grid;
  place-content: center;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(45, 45, 45, 0.05), transparent 70%),
    linear-gradient(135deg, var(--rice-paper-warm), var(--rice-paper-cool));
  border: 1px solid var(--color-border);
}

.placeholder-image::after {
  content: attr(data-label);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--ink-light);
  text-align: center;
  padding: var(--space-8);
}

.placeholder-image--landscape {
  aspect-ratio: 16 / 10;
}

.placeholder-image--portrait {
  aspect-ratio: 3 / 4;
}

.placeholder-image--square {
  aspect-ratio: 1;
}

.placeholder-image--scroll {
  aspect-ratio: 2 / 3;
}

/* ============================================
   Section Headers
   ============================================ */

.section-header {
  margin-bottom: var(--space-12);
}

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

.section-header--center .section-header__desc {
  margin-inline: auto;
}

.section-header__label {
  display: block;
  margin-bottom: var(--space-4);
}

.section-header__title {
  margin-bottom: var(--space-4);
}

.section-header__desc {
  max-width: 55ch;
  color: var(--ink-medium);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: var(--ink-black);
  color: var(--rice-paper);
  padding: var(--space-20) 0 var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

@media (max-width: 1023px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
}

.footer__brand {
  max-width: 320px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--rice-paper);
  margin-bottom: var(--space-5);
}

.footer__logo-mark {
  width: 36px;
  height: 36px;
  opacity: 0.9;
}

.footer__tagline {
  color: var(--ink-wash);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.footer__heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--ink-wash);
  margin-bottom: var(--space-5);
}

.footer__link {
  display: block;
  color: var(--rice-paper);
  font-size: var(--text-sm);
  padding: var(--space-1) 0;
  opacity: 0.8;
  transition: opacity var(--duration-fast) var(--ease-in-out-soft),
              color var(--duration-fast) var(--ease-in-out-soft);
}

.footer__link:hover {
  opacity: 1;
  color: var(--gold-light);
}

.footer__social {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.footer__social-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity var(--duration-fast) var(--ease-in-out-soft),
              transform var(--duration-normal) var(--ease-out-expo);
}

.footer__social-icon:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(245, 240, 232, 0.1);
  font-size: var(--text-xs);
  color: var(--ink-light);
}

.footer__nonprofit {
  color: var(--ink-wash);
}

/* --- Labelled social row (contact page card) --- */

.social-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.social-row a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink-medium);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out-expo);
}

.social-row a:hover,
.social-row a:focus-visible {
  color: var(--vermillion-deep);
}

.social-row svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .social-row a { transition: none; }
}

/* --- Contact form --- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Honeypot — off-screen rather than display:none, which some bots detect */
.contact-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form__status {
  margin: 0;
  min-height: 1.5em;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--ink-medium);
}

.contact-form__status.is-ok    { color: var(--jade, #2d6a4f); }
.contact-form__status.is-error { color: var(--vermillion-deep); }

.contact-form button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Touch targets ---
   Icon-only links were ~20px. iOS guidance is 44px minimum, so pad the
   hit area without changing how the icons look. */

.footer__social a,
.nav__mobile-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: calc(var(--space-2) * -1);
}

.social-row a {
  min-height: 44px;
}
