/**
 * ============================================================================
 * GLOBAL STYLES — Base reset, typography, and utility classes
 * ============================================================================
 *
 * This file establishes the visual foundation of the entire website.
 * Every element inherits from these base styles.
 *
 * SECTIONS:
 * 1. CSS Reset (normalize browser defaults)
 * 2. Base Typography (body, headings, paragraphs, links)
 * 3. Utility Classes (reusable layout helpers)
 * 4. Container (content width wrapper)
 * 5. Buttons (primary, secondary, outline styles)
 * 6. Accessibility (focus styles, screen reader text)
 *
 * @package Oraculi
 * @since   1.0.0
 * ============================================================================
 */


/* =================================================================
   1. CSS RESET
   =================================================================
   Normalize browser defaults so we start from a consistent baseline.
   GeneratePress already provides a reset, but we add specifics
   for our design needs.
*/

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

html {
    scroll-behavior: smooth;    /* Smooth scrolling for anchor links */
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--color-black);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Remove default list styles — we'll add them back where needed */
ul, ol {
    list-style: none;
}

/* Remove default link underlines — styled individually */
a {
    text-decoration: none;
    color: var(--color-link);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-link-hover);
}


/* =================================================================
   2. BASE TYPOGRAPHY
   =================================================================
   Headings use Poppins (bold, modern).
   Body text uses Inter (clean, readable).
*/

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-dark-red);
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
    font-size: var(--text-base);
    margin-bottom: var(--space-md);
    line-height: var(--leading-normal);
}

/*
 * Editor content lock.
 * Text typed in the WordPress editor (Gutenberg) can carry its own font
 * sizes (size presets or custom px values). Inside .entry-content we force
 * everything back to the standard scale so pages stay uniform.
 * Theme components (cards, hero, footer) are NOT affected — they keep
 * their own designed sizes.
 */
.entry-content p,
.entry-content li,
.entry-content td,
.entry-content th { font-size: var(--text-base) !important; line-height: var(--leading-normal) !important; }
.entry-content h1 { font-size: var(--text-4xl) !important; }
.entry-content h2 { font-size: var(--text-3xl) !important; }
.entry-content h3 { font-size: var(--text-2xl) !important; }
.entry-content h4 { font-size: var(--text-xl) !important; }
.entry-content h5 { font-size: var(--text-lg) !important; }
.entry-content h6 { font-size: var(--text-md) !important; }
.entry-content blockquote p { font-size: var(--text-lg) !important; }
.entry-content figcaption { font-size: var(--text-sm) !important; }

/*
 * Emphasis is still allowed: when an editor picks a size preset
 * (Small / Medium / Large / X-Large / XX-Large) or uses a Pull Quote,
 * the text gets bigger — but snaps to our standard scale.
 */
.entry-content .has-small-font-size    { font-size: var(--text-sm)  !important; }
.entry-content .has-medium-font-size   { font-size: var(--text-md)  !important; }
.entry-content .has-large-font-size    { font-size: var(--text-lg)  !important; }
.entry-content .has-x-large-font-size  { font-size: var(--text-xl)  !important; }
.entry-content .has-xx-large-font-size { font-size: var(--text-2xl) !important; }
.entry-content .wp-block-pullquote p   { font-size: var(--text-xl)  !important; }

/* Lead paragraph — larger text for opening paragraphs */
.lead {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--color-dark-gray);
}

/* Section label — small uppercase text above headings */
.section-label {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--color-burnt-orange);
    margin-bottom: var(--space-sm);
    display: block;
}

/* Section heading — main heading for page sections */
.section-heading {
    font-size: var(--text-3xl);
    color: var(--color-dark-red);
    margin-bottom: var(--space-md);
}

/* Section description — supporting text below section headings */
.section-description {
    font-size: var(--text-md);
    color: var(--color-dark-gray);
    max-width: 700px;
    line-height: var(--leading-relaxed);
}

/* Center the section header group */
.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header .section-description {
    margin-left: auto;
    margin-right: auto;
}

/* Blockquotes — styled for founder quotes */
blockquote {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-style: italic;
    font-weight: var(--weight-medium);
    color: var(--color-maroon);
    border-left: 4px solid var(--color-burnt-orange);
    padding: var(--space-lg) var(--space-xl);
    margin: var(--space-xl) 0;
    background-color: var(--color-cream);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}


/* =================================================================
   3. UTILITY CLASSES
   =================================================================
   Small, single-purpose classes for common layout patterns.
   Usage: <div class="text-center"> or <span class="sr-only">
*/

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Font weights */
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

/* Color utilities */
.text-maroon  { color: var(--color-maroon); }
.text-orange  { color: var(--color-burnt-orange); }
.text-white   { color: var(--color-white); }
.text-gray    { color: var(--color-medium-gray); }

/* Background utilities */
.bg-cream     { background-color: var(--color-cream); }
.bg-white     { background-color: var(--color-white); }
.bg-dark      { background-color: var(--color-charcoal); }
.bg-maroon    { background-color: var(--color-maroon); }

/* Spacing utilities */
.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }


/* =================================================================
   4. CONTAINER
   =================================================================
   The main content wrapper. Centers content and sets max-width.
   All page sections should wrap their content in a .container.
*/

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

/* Section wrapper — adds vertical padding between major page sections */
.section {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
}

/* Alternate section background (cream) for visual rhythm */
.section--alt {
    background-color: var(--color-cream);
}

/* Dark section (for CTAs, get involved) */
.section--dark {
    background-color: var(--color-charcoal);
    color: var(--color-white);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
    color: var(--color-white);
}

.section--dark .section-label {
    color: var(--color-burnt-orange);
}


/* =================================================================
   5. BUTTONS
   =================================================================
   Three button styles: primary (filled), secondary (outline), text.
   All buttons share the same base sizing and transitions.
*/

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    padding: 0.875rem 2rem;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1;
}

/* Primary button — burnt orange background (main CTA) */
.btn--primary {
    background-color: var(--color-burnt-orange);
    color: var(--color-white);
    border-color: var(--color-burnt-orange);
}

.btn--primary:hover {
    background-color: #C24E0D;    /* Slightly darker on hover */
    border-color: #C24E0D;
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Secondary button — maroon background */
.btn--secondary {
    background-color: var(--color-maroon);
    color: var(--color-white);
    border-color: var(--color-maroon);
}

.btn--secondary:hover {
    background-color: #4E0A0A;
    border-color: #4E0A0A;
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Outline button — transparent with border */
.btn--outline {
    background-color: transparent;
    color: var(--color-dark-red);
    border-color: var(--color-dark-red);
}

.btn--outline:hover {
    background-color: var(--color-dark-red);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* White outline — for use on dark backgrounds */
.btn--outline-white {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn--outline-white:hover {
    background-color: var(--color-white);
    color: var(--color-dark-red);
    transform: translateY(-2px);
}

/* Donate button — special prominent styling for the header */
.btn--donate {
    background-color: var(--color-burnt-orange);
    color: var(--color-white);
    border-color: var(--color-burnt-orange);
    font-size: var(--text-xs);
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-sm);
}

.btn--donate:hover {
    background-color: #C24E0D;
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Button group — horizontal arrangement of buttons */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
}


/* =================================================================
   6. ACCESSIBILITY
   =================================================================
   Styles that improve accessibility for all users.
*/

/* Screen reader only text — hidden visually but readable by assistive tech */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles — visible outline for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip to content link — appears on Tab for keyboard users */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-dark-red);
    color: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    z-index: var(--z-toast);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: var(--weight-semibold);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
    color: var(--color-white);
}


/* =================================================================
   7. SCROLL ANIMATION CLASSES
   =================================================================
   Elements with these classes start invisible and animate in
   when they scroll into view (triggered by animations.js).
*/

/* Starting state — invisible, slightly offset */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-smooth),
                transform var(--transition-smooth);
}

/* Animated state — visible, in position */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide from left */
.animate-slide-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity var(--transition-smooth),
                transform var(--transition-smooth);
}

.animate-slide-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from right */
.animate-slide-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity var(--transition-smooth),
                transform var(--transition-smooth);
}

.animate-slide-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up */
.animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity var(--transition-smooth),
                transform var(--transition-smooth);
}

.animate-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered animation delay for grid items */
.animate-delay-1 { transition-delay: 100ms; }
.animate-delay-2 { transition-delay: 200ms; }
.animate-delay-3 { transition-delay: 300ms; }
.animate-delay-4 { transition-delay: 400ms; }
