/*
 * OFRA brand styles — single source of truth.
 *
 * Brand tokens mirror report_reformat/OFRA_reformat.py so the web presence
 * matches the official letterhead. Edit the :root variables to retheme the
 * whole site; semantic classes below reference only variables, never raw hex.
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display+SC:wght@700&family=Montserrat:wght@500;600;700&display=swap');

:root {
    /* ---- Brand colors ---- */
    --ofra-navy: #142147;          /* OFRA_reformat HEADER_RGB */
    --ofra-navy-hover: #1d2d5f;
    --ofra-red: #BB001A;           /* OFRA_reformat BUDGET_WINDOW_RGB */
    --ofra-gray: #ADADAD;          /* OFRA_reformat FOOTER_GRAY */

    /* ---- Neutrals / surface ---- */
    --ofra-bg: #f7f7f5;
    --ofra-surface: #ffffff;
    --ofra-paper: #eeeae0;          /* warm cream — document-paper feel for cards */
    --ofra-border: #dedacf;         /* softer, matches paper */
    --ofra-text: #1e253a;
    --ofra-text-muted: #6b7280;

    /* ---- Fonts ---- */
    --font-display: 'Playfair Display SC', Georgia, serif;
    --font-ui: 'Montserrat', system-ui, -apple-system, Segoe UI, sans-serif;
    --font-body: 'Times New Roman', 'Liberation Serif', Georgia, serif;

    /* ---- Rhythm ---- */
    --radius-sm: 2px;
    --radius-md: 4px;
    --shadow-card: 0 1px 2px rgba(20, 33, 71, 0.05);
}

body {
    background: var(--ofra-bg);
    color: var(--ofra-text);
    font-family: var(--font-body);
}

/* ============================================================
   Structural chrome
   ============================================================ */

.ofra-header {
    background: var(--ofra-surface);
    border-bottom: 3px solid var(--ofra-navy);
}

/* ============================================================
   Logo shine (feature-flagged via FEATURES.LOGO_SHINE)
   A single diagonal sheen sweeps across the logo once on page
   load, masked to the logo's opaque pixels. No loop.
   ============================================================ */

.ofra-logo-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.ofra-logo-wrap--shine::before {
    content: "";
    position: absolute;
    inset: 0;
    /* Radial blob, not a linear band — reads as a point-source highlight. */
    background-image: radial-gradient(
        ellipse 60% 110% at center,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.18) 35%,
        transparent 70%
    );
    background-repeat: no-repeat;
    background-size: 55% 120%;                   /* highlight spans ~half the logo width */
    background-position: -30% 0;                 /* starts offscreen-left */
    opacity: 0;
    -webkit-mask-image: url("../img/ofra-logo.png");
            mask-image: url("../img/ofra-logo.png");
    -webkit-mask-size: contain;
            mask-size: contain;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: left center;
            mask-position: left center;
    /* Two animations with different curves: position is constant (moving
       light source), brightness rises and falls on a bell curve
       (reflection intensity). Together: a highlight that swells as light
       passes perpendicular, fades as it moves away. */
    animation:
        ofra-logo-shine-pos 1.8s linear 0.6s 1 forwards,
        ofra-logo-shine-fade 1.8s ease-in-out 0.6s 1 forwards;
    pointer-events: none;
}

@keyframes ofra-logo-shine-pos {
    0%   { background-position: -30% 0; }
    100% { background-position: 130% 0; }
}

@keyframes ofra-logo-shine-fade {
    0%   { opacity: 0; }
    50%  { opacity: 1; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ofra-logo-wrap--shine::before {
        animation: none;
        opacity: 0;
    }
}

.ofra-footer {
    border-top: 1px solid var(--ofra-border);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--ofra-gray);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ofra-footer__flag {
    /* Brand red is too dark next to footer gray text; opacity lifts it to
       the same visual weight while keeping the red hue identifiable. */
    color: var(--ofra-red);
    opacity: 0.55;
    margin-left: 0.4em;
    font-size: 0.95em;
    vertical-align: -0.05em;
}

/* ============================================================
   Typography — page-level
   ============================================================ */

.ofra-title {
    font-family: var(--font-display);
    color: var(--ofra-navy);
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 2.5rem;
    line-height: 1.15;
    margin: 0;
}

/* Small blue square after the title — editorial-mark flourish
   replacing the old horizontal accent bar. Royal blue (not brand
   navy) so it visibly contrasts against the navy title text. */
.ofra-title::after {
    content: "";
    display: inline-block;
    width: 0.45em;
    height: 0.45em;
    background: #2c5bc0;
    margin-left: 0.3em;
    vertical-align: 0.18em;
}

/* Sub-heading below the title — same display serif family, smaller
   size, sits between the main title and individual card titles in
   the hierarchy. Playfair Display SC renders it as small-caps. */
.ofra-kicker {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--ofra-navy);
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0.75rem 0 0;
}

/* Retained for possible reuse elsewhere; currently unused on the list page. */
.ofra-eyebrow {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--ofra-navy);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ofra-body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ofra-text);
}

.ofra-meta {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--ofra-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
}

/* ============================================================
   Publication list cards
   ============================================================ */

.ofra-card {
    background: var(--ofra-paper);
    border: 1px solid var(--ofra-border);
    border-left: 4px solid var(--ofra-navy);
    border-radius: var(--radius-sm);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.15s ease, border-left-color 0.15s ease;
}

.ofra-card:hover {
    box-shadow: 0 4px 14px rgba(20, 33, 71, 0.08);
    border-left-color: var(--ofra-red);
}

.ofra-card__title {
    font-family: var(--font-display);
    color: var(--ofra-navy);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.ofra-card__description {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ofra-text);
    margin: 0.5rem 0 1rem;
}

.ofra-card__meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

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

.ofra-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.15s ease;
    border: 1px solid transparent;
}

.ofra-btn--primary {
    background: var(--ofra-navy);
    color: #ffffff;
}

.ofra-btn--primary:hover {
    background: var(--ofra-navy-hover);
}
