/* ── Shared base styles ───────────────────────────
   Body, grain overlay, accent line, and reduced
   motion.  Imported by every page after tokens.css
   and before its own stylesheet.
   ──────────────────────────────────────────────── */

body {
    font-family:
        "Untitled Sans",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        sans-serif;
    font-weight: 390;
    font-size: clamp(16px, 1.1vw, 18px);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Top accent line */
body::before {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--color-gold) 0%,
        var(--color-gold-end) 100%
    );
}
[data-theme="dark"] body::before { opacity: 0.85; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body::before { opacity: 0.85; }
}

/* Subtle grain texture overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: var(--grain-opacity);
    mix-blend-mode: var(--grain-blend);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3.5' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    z-index: 9999;
}

/* Reduced motion for users who prefer it */
@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;
    }
}

/* Shared attribution styling (used on homepage source profiles and week briefing) */
.source-profile-author {
    font-family: "Financier Text", Georgia, "Times New Roman", Times, serif;
    font-weight: 380;
    font-style: italic;
    font-size: 0.94rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Accessibility: Standard utility for content that should only be available to screen readers / SEO */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
