:root {
    /* Brand colors */
    --oakseed-green: #2f7d57;
    --oakseed-dark-green: #235f42;
    --oakseed-light-green: #eaf4ee;
    --oakseed-ink: #122118;
    --oakseed-muted: #4a5c52;
    --oakseed-border: #dce7e0;

    /* Extended palette (replaces hardcoded values) */
    --oakseed-navy: #2b3a31;
    --oakseed-charcoal: #36443b;
    --oakseed-forest: #1f2f26;
    --oakseed-fog: #eff5f1;
    --oakseed-link-hover: #d6ede0;
    --oakseed-form-label: #223228;
    --oakseed-input-border: #cfddd5;
    --oakseed-surface: #f8f9fa;
    --oakseed-ui-border: #e0e4e2;

    /* Shadows */
    --oakseed-shadow-sm: 0 4px 12px rgba(18, 33, 24, 0.07);
    --oakseed-shadow: 0 12px 32px rgba(18, 33, 24, 0.08);
    --oakseed-shadow-md: 0 8px 20px rgba(18, 33, 24, 0.08);
    --oakseed-shadow-lg: 0 16px 36px rgba(18, 33, 24, 0.12);

    /* Border radii */
    --oakseed-radius-sm: 8px;
    --oakseed-radius: 14px;
    --oakseed-radius-lg: 15px;
    --oakseed-radius-pill: 20px;

    /* Spacing scale */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;

    /* Font sizes */
    --fs-xs: 0.8125rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.1rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.4rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
}

body {
    color: var(--oakseed-ink);
    background: #f7faf8;
}

a {
    color: var(--oakseed-dark-green);
}

a:hover {
    color: var(--oakseed-green);
}

.navbar {
    border-bottom: 1px solid var(--oakseed-border);
}

.navbar-brand img {
    height: 52px;
}

.navbar-nav .nav-link {
    font-weight: 600;
    margin: 0 8px;
    color: var(--oakseed-navy);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--oakseed-green);
}

.hero-section {
    background: linear-gradient(rgba(35, 95, 66, 0.62), rgba(35, 95, 66, 0.62)), url('/static/uploads/new_homepage_banner.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #ffffff;
    padding: 140px 0 120px;
    text-align: center;
    min-height: 470px;
}

.hero-section h1 {
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.hero-section p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    max-width: 760px;
    margin: 0 auto 30px;
}

.hero-section .hero-sub {
    /* Restate size explicitly — the new donor-facing subhead needs to stay readable
       below the rewritten value-prop H1 without shrinking on narrow viewports. */
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.55;
}

.hero-section .hero-scarcity {
    margin: 28px auto 0;
    font-size: 0.95rem;
    opacity: 0.92;
    letter-spacing: 0.01em;
}

.hero-section .hero-scarcity i {
    margin-right: 6px;
}

.btn-oakseed,
.btn-outline-oakseed {
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 600;
}

.btn-oakseed {
    background-color: var(--oakseed-green);
    border-color: var(--oakseed-green);
    color: #fff;
}

.btn-oakseed:hover,
.btn-oakseed:focus {
    background-color: var(--oakseed-dark-green);
    border-color: var(--oakseed-dark-green);
    color: #fff;
}

.btn-outline-oakseed {
    border-color: var(--oakseed-green);
    color: var(--oakseed-green);
    background: #fff;
}

.btn-outline-oakseed:hover,
.btn-outline-oakseed:focus {
    background-color: var(--oakseed-green);
    border-color: var(--oakseed-green);
    color: #fff;
}

.text-oakseed {
    color: var(--oakseed-green) !important;
}

.bg-oakseed-soft {
    background: var(--oakseed-light-green);
}

.stats-section {
    padding: 72px 0;
    background: #fff;
}

.stat-item {
    text-align: center;
    margin-bottom: 24px;
}

.stat-number {
    font-size: 3rem;
    line-height: 1;
    font-weight: 700;
    color: var(--oakseed-green);
    display: block;
}

.stat-label {
    font-size: 1rem;
    color: var(--oakseed-muted);
    margin-top: 10px;
}

.children-section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--oakseed-green);
    margin-bottom: 18px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--oakseed-muted);
    margin-bottom: 46px;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.child-card,
.card {
    border: 1px solid var(--oakseed-border);
    box-shadow: var(--oakseed-shadow);
    border-radius: var(--oakseed-radius);
    overflow: hidden;
}

.child-card {
    margin-bottom: 26px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.child-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(18, 33, 24, 0.12);
}

/* Whole-card link wrapper — makes the card itself the "view profile" target,
   collapsing the old dual-CTA pattern (View Profile + Sponsor) to a single
   primary Sponsor action per card. */
.child-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.child-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.child-card-link:hover .child-name-chevron {
    transform: translateX(4px);
}

.child-card-link:focus-visible {
    outline: none;
}

.child-card-link:focus-visible .child-card {
    outline: 3px solid rgba(47, 125, 87, 0.35);
    outline-offset: 3px;
}

.child-name-chevron {
    color: var(--oakseed-green);
    font-size: 0.8em;
    margin-left: 8px;
    transition: transform var(--transition-base);
}

.child-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.child-detail-chips .badge {
    padding: 6px 10px;
    font-weight: 500;
    font-size: 0.8rem;
}

.child-photo {
    width: 100%;
    height: 260px;
    object-fit: cover;
    object-position: center 30%;
}

.child-info {
    padding: 20px;
}

.child-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--oakseed-ink);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.child-details {
    color: var(--oakseed-muted);
    margin-bottom: 14px;
}

.child-description {
    color: var(--oakseed-charcoal);
    margin-bottom: 18px;
    line-height: 1.55;
}

.sponsorship-cost {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--oakseed-green);
    margin-bottom: 14px;
}

.form-container {
    max-width: 580px;
    margin: 50px auto;
    padding: 36px;
    background: #fff;
    border-radius: var(--oakseed-radius);
    box-shadow: var(--oakseed-shadow);
    border: 1px solid var(--oakseed-border);
}

.form-header {
    background-color: var(--oakseed-green);
    color: #fff;
    text-align: center;
    padding: 20px;
    margin: -36px -36px 28px -36px;
    border-radius: var(--oakseed-radius) var(--oakseed-radius) 0 0;
}

.form-header h1,
.form-header h2 {
    /* Accept both H1 (preferred, semantic) and H2 (legacy) at the same visual size. */
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.form-label {
    font-weight: 600;
    color: var(--oakseed-form-label);
}

.form-control,
.form-select {
    border: 1px solid var(--oakseed-input-border);
    border-radius: var(--oakseed-radius-sm);
    padding: 11px 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--oakseed-green);
    box-shadow: 0 0 0 0.2rem rgba(47, 125, 87, 0.18);
}

.form-check-input:checked {
    background-color: var(--oakseed-green);
    border-color: var(--oakseed-green);
}

.alert {
    border-radius: 10px;
}

.content-card {
    background: #fff;
    border: 1px solid var(--oakseed-border);
    border-radius: var(--oakseed-radius);
    box-shadow: var(--oakseed-shadow);
    padding: 24px;
}

.header-oakseed {
    background-color: var(--oakseed-green);
}

.profile-photo {
    height: 400px;
}

.avatar-sm {
    width: 30px;
    height: 30px;
    object-fit: cover;
}

.avatar-md {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
}

.avatar-lg {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.image-update {
    max-height: 250px;
    object-fit: cover;
}

.icon-2xl {
    font-size: 2rem;
}

.icon-4xl {
    font-size: 4rem;
}

.border-left-oakseed {
    border-left: 4px solid var(--oakseed-green) !important;
}

.message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-content-compact {
    max-width: 300px;
}

.is-hidden {
    display: none;
}

.inline-form {
    display: inline;
}

.progress-zero {
    width: 0%;
}

.preview-thumb {
    max-width: 200px;
    max-height: 200px;
}

.preview-image-update {
    max-height: 200px;
}

.truncated-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-oakseed {
    background: var(--oakseed-green);
    color: #fff;
}

.card-oakseed-alt {
    background: var(--oakseed-dark-green);
    color: #fff;
}

.card-oakseed-soft {
    background: var(--oakseed-light-green);
    color: var(--oakseed-ink);
}

.badge-oakseed {
    background: var(--oakseed-green);
    color: #fff;
}

.badge-oakseed-soft {
    background: var(--oakseed-light-green);
    color: var(--oakseed-dark-green);
    border: 1px solid #cfe0d6;
}

.admin-sidebar {
    background: var(--oakseed-dark-green);
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.86);
    padding: 12px 20px;
    margin: 5px 0;
    border-radius: var(--oakseed-radius-sm);
    transition: all var(--transition-base);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(5px);
}

.admin-main-content {
    background: #f7faf8;
    min-height: 100vh;
}

.admin-page-header {
    background: #fff;
    border-radius: var(--oakseed-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(18, 33, 24, 0.08);
}

.dashboard-card {
    border-radius: 15px;
    box-shadow: 0 10px 24px rgba(18, 33, 24, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(18, 33, 24, 0.16);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.85;
}

.quick-action-btn {
    border-radius: 10px;
    padding: 15px 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(18, 33, 24, 0.18);
}

.surface-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 20px rgba(18, 33, 24, 0.08);
}

.search-filter-section {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(18, 33, 24, 0.08);
}

.child-card-admin {
    border: none;
    border-radius: 15px;
    box-shadow: 0 6px 16px rgba(18, 33, 24, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.child-card-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(18, 33, 24, 0.14);
}

.child-photo-admin {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.status-badge-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-action {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    transition: transform 0.25s ease;
}

.btn-action:hover {
    transform: translateY(-1px);
}

.sponsor-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 6px 16px rgba(18, 33, 24, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sponsor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px rgba(18, 33, 24, 0.16);
}

.sponsor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sponsor-name {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--oakseed-ink);
}

.sponsor-email {
    color: var(--oakseed-muted);
    font-size: var(--fs-sm);
}

.sponsor-stats {
    background: var(--oakseed-surface);
    border-radius: var(--oakseed-radius-sm);
    padding: 15px;
    margin: 15px 0;
}

.sponsor-stat-item {
    display: inline-block;
    margin-right: 20px;
}

.sponsor-stat-value {
    font-weight: 600;
    color: var(--oakseed-dark-green);
}

.sponsorship-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 16px rgba(18, 33, 24, 0.1);
    transition: transform 0.2s ease;
}

.sponsorship-card:hover {
    transform: translateY(-2px);
}

.child-photo-sm {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

.status-chip {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
}

.assign-form {
    background: var(--oakseed-surface);
    border-radius: var(--oakseed-radius-sm);
    padding: 20px;
    margin-top: 15px;
}

.sponsor-option {
    border: 2px solid var(--oakseed-ui-border);
    border-radius: var(--oakseed-radius-sm);
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.sponsor-option:hover {
    border-color: var(--oakseed-green);
    background: #f8f9fa;
}

.sponsor-option.selected {
    border-color: var(--oakseed-green);
    background: #e9f4ee;
}

.child-photo-ministry,
.child-photo-ministry-placeholder {
    width: 50px;
    height: 50px;
}

.child-photo-ministry {
    object-fit: cover;
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.3);
}

.status-sponsored {
    color: var(--oakseed-green);
}

.status-available {
    color: #7a5a08;
}

.update-content {
    line-height: 1.6;
    font-size: 1rem;
}

.checkout-panel {
    background: #f4f8f5;
    border: 1px solid var(--oakseed-border);
    border-radius: 12px;
    padding: 20px;
}

.footer {
    background: var(--oakseed-forest);
    color: var(--oakseed-fog);
    padding: 44px 0;
    margin-top: 80px;
}

.footer a {
    color: var(--oakseed-link-hover);
    text-decoration: none;
}

.footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.focus-ring:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(47, 125, 87, 0.28);
    outline-offset: 2px;
}

@media (max-width: 992px) {
    .hero-section {
        min-height: 390px;
        padding: 110px 0 90px;
    }
}

@media (max-width: 768px) {
    .admin-page-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .card-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .card-header .text-end {
        text-align: left !important;
        margin-top: 0.5rem;
    }

    .child-card {
        margin-bottom: 20px;
    }

    .form-container {
        margin: 24px auto;
        padding: 24px;
    }

    .form-header {
        margin: -24px -24px 20px -24px;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 80px 0 60px;
        min-height: auto;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .stat-number {
        font-size: 2.25rem;
    }

    .child-photo {
        height: 220px;
    }

    .btn-oakseed,
    .btn-outline-oakseed {
        width: 100%;
        margin-bottom: 8px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .admin-page-header {
        padding: 18px;
    }

    .surface-card,
    .search-filter-section {
        padding: 16px;
    }
}

/* ── Prefers-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;
    }

    .child-card:hover,
    .dashboard-card:hover,
    .sponsor-card:hover,
    .sponsorship-card:hover,
    .child-card-admin:hover,
    .quick-action-btn:hover,
    .btn-action:hover {
        transform: none;
    }
}

/* ── Print stylesheet ───────────────────────────────────────────────────── */
@media print {
    .navbar,
    .footer,
    .btn,
    .alert,
    nav[aria-label],
    .admin-sidebar,
    form {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .card,
    .child-card,
    .content-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }
}
