/* ============================================
   Scaling EP2-6 Series Theme — Light Green/Blue
   Shared across scaling-ep2.html through scaling-ep6.html
   ============================================ */

:root {
    --bg: #f2f4ef;
    --ink: #162227;
    --muted: #42575f;
    --line: #d1dde1;
    --card: #ffffff;
    --blue: #0b5f89;
    --green: #177d5f;
    --orange: #ca5c2f;
    --shadow: 0 14px 34px rgba(18, 38, 44, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "IBM Plex Sans Thai", sans-serif;
    line-height: 1.68;
    background:
        radial-gradient(860px 360px at -5% -10%, #d9f2ea 0%, transparent 72%),
        radial-gradient(900px 360px at 105% -8%, #deedf8 0%, transparent 72%),
        var(--bg);
}

.wrap {
    width: min(1160px, 94vw);
    margin: 0 auto;
    padding: 26px 0 56px;
}

.hero {
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 30px 28px;
    background: linear-gradient(120deg, #ffffff 0%, #f4fbff 48%, #f2fff7 100%);
    box-shadow: var(--shadow);
}

.hero h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.9rem, 3.5vw, 2.8rem);
    line-height: 1.14;
    letter-spacing: 0.1px;
}

.hero p {
    margin: 10px 0 0;
    color: var(--muted);
    max-width: 980px;
    font-size: 1.03rem;
}

.meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    color: #314750;
}

.pill a {
    color: var(--blue);
    text-decoration: none;
}

.pill a:hover {
    text-decoration: underline;
}

.toc {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 18px;
}

.toc h2 {
    margin: 0 0 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.25rem;
}

.toc-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc-grid a {
    display: block;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fbfefd;
}

.toc-grid strong {
    display: block;
    font-size: 0.92rem;
    color: var(--blue);
}

.section {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 20px;
    scroll-margin-top: 12px;
}

.section h3 {
    margin: 0;
    font-size: 1.24rem;
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.2;
}

.stamp {
    display: inline-block;
    margin-top: 8px;
    border: 1px solid #bdded3;
    background: #ecfaf5;
    color: #186950;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 5px 11px;
}

.stamp a {
    color: inherit;
    text-decoration: none;
}

.stamp a:hover {
    text-decoration: underline;
}

.section-grid {
    margin-top: 13px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
}

figure {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #f5fafc;
}

figure img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

figcaption {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-top: 1px solid var(--line);
    background: #fcffff;
    color: #39535c;
}

.box {
    border: 1px dashed #b9d2da;
    border-radius: 12px;
    background: #f8fdff;
    padding: 11px 13px;
}

.box h4 {
    margin: 0 0 7px;
    color: #245267;
    font-size: 1rem;
}

.box ul {
    margin: 0;
    padding-left: 18px;
}

.box li {
    margin: 3px 0;
}

.box p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.box-detail {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #dbe8ed;
    border-radius: 10px;
    background: #fbfeff;
}

.box-detail h5 {
    margin: 0 0 6px;
    color: #1f5a70;
    font-size: 0.9rem;
}

.box-detail ul {
    margin: 0;
    padding-left: 18px;
}

.box-detail li {
    margin: 3px 0;
}

.end {
    margin-top: 18px;
    border-left: 4px solid var(--orange);
    border-radius: 8px;
    background: #fff6f0;
    color: #6f4023;
    padding: 10px 12px;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.nav-bar a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.nav-bar a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(8, 37, 34, 0.10);
    border-color: var(--green);
}

.video-embed {
    margin: 22px 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: #000;
}

.video-embed .video-wrapper {
    display: block;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    cursor: pointer;
    text-decoration: none;
}

.video-embed .video-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-embed .video-wrapper .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 0, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.video-embed .video-wrapper .play-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 16px 0 16px 28px;
    border-color: transparent transparent transparent #fff;
    margin-left: 6px;
}

.video-embed .video-wrapper:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 0, 0, 1);
}

.video-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #111;
    color: #ccc;
    font-size: 0.9rem;
}

.video-caption a {
    color: #6cb8ff;
    text-decoration: none;
    font-weight: 600;
}

.video-caption a:hover {
    text-decoration: underline;
}

@media (min-width: 920px) {
    .section-grid {
        grid-template-columns: 1.2fr 1fr;
    }
}