/*
Theme Name: Damhye
Theme URI: https://damhye.com
Author: Damhye Ha
Author URI: https://damhye.com
Description: Custom WordPress block theme for Damhye Ha Newsletter (아이의 시간표)
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: damhye
Requires at least: 6.4
*/

/* self-hosted fonts — AGENTS.md: "Google Fonts 직접 링크 금지", self-host. font-display: optional (swap 시 fallback→커스텀 폰트 metric 불일치로 텍스트 크기가 갑자기 튀는 현상 방지 — preload+immutable 캐시로 재방문자는 항상 즉시 로드됨) */
@font-face {
  font-family: 'Pretendard';
  src:
    local('Pretendard Regular'),
    local('Pretendard-Regular'),
    url('assets/fonts/Pretendard-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: optional;
}
@font-face {
  font-family: 'Pretendard';
  src:
    local('Pretendard SemiBold'),
    local('Pretendard-SemiBold'),
    url('assets/fonts/Pretendard-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: optional;
}
@font-face {
  font-family: 'Pretendard';
  src:
    local('Pretendard Bold'),
    local('Pretendard-Bold'),
    url('assets/fonts/Pretendard-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: optional;
}
@font-face {
  font-family: 'Gowun Batang';
  src: url('assets/fonts/GowunBatang-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: optional;
}
@font-face {
  font-family: 'Gowun Batang';
  src: url('assets/fonts/GowunBatang-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: optional;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src:
    local('IBM Plex Mono'),
    local('IBMPlexMono-Regular'),
    url('assets/fonts/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: optional;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src:
    local('IBM Plex Mono Medium'),
    local('IBMPlexMono-Medium'),
    url('assets/fonts/IBMPlexMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: optional;
}

:root {
  --paper: #f0efe8;
  --ink: #22241e;
  --ink-soft: #565a4e;
  --muted: #8b8d80;
  --line: #d4d2c5;
  --moss: #47593c;
  --ochre: #c0921f;
  --serif: 'Gowun Batang', Georgia, serif;
  --sans: 'Pretendard', -apple-system, 'Malgun Gothic', sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: var(--wp--style--global--wide-size);
  margin: 0 auto;
  padding: 0 var(--wp--preset--spacing--10);
}
button {
  font-family: inherit;
  cursor: pointer;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* lang tabs */
.langbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(6px);
}
.langbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
}
.sitemark {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0;
}
.langs {
  display: flex;
  gap: 2px;
}
.langs button {
  border: 1px solid transparent;
  background: none;
  padding: 6px 13px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: 0.16s;
}
.langs button:hover {
  color: var(--ink);
}
.langs button[aria-current='true'] {
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 500;
}

/* hero */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0 27px,
      rgba(34, 36, 30, 0.045) 27px 28px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 27px,
      rgba(34, 36, 30, 0.045) 27px 28px
    );
  -webkit-mask-image: radial-gradient(
    ellipse 70% 80% at 50% 30%,
    #000,
    transparent 78%
  );
  mask-image: radial-gradient(
    ellipse 70% 80% at 50% 30%,
    #000,
    transparent 78%
  );
}
.hero .wrap {
  position: relative;
}
.masthead {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 16px 0 0;
}
.masthead .dot {
  color: var(--ochre);
}
.tagline {
  font-family: var(--serif);
  color: var(--ink-soft);
  line-height: 1.85;
}
.byline {
  margin-top: 26px;
  font-size: 14px;
  color: var(--muted);
}
.byline b {
  color: var(--ink);
  font-weight: 600;
}
.cred-strip {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* archive */
.arc-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}
.arc-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 46px;
}
.arc-t {
  font-family: var(--serif);
  flex: 1;
  line-height: 1.5;
  transition: 0.18s;
}
.arc-more {
  padding: 19px 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.arc-empty {
  padding: 32px 0;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  line-height: 1.9;
}
.arc-empty b {
  color: var(--ink);
  font-weight: 700;
}

/* Query Loop archive markup — 각 게시글 항목을 flex row(날짜 + 제목)로 정렬 (arc-btn 대체) */
.arc-list .wp-block-post {
  padding: 19px 0;
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.arc-list .wp-block-post-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 46px;
}
.arc-list .wp-block-post-title {
  font-family: var(--serif);
  flex: 1;
  line-height: 1.5;
  margin: 0;
  transition: 0.18s;
}
.arc-list .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}
.arc-list .wp-block-post:hover .wp-block-post-title a {
  color: var(--moss);
}

/* resub */
.resub {
  border-top: 1px solid var(--line);
}
.resub-line {
  font-family: var(--serif);
  color: var(--ink-soft);
  line-height: 1.8;
}
.ask-quiet {
  display: inline-block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  transition: 0.18s;
}
.ask-quiet:hover {
  color: var(--moss);
  border-color: var(--moss);
}
.ask-ok {
  display: none;
  font-size: 14px;
  color: var(--moss);
  font-weight: 600;
  margin-top: 14px;
}

/* split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--wp--style--spacing--block-gap, var(--wp--preset--spacing--20));
  border-top: 1px solid var(--ink);
}
.split h3 {
  font-family: var(--serif);
  font-weight: 700;
  margin: 10px 0 18px;
}
.split p {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.9;
}
.cred {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
}
.cred li {
  font-size: 14px;
  color: var(--ink-soft);
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
}
.cred span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  flex: 0 0 58px;
  padding-top: 3px;
}
.ask {
  display: inline-block;
  margin-top: 24px;
  padding: 13px 22px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: transparent;
  transition: 0.18s;
}
.ask:hover {
  background: var(--ink);
  color: var(--paper);
}
.topics {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}
.topics li {
  font-family: var(--serif);
  font-size: 16.5px;
  padding: 11px 0 11px 22px;
  position: relative;
  border-bottom: 1px dotted var(--line);
}
.topics li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--ochre);
}
.note {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.8;
}

@media (max-width: 760px) {
  .split {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* WordPress Core Alignment Styles */
.alignnone {
  margin: 5px 20px 20px 0;
}
.aligncenter,
div.aligncenter {
  display: block;
  margin: 5px auto 5px auto;
}
.alignright {
  float: right;
  margin: 5px 0 20px 20px;
}
.alignleft {
  float: left;
  margin: 5px 20px 20px 0;
}
.wp-caption {
  background: #fff;
  border: 1px solid #f0f0f0;
  max-width: 96%;
  padding: 5px 3px 10px;
  text-align: center;
}
.wp-caption img {
  border: 0 none;
  height: auto;
  margin: 0;
  max-width: 98%;
  padding: 0;
  width: auto;
}
.wp-caption p.wp-caption-text {
  font-size: 11px;
  line-height: 17px;
  margin: 0;
  padding: 0 4px;
}

/* Single post / page templates */
.entry {
  max-width: var(--wp--style--global--content-size);
  margin: 0 auto;
}
.entry-header {
  margin-bottom: 40px;
}
.entry-title {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.entry-content {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.entry-content p {
  margin: 0 0 20px;
}
.entry-content h2,
.entry-content h3 {
  font-family: var(--serif);
  color: var(--ink);
  margin: 40px 0 16px;
}
.entry-content a {
  color: var(--moss);
}
.entry-content img {
  max-width: 100%;
  height: auto;
}
.entry-content blockquote {
  margin: 32px 0;
  padding-left: 20px;
  border-left: 2px solid var(--ochre);
  font-family: var(--serif);
  color: var(--ink);
}
