:root {
    --color-brand: #0f4c81;
    --color-brand-deep: #0b2f51;
    --color-brand-soft: #d8e7f3;
    --color-accent: #c76c29;
    --color-bg: #f4f1eb;
    --color-surface: #ffffff;
    --color-surface-alt: #f8fbff;
    --color-border: rgba(11, 47, 81, 0.12);
    --color-text: #1d2a34;
    --color-muted: #61707b;
    --color-success: #156b52;
    --color-error: #b33a3a;
    --shadow-card: 0 20px 50px rgba(11, 47, 81, 0.12);
    --shadow-soft: 0 10px 30px rgba(11, 47, 81, 0.08);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --container: 1160px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #f7f4ed 0%, #f8fbff 55%, #f4f1eb 100%);
    color: var(--color-text);
    line-height: 1.6;
}

img,
video {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    margin: 0 0 1rem;
    color: var(--color-muted);
}

h1,
h2,
h3,
h4 {
    margin: 0 0 1rem;
    color: var(--color-brand-deep);
    line-height: 1.15;
}

.container {
    width: min(var(--container), calc(100% - 2rem));
    margin: 0 auto;
}

.section {
    padding: 4.5rem 0;
}

.section-tight {
    padding: 3rem 0;
}

.eyebrow {
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-accent);
}

.button,
button,
input,
textarea,
select {
    font: inherit;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.95rem 1.35rem;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.button:hover {
    transform: perspective(500px) translateZ(10px) translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12), 0 4px 6px rgba(0,0,0,0.06);
    z-index: 2;
}

.button:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.button-primary {
    background: var(--color-brand);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.72);
    color: var(--color-brand-deep);
    border: 1px solid var(--color-border);
}

.button-small {
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
}

.button-donate {
    background: #e63946;
    color: #ffffff !important;
    padding: 0.8rem 1.6rem;
    font-size: 1.05rem;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
    animation: heartPulse 2.5s infinite ease-in-out;
    border-radius: 24px;
    border: 2px solid transparent;
    will-change: transform, box-shadow;
}

.button-donate span {
    margin-right: 6px;
    font-size: 1.2rem;
    display: inline-block;
    animation: heartBeat 1s infinite alternate;
}

.button-donate:hover {
    background: #ffffff;
    color: #e63946 !important;
    border-color: #e63946;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 57, 70, 0.4);
}

@keyframes heartPulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 8px 30px rgba(230, 57, 70, 0.5); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3); }
}

@keyframes heartBeat {
    from { transform: scale(1); }
    to { transform: scale(1.3); }
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(248, 251, 255, 0.88);
    border-bottom: 1px solid rgba(11, 47, 81, 0.08);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.brand-copy strong {
    font-size: 0.98rem;
}

.brand-copy span {
    font-size: 0.83rem;
    color: var(--color-muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.site-nav a {
    color: var(--color-muted);
    font-weight: 600;
}

.site-nav a.is-active,
.site-nav a:hover {
    color: var(--color-brand-deep);
}

.nav-toggle {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: #fff;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: var(--color-brand-deep);
}

.flash-stack {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.flash {
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-soft);
    background: #fff;
    border-left: 4px solid var(--color-brand);
}

.flash-success {
    border-left-color: var(--color-success);
}

.flash-error {
    border-left-color: var(--color-error);
}

.card,
.panel,
.stats-card,
.list-card,
.feature-card,
.story-card,
.program-card,
.testimonial-card,
.empty-state,
.form-card,
.admin-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero {
    padding: 4rem 0 2rem;
}

.hero-card,
.story-feature {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    overflow: hidden;
}

.hero-media img,
.feature-media img,
.program-card > img,
.story-card > img,
.testimonial-card > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-copy,
.feature-copy,
.card-body,
.content-card {
    padding: 2rem;
}

.hero-copy h1 {
    font-size: clamp(2.2rem, 4vw, 4rem);
    margin-bottom: 1.25rem;
}

.hero-copy p {
    font-size: 1.06rem;
}

.section-alt {
    background: rgba(216, 231, 243, 0.35);
}

.section-heading {
    margin-bottom: 1.75rem;
}

.section-heading h1,
.section-heading h2 {
    max-width: 760px;
}

.with-action {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: start;
}

.program-card,
.story-card,
.list-card {
    overflow: hidden;
}

.program-card img,
.story-card img {
    min-height: 240px;
}

.text-link {
    color: var(--color-brand);
    font-weight: 700;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--color-muted);
    font-size: 0.92rem;
}

.stats-card {
    padding: 1.75rem;
    text-align: center;
}

.stats-card strong {
    display: block;
    font-size: 2.2rem;
    color: var(--color-brand-deep);
}

.stats-card span {
    color: var(--color-muted);
}

.feature-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.testimonial-slider {
    display: grid;
    gap: 1rem;
}

.slider-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.testimonial-card {
    display: none;
    grid-template-columns: 260px 1fr;
    overflow: hidden;
}

.testimonial-card.is-active {
    display: grid;
}

.testimonial-message {
    font-size: 1.1rem;
    color: var(--color-brand-deep);
}

.cta-banner {
    display: grid;
    grid-template-columns: 1.2fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-brand-deep), var(--color-brand));
    color: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-card);
}

.cta-banner h2,
.cta-banner p,
.cta-banner .eyebrow {
    color: inherit;
}

.content-card {
    padding: 2rem;
}

.map-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    background: #fff;
}

.map-card iframe {
    display: block;
    width: 100%;
    min-height: 500px;
    border: 0;
    filter: grayscale(1) contrast(1.1) brightness(1.05);
    transition: filter 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.map-card:hover iframe {
    filter: grayscale(0) contrast(1) brightness(1);
}

.article-shell {
    max-width: 900px;
}

.article-card {
    overflow: hidden;
}

.article-body {
    padding: 2.5rem;
}

.article-image {
    margin: 1.5rem 0;
}

.story-excerpt {
    font-size: 1.08rem;
    color: var(--color-brand-deep);
}

.rich-text {
    display: grid;
    gap: 1rem;
}

.site-footer {
    margin-top: 4rem;
    padding: 2.5rem 0 1rem;
    background: var(--color-brand-deep);
    color: rgba(255, 255, 255, 0.85);
}

.site-footer h2,
.site-footer h3 {
    color: #fff;
}

.site-footer h2 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.site-footer h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.2rem;
}

.site-footer p,
.site-footer a {
    color: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    text-decoration: none;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2rem;
}

.footer-links {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85rem;
}

.empty-state {
    padding: 2.5rem;
    text-align: center;
}

.empty-state-large {
    padding: 4rem 2rem;
}

.form-card,
.admin-card {
    padding: 1.5rem;
}

label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--color-brand-deep);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="url"],
input[type="file"],
textarea,
select {
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(11, 47, 81, 0.16);
    background: #fff;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.95rem;
    border-bottom: 1px solid rgba(11, 47, 81, 0.08);
    text-align: left;
    vertical-align: top;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--color-brand-soft);
    color: var(--color-brand-deep);
}

.status-pill.success {
    background: rgba(21, 107, 82, 0.12);
    color: var(--color-success);
}

.status-pill.warning {
    background: rgba(199, 108, 41, 0.14);
    color: var(--color-accent);
}

.admin-body {
    background: #eef3f8;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    padding: 1.5rem;
    background: var(--color-brand-deep);
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.brand-admin .brand-copy strong,
.brand-admin .brand-copy span {
    color: #fff;
}

.admin-nav {
    display: grid;
    gap: 0.45rem;
}

.admin-nav a {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.78);
}

.admin-nav a.is-active,
.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.admin-sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 0.8rem;
}

.admin-main {
    padding: 1.5rem;
}

.admin-section {
    margin-top: 1.5rem;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-user-chip {
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    font-weight: 700;
}

.split {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

.muted {
    color: var(--color-muted);
}

.table-wrap {
    overflow-x: auto;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.button-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--color-brand);
    font-weight: 700;
    cursor: pointer;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(11, 47, 81, 0.08);
}

.list-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.admin-login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top, rgba(15, 76, 129, 0.12), transparent 45%), var(--color-bg);
}

.admin-login-wrapper {
    width: min(460px, calc(100% - 2rem));
}

.admin-login-card {
    padding: 2rem;
}

.image-preview,
.media-preview {
    border-radius: 18px;
    overflow: hidden;
    background: var(--color-surface-alt);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(11, 76, 129, 0.12);
    color: var(--color-brand-deep);
    font-size: 0.78rem;
    font-weight: 700;
}

@media (max-width: 960px) {
    .footer-grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .split,
    .admin-shell,
    .hero-card,
    .story-feature,
    .testimonial-card,
    .cta-banner {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        min-height: auto;
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }
    .nav-toggle span {
        margin: 0;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 1rem;
        right: 1rem;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--color-border);
        border-radius: 24px;
        box-shadow: var(--shadow-card);
    }

    .site-nav.is-open {
        display: flex;
    }
}

@media (max-width: 640px) {
    .hero,
    .section {
        padding: 3rem 0;
    }

    .brand-copy strong {
        font-size: 0.9rem;
    }

    .card-body,
    .content-card,
    .hero-copy,
    .feature-copy,
    .article-body {
        padding: 1.4rem;
    }
}

.flash-fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --- 3D Hover Effects --- */
.hover-3d {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    will-change: transform;
}
.hover-3d:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    z-index: 2;
}
/* Ensure links wrapping images don't block transform */
a.hover-3d {
    display: block;
}

/* --- Scrolling Wrapper (Native Swipe Carousel) --- */
.scrolling-wrapper {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2rem;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.scroll-snap-card {
    flex: 0 0 calc(33.333% - 1.33rem);
    scroll-snap-align: start;
    min-width: 280px;
}
.scrolling-wrapper::-webkit-scrollbar {
    height: 8px;
}
.scrolling-wrapper::-webkit-scrollbar-track {
    background: var(--color-background);
    border-radius: 4px;
}
.scrolling-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}
.scrolling-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* --- Hero Image Slider --- */
.hero-slider-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 350px;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: var(--shadow-card);
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}
.hero-slide.is-active {
    opacity: 1;
    z-index: 2;
}
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-slider-controls {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10;
    display: flex;
    gap: 0.5rem;
}
.hero-slider-controls button {
    background: rgba(255, 255, 255, 0.8);
    color: var(--color-text);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: bold;
}
.hero-slider-controls button:hover {
    background: #fff;
    transform: scale(1.1);
}

@media print {
    .site-header,
    .site-footer,
    .admin-sidebar,
    .admin-topbar,
    .flash-stack,
    .button-row,
    .button,
    .actions-cell,
    form {
        display: none !important;
    }

    body, .admin-body, .admin-shell, .admin-main {
        background: transparent !important;
        color: #000 !important;
        margin: 0;
        padding: 0;
    }

    .card, .admin-card, .article-card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* --- Mobile Footer Refinements --- */
@media (max-width: 600px) {
    .site-footer {
        padding: 2.5rem 1.5rem 1rem;
        text-align: center;
    }
    .footer-grid {
        gap: 2.5rem;
    }
    .footer-links {
        justify-items: center;
    }
    .footer-bottom {
        margin-top: 2rem;
    }
}

/* --- Skeleton Loading System --- */
#page-skeleton {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: 9999;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.page-loaded #page-skeleton {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.sk-block {
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.sk-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.sk-header { height: 60px; width: 100%; margin-bottom: 1rem; }
.sk-hero { height: 400px; width: 100%; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.sk-card { height: 350px; }
.sk-title { height: 40px; width: 60%; margin-bottom: 1rem; }
.sk-text { height: 20px; width: 90%; margin-bottom: 0.5rem; }
