* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

.navbar {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 1rem 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.nav-logo-img {
    height: 50px;
    width: auto;
    border-radius: 10px;
}

.nav-brand h2 {
    color: #ffc107;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-brand span {
    color: #ffffff;
    font-size: 0.8rem;
    display: block;
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-menu a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #ffc107;
    color: #1a1a1a;
}

/* Keep the new page easy to identify on every navigation bar. */
.nav-menu a.nav-constitution-link {
    border: 1px solid rgba(255, 193, 7, 0.85);
    white-space: nowrap;
}

.nav-menu a.nav-constitution-link:hover,
.nav-menu a.nav-constitution-link.active {
    background: #ffc107;
    color: #1a1a1a;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #ffc107;
    background: none;
    border: none;
}

.hero {
    height: 100vh;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(46,125,50,0.5) 100%),
                url('images/bg.jpg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    background: linear-gradient(135deg, #fff, #ffc107);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content h2 {
    font-size: 2.5rem;
    color: #ffc107;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto;
}

.section {
    padding: 6rem 2rem;
    min-height: 100vh;
    margin-top: 70px;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    color: #2e7d32;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    margin: 1rem auto;
    border-radius: 2px;
}

.bg-light {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8f5e9 100%);
}

/* BIGGER CARDS - 2 per row on laptop */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* BIGGER IMAGES - 400px */
.card-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* BIGGER VIDEO */
.card-video {
    width: 100%;
    height: 400px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.card-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-video iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* BIGGER PLACEHOLDER */
.no-media {
    height: 400px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: white;
}

.card-content {
    padding: 2rem;
}

.card-title {
    font-size: 1.4rem;
    color: #2e7d32;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.card-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card-text {
    color: #555;
    line-height: 1.6;
}

.imam-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.imam-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,193,7,0.4);
}

.content-section {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    font-size: 1.1rem;
    line-height: 1.8;
}

.footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 4rem 2rem 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: #ffc107;
    margin-bottom: 1.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: #ffc107;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icons a {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    text-decoration: none;
}

.social-icons a:hover {
    background: #ffc107;
    color: #1a1a1a;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #888;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #ffc107;
    color: #1a1a1a;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    font-size: 1.5rem;
    z-index: 999;
}

/* Constitution page */
.constitution-section {
    background: #f8f9fa;
}

.constitution-shell {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 3rem;
}

.document-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 3.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e2e7e2;
}

.document-information h2,
.reader-heading h2 {
    color: #2e7d32;
    font-size: 2rem;
    line-height: 1.25;
}

.title-accent {
    width: 80px;
    height: 5px;
    margin: 1rem 0 2rem;
    border-radius: 3px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
}

.document-information > p,
.reader-heading p {
    color: #697069;
    font-size: 1.05rem;
}

.document-information > p {
    max-width: 760px;
}

.document-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2.25rem;
}

.document-meta > div {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #e2e7e2;
    border-radius: 12px;
    background: #f4f8f4;
}

.document-meta span,
.document-meta strong {
    display: block;
}

.document-meta span {
    margin-bottom: 0.3rem;
    color: #858d85;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.document-meta strong {
    color: #333;
    font-size: 1rem;
}

.pdf-download-card {
    align-self: start;
    padding: 2rem;
    border-radius: 18px;
    background: #e8f5e9;
    text-align: center;
}

.pdf-file-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 118px;
    margin: 0 auto;
    border: 2px solid #c9ddcb;
    border-radius: 12px;
    background: white;
    color: white;
}

.pdf-file-icon::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 30px;
    height: 30px;
    border-left: 2px solid #c9ddcb;
    border-bottom: 2px solid #c9ddcb;
    border-radius: 0 10px 0 4px;
    background: #dcebdd;
}

.pdf-file-icon span {
    position: relative;
    z-index: 1;
    display: block;
    width: 126px;
    margin: 34px -17px 0;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    background: #d9363e;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
}

.pdf-download-card h3 {
    margin-top: 1rem;
    color: #1a1a1a;
    font-size: 1.3rem;
}

.pdf-download-card p {
    margin: 0.35rem 0 1.5rem;
    color: #7a817a;
    font-size: 0.9rem;
}

.constitution-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.85rem 1.2rem;
    border-radius: 30px;
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #1a1a1a;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.constitution-download:hover,
.constitution-download:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(255,193,7,0.35);
}

.online-reader {
    padding-top: 3rem;
}

.reader-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.reader-heading p {
    margin-top: 0.5rem;
}

.reader-heading > span {
    flex: 0 0 auto;
    padding: 0.6rem 1rem;
    border: 1px solid #cfe3d1;
    border-radius: 30px;
    background: #f2f8f2;
    color: #2e7d32;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.reader-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.constitution-toc {
    position: sticky;
    top: 105px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: 16px;
    background: #f4f8f4;
    scrollbar-width: thin;
    scrollbar-color: #b7cbb9 transparent;
}

.constitution-toc h3 {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dbe6dc;
    color: #2e7d32;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.constitution-toc nav {
    display: grid;
}

.constitution-toc a,
.mobile-constitution-toc a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    padding: 0.75rem 0.65rem;
    border-bottom: 1px solid #e0e8e0;
    border-radius: 9px;
    color: #3f453f;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.constitution-toc a span,
.mobile-constitution-toc a span {
    color: #91a093;
    font-size: 0.72rem;
    font-weight: 700;
}

.constitution-toc a strong,
.mobile-constitution-toc a strong {
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.3;
}

.constitution-toc a:hover,
.constitution-toc a.active,
.constitution-toc a:focus-visible {
    background: #2e7d32;
    color: white;
}

.constitution-toc a:hover span,
.constitution-toc a.active span,
.constitution-toc a:focus-visible span {
    color: #ffc107;
}

.mobile-constitution-toc {
    display: none;
}

.constitution-document {
    min-width: 0;
    padding: clamp(1.5rem, 4vw, 3.25rem);
    border: 1px solid #dfe5df;
    border-radius: 16px;
    color: #3d423d;
    overflow-wrap: anywhere;
}

.constitution-document > :first-child {
    margin-top: 0;
}

.constitution-document p,
.constitution-document li,
.constitution-document blockquote {
    font-size: 1rem;
    line-height: 1.85;
}

.constitution-document p {
    margin: 0.85rem 0;
}

.constitution-document ol,
.constitution-document ul {
    margin: 0.75rem 0 1.25rem 1.6rem;
}

.constitution-document li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.constitution-document blockquote {
    margin: 1rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 4px solid #ffc107;
    color: #555d55;
}

.constitution-document h1 {
    margin: 2rem 0 0.75rem;
    color: #2e7d32;
    font-size: 1.35rem;
    line-height: 1.35;
}

.constitution-document .article-heading {
    scroll-margin-top: 115px;
    margin: 3.5rem 0 1rem;
    padding: 0.85rem 1rem;
    border-left: 5px solid #ffc107;
    border-radius: 0 10px 10px 0;
    background: #f4f8f4;
    color: #2e7d32;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.constitution-document .article-heading:first-of-type {
    margin-top: 2rem;
}

.constitution-document .article-heading + p {
    color: #1f241f;
    font-size: 1.18rem;
}

.constitution-document mark {
    padding: 0.05em 0.12em;
    background: #fff4c5;
    color: inherit;
}

.constitution-document u {
    text-decoration-color: #ffc107;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

.constitution-document a {
    color: #2e7d32;
}

@media (max-width: 1280px) and (min-width: 769px) {
    .navbar {
        padding: 1rem 30px;
    }

    .nav-menu {
        gap: 0.35rem;
    }

    .nav-menu a {
        padding: 0.45rem 0.65rem;
        font-size: 0.9rem;
    }
}

/* Collapse the navigation earlier so the last item never moves off screen. */
@media (max-width: 1160px) {
    .navbar {
        padding: 1rem 30px;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 82px;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 82px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding: 1rem 30px 1.5rem;
        border-radius: 0 0 14px 14px;
        background: #1a1a1a;
        box-shadow: 0 12px 25px rgba(0,0,0,0.3);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        width: 100%;
        padding: 0.75rem 1rem;
        text-align: center;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* Tablet - 2 cards */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-image, .card-video, .no-media {
        height: 350px;
    }
    .navbar {
        padding: 1rem 50px;
    }
}

/* Mobile - 1 card */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: #1a1a1a;
        padding: 1rem;
        border-radius: 10px;
        position: absolute;
        top: 70px;
        left: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero {
        background-attachment: scroll;
        height: 70vh;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }
    
    .card-image, .card-video, .no-media {
        height: 300px;
    }
    
    .navbar {
        padding: 1rem 20px;
    }

    .constitution-shell {
        padding: 1.35rem;
    }

    .document-overview,
    .reader-layout {
        grid-template-columns: 1fr;
    }

    .document-overview {
        gap: 2rem;
    }

    .document-meta {
        grid-template-columns: 1fr;
    }

    .reader-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .constitution-toc {
        display: none;
    }

    .mobile-constitution-toc {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #dbe6dc;
        border-radius: 12px;
        background: #f4f8f4;
    }

    .mobile-constitution-toc summary {
        padding: 1rem;
        color: #2e7d32;
        cursor: pointer;
        font-weight: 700;
    }

    .mobile-constitution-toc nav {
        display: grid;
        max-height: 350px;
        overflow-y: auto;
        padding: 0 1rem 1rem;
    }

    .constitution-document {
        padding: 1.25rem;
    }

    .constitution-document p,
    .constitution-document li,
    .constitution-document blockquote {
        font-size: 0.95rem;
    }
}

@media print {
    .navbar,
    .footer,
    .scroll-top,
    .document-overview,
    .reader-heading,
    .constitution-toc,
    .mobile-constitution-toc,
    .section-title {
        display: none !important;
    }

    .section,
    .constitution-shell,
    .online-reader,
    .constitution-document {
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .reader-layout {
        display: block;
    }
}
