/* ==================================
   GENERAL RESET
================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* ==================================
   BODY
================================== */

body {
    font-family: Georgia, "Times New Roman", serif;

    min-height: 100vh;

    margin: 0;
    padding: 30px;

    background:
        linear-gradient(
            rgba(248,246,240,.45),
            rgba(248,246,240,.45)
        ),
        url("../nile_map_optimized.webp");

    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;

    color: #222;
}


/* ==================================
   MAIN CONTAINER
================================== */

.container {
    max-width: 1500px;
    margin: 0 auto;
}


/* ==================================
   HERO PANEL
================================== */

.hero {
    background: rgba(35,35,35,.72);

    border-radius: 20px;

    padding: 40px 35px;

    margin-bottom: 45px;

    text-align: center;

    box-shadow:
        0 12px 35px rgba(0,0,0,.30);

    border: 1px solid rgba(255,255,255,.15);
}

.hero-logo {
    width: 140px;

    margin-bottom: 20px;

    border-radius: 12px;

    transition: transform .3s ease;
}

.hero-logo:hover {
    transform: scale(1.05);
}

.hero h1 {
    color: white;

    font-size: clamp(2.5rem, 5vw, 4.5rem);

    line-height: 1.1;

    margin-bottom: 12px;

    text-shadow:
        3px 3px 8px rgba(0,0,0,.65);

    border-top: 6px solid #89CFF0;
    border-bottom: 6px solid #89CFF0;

    padding: 16px 10px;
}

.hebrew-title {
    color: #89CFF0;

    font-size: 2.2rem;

    margin: 18px 0;

    letter-spacing: 2px;
}

.hero-text {
    color: white;

    font-size: 1.25rem;

    margin: 15px 0 20px;

    text-shadow:
        1px 1px 4px rgba(0,0,0,.8);
}

.copyright {
    color: #DDD;

    font-size: .95rem;
}


/* ==================================
   SECTION TITLES
================================== */

.section-title {
    color: #C9A227;

    font-size: 2.1rem;

    margin: 40px 0 18px;

    text-shadow:
        1px 1px 3px rgba(0,0,0,.35);

    border-bottom: 2px solid rgba(201,162,39,.45);

    padding-bottom: 8px;
}

/* ==================================
   6D — SECTION POLISH
================================== */

.section-title {

    position: relative;

    display: flex;

    align-items: center;

    gap: 15px;

    color: #C9A227;

    font-size: clamp(1.7rem, 3vw, 2.2rem);

    margin: 50px 0 20px;

    text-shadow:
        1px 1px 3px rgba(0,0,0,.35);
}


/* Decorative lines beside section titles */

.section-title::before,
.section-title::after {

    content: "";

    height: 2px;

    flex: 1;

    background:
        linear-gradient(
            to right,
            transparent,
            rgba(201,162,39,.75)
        );
}

.section-title::after {

    background:
        linear-gradient(
            to left,
            transparent,
            rgba(201,162,39,.75)
        );
}


/* ==================================
   TORAH CARD POLISH
================================== */

.book-card {

    position: relative;

    overflow: hidden;
}


/* Small accent at top of card */

.book-card::before {

    content: "";

    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    height: 5px;

    background: #89CFF0;

    transform: scaleX(.35);

    transition: transform .3s ease;
}

.book-card:hover::before {

    transform: scaleX(1);
}


/* Keep text above decorative element */

.book-hebrew,
.book-english {

    position: relative;

    z-index: 1;
}


/* ==================================
   MEGA MENU SECTION SPACING
================================== */

.mega-section {

    margin: 55px 0;
}


/* Slightly stronger distinction between
   the mega menu and the background */

.mega-panel {

    border-color: rgba(137,207,240,.8);

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.97),
            rgba(248,246,240,.94)
        );
}

/* =========================================
   MEGA MENUS
   ========================================= */

.mega-menu {
    position: relative;
    width: 100%;
}

.mega-button {
    position: relative;
    letter-spacing: .3px;
    border: 2px solid transparent;
}

.mega-panel {
    display: none;

    margin-top: 18px;
    padding: 24px;

    background:
        linear-gradient(
            rgba(255,255,255,.96),
            rgba(248,246,240,.96)
        );

    border: 2px solid #89CFF0;
    border-radius: 18px;

    box-shadow:
        0 12px 30px rgba(0,0,0,.20);

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 14px;
}

.mega-column {
    min-width: 0;
}

.mega-column h3 {
    margin: 0 0 10px;
    padding: 10px;

    text-align: center;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 1.15rem;
    color: #fff;

    background: #3f8fc6;

    border: 1px solid #2b5f84;
    border-radius: 6px;
}

.mega-column a {
    display: block;

    padding: 7px 9px;
    margin-bottom: 5px;

    text-align: center;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: .95rem;

    color: #234f70;
    text-decoration: none;

    background: #f5f9fc;
    border: 1px solid #d3e1eb;
    border-radius: 4px;

    transition:
        background-color .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.mega-column a:hover {
    background: #89CFF0;
    border-color: #4682B4;
    transform: translateX(2px);
}

/* ==================================
   MEGA BUTTON POLISH
================================== */

.mega-button {

    position: relative;

    letter-spacing: .3px;

    border: 2px solid transparent;
}

.mega-button.open {

    border-color: #89CFF0;
}
/* ==================================
   TORAH SECTION
================================== */

.books-section {
    margin: 0 0 55px;
}

.book-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 25px;
}

.book-card {
    display: flex;

    flex-direction: column;

    justify-content: center;
    align-items: center;

    min-height: 180px;

    padding: 35px 20px;

    text-decoration: none;

    background: rgba(255,255,255,.90);

    border-radius: 18px;

    border: 2px solid #89CFF0;

    box-shadow:
        0 8px 20px rgba(0,0,0,.16);

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        background .25s ease;
}

.book-card:hover {
    transform: translateY(-7px);

    background: #89CFF0;

    box-shadow:
        0 15px 30px rgba(0,0,0,.28);
}

.book-hebrew {
    font-size: 2rem;

    color: #1565C0;

    margin-bottom: 18px;
}

.book-english {
    font-size: 1.25rem;

    color: #222;

    font-weight: bold;
}

.book-card:hover .book-hebrew,
.book-card:hover .book-english {
    color: white;
}

/* ==================================
   NEVI'IM / KETUVIM
================================== */

.mega-section {
    margin: 0 0 45px;
}


/* Main expandable buttons */

.mega-button {
    width: 100%;

    padding: 20px 25px;

    background:
        linear-gradient(
            135deg,
            #89CFF0,
            #5DB6E8
        );

    color: white;

    border: none;

    border-radius: 16px;

    font-family: inherit;

    font-size: 1.4rem;

    font-weight: bold;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(0,0,0,.22);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.mega-button:hover {
    background:
        linear-gradient(
            135deg,
            #5DB6E8,
            #4682B4
        );

    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(0,0,0,.28);
}

/* ==================================
   OPEN MEGA MENU STATE
================================== */

.mega-button.open {
    background:
        linear-gradient(
            135deg,
            #4682B4,
            #356A94
        );

    box-shadow:
        0 5px 14px rgba(0,0,0,.30);

    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}


/* Small visual indicator */

.mega-button.open::after {
    content: " ▲";

    font-size: .85em;
}

.mega-button:not(.open)::after {
    content: " ▼";

    font-size: .85em;
}

.mega-button:active {
    transform: translateY(0);
}


/* ==================================
   MEGA PANEL
================================== */

.mega-panel {

    display: none;

    margin-top: 18px;

    padding: 24px;

    background:
        linear-gradient(
            rgba(255,255,255,.96),
            rgba(248,246,240,.96)
        );

    border: 2px solid #89CFF0;

    border-radius: 18px;

    box-shadow:
        0 12px 30px rgba(0,0,0,.20);

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}


/* Open state */

.mega-panel.open {

    display: grid;

    animation:
        megaPanelOpen .2s ease-out;
}


/* ==================================
   MEGA PANEL ANIMATION
================================== */

@keyframes megaPanelOpen {

    from {

        opacity: 0;

        transform: translateY(-6px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}


/* ==================================
   MEGA PANEL BOOK LINKS
================================== */

.mega-panel a {

    display: flex;

    align-items: center;

    min-height: 52px;

    padding: 12px 16px;

    text-decoration: none;

    color: #222;

    background: rgba(255,255,255,.82);

    border: 1px solid rgba(137,207,240,.55);

    border-radius: 10px;

    font-size: 1.05rem;

    font-weight: 600;

    box-shadow:
        0 3px 8px rgba(0,0,0,.08);

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}


/* Book hover */

.mega-panel a:hover {

    background: #89CFF0;

    color: white;

    transform: translateY(-2px);

    box-shadow:
        0 6px 14px rgba(0,0,0,.18);
}


/* ==================================
   MEGA PANEL ACTIVE LINK
================================== */

.mega-panel a:active {

    transform: translateY(0);

}


/* ==================================
   TABLET
================================== */

@media (max-width: 1000px) {

    .mega-panel {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }   

}


/* ==================================
   MOBILE
================================== */

@media (max-width: 768px) {

    .mega-panel {

        grid-template-columns: 1fr;

        padding: 18px;

        gap: 10px;

    }

    .mega-panel a {

        justify-content: center;

        text-align: center;

        min-height: 50px;

    }

    .section-title {

        gap: 10px;

        margin-top: 40px;

    }

    .section-title::before,
    .section-title::after {

        min-width: 20px;

    }

}

/* ==================================
   FOCUS ACCESSIBILITY
================================== */

.mega-button:focus-visible,
.book-card:focus-visible,
.mega-panel a:focus-visible {
    outline: 3px solid #C9A227;

    outline-offset: 3px;
}


/* ==================================
   MOBILE
================================== */

@media (max-width: 768px) {

    body {
        padding: 15px;
    }

    .hero {
        padding: 25px 18px;
    }

    .hero-logo {
        width: 100px;
    }

    .hero h1 {
        font-size: 2.4rem;

        padding: 14px 8px;
    }

    .hebrew-title {
        font-size: 1.8rem;
    }

    .hero-text {
        font-size: 1.05rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .book-grid {
        grid-template-columns: 1fr;

        gap: 18px;
    }

    .book-card {
        min-height: 150px;
    }

    .mega-button {
        font-size: 1.15rem;

        padding: 18px;
    }
}


/* ==================================
   SMALL PHONES
================================== */

@media (max-width: 480px) {

    body {
        padding: 10px;
    }

    .hero {
        padding: 20px 12px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hebrew-title {
        font-size: 1.6rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .book-card {
        padding: 28px 15px;
    }

    .book-hebrew {
        font-size: 1.8rem;
    }

    .book-english {
        font-size: 1.15rem;
    }

}