/*
Theme Name: BestSpot Editorial
Theme URI: https://bestspot.net/
Author: BestSpot
Description: Editorial theme for Korea Digital Life.
Version: 1.0.0
Text Domain: bestspot-editorial
*/

:root {
    --bg: #f7f9fc;
    --card: #ffffff;
    --text: #172033;
    --muted: #687386;
    --line: #e5eaf1;
    --blue: #2563eb;
    --blue-soft: #eef4ff;
    --dark: #111827;
    --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    line-height: 1.7;
}

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

img {
    max-width: 100%;
    height: auto;
}

.site-wrap {
    width: min(var(--max), calc(100% - 40px));
    margin: 0 auto;
}

/* HEADER */

.site-header {
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-brand {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -.5px;
}

.site-brand span {
    color: var(--blue);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    font-weight: 700;
}

.main-nav a {
    color: #39445a;
}

.main-nav a:hover {
    color: var(--blue);
}

/* HERO */

.home-hero {
    padding: 92px 0 80px;
    background:
        radial-gradient(circle at 10% 20%, rgba(37,99,235,.10), transparent 30%),
        radial-gradient(circle at 90% 0%, rgba(59,130,246,.08), transparent 25%);
}

.hero-inner {
    max-width: 850px;
}

.eyebrow {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.home-hero h1 {
    margin: 20px 0 22px;
    font-size: clamp(42px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -2.5px;
}

.home-hero p {
    max-width: 760px;
    margin: 0;
    font-size: 20px;
    color: var(--muted);
    line-height: 1.75;
}

/* SECTIONS */

.home-section {
    padding: 74px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 30px;
}

.section-kicker {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.section-head h2 {
    margin: 7px 0 0;
    font-size: 34px;
    letter-spacing: -1px;
}

/* CATEGORY GRID */

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

.category-card {
    min-height: 180px;
    padding: 26px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    transition: .2s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15,23,42,.06);
    border-color: #cfd8e7;
}

.category-icon {
    font-size: 28px;
    margin-bottom: 22px;
}

.category-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.category-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* ARTICLE CARDS */

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

.article-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: .2s ease;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15,23,42,.06);
}

.article-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    background: #e9eef6;
    overflow: hidden;
}

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

.article-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-category {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.article-card h3 {
    margin: 10px 0 12px;
    font-size: 21px;
    line-height: 1.38;
    letter-spacing: -.4px;
}

.article-excerpt {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    flex: 1;
}

.article-meta {
    color: #8a94a7;
    font-size: 12px;
}

/* SINGLE ARTICLE */

.content-shell {
    width: min(820px, calc(100% - 40px));
    margin: 0 auto;
    padding: 70px 0;
}

.article-header {
    margin-bottom: 36px;
}

.article-header h1 {
    margin: 12px 0 16px;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.13;
    letter-spacing: -1.6px;
}

.article-featured {
    margin: 0 0 38px;
    overflow: hidden;
    border-radius: 22px;
}

.article-featured img {
    width: 100%;
    display: block;
}

.entry-content {
    font-size: 18px;
    color: #303a4d;
}

.entry-content h2 {
    margin-top: 52px;
    color: var(--dark);
    font-size: 30px;
    line-height: 1.3;
}

.entry-content h3 {
    margin-top: 36px;
    color: var(--dark);
    font-size: 23px;
}

.entry-content p {
    margin: 0 0 24px;
}

.entry-content ul,
.entry-content ol {
    padding-left: 26px;
    margin-bottom: 26px;
}

.entry-content a {
    color: var(--blue);
    text-decoration: underline;
}

/* ARCHIVE */

.archive-hero {
    padding: 64px 0 35px;
}

.archive-hero h1 {
    margin: 7px 0 12px;
    font-size: 46px;
}

.archive-description {
    max-width: 680px;
    color: var(--muted);
}

.pagination-wrap {
    margin: 45px 0;
    text-align: center;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-numbers {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 0 12px;
}

.page-numbers.current {
    background: var(--dark);
    border-color: var(--dark);
    color: #fff;
}

/* FOOTER */

.site-footer {
    margin-top: 70px;
    background: #111827;
    color: #d1d5db;
}

.footer-inner {
    padding: 48px 0 36px;
}

.footer-brand {
    color: #fff;
    font-size: 22px;
    font-weight: 900;
}

.footer-text {
    max-width: 600px;
    color: #9ca3af;
    margin: 10px 0 24px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
}

.footer-bottom {
    border-top: 1px solid #273142;
    margin-top: 30px;
    padding-top: 22px;
    color: #7f8897;
    font-size: 12px;
}

/* MOBILE */

@media (max-width: 900px) {
    .category-grid,
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-nav {
        gap: 14px;
    }
}

@media (max-width: 680px) {
    .site-wrap {
        width: min(100% - 28px, var(--max));
    }

    .header-inner {
        min-height: 64px;
    }

    .main-nav {
        display: none;
    }

    .home-hero {
        padding: 65px 0 58px;
    }

    .home-hero h1 {
        letter-spacing: -1.5px;
    }

    .home-hero p {
        font-size: 17px;
    }

    .category-grid,
    .post-grid {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-section {
        padding: 55px 0;
    }

    .content-shell {
        width: calc(100% - 28px);
        padding-top: 45px;
    }
}

/* ARTICLE TABLES */

.entry-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 30px 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    font-size: 16px;
}

.entry-content th,
.entry-content td {
    padding: 14px 16px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.entry-content th {
    background: #f1f5f9;
    color: var(--dark);
    font-weight: 800;
}

.entry-content th:last-child,
.entry-content td:last-child {
    border-right: 0;
}

.entry-content tr:last-child td {
    border-bottom: 0;
}

.entry-content tbody tr:hover td {
    background: #f8fafc;
}

/* Mobile table scroll */

@media (max-width: 680px) {
    .entry-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        font-size: 14px;
    }

    .entry-content th,
    .entry-content td {
        padding: 12px 14px;
    }
}


/* =========================================================
   BESTSPOT CATEGORY HOME V2
   ========================================================= */

.category-content-section {
    padding-top: 48px;
}

.category-home-block {
    margin-top: 52px;
}

.category-home-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.category-home-head h2 {
    margin: 0;
    color: var(--dark);
    font-size: 28px;
    line-height: 1.2;
}

.category-view-more {
    flex: 0 0 auto;
    color: #2563eb;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

.category-view-more:hover {
    text-decoration: underline;
}

.category-post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.category-post-card {
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
    min-height: 205px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.category-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.category-post-thumb {
    display: block;
    min-height: 205px;
    background: #e5e7eb;
    overflow: hidden;
}

.category-post-thumb img {
    width: 100%;
    height: 100%;
    min-height: 205px;
    object-fit: cover;
    display: block;
}

.category-post-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.category-post-body h3 {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.35;
}

.category-post-body h3 a {
    color: var(--dark);
    text-decoration: none;
}

.category-post-body h3 a:hover {
    color: #2563eb;
}

.category-post-body p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.category-post-meta {
    margin-top: auto;
    padding-top: 16px;
    color: #94a3b8;
    font-size: 13px;
}

.category-empty {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--muted);
}


/* =========================================================
   START HERE
   ========================================================= */

.start-here-section {
    margin-top: 30px;
    padding-bottom: 70px;
}

.start-here-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.start-here-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.start-here-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.start-here-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e5e7eb;
}

.start-here-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.start-here-body {
    padding: 20px;
}

.start-here-body h3 {
    margin: 8px 0 10px;
    font-size: 19px;
    line-height: 1.4;
}

.start-here-body h3 a {
    color: var(--dark);
    text-decoration: none;
}

.start-here-body p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 980px) {

    .category-post-grid {
        grid-template-columns: 1fr;
    }

    .start-here-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 680px) {

    .category-home-block {
        margin-top: 38px;
    }

    .category-home-head {
        align-items: flex-start;
    }

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

    .category-view-more {
        font-size: 12px;
        white-space: nowrap;
        padding-top: 5px;
    }

    .category-post-card {
        grid-template-columns: 1fr;
    }

    .category-post-thumb {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .category-post-thumb img {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .category-post-body {
        padding: 18px;
    }

    .category-post-body h3 {
        font-size: 19px;
    }

    .start-here-grid {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   BESTSPOT HOME WIDTH FIX
   ========================================================= */

/* Main content width */
.home-hero > .hero-inner,
.home-section {
    width: min(1180px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
}

/* Hero content itself stays readable */
.home-hero > .hero-inner {
    max-width: 1180px;
}

.home-hero > .hero-inner > h1,
.home-hero > .hero-inner > p,
.home-hero > .hero-inner > .section-kicker {
    max-width: 850px;
}

/* Category / Start Here headers stay inside content width */
.category-home-head,
.section-head {
    width: 100%;
}

/* Prevent cards from stretching beyond container */
.category-post-grid,
.start-here-grid {
    width: 100%;
}

/* Desktop article cards */
.category-post-card {
    min-width: 0;
}

/* Tablet */
@media (max-width: 980px) {

    .home-hero > .hero-inner,
    .home-section {
        width: min(100% - 36px, 1180px);
    }

}

/* Mobile */
@media (max-width: 680px) {

    .home-hero > .hero-inner,
    .home-section {
        width: calc(100% - 28px);
    }

}
