/* COLORS AND BASE */
:root {
    --green: #1b7548;
    --green-dark: #124b30;
    --green-soft: #e8f4ec;
    --green-line: #c6dfcf;
    --blue: #2d6f9e;
    --blue-soft: #eaf3fa;
    --blue-line: #c8dfea;
    --white: #ffffff;
    --text: #263d33;
}

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

body {
    font-family: Arial, "Myanmar Text", sans-serif;
    background: #f4f9f5;
    color: var(--text);
    line-height: 1.8;
}

button, input {
    font: inherit;
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
    transition: background .2s ease, color .2s ease,
                transform .2s ease, box-shadow .2s ease;
}

/* TOP BANNER */
.site-banner {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    color: var(--white);
    text-align: center;
    background: linear-gradient(110deg, #124b30dd, #1b7548aa),
                url("images/top-banner.jpg") center / cover no-repeat;
    text-shadow: 0 2px 5px #092e1c66;
}

.site-banner h1 {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.35;
}

.site-banner p {
    margin-top: 4px;
    color: #f4fff7;
    font-size: clamp(14px, 1.8vw, 18px);
}

/* NAVIGATION AND DROPDOWN */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    background: var(--green-dark);
    box-shadow: 0 3px 10px #123c2822;
}

.nav-btn {
    padding: 8px 15px;
    border: 1px solid #ffffff66;
    border-radius: 22px;
    background: transparent;
    color: var(--white);
    font: inherit;
}

.nav-btn:hover,
.nav-btn.active,
.dropdown.open > .nav-btn {
    background: var(--white);
    border-color: var(--white);
    color: var(--green-dark);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: max-content;
    min-width: 190px;
    max-width: min(320px, calc(100vw - 24px));
    max-height: min(70vh, 420px);
    padding: 8px;
    border: 1px solid #ffffff35;
    border-radius: 12px;
    background: var(--green-dark);
    box-shadow: 0 8px 20px #123c2830;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dropdown.open .dropdown-menu {
    display: grid;
    gap: 5px;
}

.dropdown-menu .nav-btn {
    width: 100%;
    border-radius: 8px;
    text-align: left;
}

.dropdown-menu .nav-btn:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

/* PAGE LAYOUT AND TRANSITIONS */
.container {
    width: min(94%, 1180px);
    min-height: 500px;
    margin: 26px auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: page-in .28s ease both;
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero, .banner-title {
    color: var(--white);
    border-radius: 16px;
    background: linear-gradient(90deg, #124b30e8, #1b754899),
                url("images/banner-green.jpg") center / cover;
}

.hero {
    display: flex;
    align-items: center;
    min-height: 300px;
    padding: clamp(20px, 4vw, 38px);
    background: linear-gradient(90deg, #124b30ee 0%, #124b30bb 52%, #124b3066 100%),
                url("images/image21.jpg") center 42% / cover no-repeat;
}

.hero-kicker {
    margin-bottom: 8px;
    color: #f4fff7;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .12em;
}

.hero div {
    max-width: 650px;
}

.hero h2 {
    margin-bottom: 10px;
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.5;
}

.hero p {
    margin-bottom: 18px;
}

.banner-title {
    margin-bottom: 20px;
    padding: 24px;
}

.lesson-photo {
    position: relative;
    height: clamp(170px, 25vw, 260px);
    margin: -4px 0 18px;
    overflow: hidden;
    border: 1px solid var(--green-line);
    border-radius: 14px;
    background: var(--green-soft);
}

.lesson-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lesson-photo figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 18px 16px 12px;
    background: linear-gradient(transparent, #123c28dd);
    color: var(--white);
    font-size: .92rem;
}

.section-title {
    margin: 25px 0 18px;
    padding-left: 12px;
    border-left: 5px solid var(--blue);
    color: var(--green);
}

/* HOME AND LESSON CARDS */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.card, .content-box, .quiz-box, .video-card {
    min-width: 0;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--green-line);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 4px 14px #24563b12;
}

.card {
    border-bottom: 4px solid var(--green);
}

.card:nth-child(1) .card-emoji {
    background: var(--green-soft);
}

.card:nth-child(2) .card-emoji {
    background: var(--blue-soft);
}

.card:nth-child(3) .card-emoji {
    background: #edf6ef;
}

.card-emoji {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 130px;
    margin-bottom: 10px;
    border-radius: 12px;
    font-size: 72px;
}

.card h3, .content-box h3, .video-card h3 {
    margin-bottom: 8px;
    color: var(--green);
}

.card p, .content-box p {
    margin: 9px 0;
}

.wide-image {
    width: 100%;
    max-height: 300px;
    margin-bottom: 14px;
    border-radius: 12px;
    object-fit: cover;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.topic-card {
    margin: 0;
    padding: 18px;
}

.topic-body {
    display: grid;
    grid-template-columns: minmax(120px, .85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 14px;
}

.topic-image {
    display: block;
    width: 100%;
    height: 185px;
    border: 1px solid var(--green-line);
    border-radius: 10px;
    background: var(--green-soft);
    object-fit: contain;
}

.topic-text p {
    margin: 0 0 10px;
}

/* BUTTONS */
.main-btn, .card button, .pager button,
#next-btn, #restart-btn, #check-fill, .video-card a {
    display: inline-block;
    padding: 9px 17px;
    border: 1px solid var(--green);
    border-radius: 22px;
    background: var(--green);
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
}

.main-btn:hover, .card button:hover, .pager button:hover,
#next-btn:hover:not(:disabled), #restart-btn:hover,
#check-fill:hover, .video-card a:hover {
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 3px 9px #385c8120;
    transform: translateY(-1px);
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.pager {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 24px 0;
}

/* COMPARISON TABLE */
.content-box {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

th, td {
    padding: 11px;
    border: 1px solid var(--green-line);
    text-align: center;
}

th {
    background: var(--green);
    color: var(--white);
}

tr:nth-child(even) {
    background: var(--green-soft);
}

/* VIDEO PAGE */
.video-intro {
    margin-bottom: 16px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.video-card {
    margin: 0;
}

.video-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: var(--green-soft);
    font-size: 30px;
}

.video-card:nth-child(2) .video-icon {
    background: var(--blue-soft);
}

.video-card a {
    margin-top: 8px;
}

/* QUIZ GUIDE AND CATEGORY BUTTONS */
.quiz-guide {
    margin: 14px 0;
    padding: 13px 16px;
    border: 1px solid var(--green-line);
    border-left: 5px solid var(--blue);
    border-radius: 12px;
    background: var(--blue-soft);
}

.quiz-guide h3 {
    margin-bottom: 4px;
    color: var(--green);
}

.quiz-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    margin: 14px 0;
    padding: 4px 2px 8px;
    overflow-x: auto;
}

.quiz-tab {
    flex: 1 0 auto;
    padding: 7px 11px;
    border: 1px solid var(--green-line);
    border-radius: 18px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.quiz-tab:hover, .quiz-tab.active {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
}

.quiz-box[hidden], #fill-area[hidden] {
    display: none;
}

.quiz-box h3 {
    color: var(--green);
}

.quiz-box > p:first-of-type {
    margin-top: 12px;
}

.answers {
    display: grid;
    gap: 9px;
    margin: 17px 0;
}

.quiz-box .answer-btn {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--green-line);
    border-radius: 10px;
    background: var(--green-soft);
    color: var(--text);
    text-align: left;
}

.quiz-box .answer-btn:hover:not(:disabled) {
    background: var(--blue-soft);
}

.quiz-box .answer-btn.correct {
    border-color: var(--green);
    background: #d9efdf;
}

.quiz-box .answer-btn.wrong {
    border-color: var(--blue);
    background: var(--blue-soft);
}

#fill-area {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 16px 0;
}

#fill-answer {
    flex: 1;
    min-width: 180px;
    padding: 10px;
    border: 1px solid var(--green-line);
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
}

#feedback, #score {
    margin: 12px 0;
    font-weight: 700;
}

/* FOOTER */
.footer {
    margin-top: 34px;
    padding: 22px 14px;
    background: var(--green-dark);
    color: var(--white);
    text-align: center;
}

.footer p + p {
    margin-top: 5px;
}

/* IMAGE FALLBACKS */
.image-placeholder {
    display: grid;
    place-items: center;
    min-height: 150px;
    border: 1px solid var(--green-line);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--green-soft), #ffffff);
    font-size: clamp(48px, 7vw, 76px);
}

.topic-image.image-placeholder {
    height: 185px;
}

.wide-image.image-placeholder {
    height: 240px;
    max-height: 300px;
}

/* TABLET AND MOBILE */
@media (max-width: 760px) {
    .site-banner {
        min-height: 120px;
        padding: 18px 12px;
        background-position: center;
    }

    .navbar {
        position: relative;
        gap: 6px;
        padding: 9px 7px;
    }

    .nav-btn {
        padding: 7px 10px;
        font-size: 13px;
    }

    .dropdown-menu {
        min-width: 180px;
    }

    .container {
        width: 94%;
        margin: 18px auto;
    }

    .topic-grid, .video-grid {
        grid-template-columns: 1fr;
    }

    .topic-body {
        grid-template-columns: 1fr;
    }

    .topic-image {
        height: 210px;
    }

    .hero {
        min-height: 240px;
    }

    .lesson-photo {
        height: 200px;
    }

    .card-grid {
        grid-template-columns: repeat(3, minmax(190px, 1fr));
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .quiz-tabs {
        justify-content: flex-start;
    }

    .topic-image.image-placeholder {
        height: 210px;
    }
}

@media (max-width: 480px) {
    .site-banner {
        min-height: 105px;
    }

    .navbar {
        justify-content: center;
    }

    .dropdown-menu {
        left: 50%;
        transform: translateX(-50%);
    }

    .hero {
        padding: 18px;
    }

    .hero-kicker {
        font-size: .72rem;
        letter-spacing: .08em;
    }

    .hero h2 {
        font-size: 21px;
    }

    .card, .content-box, .quiz-box, .video-card {
        padding: 16px;
    }

    .quiz-tab {
        padding: 7px 9px;
        font-size: 12px;
    }

    .pager {
        gap: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* Keyboard focus */
.nav-btn:focus-visible,
.main-btn:focus-visible,
.card button:focus-visible,
.pager button:focus-visible,
.quiz-tab:focus-visible,
.quiz-box button:focus-visible,
.quiz-box input:focus-visible,
.video-card a:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}
