/* The Zezula Foundation — editorial custom CSS
   Brand colors and fonts are defined inline via Tailwind config in each HTML file.
   This file handles typography refinement, accessibility, print, and editorial flourishes. */

/* Smoother fonts on Windows */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Variable Fraunces — optical size scales with display size */
.font-display { font-variation-settings: "opsz" 144, "SOFT" 50; font-feature-settings: "ss01", "kern", "liga"; }
.font-display.text-sm, .font-display.text-base { font-variation-settings: "opsz" 14; }

/* Refined wordmark — small vertical bar accent before the site title */
.wordmark-mark::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1.4em;
  background: #c89942;
  margin-right: 0.6em;
  vertical-align: -0.3em;
  border-radius: 1px;
}

/* Tighter heading line-height */
h1, h2, h3, h4 { letter-spacing: -0.015em; }
.font-display { letter-spacing: -0.02em; }

/* Better focus rings for accessibility */
:focus-visible {
  outline: 2px solid #c89942;
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* Selection styling matches brand */
::selection { background: #c89942; color: #0a1f36; }

/* Smooth scroll for in-page anchors */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Drop cap — first paragraph of editorial long-form */
.drop-cap::first-letter {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144;
  float: left;
  font-size: 5.5rem;
  line-height: 0.85;
  padding: 0.35rem 0.6rem 0 0;
  color: #0a1f36;
  font-weight: 400;
}

/* Pull quote — editorial accent */
.pull-quote {
  border-left: 3px solid #c89942;
  padding: 1rem 0 1rem 2rem;
  margin: 2.5rem 0;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144;
  font-size: 1.75rem;
  line-height: 1.25;
  color: #0a1f36;
  font-style: italic;
  letter-spacing: -0.01em;
}
.pull-quote-attribution {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #A53B3B;
  font-style: normal;
  margin-top: 1rem;
  font-weight: 500;
}

/* Editorial section numbers */
.section-number {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144;
  font-size: 4rem;
  line-height: 1;
  color: #c89942;
  font-weight: 400;
}

/* Long-form prose styling */
.prose-editorial p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.75;
}
.prose-editorial p:first-child {
  font-size: 1.375rem;
  line-height: 1.55;
  color: #0a1f36;
}
.prose-editorial strong { color: #0a1f36; font-weight: 600; }
.prose-editorial em { font-family: 'Fraunces', Georgia, serif; font-style: italic; }

/* Scroll-in animations (subtle) */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-in-up { opacity: 1; transform: none; }
}

/* Photography overlay */
.hero-photo {
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #0a1f36;
}
.hero-photo::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,44,74,0.65) 0%, rgba(15,44,74,0.85) 100%);
}
.hero-photo > * { position: relative; z-index: 1; }

/* Print stylesheet — donors print receipts and policy pages */
@media print {
  header, footer, button, .no-print { display: none !important; }
  body { background: white !important; color: black !important; }
  a { color: black !important; text-decoration: underline !important; }
  .hero-photo::before { display: none; }
  .font-display { font-family: 'Times New Roman', Times, serif !important; }
}

/* Donation amount selector — clean checked state */
input[type="radio"]:checked + div { font-weight: 600; }

/* Details / accordion — custom caret */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Smart typography */
abbr[title] { text-decoration: underline dotted; cursor: help; }

/* === Mobile-specific refinements === */

/* Minimum touch target size for all interactive elements (WCAG 2.5.5) */
@media (hover: none) and (pointer: coarse) {
  button, a, input[type="submit"], input[type="button"], [role="button"] {
    min-height: 44px;
  }
}

/* Mobile: tighten drop cap to avoid overwhelm */
@media (max-width: 640px) {
  .drop-cap::first-letter { font-size: 4rem; padding: 0.3rem 0.45rem 0 0; }
  .pull-quote { font-size: 1.375rem; padding: 0.75rem 0 0.75rem 1.25rem; margin: 1.5rem 0; }
  .pull-quote-attribution { font-size: 0.75rem; }
  .section-number { font-size: 2.75rem; }
  /* Reduce hero photo overlay heaviness on mobile so text is more readable */
  .hero-photo::before { background: linear-gradient(180deg, rgba(15,44,74,0.7) 0%, rgba(15,44,74,0.9) 100%); }
  /* Long-form prose: slightly smaller first paragraph */
  .prose-editorial p:first-child { font-size: 1.2rem; }
}

/* Mobile: less tight tracking on display sizes (small Fraunces needs more space) */
@media (max-width: 640px) {
  .font-display { letter-spacing: -0.01em; }
}

/* Wordmark accent: scale on mobile so it doesn't dominate */
@media (max-width: 640px) {
  .wordmark-mark::before { width: 2px; height: 1.2em; margin-right: 0.4em; }
}

/* Prevent body horizontal scroll caused by overflow */
body { overflow-x: hidden; }

/* Ensure hero photos cover full bleed on mobile (some iOS quirks) */
.hero-photo { background-attachment: scroll; }
