/*
Theme Name: Nemothia Editorial
Theme URI: https://nemothia.com/
Author: Nemothia
Description: Standalone WordPress editorial theme adapted from the Nemothia Tistory media-list skin.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: nemothia-editorial
*/

:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --panel: #f4f7f5;
  --ink: #0f1726;
  --muted: #667085;
  --line: #d8dde6;
  --accent: #0b6b5f;
  --accent-dark: #074b43;
  --max: 1370px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

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

a:hover {
  color: var(--accent);
}

button,
input {
  font: inherit;
}

.site-header {
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  width: min(var(--max), calc(100% - 80px));
  min-height: 58px;
  grid-template-columns: 260px minmax(0, 1fr) 250px;
  gap: 28px;
  align-items: center;
  margin: 0 auto;
}

.brand {
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
}

.top-nav a {
  color: var(--ink);
  opacity: 0.78;
}

.top-nav a:hover,
.top-nav .current-menu-item > a,
.top-nav .is-active {
  color: var(--accent);
  opacity: 1;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  width: 100%;
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.search-form input {
  min-width: 0;
  border: 0;
  padding: 0 12px;
  color: var(--ink);
  outline: none;
}

.search-form button,
.menu-toggle {
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.search-form button {
  width: 42px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 38px;
}

.channel-hero {
  background: #f5f8f7;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  width: min(var(--max), calc(100% - 80px));
  min-height: 126px;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: center;
  margin: 0 auto;
  padding: 30px 0 34px;
}

.hero-inner h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(46px, 6vw, 72px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.hero-inner p {
  margin: 10px 0 0;
  color: #344054;
  font-size: 17px;
  font-weight: 700;
}

.page-shell {
  width: min(var(--max), calc(100% - 80px));
  margin: 0 auto;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 34px;
  align-items: start;
  padding: 30px 0 64px;
}

.primary-column {
  min-width: 0;
}

.archive-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 10px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

.archive-meta h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.archive-meta span,
.post-date {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.list-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.list-thumb {
  display: block;
  width: 220px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e8edf4;
}

.list-thumb img,
.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-copy {
  min-width: 0;
  padding-top: 4px;
}

.meta-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.list-copy h2 {
  margin: 8px 0 10px;
  font-size: 23px;
  line-height: 1.38;
  letter-spacing: 0;
}

.list-copy p {
  display: -webkit-box;
  margin: 0 0 8px;
  overflow: hidden;
  color: #344054;
  font-size: 15px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-state {
  margin: 20px 0;
  padding: 24px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.side-column {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 18px;
}

.side-block {
  border: 1px solid #cfd6e1;
  background: var(--paper);
  padding: 24px 22px;
}

.side-block h2 {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 23px;
  line-height: 1.25;
}

.popular-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: popular;
}

.popular-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: popular;
}

.popular-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.popular-list li::before {
  color: #000;
  content: counter(popular);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.popular-list a {
  display: block;
  color: #000;
  font-weight: 800;
  line-height: 1.45;
}

.popular-list span {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.article-view {
  max-width: 880px;
  background: var(--paper);
}

.article-header {
  padding: 8px 0 26px;
  border-bottom: 2px solid var(--ink);
}

.article-header h1 {
  margin: 10px 0 14px;
  color: var(--ink);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 900;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.article-body {
  padding-top: 30px;
  color: #202b3c;
  font-size: 18px;
  line-height: 1.9;
}

.article-body img {
  width: 100%;
  height: auto;
  margin: 22px 0;
}

.article-body figure {
  margin: 28px 0;
}

.article-body figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.article-body h2,
.article-body h3 {
  margin: 46px 0 16px;
  color: var(--ink);
  line-height: 1.35;
}

.article-body h2 {
  font-size: 29px;
}

.article-body h3 {
  font-size: 23px;
}

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

.article-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(11, 107, 95, 0.35);
}

.article-body blockquote {
  margin: 30px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  background: var(--panel);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 15px;
}

.article-body th,
.article-body td {
  padding: 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.article-body th {
  background: var(--panel);
}

.tag-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.tag-trail a {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.paging .page-numbers {
  display: inline-flex;
  min-width: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.paging .current,
.paging .page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.static-page {
  max-width: 880px;
  padding: 46px 0 70px;
}

.static-page h1 {
  margin: 0 0 18px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 900;
  line-height: 1;
}

.static-page .article-body {
  padding-top: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  display: flex;
  width: min(var(--max), calc(100% - 80px));
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 30px 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-inner strong {
  color: var(--ink);
  font-size: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .top-nav {
    display: none;
    grid-column: 1 / -1;
    align-items: stretch;
    padding: 0 0 18px;
    white-space: normal;
    flex-direction: column;
  }

  .top-nav.is-open {
    display: flex;
  }

  .header-tools {
    grid-column: 2;
  }

  .search-form {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero-inner,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    position: static;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .hero-inner,
  .page-shell,
  .footer-inner {
    width: min(100% - 28px, var(--max));
  }

  .header-inner {
    min-height: 56px;
    gap: 12px;
  }

  .brand {
    font-size: 26px;
  }

  .hero-inner {
    min-height: 0;
    gap: 18px;
    padding: 28px 0 30px;
  }

  .hero-inner h1 {
    font-size: 46px;
  }

  .hero-inner p {
    font-size: 15px;
  }

  .content-layout {
    padding: 24px 0 46px;
  }

  .archive-meta {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .list-item {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .list-thumb {
    width: 100%;
  }

  .article-body {
    font-size: 17px;
  }

  .footer-inner {
    align-items: start;
    flex-direction: column;
  }
}
