/* =============================================================================
   Pandharpur Wari Portal — Base styles (reset, typography, focus, motion)
   ============================================================================= */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

img, svg { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

a { color: var(--color-accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.78; }
main a:not(.icon-btn):not(.brand):not(.button) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-text);
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); letter-spacing: -0.02em; margin-bottom: var(--space-sm); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); letter-spacing: -0.015em; margin-bottom: var(--space-xs); }
h3 { font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem); margin-bottom: var(--space-2xs); }

p { max-width: 68ch; text-wrap: pretty; margin-bottom: var(--space-sm); }
p:last-child { margin-bottom: 0; }

.container {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--space-sm);
}

/* ─── Skip link ─────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: oklch(99% 0 0);
  font-weight: 700;
  z-index: var(--z-toast);
  border-radius: 0 0 var(--radius) 0;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ─── Focus styles (WCAG 2.2 2.4.11) ───────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
@media (forced-colors: active) {
  :focus-visible { outline: 3px solid ButtonText; }
}

/* ─── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Scroll-driven reveal (progressive enhancement) ───────────────────── */
@supports (animation-timeline: view()) {
  .reveal {
    animation: fade-in linear;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
  @keyframes fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
