/*
Theme Name: Korean From Seoul
Theme URI: https://koreanfromseoul.com
Author: Korean From Seoul
Description: Custom theme replicating the original Next.js design — Inter + Noto Sans KR, stone/rose palette, minimal layout.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: kfs
*/

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-inter: 'Inter', sans-serif;
  --font-noto: 'Noto Sans KR', sans-serif;
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;
  --rose-200: #fecdd3;
  --rose-300: #fda4af;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --rose-700: #be123c;
  --rose-900: #881337;
  --max-w: 48rem; /* max-w-3xl */
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  min-height: 100vh;
  background: var(--stone-50);
  font-family: var(--font-inter), var(--font-noto), sans-serif;
  color: var(--stone-900);
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--stone-200);
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--stone-800);
}
.site-logo .accent { color: var(--rose-500); }

.nav-menu { list-style: none; display: flex; gap: 2rem; }
.nav-menu a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--stone-500);
  transition: color .15s;
}
.nav-menu a:hover { color: var(--rose-500); }

/* Mobile menu */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--stone-500);
}
.mobile-toggle svg { width: 1.5rem; height: 1.5rem; }

.mobile-menu {
  display: none;
  border-top: 1px solid var(--stone-200);
  background: #fff;
  padding: 1rem 1.5rem;
  list-style: none;
}
.mobile-menu li { padding: 0.5rem 0; }
.mobile-menu a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--stone-500);
}
.mobile-menu a:hover { color: var(--rose-500); }
.mobile-menu.open { display: block; }

@media (max-width: 639px) {
  .nav-menu { display: none; }
  .mobile-toggle { display: block; }
}

/* ── Main content ── */
.site-main { flex: 1; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

/* ── Hero (homepage) ── */
.hero {
  text-align: center;
  margin-bottom: 4rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--stone-800);
}
.hero h1 .accent { color: var(--rose-500); }
.hero p {
  margin-top: 1rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--stone-500);
}

/* ── Section heading ── */
.section-label {
  margin-bottom: 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone-400);
}

/* ── Post cards ── */
.post-grid { display: grid; gap: 1rem; }

.post-card {
  display: block;
  border-radius: 0.75rem;
  border: 1px solid var(--stone-200);
  background: #fff;
  padding: 1.5rem;
  transition: border-color .2s, box-shadow .2s;
}
.post-card:hover {
  border-color: var(--rose-300);
  box-shadow: 0 4px 12px rgba(244,63,94,.1);
}
.post-card time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--rose-500);
}
.post-card h3 {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--stone-800);
  transition: color .15s;
}
.post-card:hover h3 { color: var(--rose-600); }
.post-card .excerpt {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--stone-500);
}

/* ── Tags ── */
.tags { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  border-radius: 9999px;
  background: var(--rose-50);
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--rose-600);
}

/* ── Single post ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--rose-500);
  transition: color .15s;
}
.back-link:hover { color: var(--rose-600); }

.post-header { margin-bottom: 2.5rem; }
.post-header time {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rose-500);
}
.post-header h1 {
  margin-top: 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--stone-800);
}

/* ── Prose (post content) ── */
.prose { font-size: 1rem; line-height: 1.75; color: var(--stone-700); }
.prose p { margin: 1.25em 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-weight: 700; color: var(--stone-800); }
.prose h2 { margin-top: 2.5rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--stone-200); font-size: 1.5rem; }
.prose h3 { margin-top: 2rem; margin-bottom: 0.75rem; font-size: 1.25rem; }
.prose a { color: var(--rose-600); text-decoration: underline; text-decoration-color: var(--rose-300); text-underline-offset: 2px; transition: color .15s; }
.prose a:hover { color: var(--rose-700); text-decoration-color: var(--rose-400); }
.prose ul, .prose ol { margin: 1.25em 0; padding-left: 1.5em; }
.prose ul > li::marker { color: var(--rose-400); }
.prose ol > li::marker { color: var(--rose-500); font-weight: 500; }
.prose li { margin: 0.5em 0; }
.prose blockquote {
  position: relative;
  margin: 1.5rem 0;
  border-left: 4px solid var(--rose-400);
  border-radius: 0 0.5rem 0.5rem 0;
  background: rgba(255,241,242,.6);
  padding: 1rem 1.5rem;
  font-style: italic;
  color: var(--stone-700);
}
.prose pre {
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  background: var(--stone-900);
  padding: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.625;
  overflow-x: auto;
  color: #e7e5e4;
}
.prose :not(pre) > code {
  border-radius: 0.375rem;
  background: var(--rose-50);
  padding: 0.125rem 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rose-700);
}
.prose table { width: 100%; border-collapse: collapse; border-radius: 0.5rem; overflow: hidden; margin: 1.5rem 0; }
.prose thead { background: var(--rose-50); }
.prose th { border-bottom: 2px solid var(--rose-200); padding: 0.75rem 1rem; text-align: left; font-size: 0.875rem; font-weight: 600; color: var(--rose-900); }
.prose td { border-bottom: 1px solid var(--stone-200); padding: 0.75rem 1rem; font-size: 0.875rem; }
.prose tbody tr:nth-child(even) { background: var(--stone-50); }
.prose tbody tr:hover { background: rgba(255,241,242,.5); }
.prose hr { margin: 2rem 0; border: none; border-top: 1px solid var(--stone-200); }
.prose img { border-radius: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ── Page title (about, etc.) ── */
.page-title {
  margin-bottom: 2rem;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--stone-800);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--stone-200);
  background: rgba(245,245,244,.5);
}
.site-footer .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--stone-400);
}

/* ── Empty state ── */
.empty { color: var(--stone-400); }

/* ── Hero Korean text (big centered keyword) ── */
.korean-hero {
  text-align: center;
  margin: 2.5rem 0;
  padding: 3rem 1.5rem;
  background: linear-gradient(135deg, #fff0f3, #ffe4ea, #ffd6de);
  border-radius: 1.5rem;
  box-shadow: 0 4px 20px rgba(244,63,94,.1);
}
.korean-hero .big-korean {
  font-size: clamp(4.5rem, 15vw, 8rem);
  font-weight: 700;
  color: var(--rose-500);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.korean-hero .romanization {
  font-size: 1.5rem;
  color: var(--stone-500);
  margin-top: 0.75rem;
  font-weight: 500;
}
.korean-hero .meaning {
  font-size: 1.125rem;
  color: var(--stone-400);
  margin-top: 0.5rem;
  font-weight: 400;
}

/* ── Pattern box (key formula) ── */
.pattern-box {
  text-align: center;
  margin: 2rem 0;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, var(--stone-900), var(--stone-800));
  color: #fff;
  border-radius: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 15px rgba(0,0,0,.15);
}
.pattern-box .emoji { font-size: 1.75rem; }
.pattern-box .highlight { color: var(--rose-300); font-size: 1.75rem; font-weight: 800; }

/* ── Callout boxes (tip, warning, fun fact) ── */
.callout {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.callout-tip {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
}
.callout-tip .callout-icon::before { content: "💡 "; }
.callout-fun {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
}
.callout-fun .callout-icon::before { content: "🎉 "; }
.callout-warning {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
}
.callout-warning .callout-icon::before { content: "⚠️ "; }

/* ── Details/summary (show answer) ── */
.prose details {
  margin: 1rem 0;
  border: 2px solid var(--rose-200);
  border-radius: 0.75rem;
  overflow: hidden;
}
.prose details summary {
  padding: 0.75rem 1.25rem;
  background: var(--rose-50);
  cursor: pointer;
  font-weight: 600;
  color: var(--rose-600);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.prose details summary::before { content: "👀"; }
.prose details summary:hover { background: var(--rose-100); }
.prose details[open] summary { border-bottom: 2px solid var(--rose-200); }
.prose details > p,
.prose details > div {
  padding: 1rem 1.25rem;
  background: #fff;
  margin: 0;
}
.prose details summary::-webkit-details-marker { display: none; }

/* ── Example sentence highlight ── */
.example-sentence {
  display: block;
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, var(--rose-50), transparent);
  border-left: 3px solid var(--rose-400);
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 1.1rem;
}
.example-sentence .korean { font-weight: 700; color: var(--stone-800); font-size: 1.2rem; }
.example-sentence .arrow { color: var(--rose-400); margin: 0 0.5rem; }
.example-sentence .english { color: var(--stone-500); }

/* ── Fun table styling ── */
.prose table { border-radius: 0.75rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.prose thead { background: linear-gradient(135deg, var(--rose-500), var(--rose-400)); }
.prose th { color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: none; }
.prose td { font-size: 0.9rem; }
.prose tbody tr:hover { background: var(--rose-50); }
.prose td:first-child { font-weight: 600; font-size: 1.1rem; }

/* ── Section emoji prefix ── */
.prose h2 .emoji { margin-right: 0.5rem; }

/* ── Dialogue (teacher/student conversation) ── */
.dialogue {
  margin: 1.5rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dialogue p {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.5;
}
.dialogue-teacher {
  background: var(--stone-100);
  color: var(--stone-800);
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
}
.dialogue-student {
  background: var(--rose-50);
  color: var(--rose-900);
  align-self: flex-end;
  border-bottom-right-radius: 0.25rem;
}

/* ── WordPress overrides ── */
.wp-block-image img { border-radius: 0.75rem; }
.aligncenter { text-align: center; }
.alignleft { float: left; margin-right: 1rem; }
.alignright { float: right; margin-left: 1rem; }

/* ── Inline Romanization (2026-04-09) ── */
.rom {
  font-size: 0.82em;
  color: var(--stone-400);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Tables: romanization in cells */
td .rom, th .rom {
  display: block;
  font-size: 0.78em;
  margin-top: 0.1em;
}

/* Example-sentence: romanization after korean */
.example-sentence .rom {
  font-size: 0.8em;
  color: var(--stone-400);
  font-weight: 400;
}

/* Meaning emphasis in example-sentence */
.example-sentence .meaning-inline {
  color: var(--stone-500);
  font-style: italic;
  font-size: 0.95em;
}
