/*
Theme Name: WANNEWS ONLINE
Description: News portal theme for WANNEWS ONLINE
Version: 2.2.0
*/

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #ffffff;
    color: #202124;
    font-family: Arial, "Noto Sans Thai", Tahoma, sans-serif;
    line-height: 1.55;
}

img {
    max-width: 100%;
}

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

.wrap {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.ad {
    min-height: 90px;
    margin: 20px 0 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1f4f7;
    color: #9299a3;
    font-size: 18px;
}

/* headings */

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.section-head h2 {
    margin: 0;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 800;
}

.section-head h2 span {
    color: #e84b27;
    margin-left: 5px;
}

.section-head > a {
    color: #777;
    font-size: 14px;
}

/* image placeholder */

.wn-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #edf1f5, #dfe5eb);
    color: #7e8792;
    font-weight: 700;
    letter-spacing: 1px;
}

/* hero */

.hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    margin-bottom: 40px;
}

.hero-main,
.story-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #e9edf2;
}

.hero-main {
    min-height: 440px;
}

.hero-main img,
.story-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.story-card {
    min-height: 210px;
}

.shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.78),
        rgba(0,0,0,.08) 65%,
        transparent
    );
}

.hero-copy {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 18px;
    color: #fff;
}

.hero-copy h1,
.hero-copy h3 {
    margin: 8px 0 4px;
    line-height: 1.35;
}

.hero-copy h1 {
    font-size: clamp(25px, 3vw, 42px);
}

.hero-copy h3 {
    font-size: 19px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 30px;
    background: #e94b27;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* grids */

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

.news-item {
    min-width: 0;
}

.news-item > a {
    display: block;
}

.news-item img,
.news-item .wn-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    margin-bottom: 10px;
}

.news-item h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.45;
    font-weight: 700;
}

.meta {
    margin-top: 7px;
    color: #888;
    font-size: 12px;
}

.pill {
    display: inline-block;
    margin-left: 7px;
    padding: 2px 8px;
    border: 1px solid #ef7b5d;
    border-radius: 20px;
    color: #e85a35;
    font-size: 11px;
}

/* split */

.split {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 35px;
}

/* top news */

.top-list {
    display: flex;
    flex-direction: column;
}

.top-row {
    display: grid;
    grid-template-columns: 32px 82px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid #e3e3e3;
}

.top-number {
    font-size: 25px;
    font-weight: 800;
    color: #444;
    text-align: center;
}

.top-row img,
.top-row .wn-placeholder {
    width: 82px;
    height: 60px;
    object-fit: cover;
    border-radius: 7px;
    display: block;
}

.top-row strong {
    display: block;
    font-size: 14px;
    line-height: 1.4;
}

/* category bands */

.category-band {
    margin-top: 55px;
    padding: 35px 0 50px;
    background: #f6f7f9;
}

.empty-box {
    padding: 30px;
    border-radius: 10px;
    background: #f1f3f5;
    color: #888;
}

/* YouTube */

.yt-auto {
    margin-top: 0;
    padding: 40px 0 55px;
    background: #202733;
    color: #fff;
}

.yt-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.2);
}

.yt-head h2 {
    margin: 0;
    font-size: 28px;
}

.yt-head h2 span {
    color: #ff2d2d;
}

.yt-head a {
    color: #fff;
    opacity: .8;
}

.yt-layout {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 25px;
    margin-top: 25px;
}

.yt-frame {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    background: #111;
}

.yt-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.yt-main h3 {
    margin: 12px 0 3px;
    font-size: 19px;
}

.yt-date {
    color: #aeb6c0;
    font-size: 12px;
}

.yt-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.yt-card {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}

.yt-card img {
    width: 145px;
    height: 82px;
    object-fit: cover;
    border-radius: 7px;
}

.yt-card strong {
    display: block;
    font-size: 14px;
    line-height: 1.4;
}

.yt-card small {
    display: block;
    margin-top: 5px;
    color: #aeb6c0;
}

.yt-empty {
    margin-top: 20px;
    padding: 35px;
    text-align: center;
    background: rgba(255,255,255,.05);
    border-radius: 10px;
    color: #c5ccd4;
}

/* video zone */

.video-zone {
    padding: 45px 0 70px;
    background: #121820;
    color: #fff;
}

.video-zone .section-head {
    border-color: rgba(255,255,255,.2);
}

.video-zone .section-head > a,
.video-zone .meta {
    color: #9ea7b2;
}

.video-box {
    overflow: hidden;
    border-radius: 12px;
    background: #26313e;
}

.video-placeholder {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 65px;
    color: #fff;
}

.latest-dark .top-row {
    border-color: rgba(255,255,255,.15);
}

.latest-dark .top-number {
    color: #fff;
}

/* responsive */

@media (max-width: 900px) {

    .hero {
        grid-template-columns: 1fr;
    }

    .hero-main {
        min-height: 360px;
    }

    .split,
    .yt-layout {
        grid-template-columns: 1fr;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 600px) {

    .wrap {
        width: min(100% - 20px, 1200px);
    }

    .ad {
        min-height: 70px;
        margin-bottom: 30px;
        font-size: 14px;
    }

    .hero-side {
        grid-template-columns: 1fr;
    }

    .story-card {
        min-height: 220px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .section-head h2 {
        font-size: 23px;
    }

    .yt-card {
        grid-template-columns: 120px 1fr;
    }

    .yt-card img {
        width: 120px;
        height: 68px;
    }

    .video-placeholder {
        min-height: 230px;
    }

}

/* -------------------------------------------------------
 * Basic theme chrome required by WordPress classic themes
 * ----------------------------------------------------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #ececec;
}
.site-header-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.site-title {
    font-size: 25px;
    font-weight: 900;
}
.site-description {
    color: #888;
    font-size: 12px;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 18px;
}
.main-nav a {
    font-size: 14px;
    font-weight: 700;
}
.site-footer {
    padding: 30px 0;
    background: #111820;
    color: #aeb6c0;
}
.footer-copy { font-size: 13px; }
.archive-page { padding-bottom: 60px; }
.archive-page .news-item h2 { margin: 0; font-size: 18px; line-height: 1.45; }
.archive-pagination { margin-top: 35px; }
@media (max-width: 700px) {
    .site-header-inner { padding: 12px 0; align-items: flex-start; }
    .main-nav ul { gap: 10px; flex-wrap: wrap; }
}


/* -------------------------------------------------------
 * Automatic image sizing
 * Images always fill their news frame without distortion.
 * The source image may be any size/orientation; WordPress
 * responsive srcset selects an appropriate file automatically.
 * ----------------------------------------------------- */
.wn-auto-img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.news-item {
    min-width: 0;
}

.news-item > a > .wn-auto-img,
.news-item > a > .wn-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    object-position: center;
    overflow: hidden;
    border-radius: 10px;
}

.hero-main,
.story-card {
    position: relative;
    overflow: hidden;
}

.hero-main > a,
.story-card > a {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-main > a > .wn-auto-img,
.story-card > a > .wn-auto-img {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
}

.top-row .wn-auto-img {
    width: 82px;
    height: 60px;
    object-fit: cover;
    border-radius: 7px;
}

@media (max-width: 600px) {
    .news-item > a > .wn-auto-img,
    .news-item > a > .wn-placeholder {
        aspect-ratio: 16 / 9;
    }
}


/* -------------------------------------------------------
 * Full article / single post
 * ----------------------------------------------------- */
.single-page {
    padding: 30px 0 70px;
}

.single-article {
    max-width: 1200px;
    margin: 0 auto;
}

.article-header {
    max-width: 980px;
    margin: 0 auto 25px;
}

.article-category {
    margin-bottom: 10px;
}

.article-title {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.25;
    font-weight: 900;
    color: #171b20;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 14px;
    color: #858b93;
    font-size: 14px;
}

.article-featured {
    margin: 25px auto 35px;
    max-width: 1000px;
}

.article-featured .article-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 650px;
    object-fit: contain;
    border-radius: 12px;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 45px;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
}

.article-content {
    min-width: 0;
    font-size: 19px;
    line-height: 1.95;
    color: #292d32;
}

.article-content p {
    margin: 0 0 22px;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 32px 0 14px;
    line-height: 1.4;
}

.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 25px auto;
    border-radius: 8px;
}

.article-content figure {
    max-width: 100%;
    margin: 25px auto;
}

.article-content iframe,
.article-content video {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 25px auto;
}

.article-content blockquote {
    margin: 25px 0;
    padding: 15px 20px;
    border-left: 4px solid #e84b27;
    background: #f7f7f7;
}

.page-links {
    margin-top: 35px;
    font-weight: 700;
}

.article-side {
    position: sticky;
    top: 20px;
}

.side-title {
    font-size: 22px;
    font-weight: 900;
    padding-bottom: 10px;
    border-bottom: 2px solid #222;
    margin-bottom: 5px;
}

.side-news {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    padding: 13px 0;
    border-bottom: 1px solid #e5e5e5;
}

.side-number {
    font-size: 20px;
    font-weight: 900;
    color: #e84b27;
}

.side-news a {
    display: block;
}

.side-news .wn-auto-img,
.side-news .wn-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border-radius: 7px;
    margin-bottom: 7px;
}

.side-news strong {
    display: block;
    font-size: 14px;
    line-height: 1.45;
}

.side-news small {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 11px;
}

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .article-side {
        position: static;
    }

    .article-content {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .single-page {
        padding-top: 20px;
    }

    .article-title {
        font-size: 28px;
    }

    .article-featured {
        margin-top: 20px;
    }

    .article-featured .article-image {
        border-radius: 8px;
    }

    .article-content {
        font-size: 17px;
        line-height: 1.85;
    }
}
