:root {
    --primary-orange: #926a1c;
    --secondary-red: #201919;
    --secondary-brown: #5c3317;
    --cream: #f0e6d2;
    --text-color: #333;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

/* ===== General Page Styling ===== */
body {
    font-family: Arial, sans-serif;
    background-image: url("/media/images/back.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-color);
}

/* ===== Header & Navigation ===== */
header {
    background-color: var(--primary-orange);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}

nav a:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
footer {
    background-color: var(--secondary-brown);
    color: #fff;
    text-align: center;
    padding: 10px 0;
    margin-top: 30px;
}

/* ===== Section Styling ===== */
.section {
    background-color: var(--secondary-red);
    color: #fff;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

/* ===== Card Overlay Styling ===== */
.section-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 22rem;
    background-size: cover;
    background-position: center;
    color: #fff;
    overflow: hidden;
    border: none;
    border-radius: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.section-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.overlay-text {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    padding: 1rem;
    text-align: center;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.overlay-text h5 {
    margin: 0;
    font-weight: bold;
    font-size: 1.25rem;
}

.overlay-text p {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: #f2f2f2;
}

/* ===== Featured Article Styling ===== */
.featured-article {
    position: relative;
    color: #fff;
    border-radius: 1rem;
    overflow: hidden;
    background-color: transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.featured-article .card-title {
    display: inline-block;
    background: rgba(0, 0, 0, 0.55);
    padding: 0.25rem 0.75rem;
    font-weight: bold;
    font-size: 1.5rem;
    text-align: center;
    margin: 0.5rem auto 0;
    border-radius: 0.5rem;
    color: #fff;
    position: relative;
    z-index: 2;
}

.featured-article img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.featured-article .card-footer,
.featured-article small {
    display: inline-block;
    background: rgba(0, 0, 0, 0.55);
    padding: 0.15rem 0.5rem;
    margin: 0.25rem auto;
    border-radius: 0.25rem;
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 2;
}

/* ===== Featured Article Wrapper (Red Border) ===== */
.featured-article-wrapper {
    background-color: var(--secondary-red);
    padding: 0.5rem;
    border-radius: 1rem;
    display: inline-block;
}

/* ===== Homepage Layout Fixes ===== */
.home-mobile-order {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.troubadour-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.featured-article-block {
    display: flex;
    justify-content: center;
    align-items: center;
}

.rangers-ephraim-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Align cards inside columns */
.troubadour-block > .card,
.rangers-ephraim-block > .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Hero image slightly larger */
.hero-img {
    width: 9rem;
    height: auto;
    max-width: none;
}

/* ===== Full Article Detail ===== */
.article-detail {
    background-color: #fff;
    color: var(--text-color);
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
}

/* ===== Headings & Text ===== */
h2 {
    color: #b36b00;
    margin-bottom: 10px;
}

h3 {
    color: var(--cream);
    margin-bottom: 5px;
}

p, small {
    margin-bottom: 10px;
}

.author-icon img {
    width: 220px;
    height: auto;
    border-radius: 0;
    display: block;
    margin: 0 auto;
}

/* ===== Image Behavior in Articles ===== */
.article-detail img,
.section img {
    width: 100% !important;
    max-width: 700px;
    height: auto !important;
    max-height: 500px;
    object-fit: contain;
    display: block;
    margin: 1.5rem auto;
    border-radius: 6px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    header h1 {
        font-size: 1.5rem;
    }

    nav a {
        margin-left: 10px;
        font-size: 0.95rem;
    }

    .section-card {
        height: 18rem;
    }

    .overlay-text h5 {
        font-size: 1.1rem;
    }
}

/* ===== Mobile View ===== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    header h1 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
    }

    nav a {
        margin: 5px 10px 0 0;
        font-size: 0.9rem;
    }

    .section-card {
        height: auto;
        min-height: 16rem;
    }

    .overlay-text {
        padding: 0.75rem;
    }

    .overlay-text h5 {
        font-size: 1rem;
    }

    .article-detail img {
        max-width: 100%;
        max-height: 350px;
    }

    .author-icon img {
        width: 150px;
    }

    .home-mobile-order {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .featured-article-block {
        order: 1;
    }

    .rangers-ephraim-block {
        order: 2;
    }

    .troubadour-block {
        order: 3;
    }

    .editor-block {
        order: 4;
        margin-top: 2rem;
    }

    .home-mobile-order > .col-md-3,
    .home-mobile-order > .col-md-6 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ===== Landscape Phones ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .section-card {
        height: 14rem;
    }

    .overlay-text {
        padding: 0.5rem;
    }

    .overlay-text h5 {
        font-size: 0.95rem;
    }
}