/*
Theme Name: Evergreen Korea
Theme URI: https://evergreenkorea.com
Author: Evergreen Korea
Author URI: https://evergreenkorea.com
Description: A lightweight, editorial WordPress theme for Evergreen Korea — discovering the intersection between what Korea is paying attention to and what global audiences want to understand. No page builders, no bundled plugins required.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: evergreen-korea
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
	--ink: #0F172A;
	--accent: #2563EB;
	--bg: #FFFFFF;
	--bg-soft: #F8FAFC;
	--border: #E2E8F0;
	--border-soft: #EEF1F5;
	--body: #334155;
	--muted: #64748B;
	--muted-2: #94A3B8;

	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 18px;
	--radius-xl: 24px;
	--radius-pill: 999px;

	--shadow-card: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
	--shadow-raised: 0 12px 40px -16px rgba(15, 23, 42, .22);

	--container: 1240px;
	--container-narrow: 1080px;
	--container-article: 720px;

	--font-display: 'Manrope', system-ui, -apple-system, sans-serif;
	--font-body: 'Inter', system-ui, -apple-system, sans-serif;
	--font-editorial: 'Newsreader', Georgia, serif;
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
p { margin: 0; }
::selection { background: rgba(37, 99, 235, .16); }
.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px; height: 1px; overflow: hidden;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   3. Buttons & form controls
   ========================================================================== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 44px;
	padding: 0 22px;
	border-radius: var(--radius-pill);
	border: none;
	font-family: var(--font-body);
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.icon-btn {
	width: 40px; height: 40px; border-radius: var(--radius-pill);
	border: 1px solid var(--border); background: #fff;
	display: grid; place-items: center; cursor: pointer; color: var(--ink);
	flex-shrink: 0;
}

.search-form {
	display: flex; align-items: center; gap: 8px;
	background: #fff; border: 1px solid var(--border);
	border-radius: var(--radius-pill); padding: 6px 6px 6px 18px;
}
.search-form input[type="search"] {
	flex: 1; min-width: 0; border: none; outline: none;
	background: transparent; font-size: 15px; color: var(--ink);
}
.search-form button {
	height: 40px; padding: 0 18px; border: none; border-radius: var(--radius-pill);
	background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}

/* ==========================================================================
   4. Site header
   ========================================================================== */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .88);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--border-soft);
}
.site-header__bar {
	max-width: var(--container); margin: 0 auto; padding: 0 20px;
	height: 68px; display: flex; align-items: center; gap: 16px;
}
.site-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.site-logo__mark {
	width: 32px; height: 32px; border-radius: 10px; background: var(--accent);
	display: grid; place-items: center; flex-shrink: 0;
}
.site-logo__text { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; color: var(--ink); }

.primary-nav { display: none; align-items: center; gap: 2px; margin-left: 8px; }
.primary-nav a {
	padding: 9px 13px; border-radius: 9px; font-size: 14.5px; font-weight: 500; color: var(--body);
}
.primary-nav a:hover, .primary-nav a.current-cat { color: var(--ink); background: var(--bg-soft); }

.site-header__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.menu-toggle {
	width: 40px; height: 40px; border-radius: var(--radius-md); border: 1px solid var(--border);
	background: #fff; display: grid; place-items: center; cursor: pointer;
}
.menu-toggle svg { display: block; }

.mobile-nav {
	display: none; border-top: 1px solid var(--border-soft); background: #fff;
	padding: 12px 20px 20px;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
	display: block; padding: 13px 4px; font-size: 16px; font-weight: 500;
	border-bottom: 1px solid #F1F5F9; color: var(--body);
}
.mobile-nav a:last-child { border-bottom: none; }

.header-search { display: none; }
.header-search.is-open {
	display: block; border-top: 1px solid var(--border-soft); background: #fff; padding: 16px 20px;
}

/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero { max-width: var(--container-narrow); margin: 0 auto; padding: 48px 20px 36px; text-align: center; }
.hero__title {
	font-size: clamp(34px, 8vw, 60px); line-height: 1.06; letter-spacing: -0.035em;
	max-width: 16ch; margin: 0 auto;
}
.hero__subtitle { margin: 20px auto 0; max-width: 46ch; font-size: clamp(17px, 3vw, 21px); font-weight: 600; line-height: 1.4; color: var(--ink); }
.hero__support { margin: 12px auto 0; max-width: 56ch; font-size: clamp(15px, 2vw, 17px); line-height: 1.6; color: var(--muted); }
.hero__search { margin: 32px auto 0; max-width: 520px; box-shadow: var(--shadow-raised); }

/* ==========================================================================
   6. Cards
   ========================================================================== */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.post-card { display: flex; flex-direction: column; gap: 13px; }
.post-card__media {
	aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden;
	position: relative; background: linear-gradient(140deg, #EFF4FF, #F8FAFC);
	border: 1px solid var(--border-soft);
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cat-pill {
	display: inline-flex; align-items: center; padding: 5px 12px; border-radius: var(--radius-pill);
	background: #fff; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.post-card__media .cat-pill { position: absolute; top: 12px; left: 12px; }
.post-card__title {
	font-size: 18px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 700; margin: 0;
}
.post-card__title a { color: var(--ink); }
.post-card__excerpt {
	margin: 4px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--muted);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--muted-2); }
.post-card__meta .dot { width: 3px; height: 3px; border-radius: 99px; background: #CBD5E1; }

/* ==========================================================================
   7. Section headings
   ========================================================================== */
.section { max-width: var(--container); margin: 0 auto; padding: 40px 20px; }
.section--narrow { max-width: var(--container-narrow); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section__head h2 { font-size: clamp(24px, 5vw, 32px); }
.section__link { font-size: 14px; font-weight: 600; color: var(--body); display: inline-flex; align-items: center; gap: 5px; }

/* ==========================================================================
   8. Featured story
   ========================================================================== */
.featured-story {
	display: grid; grid-template-columns: 1fr; border-radius: 24px; overflow: hidden;
	background: var(--ink); border: 1px solid var(--ink);
}
.featured-story__media { min-height: 220px; position: relative; background: linear-gradient(140deg, #1E293B, #312E81); }
.featured-story__media img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.featured-story__body { padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.featured-story__kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.featured-story__kicker span { padding: 5px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; }
.featured-story__kicker .label { background: rgba(255, 255, 255, .12); color: #fff; }
.featured-story__title { font-size: clamp(24px, 5vw, 36px); line-height: 1.12; color: #fff; }
.featured-story__title a { color: #fff; }
.featured-story__excerpt { margin: 16px 0 0; font-size: 15.5px; line-height: 1.6; color: rgba(255, 255, 255, .74); max-width: 54ch; }
.featured-story__meta { display: flex; align-items: center; gap: 12px; margin-top: 22px; font-size: 13.5px; color: rgba(255, 255, 255, .6); }
.featured-story__meta strong { color: #fff; font-weight: 600; }

/* ==========================================================================
   9. Category grid
   ========================================================================== */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.category-card {
	display: flex; flex-direction: column; gap: 12px; padding: 20px;
	border-radius: var(--radius-lg); border: 1px solid var(--border-soft);
}
.category-card__icon {
	width: 44px; height: 44px; border-radius: 13px; background: #fff;
	display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 19px;
}
.category-card__name { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; color: var(--ink); }
.category-card__count { margin-top: 2px; font-size: 13px; color: var(--muted); }

/* ==========================================================================
   10. Who we are / intersection section
   ========================================================================== */
.intersect { max-width: var(--container-narrow); margin: 0 auto; padding: 48px 20px; text-align: center; }
.intersect__title { font-size: clamp(24px, 5vw, 32px); }
.intersect__statement {
	margin: 24px auto 0; max-width: 62ch; font-family: var(--font-editorial); font-style: italic;
	font-size: clamp(19px, 3.4vw, 24px); line-height: 1.5; color: var(--ink);
}
.intersect__pair { margin: 36px auto 0; display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 640px; }
.intersect__point {
	padding: 20px; border-radius: var(--radius-lg); background: var(--bg-soft); border: 1px solid var(--border-soft);
	text-align: left;
}
.intersect__point .kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.intersect__point p { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--body); }

/* ==========================================================================
   11. Newsletter
   ========================================================================== */
.newsletter {
	border-radius: 24px; background: linear-gradient(135deg, var(--ink), #1E293B);
	padding: 40px 24px; text-align: center; position: relative; overflow: hidden;
}
.newsletter::before {
	content: ""; position: absolute; inset: 0; opacity: .5;
	background: radial-gradient(80% 120% at 50% -10%, rgba(37, 99, 235, .45), transparent 55%);
}
.newsletter__inner { position: relative; z-index: 1; }
.newsletter__title { font-size: clamp(24px, 5vw, 36px); color: #fff; }
.newsletter__sub { margin: 14px auto 0; max-width: 48ch; font-size: 15.5px; line-height: 1.55; color: rgba(255, 255, 255, .74); }
.newsletter__form { margin: 26px auto 0; max-width: 460px; display: flex; flex-wrap: wrap; gap: 10px; }
.newsletter__form input {
	flex: 1; min-width: 180px; height: 50px; padding: 0 18px; border: none;
	border-radius: var(--radius-pill); font-size: 15px; outline: none;
}
.newsletter__form button {
	height: 50px; padding: 0 24px; background: var(--accent); color: #fff; border: none;
	border-radius: var(--radius-pill); font-weight: 700; font-size: 15px; cursor: not-allowed; opacity: .92;
}
.newsletter__note { margin-top: 14px; font-size: 12.5px; color: rgba(255, 255, 255, .5); }

/* ==========================================================================
   12. Archive / category banner
   ========================================================================== */
.archive-banner {
	border-radius: 22px; padding: 36px 24px; border: 1px solid var(--border-soft); margin-bottom: 32px;
}
.archive-banner .cat-pill { background: #fff; margin-bottom: 14px; }
.archive-banner h1 { font-size: clamp(28px, 6vw, 44px); }
.archive-banner p { margin: 12px 0 0; max-width: 58ch; font-size: 15.5px; line-height: 1.55; color: var(--body); }
.archive-banner__count { margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-2); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted-2); }
.breadcrumbs a:hover { color: var(--body); }
.breadcrumbs .current { color: var(--body); }

.category-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 24px; }
.category-tabs a {
	flex: 0 0 auto; height: 38px; padding: 0 16px; display: inline-flex; align-items: center;
	border-radius: var(--radius-pill); border: 1px solid var(--border); background: #fff;
	font-size: 14px; font-weight: 600; color: var(--body); white-space: nowrap;
}
.category-tabs a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pagination .page-numbers {
	min-width: 40px; height: 40px; padding: 0 4px; border-radius: 11px; border: 1px solid var(--border);
	background: #fff; color: var(--body); font-weight: 600; font-size: 14px; display: inline-flex;
	align-items: center; justify-content: center;
}
.pagination .page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .page-numbers.dots { border: none; background: none; color: var(--muted-2); }

/* ==========================================================================
   13. Single article
   ========================================================================== */
.article-head { max-width: var(--container-article); margin: 0 auto; padding: 32px 20px 0; }
.article-head__title { font-size: clamp(28px, 7vw, 46px); line-height: 1.1; letter-spacing: -0.035em; margin-top: 16px; }
.article-head__excerpt {
	margin: 18px 0 0; font-family: var(--font-editorial); font-size: clamp(17px, 3.2vw, 20px);
	line-height: 1.5; color: var(--body);
}
.article-head__meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px;
	padding-bottom: 24px; border-bottom: 1px solid var(--border-soft);
}
.author-avatar {
	width: 42px; height: 42px; border-radius: 99px; background: linear-gradient(135deg, #F59E0B, #EA580C);
	display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.article-head__byline { font-size: 13.5px; }
.article-head__byline strong { display: block; color: var(--ink); font-weight: 600; }
.article-head__byline span { color: var(--muted-2); }

.article-media { max-width: var(--container-narrow); margin: 28px auto 0; padding: 0 20px; }
.article-media__frame {
	aspect-ratio: 16 / 9; border-radius: var(--radius-xl); overflow: hidden;
	background: linear-gradient(140deg, #EFF4FF, #F8FAFC); border: 1px solid var(--border-soft);
}
.article-media__frame img { width: 100%; height: 100%; object-fit: cover; }
.article-media__caption { margin-top: 8px; font-size: 13px; color: var(--muted-2); font-style: italic; }

.article-body-wrap {
	max-width: var(--container-narrow); margin: 32px auto 0; padding: 0 20px;
	display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px;
}
.entry-content {
	max-width: var(--container-article); font-family: var(--font-editorial); font-size: 19px; line-height: 1.72; color: #1E293B;
}
.entry-content > p:first-of-type::first-letter {
	float: left; font-family: var(--font-display); font-weight: 800; font-size: 58px; line-height: .82;
	padding: 6px 10px 0 0; color: var(--accent);
}
.entry-content p { margin: 0 0 22px; }
.entry-content h2 {
	font-size: clamp(23px, 4vw, 28px); letter-spacing: -0.025em; line-height: 1.25; margin: 40px 0 16px; scroll-margin-top: 90px;
}
.entry-content h3 { font-size: 20px; letter-spacing: -0.01em; margin: 30px 0 14px; font-weight: 700; }
.entry-content ul, .entry-content ol { margin: 0 0 22px; padding-left: 22px; list-style: revert; }
.entry-content li { margin-bottom: 8px; }
.entry-content img, .entry-content figure { border-radius: var(--radius-lg); margin: 28px 0; }
.entry-content figcaption { font-family: var(--font-body); font-size: 13px; color: var(--muted-2); font-style: italic; margin-top: 8px; }
.entry-content blockquote {
	margin: 30px 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--accent);
	font-style: italic; font-size: clamp(20px, 3vw, 24px); line-height: 1.45; color: var(--ink);
}
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.entry-content code { font-family: 'SFMono-Regular', Consolas, monospace; background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; font-size: .9em; }

.editorial-note {
	max-width: var(--container-article); margin: 32px auto 0; padding: 20px 22px;
	border-radius: var(--radius-lg); background: #F0F7FF; border: 1px solid #DBEAFE;
}
.editorial-note__label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.editorial-note p { font-size: 15px; line-height: 1.6; color: #1E3A5F; margin: 0; }

.author-box {
	max-width: var(--container-article); margin: 32px auto 0; padding: 22px;
	border-radius: var(--radius-lg); border: 1px solid var(--border-soft);
	display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.author-box .author-avatar { width: 54px; height: 54px; font-size: 18px; }
.author-box__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.author-box__bio { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }

.toc-box { max-width: var(--container-article); margin: 28px auto 0; padding: 0 20px; }
.toc-box details { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 4px 18px; background: var(--bg-soft); }
.toc-box summary { font-family: var(--font-display); font-weight: 700; font-size: 15px; padding: 14px 0; cursor: pointer; }
.toc-box ul { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 16px; }
.toc-box a { font-size: 14px; color: var(--body); }

.reading-progress { height: 3px; background: transparent; }
.reading-progress__bar { height: 100%; width: 0%; background: var(--accent); transition: width .1s linear; }

/* ==========================================================================
   14. Related posts
   ========================================================================== */
.related-posts { max-width: var(--container-narrow); margin: 48px auto 0; padding: 0 20px 48px; }

/* ==========================================================================
   15. Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border-soft); background: var(--bg-soft); margin-top: 48px; }
.site-footer__inner { max-width: var(--container); margin: 0 auto; padding: 48px 20px 28px; display: grid; grid-template-columns: 1fr; gap: 32px; }
.site-footer__brand p { margin: 14px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 36ch; }
.site-footer__col h3 { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--ink); margin-bottom: 14px; }
.site-footer__col ul { display: flex; flex-direction: column; gap: 10px; }
.site-footer__col a { font-size: 14px; color: var(--muted); }
.site-footer__col a:hover { color: var(--ink); }
.site-footer__bottom {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
	margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted-2);
}

/* ==========================================================================
   16. 404 / search
   ========================================================================== */
.state-page { max-width: var(--container-narrow); margin: 0 auto; padding: 64px 20px; text-align: center; }
.state-page h1 { font-size: clamp(28px, 6vw, 40px); }
.state-page p { margin: 14px auto 0; max-width: 50ch; font-size: 16px; color: var(--muted); }
.state-page .search-form { margin: 28px auto 0; max-width: 460px; }

.no-results { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ==========================================================================
   17. Responsive — tablet & up (768px)
   ========================================================================== */
@media (min-width: 768px) {
	.card-grid { grid-template-columns: repeat(2, 1fr); }
	.category-grid { grid-template-columns: repeat(3, 1fr); }
	.featured-story { grid-template-columns: 1fr 1fr; }
	.featured-story__media { min-height: 100%; }
	.featured-story__body { padding: 44px; }
	.intersect__pair { grid-template-columns: 1fr 1fr; }
	.article-head, .article-media, .article-body-wrap { padding-left: 24px; padding-right: 24px; }
}

/* ==========================================================================
   18. Responsive — desktop & up (1024px)
   ========================================================================== */
@media (min-width: 1024px) {
	.primary-nav { display: flex; }
	.menu-toggle { display: none; }
	.header-search-toggle { display: grid; }
	.card-grid { grid-template-columns: repeat(3, 1fr); }
	.category-grid { grid-template-columns: repeat(4, 1fr); }
	.article-body-wrap { grid-template-columns: minmax(0, 1fr) 260px; }
	.article-sidebar { display: block; }
}

.article-sidebar { display: none; }
@media (min-width: 1024px) {
	.article-sidebar-inner { position: sticky; top: 96px; }
}

/* ==========================================================================
   19. Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
