/* ============================================================
   LITURGICAL THEMES & VARIABLES
   ============================================================ */
:root {
    --primary-color: #2e7d32; 
    --primary-dark: #1b5e20;
    --accent-bg: #f5f2eb;
    --gold: #d4af37;
    --white: #ffffff;
}

body.theme-advent, body.theme-lent {
    --primary-color: #6a1b9a;
    --primary-dark: #4a148c;
}

body.theme-christmas, body.theme-white, body.theme-gold {
    --primary-color: #d4af37;
    --primary-dark: #8b6b00;
    --accent-bg: #ffffff;
}

body.theme-holyweek, body.theme-red, body.theme-pentecost {
    --primary-color: #b71c1c;
    --primary-dark: #7f0000;
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Georgia', serif;
    background-color: var(--accent-bg);
    color: #2c2c2c;
    transition: background-color 0.8s ease;
}

section {
    scroll-margin-top: 120px; 
}

h2 {
    font-family: 'Macondo', cursive;
    font-size: 2rem;
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 8px;
    margin-bottom: 30px;
    text-transform: none; 
    letter-spacing: 0.5px;
    transition: color 0.8s ease, border-color 0.8s ease;
}

.container {
    padding: 120px 20px 50px;
    max-width: 1100px;
    margin: auto;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0));
    transition: background-color 0.4s ease, background-image 0.4s ease, padding 0.4s ease;
}

nav.scrolled {
    background-color: var(--primary-dark);
    background-image: 
        repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 30px, transparent 30px, transparent 60px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 30px, transparent 30px, transparent 60px),
        repeating-linear-gradient(45deg, transparent 0px, transparent 15px, rgba(255,255,255,0.12) 15px, rgba(255,255,255,0.12) 16px, transparent 16px, transparent 60px),
        repeating-linear-gradient(-45deg, transparent 0px, transparent 15px, rgba(255,255,255,0.12) 15px, rgba(255,255,255,0.12) 16px, transparent 16px, transparent 60px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 5px 20px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-left span {
    color: white;
    font-family: 'Macondo', cursive;
    font-size: 1.6rem;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.nav-right {
    padding-right: 40px;
}

.nav-right a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    margin-left: 20px;
    transition: opacity 0.2s;
}

.nav-right a:hover {
    opacity: 0.7;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.bar {
    width: 30px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    background-color: #000;
}

#heroImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1.5s ease-in-out;
    opacity: 1;
    will-change: opacity, transform;
}

.fade-out {
    opacity: 0 !important;
}

/* ============================================================
   CARDS & GRIDS
   ============================================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

/* ============================================================
   WELCOME & LECTIONARY SPLIT SECTION
   ============================================================ */
.split-container {
    display: flex;
    gap: 30px;
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: 20px;
}

.split-column {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

.split-column h2 {
    margin-top: 0;
    margin-bottom: 20px;
    height: 40px;
}

.equal-height-card {
    flex-grow: 1;
    margin: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 8px solid var(--primary-color);
}

.bishop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bishop-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.liturgical-date {
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.lectionary-attribution {
    margin-top: 30px;
    font-size: 0.75rem;
    font-style: italic;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 10px;
    line-height: 1.4;
}

.lectionary-attribution a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ============================================================
   PARISHES GRID
   ============================================================ */
.parish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.parish-card {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    display: block;
    text-decoration: none;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.parish-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.parish-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    color: white;
    box-sizing: border-box;
}

.parish-overlay span {
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 10px;
}

.parish-overlay small {
    font-weight: normal;
    font-size: 0.9rem;
    opacity: 0.8;
}

.view-link {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid white;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
    transition: background 0.3s, color 0.3s;
}

.parish-card:hover img { transform: scale(1.1); }
.parish-card:hover .view-link { background: white; color: black; }

/* ============================================================
   MINISTRIES GRID
   ============================================================ */
.ministry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
    margin-top: 20px;
}

.ministry-card {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    display: block;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ministry-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ministry-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: white;
}

.ministry-overlay span {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.view-link-alt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 5px 10px;
    width: fit-content;
    border-radius: 3px;
    transition: all 0.3s;
}

.ministry-card:hover img { transform: scale(1.08); }
.ministry-card:hover .view-link-alt { background: white; color: black; border-color: white; }

/* ============================================================
   CONTACT & LINKS
   ============================================================ */
#contact a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    transition: color 0.3s ease;
}

#contact a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================================
   DIVIDERS & FOOTER
   ============================================================ */
.tartan-divider {
    height: 80px;
    width: 100%;
    background-color: var(--primary-dark);
    background-image: 
        repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 30px, transparent 30px, transparent 60px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 30px, transparent 30px, transparent 60px),
        repeating-linear-gradient(45deg, transparent 0px, transparent 15px, rgba(255,255,255,0.12) 15px, rgba(255,255,255,0.12) 16px, transparent 16px, transparent 60px),
        repeating-linear-gradient(-45deg, transparent 0px, transparent 15px, rgba(255,255,255,0.12) 15px, rgba(255,255,255,0.12) 16px, transparent 16px, transparent 60px);
    box-shadow: inset 0 10px 10px -10px rgba(0,0,0,0.5), inset 0 -10px 10px -10px rgba(0,0,0,0.5);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(0,0,0,0.3);
    transition: background-color 0.8s ease;
}

footer {
    background: #1a1a1a;
    color: #ccc;
    text-align: center;
    padding: 40px;
    margin-top: 0;
}

footer p {
    font-family: 'Georgia', serif; 
    font-size: 0.9rem;
    color: #ccc;
}

.logo-font {
    font-family: 'Macondo', cursive;
    font-size: 1.3rem;
    color: white;
    margin-left: 5px;
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES
   ============================================================ */
@media (max-width: 1024px) {
    .ministry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .menu-toggle {
        display: flex;
        margin-right: 20px;
    }

    .nav-right {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-dark);
        padding: 20px 0;
        text-align: center;
        box-shadow: 0 10px 10px rgba(0,0,0,0.2);
    }

    .nav-right.active {
        display: flex;
    }

    .nav-right a {
        margin: 15px 0;
        font-size: 1.2rem;
    }

    .split-container {
        flex-direction: column;
    }

    .split-column h2 {
        height: auto;
    }

    .order-1 { order: 1; }
    .order-2 { order: 2; }

    .grid, .parish-grid {
        grid-template-columns: 1fr;
    }

    .ministry-grid {
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .nav-right {
        padding-right: 10px;
        font-size: 0.8rem;
    }
    
    .ministry-grid {
        grid-template-columns: 1fr !important;
    }
}