/*
Theme Name: epiSam Journal
Theme URI: https://sanghyukbae.com
Author: Eduardo for Sanghyuk Bae
Description: A restrained single-column editorial theme inspired by the former Ghost Journal site.
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: episam-journal
*/

:root {
  --episam-accent: #ff1a75;
  --episam-ink: #111111;
  --episam-muted: #737373;
  --episam-rule: #e8e8e8;
  --episam-paper: #ffffff;
  --episam-content: 720px;
  --episam-wide: 1080px;
  --episam-shell: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--episam-ink);
  background: var(--episam-paper);
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.78;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--episam-accent); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed; top: 1rem; left: 1rem; z-index: 9999; width: auto; height: auto; padding: .75rem 1rem; clip: auto; background: #fff; border: 1px solid var(--episam-ink); }

.site-header { border-bottom: 1px solid var(--episam-rule); }
.site-header__inner { max-width: var(--episam-shell); margin: 0 auto; padding: 2.4rem 2.5rem 1.8rem; }
.site-brand { display: inline-block; font-size: 1.55rem; font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.site-header__row { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-top: 1.7rem; }
.primary-nav ul { display: flex; align-items: center; gap: 1.8rem; margin: 0; padding: 0; list-style: none; }
.primary-nav a { font-size: .76rem; font-weight: 750; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.search-toggle { border: 0; padding: .25rem; background: transparent; cursor: pointer; line-height: 1; }
.search-toggle svg { width: 21px; height: 21px; }
.header-search { display: none; margin-top: 1rem; }
.header-search.is-open { display: block; }
.search-form { display: flex; gap: .5rem; max-width: 520px; margin-left: auto; }
.search-field { width: 100%; padding: .65rem .8rem; border: 1px solid var(--episam-rule); border-radius: 0; }
.search-submit { border: 1px solid var(--episam-ink); padding: .65rem 1rem; color: #fff; background: var(--episam-ink); cursor: pointer; }

.home-main { padding: 0 2.5rem; }
.home-hero { max-width: 900px; margin: 6.5rem auto 8.5rem; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: .55rem; margin-bottom: 1.3rem; font-size: .72rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.eyebrow__latest { color: var(--episam-accent); }
.home-hero__title { max-width: 880px; margin: 0; font-size: clamp(2.9rem, 6.4vw, 5.5rem); font-weight: 800; line-height: 1.08; letter-spacing: -.055em; }
.home-hero__title a { text-decoration: none; }
.home-hero__excerpt { max-width: 760px; margin: 2rem 0 0; font-size: 1.13rem; line-height: 1.8; }
.read-time { display: block; margin-top: 1.4rem; color: var(--episam-muted); font-size: .72rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }

.more-section { max-width: var(--episam-wide); margin: 0 auto 7rem; }
.section-title { margin: 0 0 1.7rem; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; }
.issue-list { border-top: 1px solid var(--episam-rule); }
.issue-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--episam-rule); }
.issue-card__title { margin: 0 0 .65rem; font-size: clamp(1.45rem, 3vw, 2.35rem); line-height: 1.22; letter-spacing: -.035em; }
.issue-card__title a { text-decoration: none; }
.issue-card__excerpt { max-width: 700px; margin: 0; color: #333; font-size: .95rem; line-height: 1.7; }
.issue-card__meta { color: var(--episam-muted); font-size: .74rem; white-space: nowrap; }

.home-about { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; max-width: var(--episam-wide); margin: 0 auto 7rem; padding-top: 3rem; border-top: 1px solid var(--episam-rule); }
.home-about h2, .home-about h3 { margin-top: 0; }
.home-about h2 { font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; }
.home-about h3 { font-size: 1.7rem; letter-spacing: -.03em; }
.topic-list { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.topic-list a { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--episam-rule); font-size: .78rem; text-decoration: none; }

.singular-main { padding: 0 2rem; }
.article-header { max-width: 900px; margin: 6rem auto 3.2rem; text-align: center; }
.article-header__date { color: var(--episam-muted); font-size: .78rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.article-title { margin: 1rem 0 0; font-size: clamp(2.7rem, 6vw, 5.2rem); line-height: 1.08; letter-spacing: -.055em; }
.article-feature { max-width: var(--episam-wide); margin: 0 auto 4rem; }
.article-feature img { width: 100%; }
.entry-content { max-width: var(--episam-content); margin: 0 auto; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p, .entry-content ul, .entry-content ol { margin-top: 0; margin-bottom: 1.45em; }
.entry-content h2 { margin: 2.6em 0 .8em; font-size: 1.75rem; line-height: 1.3; letter-spacing: -.025em; }
.entry-content h3 { margin: 2.2em 0 .7em; font-size: 1.35rem; }
.entry-content blockquote { margin: 2rem 0; padding-left: 1.4rem; border-left: 3px solid var(--episam-accent); font-size: 1.12rem; }
.entry-content figure { margin: 2.2rem 0; }
.entry-content figcaption { margin-top: .65rem; color: var(--episam-muted); font-size: .78rem; text-align: center; }
.entry-content .alignwide { width: min(var(--episam-wide), calc(100vw - 4rem)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.entry-content .about-me-float-photo { float: right; width: 260px; max-width: 38%; margin: .6rem 0 1.25rem 2rem; }
.entry-content .about-me-float-clear { clear: both; height: 0; }

.share-area { max-width: var(--episam-content); margin: 4rem auto 6rem; padding-top: 2rem; border-top: 1px solid var(--episam-rule); }
.share-open { border: 1px solid var(--episam-ink); padding: .7rem 1.15rem; background: #fff; cursor: pointer; }
.share-dialog { width: min(560px, calc(100vw - 2rem)); padding: 0; border: 1px solid var(--episam-ink); }
.share-dialog::backdrop { background: rgb(0 0 0 / .35); }
.share-dialog__inner { padding: 1.4rem; }
.share-dialog__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.share-dialog__head h2 { margin: 0; font-size: 1.1rem; }
.share-close { border: 0; background: transparent; font-size: 1.5rem; cursor: pointer; }
.share-links { display: grid; grid-template-columns: repeat(5, 1fr); gap: .55rem; }
.share-links a, .share-copy, .share-more summary { display: flex; min-height: 48px; align-items: center; justify-content: center; border: 1px solid var(--episam-rule); padding: .55rem; background: #fff; color: var(--episam-ink); font-size: .72rem; text-align: center; text-decoration: none; cursor: pointer; }
.share-more { grid-column: 1 / -1; }
.share-more summary { list-style: none; }
.share-more summary::-webkit-details-marker { display: none; }
.share-more__links { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-top: .55rem; }

.archive-header { max-width: var(--episam-wide); margin: 5rem auto 2rem; }
.archive-header h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -.05em; }
.pagination { max-width: var(--episam-wide); margin: 2rem auto 6rem; }

.site-footer { border-top: 1px solid var(--episam-rule); }
.site-footer__inner { display: flex; justify-content: space-between; gap: 2rem; max-width: var(--episam-shell); margin: 0 auto; padding: 2.2rem 2.5rem; color: var(--episam-muted); font-size: .75rem; }
.site-footer a { text-decoration: none; }

@media (max-width: 760px) {
  body { font-size: 17px; word-break: normal; }
  .site-header__inner { padding: 1.6rem 1.25rem 1.25rem; }
  .site-header__row { margin-top: 1.2rem; }
  .primary-nav ul { gap: 1.15rem; }
  .home-main { padding: 0 1.25rem; }
  .home-hero { margin: 4.2rem auto 5.5rem; }
  .home-hero__title { font-size: clamp(2.55rem, 13vw, 4.25rem); }
  .issue-card { grid-template-columns: 1fr; gap: .7rem; }
  .home-about { grid-template-columns: 1fr; gap: 2rem; }
  .singular-main { padding: 0 1.25rem; }
  .article-header { margin-top: 4rem; text-align: left; }
  .article-title { font-size: clamp(2.45rem, 12vw, 4rem); }
  .article-feature { margin-bottom: 2.6rem; }
  .entry-content .about-me-float-photo { float: none; width: min(72vw, 300px); max-width: 100%; margin: 1.5rem auto 2rem; }
  .share-links { grid-template-columns: repeat(2, 1fr); }
  .share-more { grid-column: 1 / -1; }
  .site-footer__inner { flex-direction: column; padding: 1.8rem 1.25rem; }
}
