/* ==========================================================================
   GPPF Design Refresh
   Inspired by 2025 Annual Report

   Color palette:
   - Navy:       #0B1E3F (deep, from annual report dark sections)
   - Red accent:  #C41230 (from annual report rules and highlights)
   - Cream:       #F1F1E6 (existing ACF light background — keep)
   - Body text:   #222222 (existing — keep)
   - White:       #FFFFFF

   Fonts:
   - Body/UI: Source Sans 3
   - Headings: Merriweather
   ========================================================================== */

/* ==========================================================================
   1. CSS Variable Overrides
   Only override colors that differ from the annual report design.
   These take precedence over the ACF-generated :root variables.
   ========================================================================== */

:root {
    --primary-color: #0B1E3F;
    --navigation-color: #0B1E3F;
    --body-link-color: #0B1E3F;
    --body-accent-color: #C41230;
    --dark-background: #0B1E3F;
    --light-buttons-background: #0B1E3F;
    --footer-background: #0B1E3F;
    --footer-social-link: #ffffff;
    --footer-link-color: #ffffff;
}

/* ==========================================================================
   2. Header
   ========================================================================== */

/* Red accent rule under header — signature annual report motif */
.header.navbar {
    border-bottom: 3px solid #C41230;
}

/* Consistent uppercase nav */
#nav-main .nav.navbar-nav > li > a {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.975rem;
}

/* Nav hover: red underline */
#nav-main .nav.navbar-nav > li > a:hover {
    color: #C41230;
}

/* Aux nav (Donate + Search area) */
#nav-aux .nav.navbar-nav > li > a {
    font-size: 0.85rem;
}

/* ==========================================================================
   3. Typography
   Font pairing: Merriweather (headings) + Source Sans 3 (body/UI)
   Scale ratio: ~1.333 (perfect fourth)
   Sizes: 0.75rem (caption) → 0.875rem (small) → 1rem (body) →
          1.333rem (h4) → 1.5rem (h3) → 2rem (h2) → 2.5rem (h1)
   ========================================================================== */

/* Body font override — Source Sans 3 replaces Lora */
body,
.article-body,
.article-content,
.entry-content,
p {
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.125rem;
    line-height: 1.65;
}

/* Headings — Merriweather */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Merriweather', Georgia, serif;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #0B1E3F;
    font-weight: 700;
}

/* Type scale + vertical rhythm */
h1, .h1 { font-size: 2.5rem; line-height: 1.1; margin-bottom: 1.5rem; }
h2, .h2 { font-size: 2rem; margin-bottom: 1.25rem; }
h3, .h3 { font-size: 1.5rem; margin-bottom: 1rem; }
h4, .h4 { font-size: 1.333rem; margin-bottom: 0.75rem; }
h5, .h5 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
h6, .h6 { font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; }

/* Article titles */
.post-header h1,
.single .entry-content h1:first-child {
    font-size: 2.5rem;
    line-height: 1.1;
}

/* Section headings within single articles only */
.single .entry-content h2,
.single .article-content h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0ddd5;
}

.single .entry-content h3,
.single .article-content h3 {
    font-size: 1.333rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

/* Nav and UI text — Source Sans */
#nav-main, #nav-aux,
.searchform,
.byline,
address,
.footer-links,
.final-bar {
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Article body — constrain line length (single posts only, not homepage) */
.single .article-body,
.single .article-content {
    max-width: 70ch;
}

/* Category/type labels — red uppercase, annual report style */
/* Scope to direct sibling before h3 to avoid hitting bylines */
span.text-light-text:first-child,
.post-type-page .entry-content p.has-small-font-size,
.news-type-label,
.post-type-label {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    text-transform: uppercase;
    font-size: 0.875rem !important;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #C41230 !important;
}

/* Byline should NOT be red */
.byline .text-light-text,
.text-sm.text-light-text {
    color: inherit !important;
    text-transform: none;
    font-size: inherit !important;
    font-weight: inherit;
    letter-spacing: normal;
}

/* ==========================================================================
   4. Links & Buttons
   ========================================================================== */

/* Body links */
a {
    color: #0B1E3F;
    transition: color 0.15s ease;
}

a:hover {
    color: #C41230;
}

/* Buttons — navy base, red hover (action buttons only) */
.more-related-button,
a.button,
.gform_button,
input[type="submit"] {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    background-color: #0B1E3F !important;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.more-related-button:hover,
a.button:hover,
.gform_button:hover,
input[type="submit"]:hover {
    background-color: #C41230 !important;
    color: #fff !important;
    text-decoration: none;
}

/* WP Block Buttons used as section headings on homepage */
.home .wp-block-buttons {
    justify-content: flex-start !important;
    margin-top: 3.5rem;
    margin-bottom: 0.75rem;
}

.home .wp-block-button__link.has-light-background-background-color {
    background: none !important;
    color: #0B1E3F !important;
    padding: 0 0 0.4rem 0;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 0;
    border-bottom: 3px solid #C41230;
    display: inline-block;
}

.home .wp-block-button__link.has-light-background-background-color:hover {
    background: none !important;
    color: #C41230 !important;
}

/* Actual action buttons in WP blocks (not section headings) */
.wp-block-button__link:not(.has-light-background-background-color) {
    background-color: #0B1E3F !important;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.wp-block-button__link:not(.has-light-background-background-color):hover {
    background-color: #C41230 !important;
    color: #fff !important;
    text-decoration: none;
}

/* ==========================================================================
   4b. Homepage Hero — Stronger visual weight
   ========================================================================== */

/* Pull hero content flush to container edge by offsetting the flex gap on the left */
.featured-content-1 > article:first-child {
    margin-left: -3rem;
}

/* Ensure hero image fills its share */
.featured-content-1 > article:first-child > img {
    max-width: 45% !important;
    flex-shrink: 0;
}

.featured-content-1 > article:first-child h3 {
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 700;
}

.featured-content-1 {
    padding-bottom: 1rem;
    margin-bottom: 0;
}

/* ==========================================================================
   5. Horizontal Rules — Red accent (annual report motif)
   ========================================================================== */

/* Red accent HR — only on single posts, not archives or filterable pages */
.single .entry-content hr,
.single .article-content hr {
    border: none;
    border-top: 3px solid #C41230;
    width: 60px;
    margin: 2rem 0;
}

/* ==========================================================================
   6. Blockquotes
   ========================================================================== */

blockquote,
.wp-block-quote {
    border-left: 4px solid #C41230;
    padding-left: 1.5rem;
    margin-left: 0;
    font-style: italic;
    color: #444;
}

/* ==========================================================================
   7. Images
   ========================================================================== */

.featured-image,
.wp-post-image,
.attachment-large {
    border-radius: 4px;
}

/* Remove Bootstrap thumbnail border for cleaner look */
.img-thumbnail {
    border: none !important;
    padding: 0 !important;
    background: none !important;
}

/* ==========================================================================
   8. Cards & Content Blocks
   ========================================================================== */

.wp-block-group.has-background {
    border-radius: 6px;
    overflow: hidden;
}

/* Subtle hover on homepage post blocks */
.home .post-block,
.home .wp-block-post {
    transition: box-shadow 0.2s ease;
}

.home .post-block:hover,
.home .wp-block-post:hover {
    box-shadow: 0 4px 20px rgba(11, 30, 63, 0.08);
}

/* ==========================================================================
   9. Signup Block
   White background wrapper creates the illusion of overlap without any
   transforms or negative margins. The footer starts with a white band
   containing the signup, then transitions to navy for the main footer.
   ========================================================================== */

.signup-block {
    border-radius: 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: -7rem !important;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    border-top: 4px solid #C41230;
}

/* Sidebar signup: reset footer overlap styles */
.friday-facts-sidebar .signup-block {
    max-width: none;
    margin-bottom: 1.5rem !important;
    position: static;
    z-index: auto;
    box-shadow: none;
    background: var(--light-background);
    border-top: 4px solid #C41230;
}

/* Take Action petition boxes — match signup block style */
.wp-block-column.has-dark-background-border-color {
    background: var(--light-background) !important;
    border: none !important;
    border-top: 4px solid #C41230 !important;
    padding: 2rem !important;
}

.wp-block-column.has-dark-background-border-color .wp-block-buttons {
    margin-top: 1.5rem;
}

.wp-block-column.has-dark-background-border-color .wp-block-button__link {
    background-color: #C41230 !important;
    color: #fff !important;
    border-radius: 0 !important;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.wp-block-column.has-dark-background-border-color .wp-block-button__link:hover {
    background-color: #0B1E3F !important;
}

.signup-block .form-wrapper h2,
.signup-block .form-wrapper .h3 {
    font-weight: 700;
    font-size: 2rem !important;
}

.signup-block .gform_button {
    background: #C41230 !important;
    color: #fff !important;
}

.signup-block .gform_button:hover {
    background: #0B1E3F !important;
}

/* ==========================================================================
   10. Footer
   ========================================================================== */

#footer {
    background-color: #0B1E3F;
    color: #ffffff;
    padding-top: 8rem;
    margin-top: 0 !important;
}

#footer a {
    color: #ffffff;
}

#footer a:hover {
    color: #C41230;
    text-decoration: none;
}

#footer .container {
    padding-top: 2.5rem;
    padding-bottom: 1.5rem;
}

/* Footer address */
#footer address {
    margin-top: 1rem;
    line-height: 1.8;
}

/* Footer nav lists */
#footer .main-nav ul {
    list-style: none;
    padding: 0;
}

#footer .main-nav ul li {
    margin-bottom: 0.5rem;
}

#footer .main-nav ul li a {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Social icons in footer — circular with consistent sizing */
.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transition: background-color 0.2s ease;
}

.footer-social-link:hover {
    background-color: #C41230;
    color: #ffffff !important;
}

/* Footer bottom bar */
#footer .footer-links {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 1.5rem;
    padding-top: 1rem;
}

#footer .final-bar {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

/* ==========================================================================
   11. Related Content / Recent News
   ========================================================================== */

.related-content a,
.recent-news a {
    text-decoration: none;
    color: #0B1E3F;
    font-weight: 500;
}

.related-content a:hover,
.recent-news a:hover {
    color: #C41230;
}

/* Section heading with red underline */
.related-content > h3:first-child,
h3.recent-news-title,
.sidebar h3 {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
    border-bottom: 2px solid #C41230;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   12. Form Inputs
   ========================================================================== */

.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper textarea,
.searchform input[type="text"] {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.6rem 0.75rem;
    transition: border-color 0.2s ease;
}

.gform_wrapper input[type="text"]:focus,
.gform_wrapper input[type="email"]:focus,
.gform_wrapper textarea:focus,
.searchform input[type="text"]:focus {
    border-color: #0B1E3F;
    outline: none;
    box-shadow: 0 0 0 2px rgba(11, 30, 63, 0.1);
}

/* ==========================================================================
   13. Bylines & Meta
   ========================================================================== */

.byline,
.byline-person .author-name {
    font-size: 0.975rem;
    color: #555;
}

.post-header .date,
.article-date {
    font-size: 0.925rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   14. Homepage Section Spacing — Rhythm
   Tight within sections, generous between.
   ========================================================================== */

.home .entry-content > * + * {
    margin-top: 1.5rem;
}

/* Section labels — consistent spacing with border separator */
.home .wp-block-buttons.is-content-justification-center {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e0ddd5;
}

/* First section label after hero — no top border */
.home .featured-content-1 + .wp-block-buttons {
    border-top: none;
    padding-top: 0;
}

/* Tighten featured-content hero gap */
.home .featured-content-1 {
    margin-top: 2.5rem !important;
}

/* Featured publication cards — tighter margins and padding */
.featured-publication-1 {
    margin-top: 2.5rem !important;
    margin-bottom: 2.5rem !important;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Warm cream for alternating sections */
.home .wp-block-group.has-pale-cyan-blue-background-color,
.home .wp-block-group.has-light-gray-background-color {
    background-color: #F1F1E6 !important;
}

/* ==========================================================================
   15. Focus Indicators (Accessibility)
   ========================================================================== */

:focus-visible {
    outline: 2px solid #C41230;
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.wp-block-button__link:focus-visible {
    outline: 2px solid #C41230;
    outline-offset: 2px;
}

/* ==========================================================================
   16. Article Card Hover States
   ========================================================================== */

.home .wp-block-post,
.home .wp-block-group .wp-block-columns .wp-block-column {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home .wp-block-group .wp-block-columns .wp-block-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(11, 30, 63, 0.08);
}

/* ==========================================================================
   17. Header Block Image — Annual Report style
   ========================================================================== */

.header-block-image {
    background-image: none !important;
    background-color: transparent !important;
    width: auto !important;
    position: static !important;
    left: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
    padding: 0 !important;
    margin-top: 2rem !important;
    margin-bottom: 2.5rem !important;
    border: none !important;
}

.header-block-image h1 {
    font-family: 'Merriweather', Georgia, serif !important;
    color: #C41230 !important;
    text-transform: none !important;
    text-align: left !important;
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    border-left: 5px solid #C41230;
    padding-left: 1.5rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

/* ==========================================================================
   18. Article List — remove separator above first item
   ========================================================================== */

.result-row:first-child hr {
    display: none;
}

.result-row:first-child {
    margin-top: 2rem;
}

/* Tighten spacing between article list items */
.result-row hr {
    margin: 2rem 0 !important;
}

/* Article list title and date spacing */
.news-item h2 {
    margin-bottom: 0.5rem !important;
}

.news-item .date {
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   19. Mobile Responsive Adaptations
   ========================================================================== */

@media (max-width: 767px) {
    /* Social icons — increase touch target */
    .footer-social-link {
        width: 40px;
        height: 40px;
    }

    /* Footer nav links — larger tap targets */
    #footer .main-nav ul li a {
        display: block;
        padding: 0.5rem 0;
    }

    /* Hero image — fill width on mobile */
    .featured-content-1 > article:first-child > img {
        max-width: 100% !important;
    }

    /* Remove hero negative margin on mobile */
    .featured-content-1 > article:first-child {
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   20. 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;
    }
}
