/* Global Styles */
:root {
    --deep-blue: #002244;
    --golden-yellow: #FFD700;
    --light-grey: #f4f4f4;
    --dark-grey: #333;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: #fff;
    color: var(--dark-grey);
    overflow-x: hidden;
}

a {
    color: var(--deep-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

/* HEADER & NAVIGATION FIX - CORRECTED TRANSPARENCY ENFORCEMENT */
.header {
color: white;
padding: 0 1rem;
width: 100%;
height: var(--header-height);
z-index: 9999;
transition: background-color 0.4s ease, box-shadow 0.4s ease;
}


/* Force transparency on home page header with higher specificity */
body.home-page header.header {
position: absolute !important;
top: 0;
left: 0;
right: 0;
background: none !important;
background-color: transparent !important;
box-shadow: none !important;
}


/* Solid background only after scrolling */
body.home-page header.header.scrolled {
position: fixed !important;
background-color: var(--deep-blue) !important;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
}


/* Other pages always get dark header */
body:not(.home-page) header.header {
position: relative !important;
background-color: var(--deep-blue) !important;
box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}


/* Navbar and links */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    height: 100%;
}

.logo a {
    color: white;
    font-size: 1.6rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
}
.logo-img {
    height: 3rem; /* Adjusted height for a better fit */
    width: auto; /* Maintain aspect ratio */
    object-fit: contain; /* Prevents the image from being distorted or cut off */
    margin-right: 15px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.8rem;
}

.nav-links li a {
    color: white;
    font-weight: 600;
    padding: 5px 0;
    position: relative;
    text-shadow: 0px 1px 2px rgba(0,0,0,0.7);
}


.nav-links li a::after {
content: '';
position: absolute;
width: 0;
height: 2px;
bottom: -5px;
left: 50%;
background-color: var(--golden-yellow);
transition: all 0.3s ease-out;
transform: translateX(-50%);
}

.nav-links li a:hover::after {
    width: 100%;
}


/* --- DROPDOWN FIXES --- */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--deep-blue);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 10000;
    border-radius: 5px;
    overflow: hidden;
    /* FIX: Replaced margin-top with padding to prevent hover gap */
    padding-top: 10px;
    padding-bottom: 5px;
}

.dropdown-content a {
    color: white;
    /* FIX: Increased horizontal padding and centered text */
    padding: 12px 20px;
    display: block;
    text-align: center;
}

.dropdown-content a:hover {
    background-color: rgba(255, 215, 0, 0.1);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown.open .dropdown-content {
    display: block;
}
/* --- END OF DROPDOWN FIXES --- */

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: white;
    transition: all 0.3s ease-in-out;
}

/* HERO SECTION */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 100svh;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100svh;
    z-index: 0;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
}

.hero-video-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    border: 0;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 20, 40, 0.6);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.6rem;
    max-width: 800px;
    margin: auto;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

#main-content {
    padding-top: 0;
}

.page-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.content-section {
    padding: 2rem 0;
}

.content-section h2 {
    color: var(--deep-blue);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.2rem;
    font-weight: 600;
}

/* --- GALLERY & BOOKLIST GRID STYLES --- */
.gallery-grid, .booklist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item, .booklist-item {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover, .booklist-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-item {
    cursor: pointer;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.anniversary-gallery-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #d7dee8;
}

.anniversary-gallery-header {
    text-align: center;
}

.anniversary-gallery-header h2 {
    margin-bottom: 0.5rem;
}

.anniversary-gallery-header p {
    max-width: 720px;
    margin: 0 auto;
}

.anniversary-group {
    margin-top: 1.75rem;
}

.anniversary-group-title {
    margin: 0 0 1rem 0;
    color: var(--deep-blue);
}

.anniversary-group-grid {
    margin-top: 0;
}

.gallery-item-period {
    position: absolute;
    left: 0.6rem;
    bottom: 0.6rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* Styles for Booklist items */
.booklist-item .booklist-preview {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f4f8;
}
.booklist-item .booklist-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.booklist-item .booklist-preview .doc-icon {
    font-size: 4rem;
    color: var(--deep-blue);
}
.booklist-info {
    padding: 1rem;
    text-align: center;
    background: #fff;
    border-top: 1px solid #eee;
}
.booklist-info h4 {
    color: var(--deep-blue);
    margin-bottom: 0.5rem;
}
.booklist-info .button {
    margin-top: 0.5rem;
    display: inline-block;
    width: auto;
}

/* Modal (Lightbox) Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 42px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    z-index: 10001;
}

.modal-arrow:hover {
    background: rgba(0, 0, 0, 0.55);
}

.modal-arrow-left {
    left: 24px;
}

.modal-arrow-right {
    right: 24px;
}

.modal-overlay.active .modal-arrow {
    display: flex;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ccc;
}
/* --- END OF GALLERY STYLES --- */

/* Homepage Layout */
.home-layout {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 2rem;
}

/* Cards for News, Events, Blog */
.card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-image-link {
    display: block;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.card-content h3 a {
    color: var(--deep-blue);
    text-decoration: none;
}

.card-content h3 a:hover {
    color: #004a8d;
    text-decoration: underline;
}

.card-content p {
    font-size: 0.95rem;
    color: #555;
    flex-grow: 1;
}

/* Footer */
.footer {
    background-color: var(--deep-blue);
    color: #ccc;
    padding: 3rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--golden-yellow);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer-section p, .footer-section a {
    color: #ccc;
    margin-bottom: 0.5rem;
    text-decoration: none;
}
.footer-section a:hover {
    color: white;
    text-decoration: underline;
}
.footer-links li {
    list-style: none;
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}
.social-links a:hover {
    transform: scale(1.2);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #003366;
    font-size: 0.9rem;
}

/* Full Page Content Styles */
.page-content .page-title {
    color: var(--deep-blue);
    margin-bottom: 2rem;
}
.page-content .page-body {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.page-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* New styles for uniform, expandable images in content */
.page-body .content-image {
    max-height: 450px;
    width: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: opacity 0.3s ease;
    margin-bottom: 1.5rem; /* Add some space below the image */
}

.page-body .content-image:hover {
    opacity: 0.85;
}


/* Admin Dashboard & Forms */
.form-group{margin-bottom:1rem}.form-group label{display:block;font-weight:700;margin-bottom:.5rem;color:var(--deep-blue)}.form-group input,.form-group textarea{width:100%;padding:.75rem;border:1px solid #ccc;border-radius:5px;font-size:1rem;background:#fcfcfc}
.button{background-color:var(--deep-blue);color:#fff;padding:.75rem 1.5rem;border:none;border-radius:5px;cursor:pointer;font-size:1rem;font-weight:600;transition: all .3s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px;}.button:hover{background-color:#003366; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1);}.button-secondary{background-color:#6c757d;color:#fff;}.button-secondary:hover{background-color:#5a6268;}
.message-box{padding:1rem;margin-top:1rem;border-radius:5px;text-align:center}.message-box.success{background-color:#d4edda;color:#155724;border:1px solid #c3e6cb}.message-box.error{background-color:#f8d7da;color:#721c24;border:1px solid #f5c6cb}
.admin-dashboard-section h3{margin-top:2rem;border-bottom:2px solid var(--golden-yellow);padding-bottom:.5rem}.admin-header{display:flex;justify-content:space-between;align-items:center}.tabs-container{display:flex;gap:10px;margin-bottom:1.5rem;flex-wrap:wrap}.tab-button{padding:10px 15px;border:1px solid #ccc;border-radius:5px;background-color:#f0f0f0;cursor:pointer; font-weight: 500;}.tab-button.active{background-color:var(--deep-blue);color:#fff;border-color:var(--deep-blue)}.tab-content{display:none}.tab-content.active{display:block}.list-item{background:#f9f9f9;padding:15px;border-left:5px solid var(--golden-yellow);margin-bottom:10px;border-radius:5px;display:flex;justify-content:space-between;align-items:center; flex-wrap: wrap; gap: 10px;}.list-item .actions{display: flex; gap: 10px;}

/* --- NEW ADMIN BUTTON STYLES --- */
.button.btn-edit { background-color: #17a2b8; }
.button.btn-edit:hover { background-color: #138496; }
.button.btn-danger { background-color: #dc3545; }
.button.btn-danger:hover { background-color: #c82333; }
.button.btn-add { background-color: #28a745; margin-bottom: 1.5rem; }
.button.btn-add:hover { background-color: #218838; }

.item-form {
    background: #fdfdfd;
    padding: 2rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.rich-text-editor {
    position: relative;
    border: 1px solid #cfd7df;
    border-radius: 10px;
    background: #fff;
    overflow: visible;
}

.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.7rem;
    background: linear-gradient(180deg, #f7faff 0%, #eef3fa 100%);
    border-bottom: 1px solid #d6dde6;
}

.rte-toolbar .rte-btn {
    border: 1px solid #d0d9e6;
    border-radius: 7px;
    background: #ffffff;
    color: #19324d;
    padding: 0.42rem 0.65rem;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    min-height: 34px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rte-toolbar .rte-btn:hover {
    background: #f0f5ff;
    border-color: #9bb3d5;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(14, 45, 86, 0.14);
}

.rte-toolbar .rte-btn.is-active {
    background: #d9e9ff;
    border-color: #5e83b1;
    box-shadow: inset 0 0 0 1px rgba(33, 81, 134, 0.18);
}

.rte-select,
.rte-color {
    height: 34px;
    border: 1px solid #c6d0db;
    border-radius: 7px;
    padding: 0 0.45rem;
    background: #fff;
    color: #0f2d48;
    font-size: 0.86rem;
    font-weight: 600;
}

.rte-color {
    width: 44px;
    padding: 0.2rem;
}

.rte-color-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--deep-blue);
    font-weight: 600;
}

.rte-surface {
    min-height: 240px;
    padding: 1rem;
    outline: none;
    background: #fff;
    border-radius: 0 0 10px 10px;
}

.rte-surface:focus {
    box-shadow: inset 0 0 0 2px rgba(0, 34, 68, 0.12);
}

.rte-source-textarea {
    display: none;
}

.rte-context-toolbar {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 20;
    min-width: min(94vw, 760px);
    width: max-content;
    max-width: calc(100% - 16px);
    border: 1px solid #b8c7da;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(13, 38, 70, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.rte-context-toolbar.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.media-url-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.media-url-row input {
    flex: 1 1 320px;
}

.content-media-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.content-media-item input {
    flex: 1 1 320px;
}

.content-media-item .gallery-entry-group,
.content-media-item .gallery-entry-period {
    flex: 1 1 180px;
    min-width: 160px;
}

.anniversary-admin-group {
    margin-top: 1.5rem;
}

.anniversary-admin-group h4 {
    color: var(--deep-blue);
    margin-bottom: 0.75rem;
}

.anniversary-admin-item {
    align-items: stretch;
}

.anniversary-admin-preview {
    width: 160px;
    flex: 0 0 160px;
}

.anniversary-admin-preview img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
}

.anniversary-admin-fields {
    flex: 1 1 380px;
}


/* Responsive Design */
@media (max-width: 992px) {
    .home-layout {
        grid-template-columns: 1fr;
    }
    .gallery-grid, .booklist-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--deep-blue);
        position: absolute;
        top: var(--header-height);
        left: 0;
        padding: 1rem 0;
    }

    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }
    .hamburger {
        display: block;
    }
    .dropdown-content {
        position: static;
        box-shadow: none;
        padding-top: 0;
        padding-bottom: 0;
        border-radius: 0;
    }
    .dropdown.open .dropdown-content {
        display: block;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
    }
    .gallery-grid, .booklist-grid {
        grid-template-columns: 1fr;
    }
    .logo a {
        font-size: 1.2rem;
    }
    .logo-img {
        height: 40px;
    }
    .rte-toolbar {
        gap: 0.4rem;
    }
    .rte-toolbar .rte-btn {
        font-size: 0.82rem;
        padding: 0.35rem 0.55rem;
    }
    .rte-context-toolbar {
        max-width: calc(100vw - 28px);
    }
}

