/* =========================================================
   Show Me The Physics — Shared Site Styles
   Used by: index.html, page1_electricity.html, page2_fluid_dynamics.html,
   page3_kinematics.html, page4_waves_optics.html, page5_circular_motion.html
   Matches the visual system used on the lesson/worksheet pages
   (Torque and Rotation, etc.) so the whole site feels like one system.
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --physics-blue: #1154CC;
    --bg-blue: #E8F0FE;
    --accent-blue: #9CBDE9;
    --light-blue: #f8fbff;
    --text-dark: #000000;
    --ap-red: #CC0000;
    --transition: all 0.3s ease;
}

html {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: var(--accent-blue);
    margin: 0;
    padding: clamp(10px, 2vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Verdana', Geneva, sans-serif;
    color: var(--text-dark);
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ================= HEADER / SITE NAVIGATION ================= */
.header-card {
    background-color: white;
    width: 100%;
    max-width: 1600px;
    margin: 10px auto 30px auto;
    padding: clamp(20px, 4vw, 40px);
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-card h1 {
    border-bottom: none;
    margin-bottom: 10px;
}

.tagline {
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    line-height: 1.5;
    color: #333;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 20px auto;
    font-weight: 500;
}

.nav-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 15px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

.nav-link {
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    font-weight: 900;
    color: var(--physics-blue);
    text-decoration: none;
    padding: clamp(14px, 2.4vw, 22px);
    background: var(--light-blue);
    border: clamp(3px, 0.5vw, 5px) solid var(--physics-blue);
    border-radius: 20px;
    transition: var(--transition);
    text-align: center;
    cursor: pointer;
    display: block;
}

.nav-link:hover { background: #d0e1f9; transform: translateY(-3px); }
.nav-link.active { background: var(--physics-blue); color: white; }

.all-lessons-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Verdana', Geneva, sans-serif;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 900;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 1px;
    padding: 16px 45px;
    border-radius: 60px;
    border: 3px solid #0a1a3a;
    background: linear-gradient(180deg, #2a5fd6 0%, #1154CC 55%, #0d3a99 100%);
    box-shadow: 0 8px 0 #0a1a3a, 0 14px 25px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
}

.all-lessons-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #0a1a3a, 0 18px 30px rgba(0,0,0,0.35);
}

.all-lessons-btn:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #0a1a3a, 0 8px 15px rgba(0,0,0,0.3);
}

/* ================= TYPOGRAPHY ================= */
h1 {
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    color: #000;
    text-align: center;
    margin-top: 0;
    border-bottom: 12px solid var(--physics-blue);
    padding-bottom: 15px;
    margin-bottom: 30px;
    line-height: 1.1;
}

h2.category-header {
    font-size: clamp(2rem, 5vw, 3.6rem);
    color: var(--physics-blue);
    text-align: center;
    margin: 0 0 10px 0;
    font-weight: 900;
    line-height: 1.15;
}

p {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ================= CONTENT CARD (page body wrapper) ================= */
.content-page {
    background-color: white;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 40px auto;
    padding: clamp(20px, 5vw, 50px);
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* ================= FEATURED VIDEO (home page) ================= */
.featured-video {
    background: var(--light-blue);
    padding: clamp(15px, 3vw, 25px);
    border-radius: 20px;
    border: 4px solid var(--accent-blue);
    max-width: 1000px;
    margin: 0 auto 30px auto;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #dbe6f7;
}

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

.description {
    margin-top: 18px;
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
    line-height: 1.55;
    text-align: center;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ================= VIDEO GRID (category pages) ================= */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(20px, 3vw, 35px);
    width: 100%;
}

.video-card {
    background: var(--light-blue);
    padding: clamp(16px, 2.5vw, 22px);
    border-radius: 18px;
    border-top: 8px solid var(--physics-blue);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.video-card .description {
    text-align: left;
}

.video-card .description strong {
    display: block;
    color: var(--physics-blue);
    font-size: clamp(1.2rem, 1.9vw, 1.45rem);
    margin-bottom: 8px;
}

/* Workspace area so a teacher can solve a related problem after an image/video */
.workspace {
    min-height: clamp(160px, 22vh, 260px);
    border: 4px dashed var(--physics-blue);
    border-radius: 15px;
    margin: 20px 0 10px 0;
    width: 100%;
    background-color: #fdfdfd;
}

/* ================= FOOTER ================= */
.footer {
    text-align: center;
    padding: 20px;
    font-weight: bold;
    color: #333;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    max-width: 1600px;
    width: 100%;
    overflow-wrap: break-word;
}

.footer a {
    color: var(--physics-blue);
    font-weight: 900;
    text-decoration: none;
}

/* ================= HERO BANNER (index page) ================= */
.hero-banner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 25px auto;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    position: relative;
}

.hero-banner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: cover;
}

/* ================= TOPIC HERO IMAGE (category pages) ================= */
.topic-hero {
    max-width: 900px;
    margin: 0 auto 35px auto;
    text-align: center;
}

.topic-hero img {
    width: 100%;
    border-radius: 20px;
    border: 5px solid var(--accent-blue);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
    background: var(--light-blue);
}

.topic-hero .hero-caption {
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    color: #555;
    margin-top: 12px;
    font-style: italic;
    line-height: 1.5;
}

/* ================= TAKEAWAY / FUN-FACT CALLOUT ================= */
.takeaway {
    background: #fff9c4;
    border: 4px solid #fbc02d;
    border-radius: 18px;
    padding: clamp(18px, 3vw, 30px);
    margin: 10px 0 35px 0;
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    line-height: 1.6;
}

.takeaway .takeaway-label {
    display: block;
    color: #8a6d00;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    margin-bottom: 8px;
}

/* ================= TOPIC EXPLORER GRID (home page) ================= */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(18px, 3vw, 28px);
    width: 100%;
    margin-bottom: 10px;
}

.topic-card {
    display: flex;
    flex-direction: column;
    background: var(--light-blue);
    border-radius: 20px;
    border-top: 8px solid var(--physics-blue);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    padding: clamp(18px, 2.5vw, 26px);
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}

.topic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.topic-card .topic-title {
    color: var(--physics-blue);
    font-weight: 900;
    font-size: clamp(1.2rem, 1.9vw, 1.5rem);
    margin-bottom: 8px;
}

.topic-card .topic-desc {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.5;
    color: #333;
}

/* ================= RELATED / CROSS-LINK SECTION ================= */
.related-pages {
    margin-top: 15px;
    padding-top: 28px;
    border-top: 3px dashed var(--accent-blue);
}

.related-pages h3 {
    color: var(--physics-blue);
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    margin: 0 0 16px 0;
    font-weight: 900;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.related-link {
    display: inline-flex;
    align-items: center;
    background: var(--light-blue);
    border: 3px solid var(--physics-blue);
    color: var(--physics-blue);
    font-weight: 800;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 14px;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    transition: var(--transition);
}

.related-link:hover {
    background: var(--physics-blue);
    color: #fff;
    transform: translateY(-2px);
}

.related-link.notes {
    border-color: var(--ap-red);
    color: var(--ap-red);
}

.related-link.notes:hover {
    background: var(--ap-red);
    color: #fff;
}

/* ================= RESPONSIVE / SMART BOARD TWEAKS ================= */
@media (min-width: 1400px) {
    .content-page { padding: clamp(30px, 3vw, 70px); }
}

@media (max-width: 500px) {
    .header-card, .content-page { border-radius: 18px; }
}
