/*
Theme Name: TripGaja Child (Astra)
Theme URI: https://tripgaja.co.kr/
Template: astra
Author: TripGaja
Description: Editorial Overseas Month-long Stay Guide Theme, child theme of Astra
Version: 1.0.0
Text Domain: tripgaja-child
*/

:root {
  --brand: #2845ae;
  --brand-dark: #1b2d75;
  --ink: #34343d;
  --muted: #6a6f80;
  --faint: #626979;
  --line: #dce2f1;
  --page: #f4f6fb;
  --white: #ffffff;
  --coral: #e05338;
  --green: #176c51;
  --green-bg: #e3f7ee;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(90deg, #fff 0, var(--page) 35%, var(--page) 65%, #fff 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Apple SD Gothic Neo", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand); }
img { height: auto; max-width: 100%; vertical-align: middle; }

/* Top Strip */
.top-strip { background: var(--brand); color: #fff; }
.top-strip-inner, .masthead-inner, .category-nav-inner, .portal-frame, .site-footer {
  max-width: 1152px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.top-strip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 35px;
  font-size: 11px;
  letter-spacing: .08em;
}
.top-strip-inner span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: .95;
}
.top-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6ee2bb;
  display: inline-block;
}

/* Masthead */
.masthead { background: var(--white); border-bottom: 1px solid rgba(220, 226, 241, 0.5); }
.masthead-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 82px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  background: #f8f9ff;
}
.brand-mark span { color: var(--coral); margin: 0 1px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { color: var(--ink); font-size: 17px; font-weight: 800; letter-spacing: -.04em; }
.brand-copy small { color: var(--faint); font-family: monospace; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.header-link { display: inline-flex; align-items: center; gap: 7px; color: var(--brand); font-size: 12px; font-weight: 700; }

/* Category Navigation */
.category-nav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 2px 6px rgba(40, 69, 174, 0.04);
}
.category-nav-inner {
  display: flex;
  align-items: center;
  min-height: 47px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-nav-inner::-webkit-scrollbar { display: none; }
.category-nav a {
  display: inline-flex;
  align-items: center;
  height: 47px;
  padding: 0 18px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.category-nav a:first-child { padding-left: 6px; }
.category-nav a:hover, .category-nav a.current {
  border-bottom-color: var(--brand);
  color: var(--brand);
}

/* Portal Frame */
.portal-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 56px;
}
.feed-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}
.feed-kicker, .side-kicker {
  margin: 0 0 6px;
  color: var(--brand);
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
}
.feed-heading h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.07em;
  color: var(--ink);
}
.feed-intro {
  max-width: 340px;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

/* Lead Story */
.lead-story {
  display: grid;
  grid-template-columns: 44% minmax(0, 1fr);
  gap: 28px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.story-thumb {
  position: relative;
  display: flex;
  aspect-ratio: 16/9;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  padding: 20px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--brand-dark);
  color: #fff;
  isolation: isolate;
  text-decoration: none;
}
.story-thumb-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.story-thumb:hover .story-thumb-image { transform: scale(1.03); }
.thumb-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(20, 25, 55, 0.95) 0%, rgba(27, 45, 117, 0.75) 48%, rgba(27, 45, 117, 0.05) 85%);
}
.thumb-label, .story-thumb small {
  position: relative;
  z-index: 1;
  font-family: monospace;
  font-size: 9.5px;
  letter-spacing: .1em;
}
.thumb-label {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.2);
}
.story-thumb .thumb-title {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  max-width: 85%;
  margin: 0;
  overflow: hidden;
  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.065em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.story-thumb small {
  margin-top: 12px;
  color: #d9daf8;
  font-size: 8.5px;
  text-transform: uppercase;
}

.lead-copy { padding: 4px 4px 0 0; }
.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
  margin-bottom: 10px;
  color: var(--brand);
  font-family: monospace;
  font-size: 10.5px;
  line-height: 1.5;
}
.story-meta span + span { color: var(--faint); }
.lead-copy h2 {
  max-width: 580px;
  margin: 0 0 14px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.07em;
}
.lead-copy h2 a:hover { color: var(--brand); }
.lead-copy p, .story-row p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}
.read-link, .side-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
}

/* Section Bar */
.section-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin: 32px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.section-bar h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.06em; }
.section-bar span { color: var(--faint); font-family: monospace; font-size: 9.5px; }

/* Story List */
.story-row {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.story-row .story-thumb { min-height: 0; padding: 12px; }
.story-row .story-thumb .thumb-title { max-width: 90%; font-size: 13.5px; line-height: 1.2; -webkit-line-clamp: 2; }
.story-row .thumb-label, .story-row .story-thumb small { font-size: 7.5px; }
.story-row .thumb-label { margin-bottom: 5px; padding: 2px 5px; }
.story-row .story-thumb small { margin-top: 6px; }
.story-row h3 { margin: 0 0 8px; font-size: 18.5px; font-weight: 700; line-height: 1.32; letter-spacing: -.06em; }
.story-row h3 a:hover { color: var(--brand); }
.story-row p { margin: 0; font-size: 12.5px; line-height: 1.7; }

/* Sidebar */
.sidebar { display: grid; align-content: start; gap: 18px; }
.side-card { padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.side-card h2 { margin: 0 0 12px; font-size: 22px; font-weight: 800; line-height: 1.22; letter-spacing: -.07em; }
.side-card h2 em { color: var(--brand); font-style: normal; }
.side-card p { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.start-card { border-top: 4px solid var(--brand); }
.side-kicker { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.live-badge { padding: 3px 8px; border-radius: 3px; background: var(--green-bg); color: var(--green); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; }
.status-line { display: grid; gap: 3px; margin-bottom: 12px; }
.status-line span { color: var(--faint); font-size: 10.5px; }
.status-line strong { font-size: 16px; font-weight: 700; letter-spacing: -.05em; color: var(--ink); }
.progress { height: 5px; margin-bottom: 17px; overflow: hidden; border-radius: 10px; background: #edeefe; }
.progress span { display: block; width: 65%; height: 100%; background: var(--brand); }
.side-check { display: grid; gap: 10px; }
.side-check div { display: grid; grid-template-columns: 17px 1fr auto; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.side-check span:first-child { color: var(--green); font-weight: 800; }
.side-check b { color: var(--green); font-size: 10.5px; }
.side-check .next span:first-child, .side-check .next b { color: var(--coral); }

.popular-list { margin: 0; padding: 0; list-style: none; }
.popular-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.popular-list li:first-child { padding-top: 0; border-top: 0; }
.popular-list span { color: var(--brand); font-family: monospace; font-size: 11px; font-weight: 700; }
.popular-list a { font-size: 12.5px; font-weight: 700; line-height: 1.48; }

.about-card { background: var(--brand-dark); color: #fff; }
.about-card .side-kicker { color: #b8b9ef; }
.about-card p { color: #d5d6f5; font-size: 12.5px; }
.about-card a { color: #fff; font-size: 11.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Principles Bar */
.principles {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  max-width: 1152px;
  margin: 0 auto;
  padding: 22px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.principles > div:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-size: 12.5px; font-weight: 800; }
.principles p { margin: 0; color: var(--muted); font-size: 12.5px; }
.principle-tags { display: flex; gap: 14px; color: var(--faint); font-family: monospace; font-size: 8.5px; letter-spacing: .06em; }

/* Footer */
.site-footer { display: flex; align-items: center; gap: 30px; padding-top: 28px; padding-bottom: 28px; }
.site-footer .brand-mark { width: 32px; height: 32px; font-size: 10px; }
.site-footer .brand-copy strong { font-size: 13.5px; }
.site-footer .brand-copy small { font-size: 7.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; color: var(--muted); font-size: 11px; }
.copyright { color: var(--faint); font-family: monospace; font-size: 8.5px; white-space: nowrap; }

/* Single Article Layout */
.article-home-link { display: inline-flex; align-items: center; gap: 7px; color: var(--brand); font-size: 12px; font-weight: 700; }
.article-frame { max-width: 1152px; margin: 0 auto; padding: 32px 24px 80px; }
.article-title-block { padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.article-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--brand); font-family: monospace; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; }
.article-eyebrow b { width: 32px; height: 1px; background: var(--brand); }
.article-title-block h1 {
  max-width: 1000px;
  margin: 18px 0 14px;
  color: var(--ink);
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.075em;
}
.article-postmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; color: var(--faint); font-family: monospace; font-size: 10.5px; }
.article-postmeta strong { color: var(--muted); font-weight: 700; }
.article-tag { padding-left: 18px; border-left: 1px solid var(--line); color: var(--brand); }
.article-columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 50px; align-items: start; }
.article-main-column { min-width: 0; }

.article-hero-slot {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  min-height: 0;
  margin-bottom: 32px;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  background: var(--brand-dark);
  isolation: isolate;
}
.article-hero-slot::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(20, 25, 55, 0.94) 0%, rgba(27, 45, 117, 0.72) 48%, rgba(27, 45, 117, 0.05) 85%);
  content: "";
}
.article-hero-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.article-hero-copy {
  position: absolute;
  left: 32px;
  bottom: 28px;
  z-index: 1;
  display: grid;
  gap: 10px;
  max-width: 65%;
  color: #fff;
}
.article-hero-copy span { font-family: monospace; font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.article-hero-copy strong { font-size: clamp(24px, 3.2vw, 36px); font-weight: 800; line-height: 1.2; letter-spacing: -.07em; }

.article-body { color: #4a505e; font-size: 16px; line-height: 1.95; }
.article-body p { margin: 0 0 22px; }
.article-body .article-lead {
  margin-bottom: 28px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: -.03em;
}

/* Outcome Box */
.tutorial-outcome {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 30px;
  padding: 20px 22px;
  border: 1px solid #d5d7f1;
  border-left: 5px solid var(--brand);
  background: #edeefe;
  border-radius: 4px;
}
.tutorial-outcome span { color: var(--brand); font-family: monospace; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tutorial-outcome p { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.65; }
.tutorial-environment {
  margin-top: -15px;
  margin-bottom: 28px;
  color: var(--faint);
  font-size: 12px;
  font-style: italic;
}

/* Headings in body */
.article-body h2 {
  margin: 44px 0 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.065em;
  scroll-margin-top: 60px;
}
.article-body h3 {
  margin: 28px 0 12px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.05em;
}
.article-body ul, .article-body ol { margin: 18px 0 26px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }

/* Custom tables */
.article-table {
  width: 100%;
  margin: 24px 0 32px;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.article-table th {
  background: #f1f3fa;
  color: var(--ink);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  text-align: left;
}
.article-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: #4a505e;
}
.article-table tr:last-child td { border-bottom: 0; }
.article-table tr:hover td { background: #fafbff; }

/* Tip box */
.article-tip {
  margin: 24px 0 30px;
  padding: 18px 20px;
  border-left: 4px solid var(--coral);
  background: #fff8f6;
  border-radius: 2px;
  font-size: 14px;
}
.article-tip strong { color: var(--coral); display: block; margin-bottom: 5px; }
.article-tip p { margin: 0; color: var(--ink); }

/* Sources & Author Evidence */
.tutorial-sources {
  margin: 44px 0 32px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 4px;
}
.tutorial-sources h2 { margin: 0 0 12px; padding: 0; border: 0; font-size: 18px; }
.tutorial-sources ul { margin: 0; padding-left: 20px; font-size: 13.5px; }

.article-author-evidence {
  margin: 36px 0 32px;
  padding: 22px 24px;
  border: 1px solid #d5d7f1;
  background: #f8f9ff;
  border-radius: 4px;
}
.article-author-evidence span { display: block; margin-bottom: 6px; color: var(--brand); font-family: monospace; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.article-author-evidence strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 15px; }
.article-author-evidence p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.article-author-evidence a { color: var(--brand); font-size: 12px; font-weight: 700; }

.article-end {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 4px;
  font-size: 13.5px;
}
.article-end span { color: var(--brand); font-weight: 700; }
.article-end a { font-weight: 700; }

/* Article Sidebar */
.article-sidebar { display: grid; gap: 18px; }
.article-side-card { padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.toc-card p { margin: 0 0 4px; color: var(--brand); font-family: monospace; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; }
.toc-card h2 { margin: 0 0 14px; font-size: 20px; font-weight: 800; line-height: 1.25; letter-spacing: -.06em; }
.toc-card h2 em { color: var(--brand); font-style: normal; }
.toc-card nav { display: grid; gap: 8px; }
.toc-card nav a { font-size: 12.5px; color: var(--muted); line-height: 1.5; padding: 4px 0; border-bottom: 1px solid #f0f2f8; }
.toc-card nav a:hover { color: var(--brand); padding-left: 4px; }
.reading-card { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.reading-card strong { font-size: 18px; color: var(--brand); }
.related-card p { margin: 0 0 12px; color: var(--faint); font-family: monospace; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.related-card a { display: block; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 700; line-height: 1.45; }
.related-card a:first-of-type { border-top: 0; padding-top: 0; }

/* Responsive adjustments */
@media (max-width: 880px) {
  .portal-frame { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-card, .about-card { grid-column: span 2; }
  .principles { grid-template-columns: auto 1fr; }
  .principle-tags { grid-column: 1 / -1; }
  .article-columns { grid-template-columns: 1fr; }
  .article-sidebar { order: -1; }
}
@media (max-width: 620px) {
  .top-strip-inner { align-items: flex-start; flex-direction: column; gap: 3px; padding: 8px 18px; }
  .masthead-inner { min-height: 70px; padding-left: 18px; padding-right: 18px; }
  .brand-copy strong { font-size: 15px; }
  .header-link { display: none; }
  .category-nav-inner { padding-left: 18px; padding-right: 18px; }
  .category-nav a { padding: 0 13px; font-size: 11.5px; }
  .portal-frame { padding: 25px 18px 38px; }
  .feed-heading { display: block; }
  .feed-heading h1 { font-size: 26px; }
  .feed-intro { margin-top: 10px; }
  .lead-story { grid-template-columns: 1fr; gap: 18px; }
  .story-row { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
  .story-row .thumb-title { font-size: 12px; }
  .story-row h3 { font-size: 15px; }
  .story-row p { display: none; }
  .sidebar { grid-template-columns: 1fr; }
  .start-card, .about-card { grid-column: auto; }
  .principles { display: block; padding: 18px; }
  .principles p { margin: 8px 0 12px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 20px; padding-left: 18px; padding-right: 18px; }
  .footer-links { margin-left: 0; }
  .copyright { white-space: normal; }
  .article-frame { padding: 24px 18px 60px; }
  .article-hero-copy { max-width: 90%; left: 20px; bottom: 20px; }
}
