@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lora:wght@700&display=swap');

:root {
    /* Modern Scribe Palette */
    --primary-brown: #8B4513; /* Saddle Brown - Accent Color */
    --primary-light: #A0522D; /* Lighter brown for hover */
    --text-dark: #2C2A28; /* Dark Taupe - Primary Text */
    --text-medium: #6B6865; /* Muted Gray-Brown - Secondary Text */
    --light-bg: #FDFCF9; /* Alabaster - Page Background */
    --accent: #D98F3B; /* A warm gold for accents */
    --accent-2: #C7782B; /* A slightly darker gold for gradients */
    --border-light: #EAE7E2; /* Light Beige-Gray for borders */
    --white: #ffffff;
    --neutral-gray: #6c757d;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--text-dark); /* Dark background for a modern feel */
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-blend-mode: soft-light; /* Use soft-light for a more subtle effect */
}

/* Responsive Background Images */
body {
    background-image: url('../images/spoc-church.webp');
}

/* Disable background image on mobile for performance and a cleaner look */
@media (max-width: 768px) {
    body {
        background-image: none;
        background-attachment: scroll; /* Ensure default scroll behavior */
    }
}

a {
    color: #4682B4;
    text-decoration: none;
}

.navbar-professional {
    background: var(--white);
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.navbar-professional.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-brown) !important;
    gap: 0.5rem;
    font-family: 'Lora', serif;
}

.navbar-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-family: 'Lora', serif;
}

.navbar-brand .brand-title {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-brown), var(--accent), var(--primary-brown));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.05);
    transition: background-position 0.5s ease-in-out;
}

.navbar-brand .brand-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    opacity: 0.8;
    transition: color 0.4s ease, opacity 0.4s ease;
}

.navbar-brand:hover .brand-title {
    background-position: -100% 0;
}

.navbar-brand:hover .brand-subtitle {
    color: var(--primary-brown);
    opacity: 1;
}

/* Increase brand name font size on mobile for better readability */
@media (max-width: 768px) {
    .navbar-brand .brand-title {
        font-size: 1rem; /* Increased from 0.9rem */
    }

    .navbar-brand .brand-subtitle {
        font-size: 0.85rem; /* Increased from 0.8rem */
    }
}

/* Hide brand text on very small screens to just show the logo */
@media (max-width: 420px) {
    .navbar-brand .brand-text {
        display: none;
    }
}

/* --- Mobile Menu Brand Text --- */
/* Hide the mobile brand text on desktop */
@media (min-width: 1200px) {
    .navbar-collapse .brand-text {
        display: none;
    }
}

/* Style the brand text inside the collapsed mobile menu */
@media (max-width: 1199.98px) {
    .navbar-nav .nav-item-brand {
        padding: 0.5rem 1rem 1rem;
        text-align: center;
        border-bottom: 1px solid var(--border-light);
        margin-bottom: 0.5rem;
    }

    .brand-text {
        font-size: 1rem;
        font-weight: 700;
        background: linear-gradient(45deg, var(--primary-brown), var(--accent), var(--primary-brown));
        background-size: 200% auto;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.05);
        transition: background-position 0.5s ease-in-out;
        font-family: 'Lora', serif;
    }

    .brand-subtitle {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-dark);
        opacity: 0.8;
        transition: color 0.4s ease, opacity 0.4s ease;
    }

    .nav-item-brand .brand-title,
    .nav-item-brand .brand-subtitle {
        display: block; /* Ensure they stack vertically */
    }
}

.nav-link {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-dark) !important; /* Increased contrast from --text-medium */
    padding: 0.5rem 0.8rem !important; /* Reduced horizontal padding */
    font-size: 0.95rem; /* Slightly reduced font size */
    border-radius: 8px;
    position: relative; /* For focus pseudo-element */
    outline: none; /* Remove default outline */
}

.nav-link:hover {
    color: var(--primary-brown) !important;
    background-color: rgba(139, 69, 19, 0.05);
}

/* Custom focus indicator for accessibility */
.nav-link:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-2);
}

.nav-link.active {
    color: var(--primary-brown) !important;
    font-weight: 700;
}

.disabled-link {
    opacity: 0.5;
    pointer-events: none;
}

.hero {
    background-color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px; /* Add padding to push content below navbar */
    overflow: hidden; /* Contain the parallax background */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/spoc-church.webp');
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    background-color: rgba(44, 42, 40, 0.6); /* Slightly more transparent */
    z-index: 1;
}
.floating-shape {
    position: absolute;
    background-color: rgba(217, 143, 59, 0.1);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
    filter: blur(10px);
}
.hero-content {
    text-align: center;
    color: var(--white);
    z-index: 2;
    position: relative;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.floating-shape.shape-1 {
    width: 150px;
    height: 150px;
    left: 10%;
    bottom: 15%;
    animation-duration: 25s;
    animation-delay: -5s;
}

.floating-shape.shape-2 {
    width: 250px;
    height: 250px;
    left: 70%;
    bottom: 50%;
    animation-duration: 35s;
    animation-delay: -15s;
    background-color: rgba(217, 143, 59, 0.08);
}

.floating-shape.shape-3 {
    width: 80px;
    height: 80px;
    left: 85%;
    bottom: 20%;
    animation-duration: 18s;
    animation-delay: -2s;
}

.floating-shape.shape-4 {
    width: 180px;
    height: 180px;
    left: -5%;
    bottom: 60%;
    animation-duration: 30s;
    animation-delay: 0s;
    background-color: rgba(217, 143, 59, 0.12);
}

.hero h1 {
    color: #F5F5DC;
    font-size: clamp(2.2rem, 7vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    font-family: 'Lora', serif;
    line-height: 1.2;
}

.hero-quote {
    font-size: 1.3rem;
    font-style: italic;
    margin-bottom: 0.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.bible-ref {
    font-size: 1rem;    
    margin-bottom: 2.5rem;
}

.hero-schedule {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 300px));
    gap: 1.5rem;
    justify-content: center; /* Center the grid items */
    margin-top: 2.5rem;
    max-width: 700px; /* Constrain the overall width of the schedule block */
    margin-left: auto;
    margin-right: auto;
}

.schedule-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(245, 245, 220, 0.2);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: pulse-glow 5s infinite alternate ease-in-out;
}

.schedule-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-2);
    animation-play-state: paused; /* Pause the pulse on hover for a stable, brighter glow */
    box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 30px rgba(217, 143, 59, 0.6); /* Enhanced shadow on hover */
}

@keyframes pulse-glow {
    from { box-shadow: 0 4px 15px rgba(0,0,0,0.1), 0 0 15px rgba(217, 143, 59, 0.3); }
    to { box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 25px rgba(217, 143, 59, 0.5); }
}

@keyframes pulse-text-glow {
    from { text-shadow: 0 0 8px rgba(217, 143, 59, 0.4); }
    to { text-shadow: 0 0 16px rgba(217, 143, 59, 0.6); }
}

@keyframes kenburns {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(1deg);
    }
}
@keyframes float {
    0% {
        transform: translateY(0px) translateX(0px);
    }
    50% {
        transform: translateY(-30px) translateX(20px);
    }
    100% {
        transform: translateY(0px) translateX(0px);
    }
}
.schedule-item .day {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.schedule-item .time-group {
    font-size: 1.1rem;
    line-height: 1.5;
}

.schedule-item .time-label {
    font-weight: 600;
    opacity: 0.8;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.schedule-item .time {
    font-weight: 400;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .hero-schedule {
        grid-template-columns: 1fr; /* Stack items in a single column */
        gap: 1rem;
        padding: 0 1rem;
    }

    .schedule-item {
        min-width: 0; /* Reset min-width for mobile */
    }
}

@media (max-width: 768px) {
    .hero-content {
        padding: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center; /* Center buttons when stacked */
    }

}

@media (max-width: 576px) {
    .hero {
        min-height: 90vh; /* Reduce height slightly on small devices */
    }
    .hero-schedule {
        padding: 0 2rem; /* Add more horizontal padding to narrow the content area */
    }
}

/* 404 Error Page Styles */
.error-page-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

.error-code {
    font-size: clamp(6rem, 25vw, 12rem);
    font-weight: 700;
    color: var(--border-light);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    user-select: none;
}

.error-title {
    font-family: 'Lora', serif;
    font-size: 2.5rem;
    color: var(--primary-brown);
}

/* Specific styles for 404 page to simplify it */
.page-404 {
    background-image: none;
    background-color: var(--light-bg);
}

.page-404 .section-transparent-bg {
    background: transparent;
    backdrop-filter: none;
}

@media (max-width: 576px) {
    .hero {
        min-height: 90vh;
    }
}
.btn-primary {
    background: linear-gradient(90deg,var(--accent),var(--accent-2));
    border: none;
    color: white;
    font-weight: 700;
    font-size: 18px;
    border-radius: 12px;
    padding: 16px 20px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 8px 25px rgba(217,143,59,0.3);
    position: relative; /* Needed for ripple effect */
    overflow: hidden; /* Contain the ripple */
    transition: transform .2s ease, box-shadow .2s ease;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 35px rgba(217,143,59,0.4);
    color: white;
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-4px);
    color: white;
    box-shadow: 0 4px 20px rgba(217, 143, 59, 0.2);
}
.btn-outline-dark {
    background-color: transparent;
    border: 2px solid var(--accent) !important;
    color: var(--accent);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-outline-dark:active, .btn-outline-dark:focus-visible {
    background-color: #CC7716 !important;
}

.btn-outline-dark:hover {
    background-color: rgba(217, 143, 59, 0.1);
    color: var(--accent-2);
    border-color: var(--accent-2);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 6px 20px rgba(217, 143, 59, 0.3);
}

.placeholder-image {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
    font-weight: 500;
}

.section-padding {
    padding: 6rem 0;
}

.section-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 2.8rem);
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-dark);
    letter-spacing: -1px;
}

.section-subtitle {
    font-size: 1.125rem;
    text-align: center;
    color: var(--text-medium);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.clergy-section .section-subtitle {
    margin-bottom: 5rem; /* Add extra space below subtitle */
}

.section-transparent-bg > .container {
    background: linear-gradient(145deg, rgba(253, 252, 249, 0.9), rgba(253, 252, 249, 0.75));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 30px rgba(0,0,0,0.1), inset 0 1px 1px rgba(255,255,255,0.7);
}

@media (max-width: 576px) {
    .section-padding { padding: 3rem 0; }
    .section-transparent-bg > .container { padding: 2rem; }
}

.priest-welcome-card {
    padding: 2.5rem;
}

.priest-photo {
    border-radius: 50%;
    max-width: 250px;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 6px solid var(--white);
    box-shadow: var(--shadow-lg);
    background-color: var(--light-bg);
}

.priest-quote {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-style: italic;
    color: var(--text-medium);
    border-left: 4px solid var(--accent);
    padding-left: 1.5rem;
    margin: 0 0 2rem 0;
}

.priest-signature {
    text-align: left;
}

.priest-name {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-brown);
    margin-bottom: 0.25rem;
}

.priest-title-signature {
    font-size: 1rem;
    color: var(--text-medium);
    margin: 0;
}

@media (max-width: 991px) {
    .priest-welcome-card {
        text-align: center;
    }
    .priest-quote {
        text-align: left;
    }
    .priest-signature {
        text-align: center;
    }
    .priest-welcome-card {
        padding: 1.5rem;
    }
}

/* Utility for extra top padding on mobile */
@media (max-width: 767px) {
    .pt-mobile-extra {
        padding-top: 5rem !important;
    }
}

.ministry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

@keyframes iconBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.ministry-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2.25rem;
    /* Prepare for bounce animation */
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
    transform: scale(0.3);
}

.visible .ministry-icon {
    animation: iconBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.2s; /* Start slightly after the card starts revealing */
}

.ministry-card:hover .ministry-icon {
    transform: scale(1.15) rotate(-10deg);
}

.ministry-card h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.ministry-card p {
    color: var(--text-medium);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem; /* Add space above the new link */
}

.ministry-card .stretched-link-btn {
    font-weight: 600;
    color: var(--primary-brown);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.ministry-card:hover .stretched-link-btn {
    color: var(--accent-2);
}

.ministry-card .stretched-link-btn .bi {
    transition: transform 0.3s ease;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.story-grid .modern-card.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.story-card {
    padding: 0; /* Remove padding from the card itself */
    overflow: hidden; /* Ensure image corners are rounded */
    display: flex;
    flex-direction: column;
}

.story-card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.story-card:hover .card-img-top {
    transform: scale(1.05);
}

.story-card .card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.story-card .card-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

/* --- Daily Readings Widget --- */
.readings-widget-container {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    background-color: var(--light-bg); /* Fallback color */
}

.story-card .card-text {
    color: var(--text-medium);
    font-size: 1rem;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1rem; /* Adjust margin to accommodate date */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-section {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    color: white;
    text-align: center;
}

.gallery-filter {
    display: flex;
    justify-content: center;
    position: relative;
    gap: 0.5rem; /* Reduced gap slightly */
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    overflow-x: auto; /* Allow horizontal scrolling */
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 50px;
    max-width: 100%; /* Allow it to use available space */
    margin: 0 auto; /* Center the filter bar */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Custom scrollbar for a cleaner look */
.gallery-filter::-webkit-scrollbar {
    height: 4px;
}
.gallery-filter::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}
.gallery-filter::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 0;
    height: calc(100% - 1rem);
    background-color: var(--white);
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.filter-btn {
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    border: 2px solid transparent;
    color: rgba(255, 255, 255, 0.8);
    background-color: transparent; /* Make buttons transparent by default */
    border-radius: 50px;
    cursor: pointer;
    position: relative; /* Ensure button text is above the sliding background */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.filter-btn:hover {
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.filter-btn.active {
    background-color: transparent;
    color: var(--primary-brown);
    transition-delay: 0.1s; /* Delay color change to sync with slide */
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}
.gallery-item {
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.4s ease;
    aspect-ratio: 1 / 1; /* Enforce a square aspect ratio */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.4s ease;
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none; /* Allow clicks to pass through to the link */
}

.gallery-item-overlay span {
    font-weight: 600;
    font-size: 1.2rem;
    transform: translateY(10px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-item:hover img, .gallery-item:focus-visible img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-item-overlay span, .gallery-item:focus-visible .gallery-item-overlay span {
    transform: translateY(0) scale(1);
}

.gallery-item.visible {
    opacity: 1; /* Let the reveal-on-scroll handle this */
    transform: scale(1);
}

.gallery-item.hide {
    transform: scale(0.8);
    opacity: 0;
    transition-duration: 0.4s;
}

@media (max-width: 992px) {
    /* No change needed, auto-fit handles it */
}

@media (max-width: 768px) {
    .gallery-grid {
        /* Use a 2-column grid on mobile for a cleaner look */
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem; /* Reduce gap on mobile */
    }

    .gallery-filter {
        justify-content: flex-start; /* Align buttons to the start on mobile */
    }
}
.footer {
    background: var(--text-dark);
    color: white;
    /* padding: 4rem 0; */
}

.footer h5, .footer h6 {
    color: var(--white);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer p, .footer li, .footer small {
    color: rgba(253, 252, 249, 0.8);
    font-size: 0.9375rem;
}

.footer a {
    color: #4682B4;
    text-decoration: none;
}

.footer a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;    
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-4px) scale(1.1);
}

/* --- Social Links on Light Backgrounds (e.g., Contact Page) --- */
.modern-card .social-links a {
    background: rgba(139, 69, 19, 0.05);
    color: var(--primary-brown);
    border: 1px solid transparent;
}

.modern-card .social-links a:hover {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent-2);
}

.modern-card .social-links a.disabled-link {
    background: rgba(0,0,0,0.05);
    color: var(--neutral-gray);
    opacity: 0.7;
    pointer-events: none;
}

.map-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    transition: background-color 0.3s ease;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Back to Top Button */
#backToTopBtn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1030; /* Above most elements */
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    cursor: pointer;
    width: 55px;
    height: 55px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* The animation now includes a subtle directional shadow */
    animation: pulse-glow 3s infinite alternate ease-in-out;
}

#backToTopBtn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2), 0 0 30px rgba(217, 143, 59, 0.7);
    animation-play-state: paused;
}

#backToTopBtn.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Reveal on Scroll Animation */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-on-scroll.visible {
    opacity: 1;    
    transform: translateY(0);
}

/* Contact Page Enhancements */
.contact-info-card h4 {
    color: var(--text-dark);
    font-weight: 700;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    /* margin-bottom: 1.75rem; */
    padding: 1rem;
    border-radius: 12px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.contact-item:hover {
    background-color: var(--light-bg);
    transform: translateX(5px);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-brown);
    margin-right: 1.25rem;
    margin-top: 0.25rem;
}

.contact-item div strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.contact-item div p {
    margin: 0;
    color: var(--text-medium);
}
@media (max-width: 576px) {
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.contact-item a {
    color: #4682B4;
    text-decoration: none;
}

.map-container {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.map-container iframe {
    filter: grayscale(80%);
    transition: filter 0.4s ease-in-out;
}

.map-container:hover iframe {
    filter: grayscale(0%);
}


/* --- Modern Form Styles --- */
.modern-card .form-control {
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(2px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.modern-card .form-control:focus {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(217, 143, 59, 0.2);
}

.modern-card .form-floating > label {
    color: var(--text-medium);
}

.modern-card .form-floating > .form-control:focus ~ label {
    color: var(--primary-brown);
}

/* --- Responsive Button Width --- */
.btn-responsive-width {
    width: 100%; /* Full width by default for mobile */
}

@media (min-width: 768px) {
    .btn-responsive-width {
        width: auto; /* Auto width for tablets and desktops */
        padding-left: 2.5rem; /* Add some horizontal padding for the auto-width state */
        padding-right: 2.5rem;
    }
}
/* Image Settle Effect */
.image-settle-container {
    overflow: hidden;
    border-radius: 16px; /* Match image radius */
}
.image-settle {
    transform: scale(1.1);
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.visible .image-settle {
    transform: scale(1);
}

.patron-section .section-title {
    margin-bottom: 1.5rem;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

/* Masked Title Reveal */
.title-mask {
    overflow: hidden;
    padding-bottom: 0.5rem; /* Give space for the text to reveal */
}
.title-reveal {
    transform: translateY(110%);
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.visible .title-reveal {
    transform: translateY(0);
}

/* Modern Card Style */
.modern-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), 
                box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.4s ease;
}
.modern-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5));
}

/* --- Schedule Info Card Styles --- */
.schedule-info-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.schedule-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--white);
    font-size: 1.75rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.schedule-info-card:hover .schedule-icon {
    transform: scale(1.1);
}

.schedule-details h5 {
    font-weight: 600;
    color: var(--primary-brown);
    margin-bottom: 0.25rem;
}

/* --- Parish Programs Card Styles --- */
.program-card {
    text-align: center;
}

.program-card h5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.program-card h5 i {
    font-size: 1.75rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.program-card:hover h5 i {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: var(--shadow-md);
}

.clergy-card {
    padding-top: 4.5rem; /* Adjusted top padding for smaller photo */
    overflow: visible;
    position: relative;
    flex-direction: column;
}

.clergy-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--white);
    box-shadow: var(--shadow-lg);
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease;
}

.clergy-card:hover .clergy-photo {
    transform: translateX(-50%) scale(1.05);
}

.clergy-card .card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-brown);
}

.clergy-card .card-text {
    color: var(--text-medium);
    font-weight: 500;
    flex-grow: 1; /* Allow p to grow to push button down if needed */
}

@media (max-width: 576px) {
    .clergy-photo {
        width: 100px;
        height: 100px;
        top: -40px;
        border-width: 4px;
    }
    .clergy-card .card-title {
        font-size: 1.1rem;
        margin-top: 0;
    }
}
.clergy-card .btn-outline-dark {
    padding: 0.5rem 1.25rem;
}


.clergy-image-placeholder {
    height: 300px;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clergy-image-placeholder i {
    font-size: 6rem;
    color: var(--neutral-gray);
    opacity: 0.5;
}

.clergy-icon {
    width: 6rem;
    height: 6rem;
    color: var(--neutral-gray);
    opacity: 0.5;
    position: relative;
}

.clergy-placeholder-img {
    filter: grayscale(100%);
    opacity: 0.7;
}

.clergy-section-wrapper {
    position: relative;
    overflow: hidden;
}

.clergy-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 1px 1px, rgba(139, 69, 19, 0.1) 1px, transparent 0);
    background-size: 20px 20px;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

/* Support & Giving Page Enhancements */
.giving-card {
    padding-top: 3rem;
    position: relative;
    overflow: visible;
}

.giving-card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.giving-card:hover {
    /* The main card hover is handled by .modern-card:hover */
}

.giving-card:hover .giving-card-icon {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 10px 25px rgba(217, 143, 59, 0.4);
}

.giving-card .stretched-link-btn {
    position: relative;
    z-index: 2;
}

@media (max-width: 576px) {
    .giving-card-icon {
        width: 64px;
        height: 64px;
        top: -32px;
    }
}
/* --- Support Points List --- */
.support-points {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.support-point {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.support-point i {
    font-size: 1.75rem;
    color: var(--accent);
    margin-top: 0.25rem;
}

.support-point h5 {
    font-weight: 600;
    color: var(--primary-brown);
    margin-bottom: 0.25rem;
}

.support-point p {
    margin: 0;
}

.impact-counter {
    position: relative;
    padding: 2rem;
    overflow: hidden;
}

.impact-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.15;
    transform: rotate(-15deg);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.impact-counter:hover .impact-icon {
    transform: rotate(0deg) scale(1.2);
    opacity: 0.25;
}

.impact-counter h3 {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.impact-counter p {
    font-size: 1.1rem;
    color: var(--text-medium);
    font-weight: 500;
    margin: 0;
}

.impact-section {
    position: relative;
    overflow: hidden;
}

.impact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 1px 1px, rgba(139, 69, 19, 0.08) 1px, transparent 0);
    background-size: 25px 25px;
    opacity: 0.7;
    z-index: 0;
}

@media (max-width: 992px) {
    .impact-counter h3 {
        font-size: 2.7rem; /* Further reduced font size for medium devices */
    }
}

@media (max-width: 768px) {
    .impact-counter h3 {
        font-size: 3.5rem; /* Reduced font size for mobile */
    }

    .impact-counter p {
        font-size: 1rem; /* Slightly smaller text for balance */
    }
}

.stewardship-card h5 {
    display: flex;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.stewardship-card h5 i {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.cta-wrapper {
    background: var(--white);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.cta-content {
    padding: 3rem;
}

.cta-wrapper .section-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2.2rem, 7vw, 3rem);
}

.donation-selector {
    background: rgba(253, 252, 249, 0.85); /* Alabaster with transparency */
    backdrop-filter: blur(8px);
    padding: 2.5rem;
    border-radius: 16px;
}

.donation-box-wrapper {
    background-color: var(--light-bg);
    padding: 3rem;
}

.donation-box {
  background: transparent;
  padding: 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:22px;
  box-shadow: none;
  border: none;
}

.amount-grid {
  display: flex;
  flex-wrap: wrap;
  width:100%;
  border: 1.5px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}

/* On smaller screens, force a 2x2 grid for consistency */
@media (max-width: 576px) {
    /* No specific rule needed, flex-wrap handles it */
}

.preset {
  flex: 1 1 auto;
  border: none;
  border-right: 1.5px solid #eee;
  padding:16px 10px;
  font-weight:600;
  font-size:16px;
  cursor:pointer;
  background:#fff;
  transition:all .2s ease;
}
.preset:last-of-type {
  border-right: none;
}

.preset:hover {
    background:#f8f5f1; 
}
.preset.active {
  background:linear-gradient(180deg,var(--accent),var(--accent-2));
  color:#fff;
  box-shadow:0 5px 18px rgba(0,0,0,0.1);
}

.custom-input { 
  position:relative; 
  flex: 1 1 100%; /* Take full width on a new line */
  display: flex;
}
.currency-prefix {
  position:absolute;
  top:50%;
  left:12px;
  transform:translateY(-50%);
  color:var(--text-medium);
  font-weight:600;
  pointer-events: none;
}
input.custom {
  padding:14px 14px 14px 36px;
  border: none;
  border-top: 1.5px solid #eee;
  font-weight:600;
  width:100%;
  transition: border-color 0.2s ease;
  background-color: #fff;
}

input.custom:focus {
    outline: none;
    border-color: var(--accent);
}

.custom-input.active input.custom,
input.custom:focus {
    background:linear-gradient(180deg,var(--accent),var(--accent-2));
    color:#fff;
}

.cta {
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  color:#fff;
  font-weight:700;
  font-size:18px;
  border:none;
  border-radius:14px;
  padding:16px 20px;
  width:100%;
  cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease;
  position: relative; /* Needed for ripple effect */
  overflow: hidden; /* Contain the ripple */
  box-shadow:0 8px 25px rgba(217,143,59,0.3);
}
.cta:hover {transform:translateY(-4px); box-shadow:0 10px 35px rgba(217,143,59,0.4);}

.donation-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.donation-amount-btn {
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--border-light);
    background-color: transparent;
    color: var(--text-medium);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.donation-amount-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-brown);
}

.donation-amount-btn.active {
    background-color: var(--primary-brown);
    color: var(--white);
    border-color: var(--primary-brown);
}

.donation-amount-custom {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border-color: rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-light);
    background-color: transparent;
    color: var(--text-medium);
    padding: 0.75rem;
}

.donation-amount-custom:focus {
    border-color: var(--primary-brown);
    box-shadow: none;
}
@media (max-width: 576px) {
    .donation-amounts {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 992px) {
    .donation-amounts {
        grid-template-columns: 1fr 1fr;
    }
}

/* Modern QR Code Modal Styles */
.modal-content.modern-card {
    background: linear-gradient(145deg, rgba(253, 252, 249, 0.95), rgba(253, 252, 249, 0.8));
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-xl);
}

.modal-header, .modal-footer {
    border-bottom: none;
    border-top: none;
}

.modal-header .btn-close {
    filter: invert(0.5);
}

.qr-option-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3));
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.qr-option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 6px;
    background-color: var(--brand-color, var(--border-light));
    border-radius: 0 0 6px 6px;
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.qr-option-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 0, var(--brand-color-glow), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: -1;
}

.qr-option-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-color, var(--border-light));
}

.qr-option-card:hover::before {
    width: 100%;
}

.qr-option-card:hover::after {
    opacity: 1;
}

.gcash-card { --brand-color: #0070BA; --brand-color-glow: rgba(0, 112, 186, 0.3); }
.maya-card { --brand-color: #00A884; --brand-color-glow: rgba(0, 168, 132, 0.3); }

.qr-logo {
    height: 30px;
    margin-bottom: 1rem;
}

.qr-code-img {
    max-width: 200px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-md);
}

.qr-details small {
    color: var(--text-medium);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.25rem;
}

.copy-field {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    text-align: left;
}

.copy-field:hover { 
    background-color: rgba(0, 0, 0, 0.09);
    transform: scale(1.02);
}
.copy-field span { 
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
}
.copy-icon.bi-check-lg { color: #198754; }

/* --- Ripple Effect for Buttons --- */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}





/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    transition: top 0.3s ease-in-out;
    font-weight: 600;
}
.skip-link:focus {
    top: 0;
}
/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        transition: none;
    }
    .reveal-on-scroll, .image-settle, .title-reveal {
        opacity: 1;
        transform: none;
    }
}

/* Print-Friendly Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: none !important;
        color: #000 !important;
        font-size: 12pt;
    }

    .section-padding {
        padding: 0 !important;
    }

    .section-transparent-bg > .container,
    .modern-card {
        background: transparent !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #ccc;
        padding: 1rem;
        page-break-inside: avoid;
    }

    /* --- Org Chart Print Styles --- */
    .org-wrap {
        margin-top: 0 !important;
    }

    .tree .group.collapsed > ul {
        display: block !important; /* Force all groups to expand */
    }

    .tree ul {
        border-left-style: solid; /* Use solid lines for print */
        border-left-color: #ccc;
    }

    .tree li:before {
        border-top-style: solid;
        border-top-color: #ccc;
    }

    .node .toggle-icon,
    .node .member-count {
        display: none !important; /* Hide interactive elements */
    }

    .node.search-highlight .title,
    .tree li.search-dimmed > .node {
        background-color: transparent !important; /* Remove search highlights */
        box-shadow: none !important;
        opacity: 1 !important;
    }
}

/* Timeline Styles */
.timeline {
    position: relative;
    max-width: 900px; /* Increased width for better spacing on larger screens */
    margin: 4rem auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--accent-2), var(--accent));
    border-radius: 2px;
    left: 50%;
    margin-left: -2px;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.visible .timeline::before {
    transform: scaleY(1);
}

.timeline .event {
    position: relative;
    width: 50%;
    padding: 0 2.5rem;
    margin-bottom: 2rem;
}

.timeline .event-content {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-md);
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.timeline .event-content:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.timeline .event-content h5 {
    font-size: 1.3rem;
    color: var(--primary-brown);
    transition: color 0.3s ease;
}

.timeline .event-content:hover h5 {
    color: var(--accent-2);
}

.timeline .event-content p {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.timeline .event-content small {
    font-weight: 600;
    background-color: rgba(139, 69, 19, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    color: var(--text-medium);
}

.timeline .event::after { /* This is the dot on the timeline */
    content: '';
    position: absolute;
    top: calc(50% - 9px);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--white);
    border: 4px solid var(--accent);
    z-index: 1;
    box-shadow: 0 0 15px rgba(217, 143, 59, 0.4);
    transform: scale(0);
    transition: transform 0.4s ease-out;
}

.visible .event::after {
    transform: scale(1);
    transition-delay: inherit;
}

.timeline .event:hover::after {
    box-shadow: 0 0 25px rgba(217, 143, 59, 0.7);
    animation: pulse-glow 1.5s infinite alternate;
}

.timeline .event:nth-child(odd) {
    left: 0;
    padding-right: 2.5rem;
    padding-left: 0;
}

.timeline .event:nth-child(even) {
    left: 50%;
    padding-left: 2.5rem;
    padding-right: 0;
}

.timeline .event:nth-child(odd)::after {
    right: -9px;
}

.timeline .event:nth-child(even)::after {
    left: -9px;
}

/* Arrow for the card */
.timeline .event-content::before {
    content: '';
    position: absolute;
    top: calc(50% - 10px);
    width: 0;
    height: 0;
    border-style: solid;
}

.timeline .event:nth-child(odd) .event-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.8);
}

.timeline .event:nth-child(even) .event-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent rgba(255, 255, 255, 0.8) transparent transparent;
}

.reveal-stagger {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger:nth-child(odd) {
    transform: translateX(-40px);
}

.reveal-stagger:nth-child(even) {
    transform: translateX(40px);
}

.reveal-stagger.visible {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 768px) {
    .timeline {
        margin-left: 0;
        margin-right: 0;
    }
    .timeline::before {
        left: 20px;
        margin-left: -2px;
    }
    .timeline .event {
        width: 100%; /* Full width for the event container */
        left: 0 !important;
        padding-left: 50px; /* Increased padding to make space for the connector */
        padding-right: 20px; /* Match the left timeline bar position for symmetry */
        margin-bottom: 2rem;
    }
    .timeline .event:nth-child(even) {
        left: 0 !important; /* Explicitly reset left for even children */
    }
    /* Ensure padding is consistent for all events on mobile, overriding desktop styles */
    .timeline .event:nth-child(odd),
    .timeline .event:nth-child(even) {
        padding-left: 50px;
        padding-right: 20px;
    }
    .timeline .event::after, .timeline .event:nth-child(even)::after, .timeline .event:nth-child(odd)::after {
        left: 11px; /* Position the dot on the timeline bar (20px - 9px) */
        right: auto;
    }

    /* Hide the desktop arrow and create a new horizontal connector line */
    .timeline .event-content::before,
    .timeline .event:nth-child(odd) .event-content::before,
    .timeline .event:nth-child(even) .event-content::before {
        content: '';
        position: absolute;
        top: calc(50% - 1px);
        left: -22px; /* Position it between the dot and the card */
        right: auto;
        width: 14px; /* Length of the connector line */
        height: 2px;
        background-color: var(--accent);
        border: none;
        display: block; /* Ensure it's visible */
    }

    .timeline .event-content {
        padding: 1.5rem;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    }

    .timeline .event-content h5 {
        font-size: 1.15rem;
    }

    .timeline .event-content small {
        background-color: rgba(139, 69, 19, 0.08);
        padding: 0.2rem 0.5rem;
        border-radius: 6px;
    }
}

/* --- Sacrament Card Styles --- */
.sacrament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.sacrament-card {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.sacrament-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2.25rem;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
    transform: scale(0.3);
}

.visible .sacrament-icon {
    animation: iconBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.2s;
}

.sacrament-card:hover .sacrament-icon {
    transform: scale(1.15) rotate(-10deg);
}

.sacrament-card h5 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.sacrament-card p {
    color: var(--text-medium);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0; /* No margin at the bottom as there's no link */
    flex-grow: 1;
}

/* --- Prayer Resource Card Styles --- */
.prayer-resource-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    padding: 2rem; /* Adjust padding to be uniform */
    position: relative;
    overflow: hidden; /* Hide icon overflow like impact-card */
}

.prayer-resource-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.15;
    transform: rotate(-15deg);
    transition: transform 0.4s ease, opacity 0.4s ease;
    /* Remove properties that are no longer needed */
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
}

.prayer-resource-card:hover .prayer-resource-icon {
    transform: rotate(0deg) scale(1.2);
    opacity: 0.25;
}

.prayer-resource-card h5 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.prayer-resource-card p {
    color: var(--text-medium);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}


/* Reveal Stagger Animation for Timeline */
.reveal-stagger {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger:nth-child(odd) {
    transform: translateX(-40px);
}

.reveal-stagger:nth-child(even) {
    transform: translateX(40px);
}

.reveal-stagger.visible {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 768px) {
    .reveal-stagger:nth-child(odd),
    .reveal-stagger:nth-child(even) {
        transform: translateX(40px); /* All events slide in from the right on mobile */
    }
}

/* --- Custom Calendar Styles --- */
.calendar-container {
    background-color: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.calendar-header {
    background-color: var(--primary-brown);
    color: white;
}

.calendar-nav-btn {
    background-color: transparent;
    border: none;
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    border-radius: 50%; /* Make it circular */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.calendar-header .form-select {
    width: 150px;
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    padding: 0.5rem 2.5rem 0.5rem 1rem; /* Increased padding */
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}
.calendar-header .calendar-month-select {
    min-width: 160px; /* Give the month selector more space */
}

.calendar-header .form-select:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.calendar-header .form-select:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: var(--accent);
    box-shadow: none;
}
.calendar-header .form-select option {
    color: var(--text-dark);
    background-color: var(--white);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 0.75rem 0.25rem;
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.calendar-day {
    position: relative;
    height: 140px; /* Set a fixed height for uniform cells */
    padding: 0.5rem;
    border-right: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background-color: #f8f5f1;
}

.day-number {
    font-weight: 600;
}

.calendar-day.other-month .day-number {
    color: var(--neutral-gray);
    opacity: 0.7;
}

.calendar-day.today {
    background-color: #fffbeB; /* A light yellow */
}

.calendar-day.today .day-number {
    color: var(--white);
    background-color: var(--accent);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.event-list {
    list-style: none;
    padding: 0;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    overflow: hidden;
}

.event-item {
    background-color: rgba(139, 69, 19, 0.15);
    color: var(--primary-brown);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    white-space: normal; /* Allow text to wrap */
    word-break: break-word; /* Break long words if necessary */
    font-weight: 500;
}
/* Mobile-only week display */
#calendar-week-display {
    font-size: 1.1rem;
    min-width: 200px; /* Ensure it has enough space */
}

.event-item-more {
    font-style: italic;
    color: var(--text-medium);
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .calendar-header .h4 {
        font-size: 1.1rem;
    }
    #calendar-day-headers {
        display: none; /* Hide the separate header row on mobile */
    }
    .calendar-grid {
        display: block; /* Change from flex to block for a vertical list */
        padding: 0;
        border-top: none;
    }
    .calendar-day {
        width: 100%;
        height: auto;
        border: none;
        border-bottom: 1px solid var(--border-light);
        display: flex;
        flex-direction: row;
        align-items: flex-start; /* Allow row to grow with content */
        justify-content: space-between;
        padding: 1rem;
    }
    .calendar-day:has(.event-list) {
        cursor: pointer; /* Add pointer cursor only if there are events */
    }
    .day-info {
        display: flex;
        /* Group day-of-week and day-number together */
        flex-direction: column;
        align-items: center; /* Center the day and number within their group */
        gap: 0.75rem;
        flex-shrink: 0;
    }
    .day-of-week {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--text-medium);
        text-transform: uppercase;
        width: 3em; /* Give it a fixed width for alignment */
    }
    .event-list { /* Show event text again for week view */
        font-size: 0.9rem;
        text-align: left;
        margin: 0;
        flex-grow: 1;
        padding-left: 1rem; /* Add some space between day and event */
    }
    .event-item {
        /* Retain badge styling on mobile */
        padding: 2px 6px;
        font-weight: 600;
        white-space: normal; /* Allow text to wrap */
    }
}

/* --- File Tree Styles for Organizational Chart --- */
.file-tree ul {
    position: relative;
    padding-left: 1.75rem; /* Increased indentation for nested items */
}

.file-tree ul::before {
    content: '';
    position: absolute;
    left: 0.75rem; /* Aligned with the new padding */
    top: 0;
    bottom: 0;
    width: 1.5px; /* A slightly more substantial line */
    background-color: #DCD9D4; /* A refined, subtle gray-brown */
}

.file-tree li {
    position: relative;
    padding: 0.25rem 0.5rem 0.25rem 1.75rem; /* Increased vertical spacing and added horizontal padding */
    line-height: 1.8; /* Increased line-height for better readability */
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.file-tree li:hover {
    background-color: rgba(139, 69, 19, 0.05); /* Subtle hover effect */
}

.file-tree li::before {
    content: '';
    position: absolute;
    left: 0.75rem; /* Aligned with the new padding */
    top: 1.3rem; /* Perfectly centered with the new line-height */
    width: 1rem;
    height: 1.5px;
    background-color: #DCD9D4; /* Match the vertical line color */
}

.file-tree li:last-child > ul::before {
    height: 1.3rem; /* Stop the vertical line at the last item's connector */
}

.file-tree .bi-folder2, .file-tree .bi-folder2-open { color: var(--accent); }
.file-tree .bi-person-fill, .file-tree .bi-person-workspace, .file-tree .bi-person-fill-gear, .file-tree .bi-bank { color: var(--primary-brown); }

/* --- Collapsible Tree Styles --- */
.file-tree li > .d-flex {
    margin-left: -0.5rem; /* Align toggle with the item's padding */
}

.file-tree .tree-toggle {
    color: var(--text-medium);
    text-decoration: none;
    padding: 0.25rem 0.5rem; /* Make the click area larger */
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 50%;
}

.file-tree .tree-toggle:hover {
    color: var(--text-dark);
    background-color: rgba(0,0,0,0.05);
}

.file-tree .tree-toggle .bi-chevron-right {
    transition: transform 0.3s ease;
    font-size: 0.8rem; /* Slightly smaller chevron */
}

.file-tree .tree-toggle[aria-expanded="true"] .bi-chevron-right {
    transform: rotate(90deg);
}

/* Remove hover effect from the top-level items that are not interactive */
.file-tree > ul > li:not(:has(ul)) {
    pointer-events: none;
}
.file-tree > ul > li:not(:has(ul)):hover {
    background-color: transparent;
}

/* --- Organizational Chart Styles --- */
.org-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

.org-wrap h1, .org-wrap h2 {
    font-weight: 600;
}

/* Tree styles */
.tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree li {
    position: relative;
    margin: 0;
    padding: 0 0 0.25rem 1.75rem; /* Indentation for items */
}

/* The horizontal connector line for each item */
.tree li::before {
    content: '';
    position: absolute;
    top: 1rem; /* Vertically align with the middle of the node */
    left: 0;
    width: 1.25rem; /* Length of the horizontal line */
    border-top: 1px solid var(--accent);
}

/* The vertical connector line for a group of items */
.tree ul {
    position: relative;
    list-style: none;
    margin: 0;
    padding-left: 1.75rem; /* Indentation for the group */
    padding-top: 0.5rem;
}

.tree ul::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    /* left: 0.5rem; Position of the vertical line */
    width: 1px;
    background-color: var(--accent);
}

/* This pseudo-element "erases" the part of the vertical line below the last item's horizontal connector */
.tree ul > li:last-child::after {
    content: '';
    position: absolute;
    top: 1.05rem; /* Start just below the horizontal line */
    bottom: 0;
    left: 0rem; /* Position relative to the li's padding start */
    width: 1px;
    background-color: #dadad7; /* Use the opaque background color to fully "erase" the line */
}

/* Node label */
.node {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Increase gap for better spacing */
    cursor: default; /* Default cursor, pointer on groups */
    padding: 0.2rem 0.5rem; /* Reduced vertical padding */
    border-radius: 8px;
    transition: background-color 0.2s ease; /* Smooth hover transition */
}

.node:hover {
    background-color: rgba(139, 69, 19, 0.04); /* Use a subtle theme color for hover */
}

/* Add a background to the expanded group's node to highlight the active parent */
.group:not(.collapsed) > .node {
    background-color: rgba(217, 143, 59, 0.05); /* A very light gold accent */
}

.node .toggle-icon {
    margin-left: auto; /* Push the icon to the far right */
    font-size: 0.8rem;
    color: var(--text-medium);
    transition: transform 0.3s ease;
    padding: 0.25rem;
}

/* Rotate the icon when the parent is not collapsed (i.e., it's open) */
.group:not(.collapsed) > .node .toggle-icon {
    transform: rotate(90deg);
}

.member-count {
    font-size: 0.8rem;
    color: var(--text-medium);
    margin-left: 0.5rem;
    font-style: italic;
    display: none; /* Hidden by default */
}

/* Show the count only when the group is expanded (not collapsed) */
.group:not(.collapsed) .member-count {
    display: inline;
}


.group > .node {
    cursor: pointer; /* Only groups are clickable */
}

.node .bi { font-size: 1.05rem; }
.node .title { font-weight: 500; }

/* Make member names slightly smaller for better hierarchy */
.group > .node .title {
    font-weight: 600; /* Make group titles bolder */
    color: var(--primary-brown) !important; /* Ensure primary color is applied */
}
.member .node .title {
    font-size: 0.9rem;
    color: var(--text-medium);
}

/* Distinguish groups */
.group .node .bi { color: var(--primary-brown); }
.member .node .bi { color: var(--text-medium); }

/* Collapsed state */
.collapsed > ul { display: none; }

/* Top header styling */
.top-header { display: flex; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; }

.chart-head-container .bishop-title {
    background-color: #f0e6dd; /* A very light shade of the primary brown */
    color: var(--text-dark);
    padding: 1rem 2rem;
    border-radius: 12px;
    display: inline-block;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    line-height: 1.4;
}

.bishop-role {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
}

.bishop-name {
    display: block;
    font-size: 1.3rem;
    color: var(--primary-brown);
    font-weight: 600;
    animation: pulse-text-glow 3s infinite alternate ease-in-out;
}

.chart-head .priest-title {
    font-weight: 500;
    color: var(--text-medium);
    font-size: 0.95rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-light);
    background-color: var(--light-bg);
    border-radius: 50px;
    display: inline-block;
}

.chart-head-container {
    /* This container is now just for centering text */
}

.chart-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.chart-logo {
    height: 150px; /* Made the logos slightly larger */
    width: auto;
    flex-shrink: 0;
}

/* --- Org Chart Search Styles --- */
.tree li.search-no-match {
    display: none;
}
.node.search-highlight {
    background-color: rgba(217, 143, 59, 0.15); /* A light gold accent */
    box-shadow: 0 0 8px rgba(217, 143, 59, 0.2);
}
.tree li.search-dimmed > .node {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* When searching, don't dim the parent nodes, keep them fully visible */
.tree li.search-dimmed > .node { opacity: 1; }

/* --- Org Chart Controls & Search --- */
.org-chart-controls-wrapper {
    /* Wrapper is now a simple block container */
}

.org-chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.org-chart-controls .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1; /* Allow buttons to grow and fill space on mobile */
}

@media (min-width: 768px) {
    .org-chart-controls {
        flex-wrap: nowrap;
    }
    .org-chart-controls .btn {
        flex-grow: 0; /* Revert to natural width on desktop */
    }
}

@media (max-width: 767px) {
    .org-chart-controls .btn .btn-text {
        display: none; /* Hide text on mobile */
    }
    .org-chart-controls .btn {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        justify-content: center; /* Center the icon inside the button */
    }
}

.org-chart-search-wrapper {
    max-width: 705px; /* Set a max-width to make the search bar smaller */
    margin-left: auto; /* Center the search bar */
    margin-right: auto; /* Center the search bar */
}
.org-chart-search-wrapper .form-control, .org-chart-search-wrapper .input-group-text {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.org-chart-search-wrapper .form-control:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(217, 143, 59, 0.2);
}

/* Style for the first-level person (Parish Priest) to make them stand out */
.tree li[data-depth="1"].member .node .title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
}

.tree li.main-priest-group > .node .title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tree li[data-depth="2"].member .node .title {
    font-weight: 600;
}


/* --- Organizational Chart Responsive Styles --- */
@media (max-width: 768px) {
    .org-wrap {
        padding: 0; /* Remove horizontal padding to use full width */
    }

    .tree ul {
        padding-left: 0.75rem; /* Further reduce indentation */
        border-left-style: solid; /* Use solid lines on mobile for a cleaner look */
        border-left-color: var(--border-light);
    }

    .tree li {
        padding-left: 1rem; /* Adjust indentation */
    }

    .tree li:before {
        border-top-style: solid;
        border-top-color: var(--border-light);
        width: 0.75rem; /* Shorten the horizontal connector */
        top: 1.3rem;
    }
    .tree ul > li:last-child::after {
        left: -0.75rem; /* Adjust to new indentation */
    }
    .chart-logo {
        height: 100px;
    }

    .node {
        gap: 0.6rem; /* Adjust gap */
        padding: 0.5rem 0.25rem; /* Add vertical padding for better touch targets */
        align-items: flex-start; /* Align items to the top for wrapped text */
    }

    .node > div {
        display: flex;
        flex-direction: column;
    }

    .node .bi {
        font-size: 0.9rem; /* Smaller icons */
    }

    .node .title,
    .member .node .title,
    .tree li.main-priest-group > .node .title,
    .tree li[data-depth="1"].member .node .title {
        font-size: 0.85rem; /* Slightly larger for readability */
        line-height: 1.4;
    }

    .member-count {
        font-size: 0.75rem;
    }
}

/* --- Mission & Vision Card --- */
.mission-vision-card {
    position: relative;
    padding-top: 4rem; /* Space for the icon */
}

.mission-vision-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.mission-vision-card:hover .mission-vision-icon {
    transform: translateX(-50%) scale(1.1) rotate(-10deg);
    box-shadow: 0 10px 25px rgba(217, 143, 59, 0.4);
}

.mission-vision-title {
    font-family: 'Lora', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-brown);
    margin-bottom: 1rem;
}

.vision-col {
    border-left: 1px solid var(--border-light);
}

@media (max-width: 767px) {
    .vision-col {
        border-left: none;
        border-top: 1px solid var(--border-light);
        padding-top: 2rem; /* g-5 provides bottom padding, so we only need top */
    }
}

/* --- Patron Story Card Styles --- */
.patron-story-card {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.patron-story-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2.25rem;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
    transform: scale(0.3);
}

.visible .patron-story-icon {
    animation: iconBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.2s;
}

.patron-story-card:hover .patron-story-icon {
    transform: scale(1.15) rotate(-10deg);
}

.patron-story-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.patron-story-card p {
    color: var(--text-medium);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
    flex-grow: 1;
}

/* --- Prayer Accordion Styles --- */
.prayer-accordion {
    --bs-accordion-border-color: transparent;
    --bs-accordion-border-radius: 16px;
    --bs-accordion-inner-border-radius: 16px;
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238B4513'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.50 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(217, 143, 59, 0.25);
    --bs-accordion-active-color: var(--white);
    --bs-accordion-active-bg: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.prayer-accordion .accordion-item {
    background-color: transparent;
    border: none;
    margin-bottom: 1rem;
}

.prayer-accordion .accordion-button {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(10px);
    border-radius: 16px !important; /* Override Bootstrap's rounded corners */
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
    padding: 1.25rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-brown);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.prayer-accordion .accordion-button:not(.collapsed) {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.prayer-accordion .accordion-button:not(.collapsed)::after {
    transform: rotate(-180deg);
}

.prayer-accordion .accordion-button:focus {
    border-color: var(--accent);
}

.prayer-accordion .accordion-button i {
    font-size: 1.5rem;
    color: var(--accent);
    transition: color 0.3s ease;
}

.prayer-accordion .accordion-button:not(.collapsed) i {
    color: var(--white);
}

.prayer-accordion .accordion-body {
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 0 0 16px 16px;
    margin-top: -15px; /* Pull body up under the button */
    padding-top: 2.5rem; /* Add back padding */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: none;
}

.prayer-accordion .list-group-item {
    background-color: transparent;
    border-color: var(--border-light);
}

/* --- Mysteries of the Rosary List Styles --- */
.mysteries-list {
    list-style: none;
    padding-left: 0;
    counter-reset: mysteries-counter;
}

.mysteries-list li {
    counter-increment: mysteries-counter;
    position: relative;
    padding: 0.5rem 0 0.5rem 2.5rem;
    margin-bottom: 0.5rem;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.mysteries-list li::before {
    content: counter(mysteries-counter);
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--accent-2);
    font-size: 1.1rem;
}
