:root {
  --accent: #d0201e;
  --text: #1a1a1a;
  --meta: #767676;
  --border: #e5e5e5;
  --bg: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", Dotum, 돋움, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

/* ---------- Header ---------- */
.site-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.hamburger {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
}

.cat-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.cat-nav a {
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  color: #2e2a26;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  padding-right: 14px;
}

.cat-nav a:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--border);
}

.brand-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.logo {
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
}

.brand-date {
  justify-self: start;
  color: var(--meta);
  font-size: 13px;
  white-space: nowrap;
}

.brand-write-link {
  justify-self: end;
  color: var(--accent);
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
}

.ad-slot {
  height: 90px;
  background: #f4f4f4;
  border: 1px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #aaa;
  font-size: 12px;
}
.ad-slot img { width: 100%; height: 100%; object-fit: cover; }
.ad-header-right { justify-self: end; }
.ad-header-left { justify-self: start; }
.ad-slot, .ad-header-left, .ad-header-right { width: 100%; max-width: 300px; }

.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 3px solid var(--accent);
}

.quick-links {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--accent);
  font-weight: bold;
}

.search-box {
  display: flex;
}
.search-box input {
  border: 1px solid var(--border);
  padding: 6px 10px;
  width: 220px;
  font-size: 13px;
}
.search-box button {
  border: 1px solid var(--text);
  background: var(--text);
  color: #fff;
  padding: 6px 12px;
  cursor: pointer;
}

/* ---------- Main layout ---------- */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 32px;
}

.loading { color: var(--meta); font-size: 14px; }

/* ---------- Section blocks (하이라이트/카테고리) ---------- */
.section-block {
  margin-bottom: 32px;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--text);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: 20px;
  margin: 0;
}
.more-link {
  font-size: 13px;
  color: var(--meta);
  white-space: nowrap;
}

/* 카테고리 섹션 리스트 */
.category-list {
  display: flex;
  flex-direction: column;
}
.category-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.category-row img {
  width: 100%;
  height: 75px;
  object-fit: cover;
  background: #eee;
}
.category-row h3 {
  font-size: 16px;
  font-weight: 800;
  color: #191919;
  margin: 0 0 4px;
  line-height: 1.4;
}
.category-row.is-first h3 {
  font-size: 20px;
}
.category-row-summary {
  font-size: 14px;
  color: var(--meta);
  line-height: 1.5;
  margin: 0 0 6px;
}
.category-row-meta {
  font-size: 12px;
  color: #999;
}

/* 섹션 사이 인피드 광고 */
.infeed-ad {
  margin: 0 0 32px;
  background: #f4f4f4;
  border: 1px dashed #ccc;
  overflow: hidden;
}
.infeed-ad:empty { display: none; margin: 0; border: none; }
.infeed-ad img { width: 100%; height: auto; display: block; }

/* ---------- Sidebar (군민/공지사항/랭킹) ---------- */
.side-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 16px;
  align-self: start;
}

.side-col .ad-slot.side-ad {
  height: auto;
  max-width: none;
  aspect-ratio: 300 / 250;
}
.side-col .ad-slot.side-ad img { height: auto; aspect-ratio: 300 / 250; object-fit: cover; }

.side-block h3 {
  font-size: 16px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 8px;
  margin: 0 0 8px;
}
.side-block .side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-block .side-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
}
.side-block .side-empty {
  font-size: 13px;
  color: var(--meta);
}

.photo-news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.photo-news-grid a {
  display: block;
  position: relative;
}
.photo-news-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #eee;
}
.photo-news-grid span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ad-grid .ad-cell {
  aspect-ratio: 1 / 1;
  background: #f4f4f4;
  border: 1px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #aaa;
  overflow: hidden;
}
.ad-grid .ad-cell img { width: 100%; height: 100%; object-fit: cover; }

.ranking-box h3 {
  font-size: 16px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 8px;
  margin: 0 0 8px;
}
.ranking-box ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}
.ranking-box li {
  counter-increment: rank;
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.ranking-box li::before {
  content: counter(rank);
  font-weight: 900;
  color: var(--accent);
  width: 16px;
}

/* Footer */
.site-footer {
  border-top: 1px solid #ddd;
  margin-top: 32px;
  padding: 32px 16px;
  background: #f2f2f2;
  color: #555;
  font-size: 13px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 40px;
}
.footer-logo-col {
  flex: 0 0 auto;
}
.footer-info-col {
  flex: 1 1 auto;
  min-width: 0;
}
.footer-logo {
  height: 30px;
}
.footer-info, .footer-note {
  margin: 0 0 10px;
  line-height: 2;
  font-size: 12px;
  color: #555;
}
.footer-tip {
  font-weight: 700;
  color: #333;
}
.footer-tip a { color: var(--accent); }
.footer-copyright {
  margin: 14px 0 0;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.8;
  color: #333;
}
.footer-sns {
  margin: 0 0 10px;
}
.footer-sns a {
  color: var(--accent);
  font-weight: bold;
  margin-right: 4px;
}

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; gap: 16px; }
}

/* ---------- Article detail ---------- */
.article-detail-cat {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  margin: 0 0 10px;
}
.article-detail-title {
  font-size: 28px;
  font-weight: 800;
  color: #191919;
  line-height: 1.4;
  margin: 0 0 12px;
}
.article-detail-subtitle {
  font-size: 16px;
  color: #444;
  font-weight: 600;
  margin: 0 0 12px;
}
.article-detail-meta {
  font-size: 13px;
  color: var(--meta);
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin: 0 0 16px;
}
.share-row {
  margin: 0 0 20px;
}
.share-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}
.share-btn:hover {
  background: #f4f4f4;
}
.article-detail-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  background: #eee;
  margin-bottom: 20px;
}
.article-detail-body {
  font-size: 16px;
  line-height: 1.9;
  color: #222;
}
.article-detail-body p {
  margin: 0 0 18px;
}
.tag-list {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-pill {
  background: #f2f2f2;
  color: #555;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
}
.article-detail-back {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .brand-row { grid-template-columns: 1fr; }
  .ad-slot { display: none; }
  .category-row { grid-template-columns: 80px 1fr; }
  .subnav { flex-wrap: wrap; row-gap: 10px; }
  .hamburger { order: 1; }
  .search-box { order: 2; margin-left: auto; }
  .cat-nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
}
