/* ============================
   VERSION 2 — GLOBAL STYLES
   ============================ */

:root {
    --homepage-earth-image: url("https://commons.wikimedia.org/wiki/Special:FilePath/The_Earth_seen_from_Apollo_17.jpg");
    --text-color: #ffffff;
    --bg-dark: #000000;
    --card-bg: rgba(255,255,255,0.12);
    --card-hover-bg: rgba(255,255,255,0.22);
    --accent: #4fc3f7;
    --accent-light: #81d4fa;
    --header-shadow: 0 0 20px #ffffff;
}

/* GLOBAL */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-color);
    overflow-x: hidden;
}

/* NAVBAR */
.navbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px 30px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.nav-logo {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    display: inline-block;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.nav-links li a:hover {
    background: var(--card-hover-bg);
    color: var(--accent-light);
}

/* SPINNING EARTH BACKGROUND */
.earth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.earth {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2000px;
    height: 2000px;
    margin-left: -1000px;
    margin-top: -1000px;
    border-radius: 50%;
    background:
      radial-gradient(circle at 35% 35%, rgba(79,195,247,0.45), rgba(2,136,209,0.55) 40%, rgba(1,87,155,0.65) 70%, rgba(0,47,108,0.75) 100%),
      var(--homepage-earth-image) no-repeat center/cover,
      radial-gradient(circle at 35% 35%, #29b6f6, #0288d1 45%, #01579b 75%, #002f6c 100%);
    background-blend-mode: soft-light, normal, normal;
    animation: spinEarth 50s linear infinite;
    filter: saturate(1.9) brightness(1.3) contrast(1.12);
    box-shadow: inset -60px -60px 140px rgba(0,0,0,0.35),
                inset 50px 50px 120px rgba(255,255,255,0.25);
}

@keyframes spinEarth {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* CLOUDS: drawn with CSS radial-gradients — no image file needed */
.clouds {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2000px;
    height: 2000px;
    margin-left: -1000px;
    margin-top: -1000px;
    border-radius: 50%;
    opacity: 0.55;
    background:
      radial-gradient(70px 30px at 25% 28%, rgba(255,255,255,0.8) 0%, rgba(0,0,0,0) 75%),
      radial-gradient(90px 25px at 58% 15%, rgba(255,255,255,0.7) 0%, rgba(0,0,0,0) 75%),
      radial-gradient(60px 35px at 72% 45%, rgba(255,255,255,0.75) 0%, rgba(0,0,0,0) 75%),
      radial-gradient(100px 30px at 20% 62%, rgba(255,255,255,0.65) 0%, rgba(0,0,0,0) 75%),
      radial-gradient(80px 28px at 45% 78%, rgba(255,255,255,0.7) 0%, rgba(0,0,0,0) 75%),
      radial-gradient(65px 22px at 85% 68%, rgba(255,255,255,0.6) 0%, rgba(0,0,0,0) 75%),
      radial-gradient(75px 26px at 10% 40%, rgba(255,255,255,0.55) 0%, rgba(0,0,0,0) 75%);
    animation: spinClouds 90s linear infinite;
}

@keyframes spinClouds {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ACCESSIBILITY: respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .earth,
    .clouds {
        animation: none;
    }
}

/* DARK OVERLAY */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 1;
}

/* PER-PAGE BACKGROUND PHOTO (World pages with a topic-relevant image) */
.page-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* HEADER */
header {
    padding: 140px 20px 80px;
    text-align: center;
    position: relative;
    z-index: 2;
}

header h1 {
    margin: 0;
    font-size: 64px;
    font-weight: bold;
    text-shadow: var(--header-shadow);
}

header p {
    margin-top: 15px;
    font-size: 28px;
    opacity: 0.95;
}

/* BUTTON */
.explore-btn {
    margin-top: 35px;
    background: #ffffff;
    color: #01579b;
    padding: 16px 34px;
    border-radius: 12px;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: 0.25s;
}
.explore-btn:hover {
    background: var(--accent-light);
}

/* FEATURED CARD */
.featured {
    max-width: 900px;
    margin: 40px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 14px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    text-align: center;
    z-index: 2;
    position: relative;
}

.featured h2 {
    font-size: 34px;
    margin-bottom: 10px;
}

.featured p {
    font-size: 20px;
}

/* WORLDS GRID */
.worlds-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: auto;
    position: relative;
    z-index: 2;
}

.worlds-section h2 {
    text-align: center;
    font-size: 38px;
    margin-bottom: 40px;
}

.world-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 36px;
    column-gap: 25px;
    margin-bottom: 36px;
}

.world-grid:last-child {
    margin-bottom: 0;
}

.world-grid.single-card {
    grid-template-columns: 1fr;
}

.world-grid.single-card .world-card {
    margin: 0 auto;
}

/* CROSS-SHAPED LAYOUT (Creation / Old Testament / Jesus the Messiah / New Testament / Gospels) */
.cross-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        ".  creation ."
        "ot messiah  gospels"
        ".  nt  .";
    row-gap: 36px;
    column-gap: 25px;
    margin-bottom: 36px;
}

.cross-grid .world-card {
    margin: 0 auto;
    width: 100%;
}

.cross-creation { grid-area: creation; }
.cross-ot { grid-area: ot; }
.cross-messiah { grid-area: messiah; }
.cross-nt { grid-area: nt; }
.cross-gospels { grid-area: gospels; }

/* SPECIES PHOTO GRID (Sharks, and future species categories) */
.species-paginator {
    margin-bottom: 20px;
}

.species-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.species-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s ease;
}

.species-card:hover {
    transform: translateY(-4px);
}

.species-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.species-card span {
    display: block;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 600;
}

.species-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.species-page-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: inherit;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.species-page-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.2);
}

.species-page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.species-page-label {
    font-size: 14px;
    opacity: 0.75;
    min-width: 70px;
    text-align: center;
}

@media (max-width: 700px) {
    .species-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* LARGE PHOTO GRID: bigger, taller cards that show the whole picture
   (no cropping) instead of the small 130px cropped thumbnails above.
   Opt-in via .species-grid--large so existing species-grid pages
   (Woodland, Ocean World sharks, etc.) are unaffected. */
.species-grid--large {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.species-grid--large .species-card img {
    height: 260px;
    object-fit: contain;
    background: rgba(0,0,0,0.25);
    padding: 10px;
}

.species-grid--large .species-card span {
    font-size: 15px;
    padding: 12px 10px;
}

@media (max-width: 900px) {
    .species-grid--large {
        grid-template-columns: repeat(2, 1fr);
    }
    .species-grid--large .species-card img {
        height: 220px;
    }
}

@media (max-width: 500px) {
    .species-grid--large {
        grid-template-columns: 1fr;
    }
    .species-grid--large .species-card img {
        height: 260px;
    }
}

.world-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 25px;
    border-radius: 14px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    text-align: center;
    transition: transform 0.25s, background 0.25s, border-color 0.25s;
    display: block;
    text-decoration: none;
    color: inherit;
    max-width: 340px;
    margin: 0 auto;
    width: 100%;
}

.world-card:hover {
    transform: translateY(-6px);
    background: var(--card-hover-bg);
    border-color: rgba(255,255,255,0.4);
}

.world-card h3 {
    margin: 0;
    font-size: 26px;
}

.world-card p {
    margin-top: 12px;
    font-size: 17px;
}

.world-card .badge {
    display: inline-block;
    margin-top: 14px;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
}

/* COMING SOON CARDS: muted, non-interactive variant */
.world-card.coming-soon {
    opacity: 0.55;
    cursor: default;
}

.world-card.coming-soon:hover {
    transform: none;
    background: var(--card-bg);
}

.world-card.coming-soon .badge {
    background: rgba(255,255,255,0.1);
    font-style: italic;
}

/* DETAIL SECTIONS (in-page anchor content, linked from world-cards) */
.detail-section {
    max-width: 900px;
    margin: 0 auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-block {
    background: var(--card-bg);
    padding: 30px 34px;
    border-radius: 14px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    scroll-margin-top: 30px;
}

.detail-block h2 {
    margin-top: 0;
    font-size: 28px;
    color: var(--accent-light);
}

.detail-block p {
    font-size: 17px;
    line-height: 1.65;
    margin-bottom: 0;
}

/* FOOTER */

/* SCRIPTURE READING PAGES */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.chapter-nav-btn {
    color: var(--accent-light);
    text-decoration: none;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--card-bg);
    transition: background 0.2s;
}

.chapter-nav-btn:hover {
    background: var(--card-hover-bg);
}

.chapter-nav-current {
    font-size: 14px;
    opacity: 0.75;
}

.chapter-nav-btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.chapter-nav-btn.disabled:hover {
    background: var(--card-bg);
}

.scripture-chapter {
    max-width: 800px;
    margin: 0 auto 20px;
    padding: 30px 34px;
    background: var(--card-bg);
    border-radius: 14px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.scripture-chapter .verse {
    font-size: 18px;
    line-height: 1.75;
    margin: 0 0 14px;
}

.verse-num {
    color: var(--accent-light);
    font-weight: bold;
    margin-right: 4px;
}

/* LISTEN WIDGET (text-to-speech) */
.listen-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10;
}

.listen-btn {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    color: var(--text-color);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    transition: background 0.2s, transform 0.2s;
}

.listen-btn:hover {
    background: var(--card-hover-bg);
    transform: scale(1.05);
}

footer {
    background: rgba(0,0,0,0.3);
    color: white;
    text-align: center;
    padding: 25px;
    font-size: 16px;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 2;
}

/* ============================
   MOBILE RESPONSIVE STYLES
   ============================ */
/* TABLET: 3 fixed columns get too narrow between mobile and full desktop width */
@media (max-width: 1000px) and (min-width: 701px) {
    .world-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cross-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "creation"
            "ot"
            "messiah"
            "gospels"
            "nt";
    }
}

@media (max-width: 700px) {
    header {
        padding: 90px 16px 50px;
    }

    header h1 {
        font-size: 38px;
    }

    header p {
        font-size: 18px;
    }

    .explore-btn {
        padding: 13px 26px;
        font-size: 18px;
    }

    .featured {
        margin: 24px auto;
        padding: 22px;
    }

    .featured h2 {
        font-size: 24px;
    }

    .featured p {
        font-size: 16px;
    }

    .worlds-section {
        padding: 36px 14px;
    }

    .worlds-section h2 {
        font-size: 26px;
        margin-bottom: 26px;
    }

    .world-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 18px;
    }

    .cross-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "creation"
            "ot"
            "messiah"
            "gospels"
            "nt";
        gap: 18px;
        margin-bottom: 18px;
    }

    .world-card {
        max-width: 100%;
        padding: 20px;
    }

    .world-card h3 {
        font-size: 21px;
    }

    .world-card p {
        font-size: 15px;
    }

    .detail-section {
        padding: 0 14px;
        gap: 20px;
        margin-bottom: 40px;
    }

    .detail-block {
        padding: 22px 20px;
    }

    .detail-block h2 {
        font-size: 22px;
    }

    .detail-block p {
        font-size: 15.5px;
    }

    .scripture-chapter {
        padding: 22px 20px;
    }

    .scripture-chapter .verse {
        font-size: 16px;
    }

    .chapter-nav {
        padding: 0 14px;
        justify-content: center;
        text-align: center;
    }

    .listen-widget {
        bottom: 16px;
        right: 16px;
    }

    .listen-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .nav-links {
        justify-content: center;
    }

    .navbar {
        padding: 14px 16px;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 400px) {
    header h1 {
        font-size: 30px;
    }

    .world-card h3 {
        font-size: 19px;
    }
}
