/* 1. Variables & Root */
:root {
    --primary: #800020;
    --primary-dark: #5a0017;
    --primary-light: #a8324a;
    --white: #fff;
    --light-gray: #f5f5f5;
    --gray: #e0e0e0;
    --text: #333;
    --text-light: #666;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* 2. Global Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: #fafafa;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Removed repeat display:block in later classes */
}

/* 3. Layout Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    display: flex;
    gap: 40px;
    margin-bottom: 50px;
}

.content-primary {
    flex: 3;
}

.content-sidebar {
    flex: 1;
    position: relative;
}

/* 4. Header & Navigation */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px;
    margin-right: 12px;
}

.logo-text h1 {
    font-size: 1.2rem;
    margin-bottom: 0;
}

.logo-text p {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 2px;
}

.nav-menu {
    display: flex;
}

.nav-menu li {
    margin-left: 25px;
    position: relative;
}

.nav-menu a {
    font-weight: 500;
    padding: 5px 0;
    color: var(--text);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a i {
    font-size: 0.75rem;
}

.nav-menu a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--primary);
    transition: var(--transition);
}

.nav-menu a:hover:after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
}

/* 5. Marquee & Hero */
.marquee-bar {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 8px 0;
    overflow: hidden;
}

.marquee-content {
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    font-size: 0.85rem;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.hero {
    position: relative;
    height: 300px;
    margin-bottom: 40px;
}

.hero-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    overflow: hidden;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 6. Directory Controls (Search & Filters) */
.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 18px;
    border-radius: 8px;
    border: 2px solid var(--gray);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(128,0,32,0.1);
}

.search-box i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.1rem;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-tab {
    padding: 8px 16px;
    background: var(--light-gray);
    border: 2px solid var(--gray);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.85rem;
}

.filter-tab:hover, .filter-tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.results-info {
    padding: 12px;
    background: var(--light-gray);
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* 7. Accordion (Diocese & Region) */
.diocese-section { margin-bottom: 20px; }

.diocese-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.diocese-header:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.diocese-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.diocese-count {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.diocese-toggle, .region-toggle { transition: transform 0.3s; }

.diocese-header.active .diocese-toggle, 
.region-header.active .region-toggle { 
    transform: rotate(180deg); 
}

.diocese-content, .region-parishes { display: none; }
.diocese-content.active, .region-parishes.active { display: block; }

.diocese-content {
    padding: 15px;
    background: var(--white);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.region-header {
    background: var(--light-gray);
    padding: 10px 15px;
    border-left: 4px solid var(--primary);
    border-radius: 5px;
    margin-bottom: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.region-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 8. Parish Cards & Grid */
.parish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.parish-card {
    background: var(--white);
    border: 2px solid var(--gray);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.parish-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.parish-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.parish-content { padding: 15px; }

.parish-number {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.parish-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.parish-detail-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.parish-detail-row i {
    margin-right: 8px;
    color: var(--primary);
    width: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.parish-detail-row a {
    color: var(--primary);
    text-decoration: underline;
}

/* 9. Components (Buttons, Sidebar, Cards) */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--primary);
    color: var(--white);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
}

.content-card {
    background: var(--white);
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.content-sidebar-sticky {
    position: sticky;
    top: 100px;
    width: 100%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
}

.content-sidebar-sticky::-webkit-scrollbar { display: none; }

.sidebar-widget {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary);
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.sidebar-links li {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray);
    margin-bottom: 10px;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.sidebar-links i {
    margin-right: 10px;
    color: var(--primary);
    width: 14px;
    text-align: center;
}

/* 10. Footer */
footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #4a0012 100%);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 35px;
    margin-bottom: 35px;
}

.footer-column h3 {
    color: var(--white);
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--white) 0%, transparent 100%);
}

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

/* 11. Utilities */
.no-results {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
    display: none;
}

/* 12. Media Queries */
@media (max-width: 992px) {
    .main-content { flex-direction: column; }
    .content-sidebar-sticky { position: relative; top: auto; max-height: none; }
    .parish-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 80px);
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        z-index: 999;
    }
    .nav-menu.active { left: 0; }
    .nav-menu li { margin: 0 0 15px 0; }
    .mobile-menu-btn { display: block; }
    .hero { height: 250px; }
    .parish-grid { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .logo { flex-direction: column; align-items: flex-start; }
    .logo img { margin-bottom: 6px; }
    .logo-text h1 { font-size: 1rem; }
    .hero { height: 220px; }
}