:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --border: #e5e7eb;
  --text: #111827;
  --subtext: #6b7280;
  --primary: #f43252;
  --accent: #2563eb;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 1.5rem 2rem;
  background: var(--surface);
  border-radius: 18px 18px 8px 8px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.branding .logo {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--primary);
}

.branding p {
  margin: 0.2rem 0 0;
  color: var(--subtext);
}

.lang-switcher {
  position: relative;
  font-size: 0.95rem;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.lang-toggle .flag {
  font-size: 1.1rem;
}

.lang-toggle .chevron {
  font-size: 0.8rem;
  color: var(--subtext);
}

.lang-menu {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
  min-width: 180px;
  display: none;
  z-index: 20;
}

.lang-menu[aria-expanded='true'] {
  display: block;
}

.lang-menu li {
  list-style: none;
}

.lang-menu li a {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
}

.lang-menu li a:hover {
  background: rgba(244, 50, 82, 0.08);
}

.lang-menu li.active a {
  font-weight: 700;
  color: var(--primary);
}

.lang-menu li.active a::after {
  content: '•';
  margin-left: auto;
  color: var(--primary);
}

.primary-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.4rem 0.4rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.nav-tab {
  border: none;
  background: none;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--subtext);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-tab.active {
  background: rgba(244, 50, 82, 0.08);
  color: var(--primary);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.content-section {
  display: none;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.content-section.active {
  display: block;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.section-headline {
  margin: 0.2rem 0 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.ticker {
  margin: 0;
  color: var(--subtext);
  font-size: 0.95rem;
}

.ticker a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.ticker a:hover {
  text-decoration: underline;
}

.publisher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.publisher-hero {
  margin-bottom: 1.5rem;
}

.publisher-hero .ticker {
  margin-top: 0.75rem;
}

.publisher-card {
  border: 1px solid var(--border);
  padding: 0.9rem;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  text-decoration: none;
  color: inherit;
  transition: border 0.2s ease, transform 0.2s ease;
}

.publisher-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.publisher-logo {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: transparent;
  overflow: hidden;
  padding: 0.35rem;
}

.publisher-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.publisher-logo.placeholder span {
  text-transform: uppercase;
}

.publisher-name {
  font-weight: 600;
  margin: 0;
}

.publisher-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--subtext);
}

.section-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pager {
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.pager:disabled {
  opacity: 0.4;
  cursor: default;
}

.news-meta {
  color: var(--subtext);
  font-size: 0.8rem;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.article-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-media img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.article-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
}

.article-body h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.article-summary {
  margin: 0;
  color: var(--subtext);
  line-height: 1.5;
  flex-grow: 1;
}

.site-footer {
  text-align: center;
  color: var(--subtext);
  padding-bottom: 2rem;
}

.policy-footer {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
}

.policy-logo {
  display: none;
}

.brand-logo {
  width: 120px;
  height: auto;
  display: block;
}

.policy-description {
  margin: 0.6rem 0 0;
  color: var(--subtext);
  font-size: 0.95rem;
}

.policy-links {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.policy-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  background: #fff;
  transition: border 0.2s ease, transform 0.2s ease;
}

.policy-links a:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.copyright {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header,
  .primary-nav,
  main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-header,
  .content-section {
    padding: 1.25rem;
  }

  .primary-nav {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
  }

  .publisher-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .policy-footer {
    padding: 1.25rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .article-media img {
    height: 180px;
  }
}
