* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #ffffff;
    color: #2d66cf;
    padding: 1rem 0;
    position: fixed; /* Make header fixed too */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    position: relative; /* IMPORTANT */
    padding: 14px 0;
}
.w-1200 {
    max-width: 1200px;
    margin: 0 auto;
    border-top: solid 2px rgba(246, 191, 80, 1);
}
.header h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 400;
}
.site-title {
    text-align: center;
    margin: 0;
    font-size: 2rem;
    font-weight: 400;
}
.site-title a {
    color: inherit;
    text-decoration: none;
}
.logo {
    width: 100px;
    position: absolute;
    left: 200;
    top: 30%;
    transform: translateY(-50%);
}

.nav {
    border-top: solid 2px rgba(246, 191, 80, 1);
    margin-top: 1rem;
    text-align: center;
}

.nav a {
    color: #5893ff;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.5rem 1rem 0rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
}

.nav a:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Content - Account for fixed header */
.main {
    margin-top: 140px; /* Space for fixed header */
}

/* Main Layout - COMPLETELY FIXED SIDEBAR */
.main-layout {
    display: flex;
    min-height: calc(100vh - 140px);
    position: relative;
}

/* ABSOLUTELY FIXED SIDEBAR */
.sidebar {
    position: fixed;
    top: 140px; /* Below the fixed header */
    left: 0;
    width: 30vw; /* Use viewport width for consistency */
    height: calc(100vh - 140px);
    overflow: hidden;
    z-index: 50;
}

.sidebar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* CONTENT AREA - OFFSET FOR FIXED SIDEBAR */
.content {
    position: relative;
    margin-left: 30vw; /* Match sidebar width */
    width: 70vw;
    padding: 2rem;
    min-height: calc(100vh - 140px);
    background: #ffffff;
    z-index: 100;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.card-description {
    display: none;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Page Title */
.page-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.page-description {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Post Content */
.post-layout {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.post-image {
    width: 40%;
}

.post-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.post-content {
    width: 60%;
}

.post-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.post-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.post-text p {
    margin-bottom: 1.5rem;
}

/* Footer - Align with content */
footer {
    margin-left: 30vw !important;
    width: 70vw !important;
    box-sizing: border-box;
}

/* Active menu item highlighting */
.nav-link.active {
    /* background-color: rgb(248, 243, 216); */
    border-radius: 4px;
    font-weight: bold;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: #ffc814;
    border-radius: 1px;
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

/* Show only on mobile */
/* Hide whatsApp sharing and any other desired element just add the .mobile-only class*/
.mobile-only {
    display: inline-block;
}

/* Hamburger Menu (Mobile Only) */
.hamburger {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ── SEARCH INPUT (shared desktop styles) ───────────────────────────────── */
.search-input {
    padding: 0.35rem 0.85rem;
    border: none;
    border-radius: 20px 0 0 20px;
    font-size: 0.85rem;
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    width: 140px;
    transition: width 0.3s ease, background 0.3s ease;
}
.search-input:focus {
    width: 185px;
    background: rgba(255, 255, 255, 0.25);
}
.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.7rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background 0.3s;
    line-height: 1;
}
.search-button:hover {
    background: rgba(255, 255, 255, 0.38);
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE / MEDIA QUERIES
   (all max-width:768px rules consolidated into ONE block,
    all min-width:769px rules consolidated into ONE block)
   ───────────────────────────────────────────────────────────────────────── */

@media (min-width: 769px) {
    .mobile-slider {
        display: none;
    }

    .mobile-only {
        display: none;
    }

    .hamburger {
        display: none !important;
    }
    .nav {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.1rem;
    }
    .search-form {
        display: inline-flex;
        align-items: center;
        margin-left: 0.75rem;
    }
}

@media (max-width: 768px) {
    .header {
        position: sticky; /* Change back to sticky on mobile */
    }

    .header-content {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        position: relative;
        padding: 24px 10px 0px 10px;
    }

    .site-title {
        flex: 1;
        order: 1;
        font-size: 1.3rem !important;
        padding-right: 50px; /* Space for hamburger */
    }

    .logo {
        left: 50px;
        top: 15%;
    }

    /* Show hamburger on mobile */
    .hamburger {
        display: flex;
        order: 2;
        flex-shrink: 0;
        align-self: center;
    }

    /* Mobile Navigation */
    .nav {
        order: 3;
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: #2c3e50;
        flex-direction: column;
        padding: 80px 0 20px 0;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -2px 0 10px rgba(0,0,0,0.3);
        z-index: 1000;
    }

    .nav.active {
        right: 0;
    }

    .nav a {
        display: block;
        margin: 0;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: left;
    }

    .nav a:hover {
        background: rgba(255,255,255,0.15);
    }

    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 0;
    }

    .nav-link.active::after {
        display: none;
    }

    /* Overlay for mobile menu */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .nav-overlay.active {
        display: block;
    }

    /* Search bar inside mobile nav */
    .search-form {
        display: flex;
        order: -1;           /* sits at top of the dropdown */
        width: calc(100% - 3rem);
        margin: 1rem 1.5rem 0.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    .search-input {
        flex: 1;
        width: auto !important;  /* let flex control width */
        padding: 0.65rem 1rem;
        font-size: 1rem;
        border-radius: 20px 0 0 20px;
    }
    .search-button {
        padding: 0.65rem 0.9rem;
        border-radius: 0 20px 20px 0;
    }

    .main {
        margin-top: 0; /* Remove top margin on mobile */
    }

    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative; /* Not fixed on mobile */
        top: auto;
        left: auto;
        width: 100%;
        height: 200px;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    footer {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .cards-grid {
        display: none;
    }

    .mobile-slider {
        display: block;
        overflow-x: auto;
        padding: 1rem 0;
    }

    .mobile-cards {
        display: flex;
        gap: 1rem;
        padding-bottom: 1rem;
    }

    .mobile-card {
        min-width: 45%;
        background: white;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        position: relative;
        height: 250px;
    }

    .mobile-card-bg {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center;
    }

    .mobile-card-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(transparent, rgba(0,0,0,0.8));
        color: white;
        padding: 1rem;
    }

    .mobile-card-title {
        font-size: 0.9rem;
        font-weight: bold;
        margin-bottom: 0.25rem;
    }

    .mobile-card-description {
        display: none;
        font-size: 0.7rem;
        opacity: 0.9;
        line-height: 1.3;
    }

    .post-layout {
        flex-direction: column;
    }

    .post-image, .post-content {
        width: 100%;
    }

    .post-title {
        font-size: 2rem;
    }

    .page-title {
        font-size: 1.6rem;
        line-height: 2rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   FORMAT PILLS / SELECTOR / MODAL / AUDIO / VIDEO PLAYER
   ───────────────────────────────────────────────────────────────────────── */

/* ── Format pills on novena card images ──────────────────────────────────── */
.novena-format-pills {
    position: absolute;
    bottom: 0.6rem;
    left: 0.6rem;
    /* display: flex; */
    display: none;
    gap: 0.35rem;
    flex-wrap: wrap;
    pointer-events: none;
}

.novena-format-pill {
    display: inline-block;
    padding: 0.18rem 0.9rem;
    border-radius: 20px 0px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #552001;
    opacity: 0.92;
    letter-spacing: 0.02em;
}

/* ── Format selector bar (subcategory.php) ───────────────────────────────── */
.format-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}

.format-selector-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    margin-right: 0.25rem;
    white-space: nowrap;
}

.format-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 1.1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 2px solid #e0e0e0;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.format-selector-btn:hover {
    border-color: #bbb;
    color: #333;
}

.format-selector-btn.active {
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* ── Format Selection Modal ──────────────────────────────────────────────── */
.fmt-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;         /* sheet slides from bottom on mobile */
    justify-content: center;
    padding: 0 1rem 1.5rem;
    background: rgba(0, 0, 0, 0);
    visibility: hidden;
    pointer-events: none;
    z-index: 9000;
    transition:
        background-color 0.25s ease,
        visibility 0s linear 0.3s; /* delay = close animation duration */
}

@media (min-width: 600px) {
    .fmt-modal-overlay {
        align-items: center;       /* centered dialog on desktop */
        padding: 1rem;
    }
}

.fmt-modal-overlay.is-open {
    background: rgba(0, 0, 0, 0.65);
    visibility: visible;
    pointer-events: auto;
    transition:
        background-color 0.25s ease,
        visibility 0s linear 0s;  /* no delay on open */
}

.fmt-modal-box {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(40px) scale(0.97);
    opacity: 0;
    transition:
        transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1),
        opacity   0.22s ease;
}

.fmt-modal-overlay.is-open .fmt-modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.fmt-modal-hdr {
    padding: 1.25rem 1.5rem 1rem;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    position: relative;
}

.fmt-modal-pretitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.3rem;
}

.fmt-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    padding-right: 2.2rem;   /* space for close button */
    margin: 0;
}

.fmt-modal-close-btn {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.15rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.fmt-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fmt-modal-opts {
    padding: 1rem 1.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fmt-opt-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #fff;
    text-align: left;
    width: 100%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fmt-opt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.fmt-opt-btn:active {
    transform: scale(0.97);
}

.fmt-opt-icon {
    font-size: 1.7rem;
    width: 2.2rem;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.fmt-opt-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.fmt-opt-text strong {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.fmt-opt-text small {
    font-size: 0.74rem;
    opacity: 0.82;
    line-height: 1.3;
}

.fmt-opt-arrow {
    font-size: 1.4rem;
    opacity: 0.55;
    flex-shrink: 0;
}

.fmt-modal-footer {
    padding: 0.6rem 1.25rem 1.25rem;
    text-align: center;
}

.fmt-cancel-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.fmt-cancel-btn:hover {
    color: #666;
    background: #f5f5f5;
}

/* ── Audio Player ─────────────────────────────────────────────────────────── */
.audio-player-wrap {
    max-width: 960px;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    border-radius: 14px;
    padding: 1.25rem 1.5rem 1rem;
    margin: 0 auto 2rem;
    box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}
.audio-player-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}
.audio-player-icon { font-size: 1.6rem; line-height: 1; }
.audio-player-label {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
}
.audio-player-el {
    width: 100%;
    border-radius: 8px;
    outline: none;
    accent-color: #3498db;
}
.audio-player-hint {
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    text-align: right;
}
.audio-player-hint a { color: rgba(255,255,255,0.65); text-decoration: underline; }
.audio-player-hint a:hover { color: #fff; }

/* ── Video Player ─────────────────────────────────────────────────────────── */
.video-player-wrap {
    margin: 0 auto 2rem;       /* Center Video element */
    max-width: 960px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.22);
    background: #000;
}
.video-player-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
}
.video-player-icon { font-size: 1.3rem; line-height: 1; }
.video-player-label {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
/* 16:9 responsive container */
.video-player-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.video-player-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ************* ===== AUDIO VIDEO PLAYER ON MOBILE ===== *************  */

@media (max-width: 480px) {
    .audio-player-wrap { padding: 1rem 1rem 0.85rem; border-radius: 10px; }
    .video-player-wrap { border-radius: 10px; }
}