
/* COLORS AND BASE — layout follows the Industrial Revolution reference site */
:root {
    --brown: #795238;
    --brown-dark: #4b3023;
    --brown-soft: #f2e7dc;
    --brown-line: #d9c2ad;
    --cream: #fff8ef;
    --cream-soft: #f8efe5;
    --tan: #e8d2bb;
    --white: #ffffff;
    --text: #49382d;
}

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

body {
    font-family: Arial, "Myanmar Text", sans-serif;
    background: #faf8f5;
    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 — photograph */
.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, #4b3023e8, #795238a8),
        url("images/image1.jpg") center / cover no-repeat;
    text-shadow: 0 2px 5px #2d1b1266;
}

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

.site-banner p {
    margin-top: 4px;
    color: #fff8ef;
    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(--brown-dark);
    box-shadow: 0 3px 10px #3b261c22;
}

.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(--tan);
    border-color: var(--tan);
    color: var(--brown-dark);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 270px;
    max-width: min(340px, 90vw);
    padding: 8px;
    border: 1px solid #ffffff35;
    border-radius: 12px;
    background: var(--brown-dark);
    box-shadow: 0 8px 20px #3b261c30;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu {
    display: grid;
    gap: 5px;
}

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

/* 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);
    }
}

/* SHARED HERO AND PAGE BANNER */
.hero, .banner-title {
    color: var(--white);
    border-radius: 16px;
}

.hero {
    display: flex;
    align-items: center;
    min-height: 300px;
    padding: clamp(20px, 4vw, 38px);
    background:
        linear-gradient(90deg, #4b3023e8, #79523866),
        url("images/image2.jpg") center / cover no-repeat;
}

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

/* Consumer-specific banner photograph */
.banner-title {
    margin-bottom: 20px;
    padding: 24px;
    background:
        linear-gradient(90deg, #4b3023e8, #79523866),
        url("images/image2.jpg") center / cover no-repeat;
}

.hero-label {
    margin-bottom: 8px;
    color: #f6dfc8;
    font-weight: 700;
}

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

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

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

/* 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(--brown-line);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 4px 14px #65452d12;
}

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

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

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

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

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

.lesson-number {
    color: var(--brown);
    font-size: 13px;
    font-weight: 700;
}

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

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

.wide-image {
    display: block;
    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(--brown-line);
    border-radius: 10px;
    background: var(--cream);
    object-fit: cover;
}

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

.content-list {
    margin: 12px 0 12px 24px;
}

.content-list li {
    margin: 7px 0;
}

/* 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(--brown-line);
    border-radius: 22px;
    background: var(--tan);
    color: var(--brown-dark);
    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(--brown-soft);
    box-shadow: 0 3px 9px #65452d20;
    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(--brown-line);
    text-align: center;
}

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

tr:nth-child(even) {
    background: var(--brown-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-thumb {
    display: block;
    width: 100%;
    height: 155px;
    margin-bottom: 12px;
    border-radius: 11px;
    object-fit: cover;
}

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

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

.source-link {
    color: var(--brown);
    font-weight: 700;
}

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

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

.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(--brown-line);
    border-radius: 18px;
    background: var(--cream-soft);
    color: var(--brown-dark);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

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

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

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

.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(--brown-line);
    border-radius: 10px;
    background: var(--cream-soft);
    color: var(--text);
    text-align: left;
}

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

.quiz-box .answer-btn.correct {
    border-color: #64866a;
    background: #e8f2e8;
}

.quiz-box .answer-btn.wrong {
    border-color: #bd7770;
    background: #f9e8e5;
}

#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(--brown-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(--brown-dark);
    color: var(--white);
    text-align: center;
}

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

/* 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: 210px;
    }

    .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;
    }

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

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

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

    .navbar {
        justify-content: center;
    }

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

    .hero {
        padding: 18px;
    }

    .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;
    }
}
