:root {
    --farm-dark-green: #1f4d2c;
    --farm-mid-green: #3a6b35;
    --farm-light-green: #7fa96b;
    --farm-cream: #f6f3ea;
    --farm-brown: #6b4226;
}

html {
    overflow-x: hidden;
}

body {
    background-color: var(--farm-cream);
    color: #2b2b26;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

main {
    flex: 1 0 auto;
}

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

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

/* ---- Navbar ---- */
.navbar {
    background-color: var(--farm-dark-green);
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #ffffff;
    font-weight: 600;
}

/* ---- Footer ---- */
.site-footer {
    background-color: var(--farm-dark-green);
    color: rgba(255, 255, 255, 0.8);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

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

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, var(--farm-dark-green) 0%, var(--farm-mid-green) 100%);
    color: #fff;
    padding: 4.5rem 0;
}

.hero h1 {
    font-weight: 700;
}

/* ---- Hero carousel (super-admin managed) ---- */
.hero-carousel .carousel-item {
    height: 480px;
}

.hero-slide-img {
    height: 480px;
    object-fit: cover;
}

.hero-slide-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(31, 77, 44, 0.8) 0%, rgba(58, 107, 53, 0.55) 100%);
    color: #fff;
}

.hero-slide-overlay h1 {
    font-weight: 700;
}

.hero-carousel .carousel-indicators {
    margin-bottom: 0.5rem;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 5%;
}

@media (max-width: 576px) {
    .hero-carousel .carousel-item,
    .hero-slide-img {
        height: 380px;
    }
}

/* ---- Cards ---- */
.school-card {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
}

.school-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.15);
}

.school-card .card-img-top {
    height: 170px;
    object-fit: cover;
}

.school-card .logo-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    margin-top: -32px;
    background: #fff;
}

.badge-province {
    background-color: var(--farm-light-green);
    color: #1a2e14;
}

/* ---- Profile page ---- */
.profile-cover {
    height: 280px;
    object-fit: cover;
    width: 100%;
}

.profile-logo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    margin-top: -70px;
    background: #fff;
    flex-shrink: 0;
}

.profile-heading {
    min-width: 0;
}

.profile-heading h1 {
    overflow-wrap: break-word;
}

@media (max-width: 576px) {
    .profile-cover {
        height: 160px;
    }
    .profile-logo {
        width: 80px;
        height: 80px;
        margin-top: -50px;
    }
}

/* Auto-packing card grids: cards keep a consistent width and wrap left-to-right,
   instead of Bootstrap columns leaving a half-empty row when a category has
   only one or two items. */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 232px));
    gap: 1rem;
}

.crop-card {
    border: none;
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.07);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.crop-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.13);
}

.crop-card img,
.gallery-thumb {
    height: 150px;
    object-fit: cover;
    width: 100%;
    display: block;
}

.gallery-item {
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.07);
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.13);
}

.gallery-item .gallery-thumb {
    height: 150px;
    border-radius: 0;
}

.gallery-item .gallery-caption {
    padding: 0.5rem 0.65rem;
}

.timeline-avatar {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.post-media-item {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #000;
}

.post-media-grid .col-12 .post-media-item {
    height: 360px;
}

.section-heading {
    border-left: 5px solid var(--farm-mid-green);
    padding-left: 0.75rem;
    margin-bottom: 1.25rem;
}

/* ---- Misc ---- */
.stat-box {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.06);
}

.quick-fact {
    background: var(--farm-cream);
    border-radius: 0.5rem;
    padding: 0.75rem 0.5rem;
}
