/*
Theme Name: Issue Today
Theme URI: https://issue-today.com
Description: 연애 리얼리티/연예 이슈 블로그용 매거진 테마. 매거진형 홈, 자극적 카드, 광고 슬롯, 인기글/관련글, Pretendard 한글 타이포 최적화. 독립 테마(부모테마 불필요).
Author: Ted
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: issue-today
*/

:root {
  --accent: #f0353b;
  --accent-dark: #c31d23;
  --ink: #17171b;
  --ink-soft: #4a4a52;
  --muted: #8a8a93;
  --line: #ececf0;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(20, 20, 30, 0.08);
  --shadow-hover: 0 14px 40px rgba(20, 20, 30, 0.16);
  --maxw: 1180px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}
.site-brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}
.site-brand .brand-dot { color: var(--accent); }
.custom-logo { max-height: 40px; width: auto; }

.primary-nav { margin-left: auto; }
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.primary-nav a {
  display: block;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  border-radius: 8px;
  color: var(--ink-soft);
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  color: var(--accent);
  background: var(--bg-soft);
}

.header-search {
  display: flex;
  align-items: center;
}
.header-search input[type="search"] {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  width: 160px;
  outline: none;
  font-family: var(--font);
}
.header-search input[type="search"]:focus {
  border-color: var(--accent);
  background: #fff;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  font-size: 26px;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Layout ---------- */
.site-main { padding: 32px 0 56px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
}
.layout.full { grid-template-columns: minmax(0, 1fr); }

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 20px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
}
.section-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-head .accent { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0) 100%);
  color: #fff;
}
.hero-overlay .cat-badge { align-self: flex-start; }
.hero-overlay h2 {
  margin: 12px 0 0;
  font-size: clamp(22px, 3.4vw, 36px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.035em;
  color: #fff;
}
.hero-overlay .post-meta { color: rgba(255,255,255,0.82); margin-top: 10px; }
.hero:hover img { transform: scale(1.03); }
.hero img { transition: transform .5s ease; }

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-soft);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-thumb img { transform: scale(1.06); }
.card-thumb .cat-badge { position: absolute; top: 12px; left: 12px; }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.03em;
}
.card-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { margin-top: auto; }

/* ---------- Category badge / meta ---------- */
.cat-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1;
}
.cat-badge:hover { color: #fff; background: var(--accent-dark); }
.post-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.post-meta .dot::before { content: "·"; margin: 0 2px; }

/* ---------- Pagination ---------- */
.pagination {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  color: var(--ink-soft);
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Single post ---------- */
.single-wrap { max-width: 760px; margin: 0 auto; }
.single-header { margin-bottom: 24px; }
.single-header .cat-badge { margin-bottom: 16px; }
.single-title {
  margin: 0 0 16px;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.035em;
}
.single-header .post-meta { font-size: 14px; }
.single-featured {
  margin: 0 0 32px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.entry-content {
  font-size: 18px;
  line-height: 1.9;
  color: #232329;
  letter-spacing: -0.01em;
}
.entry-content p { margin: 0 0 1.05em; }
.entry-content img {
  border-radius: var(--radius);
  margin: 8px auto 8px;
}
.entry-content h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 1.8em 0 0.6em;
  line-height: 1.35;
}
.entry-content h3 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.6em 0 0.5em;
}
.entry-content a { color: var(--accent-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--accent);
  color: var(--ink-soft);
  font-size: 1.02em;
}
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1.5em; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content figcaption { text-align: center; color: var(--muted); font-size: 14px; margin-top: 8px; }
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}
.entry-content th, .entry-content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.entry-content thead th, .entry-content tr:first-child th {
  background: var(--bg-soft);
  font-weight: 800;
  color: var(--ink);
}
.entry-content tbody tr:nth-child(even) { background: #fafafb; }

.entry-tags {
  margin: 36px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.entry-tags a {
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}
.entry-tags a:hover { background: var(--accent); color: #fff; }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 32px auto;
  text-align: center;
  min-height: 1px;
  overflow: hidden;
}
.ad-slot--in-article { margin: 40px auto; }

/* ---------- Related ---------- */
.related {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 32px; }
.widget { }
.widget-title {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget:not(.widget-popular) ul li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}
.widget:not(.widget-popular) ul li:last-child { border-bottom: 0; }

.popular-list { display: flex; flex-direction: column; gap: 14px; }
.popular-item { display: flex; gap: 12px; align-items: flex-start; }
.popular-rank {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  width: 22px;
  line-height: 1.4;
}
.popular-thumb {
  flex: 0 0 64px;
  width: 64px; height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-body { flex: 1; }
.popular-body .p-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.popular-body .post-meta { margin-top: 4px; font-size: 12px; }

/* ---------- Footer ---------- */
.site-footer {
  background: #16161a;
  color: #b8b8c0;
  padding: 40px 0;
  margin-top: 40px;
}
.footer-inner { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.footer-brand { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.03em; }
.footer-brand .brand-dot { color: var(--accent); }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: #b8b8c0; font-size: 14px; font-weight: 600; }
.footer-nav a:hover { color: #fff; }
.footer-copy { font-size: 13px; color: #6f6f78; }

/* ---------- Archive header ---------- */
.archive-hero {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 32px;
}
.archive-hero h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.archive-hero .archive-desc { margin: 8px 0 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- 404 / no results ---------- */
.no-results {
  text-align: center;
  padding: 80px 20px;
}
.no-results h1 { font-size: 48px; margin: 0 0 8px; letter-spacing: -0.04em; }
.no-results p { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { margin-top: 8px; }
}
@media (max-width: 720px) {
  .header-search { display: none; }
  .nav-toggle { display: block; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    box-shadow: var(--shadow);
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0 12px; }
  .primary-nav a { padding: 12px 10px; border-radius: 8px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .card-title { font-size: 15px; }
  .card-excerpt { display: none; }
  .card-body { padding: 12px 12px 14px; gap: 8px; }
  .entry-content { font-size: 17px; }
  .site-main { padding: 20px 0 40px; }
}
