main > .container {
    padding: 70px 15px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.not-set {
    color: var(--bs-danger);
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px var(--bs-body-color);
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px var(--bs-body-color);
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: var(--bs-secondary-color);
}

.error-summary {
    color: var(--bs-danger-text-emphasis);
    background: var(--bs-danger-bg-subtle);
    border-left: 3px solid var(--bs-danger-border-subtle);
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding-top: 7px;
    color: var(--bs-navbar-color);
}

@media (max-width: 767.98px) {
    .nav li > form > button.logout {
        display: block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    color: var(--bs-navbar-hover-color);
}

.nav > li > form > button.logout:focus {
    outline: none;
}

/* footer logo: light logo by default (light bg-body-tertiary), dark logo for dark theme */
.footer-logo-dark { display: none; }

[data-bs-theme="dark"] .footer-logo-light { display: none; }
[data-bs-theme="dark"] .footer-logo-dark  { display: inline-block; }

/* contact form textarea height */
.site-contact textarea.form-control {
    height: 140px;
}

/* form cards */
.site-login .card,
.site-contact .card {
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .08);
}

/* dark mode: elevate form cards against dark background */
[data-bs-theme="dark"] .site-login .card,
[data-bs-theme="dark"] .site-contact .card {
    box-shadow: 0 0 0 1px var(--bs-border-color), 0 2px 16px rgba(0, 0, 0, .3);
}

/* dark mode: invert captcha text color for visibility on dark background */
[data-bs-theme="dark"] .site-contact img[src*="captcha"] {
    filter: invert(1) hue-rotate(180deg);
}

/* centered page layout: error, about, contact success */
.site-index,
.site-error,
.site-about,
.site-contact-success {
    flex: 1;
}

.site-error .site-error-content,
.site-about .site-about-content,
.site-contact-success .site-contact-success-content {
    width: 100%;
    max-width: 90%;
}

@media (min-width: 576px) {
    .site-error .site-error-content,
    .site-about .site-about-content,
    .site-contact-success .site-contact-success-content {
        max-width: 80%;
    }
}

@media (min-width: 768px) {
    .site-error .site-error-content,
    .site-about .site-about-content,
    .site-contact-success .site-contact-success-content {
        max-width: 60%;
    }
}

@media (min-width: 992px) {
    .site-error .site-error-content,
    .site-about .site-about-content,
    .site-contact-success .site-contact-success-content {
        max-width: 50%;
    }
}

/* ===== FONAPSA theme: green navbar ===== */
.fonapsa-navbar {
    background-color: #157347 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.fonapsa-navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}
.fonapsa-navbar .navbar-nav .nav-link:hover,
.fonapsa-navbar .navbar-nav .nav-link:focus {
    color: #fff !important;
}
.fonapsa-navbar .navbar-brand {
    color: #fff !important;
    font-size: 1.25rem;
}

/* ===== Hero carousel (full-width, Seeta-style) ===== */
.fonapsa-hero {
    margin-top: -0;  /* under fixed navbar; carousel is full width */
}
.fonapsa-hero .carousel,
.fonapsa-hero .carousel-inner,
.fonapsa-hero .carousel-item {
    height: 70vh;
    min-height: 380px;
}
.fonapsa-hero .hero-slide {
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Image-based slides: background set inline in view; fallback color */
.fonapsa-hero .hero-slide-img {
    background-color: #157347;
    background-size: cover;
    background-position: center;
}
.fonapsa-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}
.fonapsa-hero .hero-caption {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    padding: 1rem 2rem;
    max-width: 800px;
}
.fonapsa-hero .hero-caption h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.fonapsa-hero .hero-caption p {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin-bottom: 0;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.fonapsa-hero .carousel-control-prev-icon,
.fonapsa-hero .carousel-control-next-icon {
    filter: none;
}

/* ===== Section titles ===== */
.section-title {
    font-weight: 700;
    color: var(--bs-dark, #212529);
}

/* ===== Mission cards ===== */
.mission-icon {
    font-size: 2rem;
    line-height: 1;
}

/* ===== Values badges ===== */
.values-list .value-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: rgba(21, 115, 71, 0.12);
    color: #157347;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
}
[data-bs-theme="dark"] .values-list .value-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #75d4a2;
}

/* ===== Footer ===== */
.fonapsa-footer {
    background: linear-gradient(180deg, #0d5c3d 0%, #0a4d32 100%);
    color: #fff;
}
.fonapsa-footer a:hover {
    color: #fff !important;
}

/* ===== About page ===== */
.about-hero {
    background: linear-gradient(135deg, #157347 0%, #0d5c3d 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.about-hero-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}
.about-hero-lead {
    font-size: 1rem;
    opacity: 0.9;
}

.site-about .card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.site-about .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}
[data-bs-theme="dark"] .site-about .card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.site-about .about-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1.5rem;
    font-size: 0.95rem;
}
.site-about .about-dl dt {
    color: var(--bs-secondary-color);
    font-weight: 500;
    margin: 0;
}
.site-about .about-dl dd {
    margin: 0;
}

.site-about .about-info-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.site-about .about-info-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.site-about .about-info-list li:first-child {
    padding-top: 0;
}
.about-info-icon {
    font-size: 1.25rem;
    line-height: 1.4;
    flex-shrink: 0;
}

.site-about a[href^="tel:"],
.site-about a[href^="mailto:"] {
    color: var(--bs-success);
}
.site-about a[href^="tel"]:hover,
.site-about a[href^="mailto:"]:hover {
    text-decoration: underline !important;
}

.about-cta {
    border-top: 1px solid var(--bs-border-color-translucent);
}

/* ===== Resources page ===== */
.resources-index {
    padding-top: 0.5rem;
}
.resources-hero {
    background: linear-gradient(135deg, #157347 0%, #0d5c3d 100%);
    color: #fff;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 4px 12px rgba(21, 115, 71, 0.2);
}
.resources-hero-title {
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #fff;
}
.resources-hero-lead {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 0;
}
.resources-filter-card {
    border-radius: 12px;
    background: var(--bs-body-bg);
}
.resources-filter-icon {
    opacity: 0.9;
}
.resources-card {
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.resources-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}
[data-bs-theme="dark"] .resources-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}
.resources-card-header {
    border: 0;
    font-weight: 600;
}
.resources-card-header-papers {
    background: linear-gradient(135deg, #157347 0%, #0d5c3d 100%);
}
.resources-card-header-notes {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    color: #1a1a1a;
}
.resources-card-header-notes h2 {
    color: #1a1a1a !important;
}
.resources-card-icon {
    font-size: 1.1em;
}
.resources-list {
    border-radius: 0;
}
.resources-list-item {
    border-color: var(--bs-border-color-translucent) !important;
    padding: 0.75rem 0;
}
.resources-list-item:first-child {
    padding-top: 0;
}
.resources-list-title {
    font-weight: 500;
    color: var(--bs-body-color);
}
.resources-empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}
@media (min-width: 768px) {
    .resources-hero {
        padding: 2rem 2rem;
    }
}
