/**
 * Non-Profit CMS — Custom Styles
 *
 * Brand colors are driven by CSS custom properties set in the <head> by PHP
 * based on the settings stored in cms_settings. Changing colors in
 * Admin → Settings → Branding updates these variables automatically.
 *
 * --color-primary-rgb     : primary color as R G B channel values
 * --color-primary-light-rgb
 * --color-primary-dark-rgb
 * --color-secondary-rgb   : accent color as R G B channel values
 * --color-secondary-light-rgb
 * --color-secondary-dark-rgb
 *
 * Default values (overridden by the PHP <style> block):
 *   primary  = #1e3a5f  (navy)
 *   secondary = #f5a623 (gold)
 */

/* ===========================================
   BASE
   =========================================== */

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* ===========================================
   NAVIGATION
   =========================================== */

.nav-link {
    color: #4b5563;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
    color: rgb(var(--color-primary-rgb));
}

.nav-link-active {
    color: rgb(var(--color-primary-rgb));
    border-bottom-color: rgb(var(--color-secondary-rgb));
}

/* ===========================================
   BUTTONS
   =========================================== */

.btn-primary {
    display: inline-block;
    background-color: rgb(var(--color-secondary-rgb));
    color: rgb(var(--color-primary-rgb));
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background-color: rgb(var(--color-secondary-dark-rgb));
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    display: inline-block;
    background-color: rgb(var(--color-primary-rgb));
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-secondary:hover {
    background-color: rgb(var(--color-primary-light-rgb));
}

.btn-secondary:active { transform: scale(0.98); }

.btn-outline {
    display: inline-block;
    background-color: transparent;
    color: rgb(var(--color-primary-rgb));
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid rgb(var(--color-primary-rgb));
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-outline:hover {
    background-color: rgb(var(--color-primary-rgb));
    color: white;
}

/* ===========================================
   FORMS
   =========================================== */

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: rgb(var(--color-primary-rgb));
    box-shadow: 0 0 0 3px rgb(var(--color-primary-rgb) / 0.1);
}

.form-input::placeholder { color: #9ca3af; }

.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-label-required::after { content: " *"; color: #dc2626; }
.form-error  { color: #dc2626;  font-size: 0.875rem; margin-top: 0.25rem; }
.form-help   { color: #6b7280;  font-size: 0.875rem; margin-top: 0.25rem; }

/* ===========================================
   CARDS
   =========================================== */

.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

.card-bordered {
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

/* ===========================================
   SECTIONS
   =========================================== */

.section     { padding: 4rem 0; }
.section-alt { background-color: #f9fafb; }

.section-navy {
    background-color: rgb(var(--color-primary-rgb));
    color: white;
}

/* ===========================================
   TYPOGRAPHY
   =========================================== */

.heading-1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: rgb(var(--color-primary-rgb));
}

.heading-2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: rgb(var(--color-primary-rgb));
}

.heading-3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: rgb(var(--color-primary-rgb));
}

.text-lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #4b5563;
}

/* ===========================================
   UTILITIES
   =========================================== */

.underline-gold {
    position: relative;
    display: inline-block;
}

.underline-gold::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: rgb(var(--color-secondary-rgb));
}

.divider-compass {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.divider-compass::before,
.divider-compass::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #e5e7eb;
}

.divider-compass img {
    margin: 0 1rem;
    height: 2rem;
    width: auto;
    opacity: 0.5;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 640px) {
    .heading-1 { font-size: 2rem; }
    .heading-2 { font-size: 1.5rem; }
    .section   { padding: 2.5rem 0; }
}
