@import url('https://fonts.googleapis.com/css2?family=Lora:wght@600&family=Open+Sans:wght@400;600&display=swap');

/* Global box-sizing for predictable layouts */
*, *::before, *::after { box-sizing: border-box; }

/* Prevent horizontal scroll */
html { overflow-x: hidden; }
body {
    overflow-x: hidden;
    width: 100%;
}

/* General Body Styles */
body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    /* Subtle Islamic pattern background */
    background-color: #fdfdfd;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23e9e9e9' fill-opacity='0.4'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0h1v5h5v1H6v5H5V6H0V5h5z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: #212121;
    /* Increased contrast from #333 */
}

/* Custom Main Scrollbar Styling to match site theme */
html::-webkit-scrollbar {
    width: 10px;
}
html::-webkit-scrollbar-track {
    background: #f1f1f1;
}
html::-webkit-scrollbar-thumb {
    background: #c2a35f;
    border-radius: 5px;
}
html::-webkit-scrollbar-thumb:hover { background: #a98c4f; }

/* Accessibility: Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #c2a35f;
    color: white;
    padding: 8px;
    z-index: 1001;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

h1,
h2,
h3,
h4 {
    font-family: 'Lora', serif;
    font-weight: 600;
    color: #004d40;
    background: linear-gradient(to right, #004d40, #00695c);
    -webkit-background-clip: text;
    /* Prevent long words from breaking layouts */
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Navigation Bar */
.nav {
    background-color: #fff;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    height: 80px;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
}

.logo h4 {
    margin: 0;
    font-size: 1.6rem;
    color: #004d40;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: #004d40;
    /* Use theme's dark green */
    margin: 5px;
    transition: all 0.3s ease;
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    /* Ensure it stays above content when open on mobile */
    z-index: 1002;
}

.nav-links li {
    padding: 0 1rem;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #c2a35f;
    /* Gold hover color */
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    list-style: none;
    padding: 0;
    padding-top: 10px;
    /* Use padding to create space */
    border-radius: 5px;
    top: 100%;
    /* Position directly below the parent */
    left: 0;
    transition: opacity 0.3s ease;
}

.dropdown-content li a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content li a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    display: block;
}

/* Main content padding to avoid overlap with fixed nav */
main {
    padding-top: 80px;
}

/* Make images fluid by default */
img, video, canvas, svg { max-width: 100%; height: auto; }

/* Prevent layout shifts due to long inline elements */
.container, .info-grid, .page-layout, .card, .featured-card, .contact-card { min-width: 0; }

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 50, 40, 0.85), rgba(0, 30, 20, 0.75)), url('https://via.placeholder.com/1920x1080/004d40/FFFFFF?text=Islamic+Architecture+Hero') no-repeat center center/cover;
    color: #fff;
    margin-top: -80px; /* Counteract main's padding-top to remove gap */
    min-height: 60vh;
    height: 90svh; /* small viewport units for mobile chrome */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: #fff;
    animation: fadeInUp 1s ease-out;
    margin-bottom: 1.5rem;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.6rem;
    font-weight: 300;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Keyframe for hero text animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    display: inline-block;
    background: linear-gradient(145deg, #c2a35f, #a98c4f);
    /* Gold color for buttons */
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
}

.hero .btn {
    padding: 15px 45px;
    font-size: 1.2rem;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: #c2a35f;
}

.btn:hover {
    background: linear-gradient(145deg, #d4b36a, #b99b5a);
    /* Darker gold on hover */
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.hero .btn:hover {
    background: transparent;
    color: #c2a35f;
}

/* General Container for Sections */
.container {
    padding: 2rem;
    margin: 0 auto;
    max-width: min(960px, 92vw);
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
    /* Ensures padding is included in the width */
}

/* Add scroll padding to sections to prevent overlap with fixed nav */
section[id] {
    scroll-margin-top: 100px;
}

/* About Section */
#about {
    background: #fff;
    padding: clamp(2rem, 4vw, 4rem);
    margin: -80px auto 4rem auto; /* Negative margin to overlap hero */
    max-width: min(1100px, 95vw);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    text-align: center;
}

#about h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: left;
}

.about-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #444;
}

.profile-pic {
    border-radius: 50%;
    width: 200px;
    /* Make it a bit smaller */
    height: 200px;
    object-fit: cover;
    border: 5px solid #c2a35f;
    flex-shrink: 0;
    background-color: #f0f0f0;
}

/* Card styles for Lectures/Services */
.card-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #004d40;
    /* Green accent on cards */
    flex: 1 1 300px;
    min-width: 260px;
    max-width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}


/* Styles for embedded video */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card .summary {
    margin-top: 1.5rem;
}

/* Contact Section */
#contact p {
    font-size: 1.1rem;
}

#contact a {
    color: #004d40;
    text-decoration: none;
}

#contact a:hover {
    text-decoration: underline;
}

/* Form Section */
#form {
    background: linear-gradient(135deg, #004d40 0%, #00251a 100%);
    color: #fff;
    padding: clamp(2rem, 5vw, 5rem) 2rem;
    margin: 5rem auto;
    max-width: min(1200px, 95vw);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

#form h2 {
    color: #fff;
    background: none;
    -webkit-text-fill-color: initial;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    font-size: 2.2rem;
}

.form-content p {
    margin: 0 auto 2.5rem auto;
    font-size: 1.25rem;
    max-width: 800px;
    color: rgba(255, 255, 255, 0.9);
}

#form .btn {
    background: #c2a35f;
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* Footer */
footer {
    background-color: #004d40;
    /* Dark Green footer */
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Social Media Links in Footer */
.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    color: #fff;
    font-size: 1.5rem;
    margin: 0 0.75rem;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.social-links a:hover {
    color: #c2a35f;
    /* Gold hover color */
    transform: translateY(-3px);
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 77, 64, 0.2);
    /* Light green */
    border-top-color: #004d40;
    /* Dark Green */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Revamped Media Page --- */
.media-hero {
    height: 60vh;
    background: linear-gradient(rgba(0, 50, 40, 0.85), rgba(0, 30, 20, 0.75)), url('https://via.placeholder.com/1920x600/004d40/FFFFFF?text=Gallery+Moments') no-repeat center center/cover;
    background-attachment: fixed;
}

/* Revamped Media Gallery */
.media-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 4rem); /* Space between each media item section */
}

.media-item-section {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  overflow: hidden;
}

.media-item-section h3 {
  font-size: 2rem;
  text-align: center;
  margin-top: 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid #c2a35f;
  padding-bottom: 1rem;
}

.media-single-image {
  border-radius: 12px;
  overflow: hidden;
  background-color: #f0f2f5; /* BG for padding */
}

.media-single-image img {
  width: 100%;
  height: auto;
  max-height: 70svh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.media-image-link {
  display: block;
  cursor: zoom-in;
  height: 100%;
}


/* --- Responsive Design --- */

/* For large desktops */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media screen and (max-width: 1024px) {
    .card-container {
        flex-direction: column;
        align-items: center;
    }

    .card {
        width: min(100%, 500px);
        max-width: 100%;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .hero {
        height: 80svh; /* Reduce height on tablets */
    }

    .info-grid {
        gap: 2rem;
        width: 98%;
    }

    .info-col {
        padding: 2rem;
    }

    .contact-card {
        padding: 2.5rem;
    }

    /* Fix for mobile scroll issues with fixed backgrounds */
    .hero, .courses-hero, .media-hero, .blog-hero, .contact-hero {
        background-attachment: scroll;
    }
}

@media screen and (max-width: 768px) {
    .nav {
        padding: 0 1rem;
        height: 60px;
    }

    .nav-links {
        position: fixed;
        right: 0;
        height: calc(100vh - var(--nav-h, 60px));
        top: var(--nav-h, 60px);
        background-color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: min(80%, 360px);
        /* Ensure dropdowns can appear outside the nav area */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.35s ease-in-out;
        box-shadow: -4px 0 12px rgba(0,0,0,0.08);
    }

    /* Adjust main content and hero for smaller 60px nav bar */
    main {
        padding-top: 60px;
    }

    .hero {
        margin-top: -60px;
    }

    .nav-links li {
        opacity: 0;
        padding: 1rem 0;
        width: 100%;
        text-align: center;
    }

    .nav-links a { display: block; width: 100%; padding: 0.5rem 1rem; }

    /* Mobile Dropdown Styles */
    .dropdown { position: static; }

    .dropdown-content {
        display: none;
        position: static;
        background-color: #e9e9e9;
        box-shadow: none;
        width: 100%;
        text-align: center;
    }

    .dropdown.active .dropdown-content { display: block; }

    /* Override desktop hover behavior on mobile */
    .dropdown:hover .dropdown-content { display: none; }
    .dropdown.active:hover .dropdown-content { display: block; }

    .burger { display: block; }

    .nav-active { transform: translateX(0%); }

    /* Ensure items are visible when menu is open, even if animations fail */
    .nav-links.nav-active li { opacity: 1; animation: none !important; }

    @keyframes navLinkFade {
        from { opacity: 0; transform: translateX(50px); }
        to { opacity: 1; transform: translateX(0px); }
    }

    /* Burger animation to 'X' */
    .toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
    .toggle .line2 { opacity: 0; }
    .toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); }

    .hero {
        height: 70svh; /* Further reduce height on mobile */
    }

    .hero-content h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
    .hero-content p { font-size: clamp(0.95rem, 3.5vw, 1.1rem); }

    .profile-pic {
        width: 140px;
        height: 140px;
    }

    .container { padding: 1.5rem 1rem; }

    #about, #form {
        padding: 1.5rem 1rem;
        margin-top: 2rem;
        width: 92%;
    }

    #about { margin-top: -40px; }

    .info-col { padding: 1.25rem; }

    .info-col h3 { font-size: 1.4rem; margin-bottom: 1.25rem; }

    .contact-card { padding: 1.5rem 1rem; }

    .social-links a { font-size: 1.25rem; margin: 0 0.5rem; }
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    /* WhatsApp Green */
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* For very small screens */
@media screen and (max-width: 480px) {
    .logo h4 { font-size: 1.1rem; }
    .hero-content h1 { font-size: clamp(1.6rem, 8vw, 2rem); }
    .hero-content p { font-size: 0.95rem; }

    /* Contact page small-screen refinements */
    .contact-card { padding: 1.25rem 1rem; }
    .contact-info-item { flex-wrap: wrap; align-items: flex-start; gap: 0.5rem 0.75rem; }
    .contact-info-item i { width: 40px; height: 40px; min-width: 40px; font-size: 1.2rem; }
    .contact-info-text a, .contact-info-text span { font-size: 1.05rem; }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 16px;
        right: 16px;
        font-size: 24px; /* Adjust icon size for smaller button */
    }
}

/* --- Sidebar Layout for Home Page --- */
.page-layout {
    display: flex;
    flex-wrap: wrap;
    max-width: min(1200px, 95vw);
    margin: 0 auto;
    padding: 2rem 1rem;
    gap: 2rem;
    align-items: flex-start;
}

.sidebar {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px; /* Below fixed nav */
}

.sidebar h3 {
    margin-top: 0;
    border-bottom: 2px solid #c2a35f;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.content-column {
    flex: 3;
    min-width: 0; /* Prevents flex items from overflowing */
}

.content-column .container {
    max-width: 100%;
    margin-bottom: 2rem;
}

@media screen and (max-width: 900px) {
    .page-layout {
        flex-direction: column;
    }
    .sidebar {
        order: 2;
        max-width: 100%;
        width: 100%;
        position: static;
        box-sizing: border-box;
    }
    .content-column {
        width: 100%;
    }
}

/* --- Featured Post Section --- */
.featured-card {
    display: flex;
    gap: 2rem;
    align-items: center;
    text-align: left;
    background: transparent; /* Removed to blend with container */
    border-radius: 0;
    /* Ensure it fits within container padding */
}

/* Adjust Featured Card when inside Sidebar */
.sidebar .featured-card {
    flex-direction: column;
    gap: 1rem;
}

.sidebar .featured-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    border-bottom: none; /* Reset sidebar h3 border */
    padding-bottom: 0;
}

.featured-image {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

.featured-image img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.featured-content {
    flex: 1;
}

.featured-content h3 {
    margin-top: 0;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

@media screen and (max-width: 768px) {
    .featured-card {
        flex-direction: column;
    }
}

/* --- Info Grid (Bottom Sections) --- */
.info-grid {
    display: flex;
    gap: clamp(1rem, 3vw, 3rem);
    width: 95%;
    max-width: min(1600px, 98vw);
    margin: 4rem auto;
    padding: 0;
    box-sizing: border-box;
}

.info-col {
    flex: 1;
    background: #fff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    /* Make columns stretch and allow content to grow */
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.info-col h3 {
    margin-top: 0;
    border-bottom: 3px solid #c2a35f;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    letter-spacing: 0.5px;
}

/* Scrollable Video List */
#sidebar-video-list {
    max-height: 1200px; /* Increased height to match featured post */
    overflow-y: auto;  /* Enable vertical scrolling */
    padding-right: 10px; /* Space for scrollbar */
}

/* Allow content divs to grow to fill the column */
#sidebar-video-list,
#featured-post-content {
    flex-grow: 1;
    min-height: 0; /* Prevents overflow issues in flex children */
}

/* Custom Scrollbar Styling */
#sidebar-video-list::-webkit-scrollbar {
    width: 6px;
}
#sidebar-video-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
#sidebar-video-list::-webkit-scrollbar-thumb {
    background: #c2a35f;
    border-radius: 3px;
}

/* --- Featured Post (in info-col) --- */
.featured-post-full {
    text-align: left;
}

.featured-post-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.featured-post-body p {
    margin-top: 0;
    line-height: 1.7;
    color: #333;
}

@media screen and (max-width: 768px) {
    .info-grid {
        flex-direction: column;
    }
}

/* --- Blog Post Page Styles --- */
.post-article {
    max-width: 800px !important; /* Override container max-width for reading focus */
    background: #fff;
    padding: 3rem !important;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    margin-top: 2rem;
    margin-bottom: 4rem;
    text-align: left;
}

.post-header {
    margin-bottom: 2rem;
    text-align: center;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-meta {
    color: #777;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.post-featured-image {
    width: 100%;
    margin-bottom: 2.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    font-family: 'Lora', serif; /* Use serif for better reading experience */
    font-size: 1.2rem;
    line-height: 1.9;
    color: #333;
    white-space: pre-wrap; /* Preserve line breaks from text fields */
}

.post-content p {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #c2a35f;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.back-link:hover {
    transform: translateX(-5px);
    color: #004d40;
}

@media (max-width: 768px) {
    .post-article {
        padding: 1.5rem !important;
    }
    .post-header h1 {
        font-size: 2rem;
    }
}

/* --- Revamped Blog Section --- */
.blog-hero {
    height: 60vh;
    background: linear-gradient(rgba(0, 50, 40, 0.85), rgba(0, 30, 20, 0.75)), url('https://via.placeholder.com/1920x600/004d40/FFFFFF?text=Islamic+Library') no-repeat center center/cover;
    background-attachment: fixed;
}

.blog-section-overlap {
    margin-top: -100px !important;
    position: relative;
    z-index: 10;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 1400px !important;
    width: 95%;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    padding-bottom: 4rem;
}

.blog-card-revamp {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    height: 100%;
}

.blog-card-revamp:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.blog-card-revamp img {
    width: 100%;
    height: 300px;
    object-fit: cover; /* Ensures the image fills the card, cropping if necessary */
    transition: transform 0.5s ease;
}

.blog-card-revamp:hover img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 1.5rem;
    text-align: center;
    background: #fff;
}

.blog-card-content h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #004d40;
    font-weight: 700;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Revamped Contact Page --- */
.contact-hero {
    height: 60vh;
    background: linear-gradient(rgba(0, 50, 40, 0.85), rgba(0, 30, 20, 0.75)), url('https://via.placeholder.com/1920x600/004d40/FFFFFF?text=Contact+Us') no-repeat center center/cover;
    background-attachment: fixed;
}

.contact-section-overlap {
    margin-top: -100px !important;
    position: relative;
    z-index: 10;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 900px !important;
    width: 95%;
}

.contact-card {
    background: #fff;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    text-align: left;
}

.contact-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 2.2rem;
}

.contact-info-item {
    margin: 1.5rem 0;
    display: flex;
    align-items: center; /* vertically center icon and text */
    justify-content: flex-start; /* left-align within the card */
    gap: 1rem;
    flex-wrap: nowrap; /* keep icon and text together */
}

.contact-info-item i {
    color: #c2a35f;
    font-size: 1.4rem; /* smaller glyph inside circle */
    background: rgba(194, 163, 95, 0.1);
    width: 44px;
    height: 44px;
    min-width: 44px; /* prevent shrinking */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(194, 163, 95, 0.25);
}

.contact-info-text {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-info-text strong {
    display: block;
    font-size: 0.9rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.contact-info-text a, .contact-info-text span {
    font-size: 1.3rem;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.contact-info-text a:hover {
    color: #004d40;
}

/* --- Revamped Courses Page --- */
.courses-hero {
    height: 60vh;
    background: linear-gradient(rgba(0, 50, 40, 0.9), rgba(0, 30, 20, 0.8)), url('https://via.placeholder.com/1920x600/004d40/FFFFFF?text=Seek+Knowledge') no-repeat center center/cover;
    background-attachment: fixed;
}

.course-card-revamp {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

.course-card-revamp:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.course-card-revamp img {
    width: 100%;
    height: clamp(160px, 28vw, 220px);
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-card-revamp:hover img {
    transform: scale(1.05);
}

.course-card-content {
    padding: clamp(1rem, 3vw, 2rem);
    text-align: left;
    background: #fff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.course-badge {
    display: inline-block;
    background: rgba(194, 163, 95, 0.15);
    color: #c2a35f;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-card-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: #004d40;
}

.course-card-content p {
    margin-bottom: 2rem;
    color: #666;
    flex-grow: 1;
    line-height: 1.6;
    font-size: 1rem;
}

.course-card-content .btn {
    align-self: flex-start;
    background: transparent;
    color: #c2a35f;
    border: 2px solid #c2a35f;
    padding: 10px 25px;
    border-radius: 50px;
}

.course-card-content .btn:hover {
    background: #c2a35f;
    color: #fff;
}