/*
Theme Name:  OONews — 지역 밀착 인터넷 신문
Theme URI:   https://oonews.kr
Author:      ○○시 뉴스
Description: 시/군 단위 지역 인터넷 신문 전용 워드프레스 테마. 생활·문화·행사 콘텐츠 특화, 반응형, PWA 지원.
Version:     1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License:     Proprietary
Text Domain: oonews
Tags:        news, local, responsive, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ════════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════════ */
:root {
  --green-deep:   #1B3A2D;
  --green-mid:    #2D5F3F;
  --green-light:  #4A8C5C;
  --green-pale:   #EEF6F1;
  --green-ghost:  #F4F9F6;
  --red:          #C0392B;
  --red-pale:     #FDF0EF;
  --gold:         #B07D2E;
  --gold-pale:    #FDF6EA;
  --cream:        #F8F5EF;
  --paper:        #FDFCF9;
  --ink:          #1A1712;
  --ink-mid:      #3D3830;
  --ink-muted:    #7A7264;
  --rule:         #E2DDD6;
  --white:        #FFFFFF;

  --serif:  'Noto Serif KR', Georgia, serif;
  --sans:   'Noto Sans KR', -apple-system, sans-serif;
  --mono:   'DM Mono', 'Courier New', monospace;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.10), 0 16px 48px rgba(0,0,0,.08);

  --ease-out:    cubic-bezier(.16,1,.3,1);
  --ease-in-out: cubic-bezier(.83,0,.17,1);

  --header-h: 64px;
  --ticker-h: 36px;
  --content-max: 1280px;
  --article-max: 720px;
}

/* ════════════════════════════════════════════
   RESET
════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

/* ════════════════════════════════════════════
   WORDPRESS CORE CLASSES
════════════════════════════════════════════ */
.alignnone  { margin: 1em 0; }
.aligncenter { display: block; margin: 1.5em auto; }
.alignleft  { float: left; margin: .5em 1.5em 1em 0; }
.alignright { float: right; margin: .5em 0 1em 1.5em; }
.alignwide  { width: 100%; margin-left: auto; margin-right: auto; }
.alignfull  { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-muted); margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}
.wp-caption-text::before { content: '▲'; font-size: 9px; opacity:.5; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.sticky {}
.gallery-caption {}
.bypostauthor {}

/* ════════════════════════════════════════════
   LAYOUT UTILITIES
════════════════════════════════════════════ */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.flex    { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ════════════════════════════════════════════
   TYPOGRAPHY
════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
h1 { font-size: clamp(24px, 3.5vw, 36px); }
h2 { font-size: clamp(20px, 2.5vw, 26px); }
h3 { font-size: clamp(17px, 2vw, 20px); }
h4 { font-size: 17px; }
h5 { font-size: 15px; }
h6 { font-size: 13px; }

p { margin-bottom: 1em; color: var(--ink-mid); }

/* ════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 4px;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  transition: all .15s; cursor: pointer;
}
.btn-primary { background: var(--green-deep); color: var(--white); }
.btn-primary:hover { background: var(--green-mid); transform: translateY(-1px); }
.btn-secondary { background: var(--paper); color: var(--ink-mid); border-color: var(--rule); }
.btn-secondary:hover { border-color: var(--green-mid); color: var(--green-mid); }
.btn-ghost { background: none; color: var(--green-mid); }
.btn-ghost:hover { background: var(--green-ghost); }

/* ════════════════════════════════════════════
   CARD BASE
════════════════════════════════════════════ */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  overflow: hidden;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-thumb {
  aspect-ratio: 16/9; overflow: hidden;
  position: relative; flex-shrink: 0;
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s var(--ease-out);
}
.card:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat {
  position: absolute; top: 10px; left: 10px;
  background: var(--green-deep); color: var(--white);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .08em; padding: 3px 8px;
}
.card-title {
  font-family: var(--serif); font-size: 15px;
  font-weight: 600; line-height: 1.45;
  color: var(--ink); transition: color .15s;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card:hover .card-title { color: var(--green-mid); }
.card-meta {
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-muted); display: flex;
  align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--rule);
  margin-top: auto;
}

/* ════════════════════════════════════════════
   SECTION HEADER
════════════════════════════════════════════ */
.section-hd {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.section-hd-left { display: flex; align-items: center; gap: 10px; }
.section-hd-dot {
  width: 10px; height: 10px;
  border-radius: 50%; background: var(--green-mid);
}
.section-hd-title {
  font-family: var(--serif); font-size: 18px; font-weight: 700;
}
.section-hd-more {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .08em; color: var(--ink-muted);
  display: flex; align-items: center; gap: 4px;
  transition: color .15s, gap .15s;
}
.section-hd-more:hover { color: var(--green-mid); gap: 8px; }

/* ════════════════════════════════════════════
   WIDGET BASE
════════════════════════════════════════════ */
.widget { background: var(--paper); border: 1px solid var(--rule); overflow: hidden; margin-bottom: 24px; }
.widget-title {
  padding: 12px 16px;
  background: var(--green-deep); color: var(--white);
  font-family: var(--serif); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.widget ul li {
  display: flex; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--rule);
  cursor: pointer; transition: background .15s;
}
.widget ul li:hover { background: var(--green-ghost); }
.widget ul li:last-child { border-bottom: none; }

/* ════════════════════════════════════════════
   COMMENT STYLES
════════════════════════════════════════════ */
.comment-list { margin: 0; padding: 0; list-style: none; }
.comment { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.comment:last-child { border-bottom: none; }
.comment .comment-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.comment .comment-author img { width: 40px; height: 40px; border-radius: 50%; }
.comment .comment-metadata { font-family: var(--mono); font-size: 11px; color: var(--ink-muted); }
.comment-content { font-size: 14.5px; color: var(--ink-mid); line-height: 1.75; }
.comment-reply-link {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-muted); margin-top: 8px;
  display: inline-block; transition: color .15s;
}
.comment-reply-link:hover { color: var(--green-mid); }
.children { margin-left: 40px; border-left: 3px solid var(--green-pale); padding-left: 16px; }

/* ════════════════════════════════════════════
   PAGINATION
════════════════════════════════════════════ */
.pagination, .nav-links {
  display: flex; align-items: center;
  justify-content: center; gap: 4px; margin: 40px 0;
}
.page-numbers, .nav-links a, .nav-links span {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: 4px;
  font-family: var(--mono); font-size: 13px;
  color: var(--ink-muted); transition: all .15s;
}
.page-numbers:hover, .nav-links a:hover { border-color: var(--green-mid); color: var(--green-mid); }
.page-numbers.current { background: var(--green-deep); color: var(--white); border-color: var(--green-deep); }
.page-numbers.dots { border: none; }
.nav-previous, .nav-next { min-width: 80px; padding: 0 12px; width: auto; }

/* ════════════════════════════════════════════
   FORMS (댓글, 검색, 구독)
════════════════════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--rule); border-radius: 4px;
  font-family: var(--sans); font-size: 14px;
  color: var(--ink); background: var(--cream);
  outline: none; transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--green-mid); }
textarea { min-height: 100px; resize: vertical; }
label { font-size: 13px; color: var(--ink-muted); margin-bottom: 4px; display: block; }

/* ════════════════════════════════════════════
   TAG CLOUD
════════════════════════════════════════════ */
.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tagcloud a {
  padding: 4px 12px; border: 1px solid var(--rule);
  border-radius: 100px; font-size: 13px !important;
  color: var(--ink-muted); transition: all .15s;
}
.tagcloud a:hover { border-color: var(--green-mid); color: var(--green-mid); background: var(--green-ghost); }

/* ════════════════════════════════════════════
   POST FORMATS
════════════════════════════════════════════ */
.format-quote blockquote {
  border-left: 4px solid var(--gold);
  padding: 16px 24px;
  background: var(--gold-pale);
  margin: 1.5em 0;
}
.format-quote blockquote p { font-style: italic; font-size: 17px; color: var(--ink-mid); }

/* ════════════════════════════════════════════
   ACCESSIBILITY
════════════════════════════════════════════ */
:focus-visible { outline: 2px solid var(--green-mid); outline-offset: 2px; }
.skip-link {
  position: absolute; top: -999px; left: -999px;
  background: var(--green-deep); color: var(--white);
  padding: 8px 16px; z-index: 9999;
  font-size: 14px; font-weight: 600;
}
.skip-link:focus { top: 8px; left: 8px; }

/* ════════════════════════════════════════════
   PRINT
════════════════════════════════════════════ */
@media print {
  .site-header, .site-footer, .sidebar, .ticker-bar,
  .share-row, .comment-section, .related-section { display: none !important; }
  .article-body { font-size: 12pt; line-height: 1.6; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 10pt; }
}

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  h2 { font-size: 19px; }
}
