/* ==========================================================================
   ie-news.co.kr - Common CSS
   Base styles, design tokens, layout, header, footer, cards, utilities
   ========================================================================== */


/* ==========================================================================
   1. CSS RESET / NORMALIZE
   ========================================================================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  line-height: 1.15;
}

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

fieldset {
  border: none;
}

/* Remove default appearance */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Remove spinner from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}


/* ==========================================================================
   2. DESIGN TOKENS (CSS Custom Properties)
   ========================================================================== */

:root {
  /* --- Brand Colors (뉴스엔디 코퍼레이트 네이비) --- */
  --color-primary: #0a2540;
  --color-primary-hover: #0f3257;
  --color-primary-light: #e9eef3;
  --color-accent: #1d4ed8;
  --color-secondary: #1d4ed8;
  --color-secondary-hover: #1739ab;

  /* --- Status Colors --- */
  --color-breaking: #d7263d;
  --color-breaking-bg: #fdecee;
  --color-live: #2e7d32;
  --color-live-bg: #e8f5e9;
  --color-success: #2e7d32;
  --color-warning: #f57c00;
  --color-error: #d7263d;
  --color-info: #1d4ed8;

  /* --- Section Colors (Guardian-inspired) --- */
  --color-politics: #8b1a1a;      /* 정치 */
  --color-economy: #1565c0;       /* 경제 */
  --color-society: #2e7d32;       /* 사회 */
  --color-culture: #6a1b9a;       /* 문화 */
  --color-international: #00695c; /* 국제 */
  --color-sports: #e65100;        /* 스포츠 */
  --color-tech: #0277bd;          /* 기술 */
  --color-opinion: #4a148c;       /* 오피니언 */

  /* --- Neutral Colors --- */
  --background: #f4f5f7;
  --background-secondary: #ffffff;
  --background-tertiary: #eaedf1;
  --background-dark: #0a2540;
  --background-footer: #0a2540;
  --foreground: #15191e;
  --foreground-secondary: #4a5360;
  --foreground-muted: #79828e;
  --border: #dee3e8;
  --border-light: #e8eaed;

  /* --- Typography --- */
  --font-sans: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Noto Serif KR', serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, 'Courier New', monospace;

  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-md: 1.0625rem;   /* 17px - article body */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.75rem;    /* 28px */
  --font-size-4xl: 2rem;       /* 32px */
  --font-size-5xl: 2.5rem;     /* 40px */

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.3;
  --line-height-snug: 1.4;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  --letter-spacing-tight: -0.02em;
  --letter-spacing-snug: -0.01em;
  --letter-spacing-normal: 0;

  /* --- Spacing (8px base system) --- */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* --- Border Radius --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Z-Index Scale --- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;
  --z-header: 1000;

  /* --- Layout --- */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1400px;
  --container-reading: 720px;

  /* --- Header Heights --- */
  --header-height-top: 36px;
  --header-height-middle: 64px;
  --header-height-nav: 48px;
}


/* ==========================================================================
   3. BASE STYLES
   ========================================================================== */

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Selection */
::selection {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* Focus ring */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
  outline-offset: 4px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-offset: 0;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Base link style */
a {
  transition: color var(--transition-fast);
}

/* Base image */
img {
  height: auto;
}


/* ==========================================================================
   4. LAYOUT CONTAINERS
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.header-container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.content-container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-narrow {
  max-width: var(--container-md);
  margin-left: auto;
  margin-right: auto;
}

.container-reading {
  max-width: var(--container-reading);
  margin-left: auto;
  margin-right: auto;
}

.container-wide {
  max-width: var(--container-2xl);
  margin-left: auto;
  margin-right: auto;
}


/* ==========================================================================
   5. SITE HEADER
   Sticky header with 3-tier structure: top-bar, middle-bar, nav-bar
   Compact mode on scroll with smooth transitions
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--background-secondary);
  transition: box-shadow var(--transition-base);
}

.site-header.header-scrolled {
  box-shadow: var(--shadow-lg);
}

/* --- Header Top Bar (navy utility strip) --- */
.header-top-bar {
  background: var(--color-primary);
  transition: max-height var(--transition-base) ease, opacity var(--transition-base) ease;
  overflow: hidden;
  max-height: var(--header-height-top);
  opacity: 1;
}

.header-scrolled .header-top-bar {
  max-height: 0;
  opacity: 0;
}

.header-top-bar .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height-top);
}

.header-date {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: #cfd8e3;
  letter-spacing: var(--letter-spacing-tight);
}

.header-top-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sns-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  color: #cfd8e3;
  font-size: 12px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.sns-icon:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.12);
}

/* --- Header Middle Bar (masthead: logo + search) --- */
.header-middle-bar {
  background: var(--background-secondary);
  border-bottom: 1px solid var(--border-light);
  transition: max-height var(--transition-base) ease, opacity var(--transition-base) ease;
  overflow: hidden;
  max-height: var(--header-height-middle);
  opacity: 1;
}

.header-scrolled .header-middle-bar {
  max-height: 0;
  opacity: 0;
  border-bottom: none;
}

.header-middle-bar .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  height: var(--header-height-middle);
}

.header-logo .logo-img {
  height: 40px;
  width: auto;
}

.header-search {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--background);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 9px 16px;
  transition: border-color var(--transition-fast);
}

.header-search:focus-within {
  border-color: var(--color-primary);
}

.header-search__icon {
  flex-shrink: 0;
  color: var(--foreground-muted);
}

.header-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--foreground);
}

.header-search__submit {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.kakao-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  background: #FEE500;
  color: #3C1E1E;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.kakao-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.kakao-link img {
  width: 22px;
  height: 22px;
}

/* --- Header Navigation Bar --- */
.header-nav-bar {
  background: var(--background-secondary);
  border-bottom: 2px solid var(--color-primary);
}

.nav-scroll-wrapper {
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  cursor: grab;
}

.nav-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

.nav-scroll-wrapper.nav-grabbing {
  cursor: grabbing;
}

.nav-sections {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}

.nav-section-item {
  flex-shrink: 0;
}

.nav-section-link {
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  height: var(--header-height-nav);
  font-size: 15.5px;
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--foreground);
  position: relative;
  transition: color var(--transition-fast);
}

.nav-section-link:hover,
.nav-section-link--active {
  color: var(--color-primary);
}

/* Underline animation: left-to-right expand */
.nav-section-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  width: 70%;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--color-primary);
  transition: transform var(--transition-base);
}

.nav-section-link:hover::after,
.nav-section-link--active::after {
  transform: translateX(-50%) scaleX(1);
}

/* --- Breaking Ticker --- */
.breaking-ticker {
  background: var(--background-secondary);
  border-bottom: 1px solid var(--border-light);
}

.breaking-ticker .header-container {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  overflow: hidden;
}

.breaking-ticker__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-breaking);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 5px;
}

.breaking-ticker__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
}

.breaking-ticker__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: var(--letter-spacing-tight);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.breaking-ticker__title:hover {
  color: var(--color-primary);
}


/* ==========================================================================
   6. SECTION HEADER (shared across pages)
   ========================================================================== */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--border);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-header-accent {
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: var(--color-primary);
}

/* Section header accent colors by data-section */
.section-header-accent[data-section="S1"] { background: var(--color-politics); }
.section-header-accent[data-section="S2"] { background: var(--color-economy); }
.section-header-accent[data-section="S3"] { background: var(--color-society); }
.section-header-accent[data-section="S4"] { background: var(--color-culture); }
.section-header-accent[data-section="S5"] { background: var(--color-international); }
.section-header-accent[data-section="S6"] { background: var(--color-sports); }
.section-header-accent[data-section="S7"] { background: var(--color-tech); }
.section-header-accent[data-section="S8"] { background: var(--color-opinion); }
.section-header-accent.accent-breaking { background: var(--color-breaking); }

.section-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--foreground);
  letter-spacing: var(--letter-spacing-tight);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title i {
  font-size: var(--font-size-base);
  color: var(--color-breaking);
}

.section-more-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.section-more-link:hover {
  gap: var(--space-2);
}

.section-more-link i {
  font-size: 11px;
  transition: transform var(--transition-fast);
}

.section-more-link:hover i {
  transform: translateX(2px);
}

/* Section more link colors by data-section */
.section-more-link[data-section="S1"] { color: var(--color-politics); }
.section-more-link[data-section="S2"] { color: var(--color-economy); }
.section-more-link[data-section="S3"] { color: var(--color-society); }
.section-more-link[data-section="S4"] { color: var(--color-culture); }
.section-more-link[data-section="S5"] { color: var(--color-international); }
.section-more-link[data-section="S6"] { color: var(--color-sports); }
.section-more-link[data-section="S7"] { color: var(--color-tech); }
.section-more-link[data-section="S8"] { color: var(--color-opinion); }


/* ==========================================================================
   7. ARTICLE CARD (shared base style)
   ========================================================================== */

.article-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--background);
  border: 1px solid var(--border-light);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.article-card-link {
  display: block;
  height: 100%;
}

.article-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--background-secondary);
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article-card:hover .article-card-image img {
  transform: scale(1.03);
}

.article-card-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  color: #fff;
  background: var(--color-primary);
  letter-spacing: var(--letter-spacing-tight);
}

/* Article badge colors by data-section */
.article-card-badge[data-section="S1"] { background: var(--color-politics); }
.article-card-badge[data-section="S2"] { background: var(--color-economy); }
.article-card-badge[data-section="S3"] { background: var(--color-society); }
.article-card-badge[data-section="S4"] { background: var(--color-culture); }
.article-card-badge[data-section="S5"] { background: var(--color-international); }
.article-card-badge[data-section="S6"] { background: var(--color-sports); }
.article-card-badge[data-section="S7"] { background: var(--color-tech); }
.article-card-badge[data-section="S8"] { background: var(--color-opinion); }

.article-card-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.article-card-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--foreground);
  line-height: var(--line-height-snug);
  letter-spacing: var(--letter-spacing-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-2);
  transition: color var(--transition-fast);
}

.article-card:hover .article-card-title {
  color: var(--color-primary);
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--foreground-muted);
}

.article-card-author {
  font-weight: var(--font-weight-medium);
}

.article-card-date::before {
  content: '\00B7';
  margin-right: var(--space-2);
  color: var(--border);
}


/* ==========================================================================
   8. SITE FOOTER
   Dark footer with 3-column grid
   ========================================================================== */

.site-footer {
  margin-top: var(--space-10);
}

.footer-top {
  background: var(--background-dark);
  padding: var(--space-12) 0 var(--space-10);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--space-10);
}

.footer-col--brand {
  padding-right: var(--space-5);
}

.footer-logo-img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: var(--space-3);
}

.footer-description {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.6);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-5);
}

.footer-sns {
  display: flex;
  gap: var(--space-2);
}

.footer-sns-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              transform var(--transition-fast);
}

.footer-sns-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}

.footer-col-title {
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #fff;
}

.footer-info-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-info-list li {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}

/* Footer Bottom */
.footer-bottom {
  background: var(--background-footer);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-6) 0;
}

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  position: relative;
}

.footer-address {
  font-style: normal;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  line-height: var(--line-height-relaxed);
}

.footer-divider {
  margin: 0 var(--space-2);
  color: rgba(255, 255, 255, 0.2);
}

.footer-copyright-row {
  text-align: center;
}

.footer-copyright {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: var(--space-1);
}

.footer-copyright-mark {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
  font-weight: var(--font-weight-semibold);
}

.back-to-top-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-fast),
              color var(--transition-fast);
}

.back-to-top-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.back-to-top-btn i {
  font-size: 11px;
  transition: transform var(--transition-fast);
}

.back-to-top-btn:hover i {
  transform: translateY(-2px);
}


/* ==========================================================================
   9. TYPOGRAPHY - PROSE (Article Body)
   ========================================================================== */

.prose {
  max-width: 65ch;
  color: var(--foreground);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.prose h2 {
  margin-top: 2.5em;
  margin-bottom: 1em;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
  color: var(--foreground);
  letter-spacing: var(--letter-spacing-tight);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-size: 1.375rem;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
  color: var(--foreground);
  letter-spacing: var(--letter-spacing-snug);
}

.prose h4 {
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  color: var(--foreground);
}

.prose p {
  margin-bottom: 1.5em;
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: var(--foreground);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.prose blockquote {
  margin: 2em 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--color-primary);
  background-color: var(--background-tertiary);
  border-radius: var(--radius-md);
  font-style: italic;
  color: var(--foreground-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
}

.prose blockquote p {
  margin-bottom: 0;
}

.prose img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 2.5em 0;
  box-shadow: var(--shadow-md);
}

.prose figure {
  margin: 2.5em 0;
}

.prose figcaption {
  margin-top: 0.75em;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--foreground-muted);
  text-align: center;
  font-style: italic;
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--transition-fast);
}

.prose a:hover {
  color: var(--color-primary-hover);
  text-decoration-thickness: 2px;
}

.prose ul,
.prose ol {
  margin: 1.5em 0;
  padding-left: 1.75em;
  line-height: var(--line-height-relaxed);
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 0.5em;
  padding-left: 0.375em;
}

.prose li::marker {
  color: var(--color-primary);
}

.prose hr {
  margin: 3em 0;
  border: none;
  border-top: 1px solid var(--border);
}

.prose code {
  padding: 0.2em 0.4em;
  background-color: var(--background-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--color-secondary);
}

.prose pre {
  margin: 2em 0;
  padding: var(--space-6);
  background-color: var(--background-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--line-height-normal);
}

.prose pre code {
  padding: 0;
  background-color: transparent;
  border: none;
  font-size: var(--font-size-sm);
  color: var(--foreground);
}

.prose table {
  width: 100%;
  margin: 2em 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: var(--line-height-normal);
}

.prose thead {
  background-color: var(--background-tertiary);
  border-bottom: 2px solid var(--border);
}

.prose th {
  padding: 0.75rem 1rem;
  font-weight: var(--font-weight-semibold);
  text-align: left;
  color: var(--foreground);
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.prose tbody tr:hover {
  background-color: var(--background-tertiary);
}


/* ==========================================================================
   10. KEYFRAME ANIMATIONS
   ========================================================================== */

/* Skeleton / Shimmer loading */
@keyframes shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

/* Pulse (Breaking news) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Slide in from top */
@keyframes slideInDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Slide in from right */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Slide out to right */
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Fade in up */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Fade out down */
@keyframes fadeOutDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

/* Card fade in up */
@keyframes cardFadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Spin (loading spinner) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Reveal animation for intersection observer */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   11. SKELETON / LOADING
   ========================================================================== */

.skeleton {
  background-color: var(--background-secondary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer {
  animation: shimmer 1.2s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    var(--background-secondary) 0px,
    var(--background-tertiary) 40px,
    var(--background-secondary) 80px
  );
  background-size: 800px 100%;
}

.skeleton-text {
  height: 1em;
  border-radius: var(--radius-sm);
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  border-radius: var(--radius-sm);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
}

.skeleton-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}


/* ==========================================================================
   11B. INFO / POLICY PAGES (약관, 정책 등 회사 정보 페이지)
   ========================================================================== */

.info-page {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--space-10, 2.5rem) var(--space-5, 1.25rem) var(--space-16, 4rem);
}

.info-breadcrumb {
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--foreground-muted);
  margin-bottom: var(--space-5, 1.25rem);
}

.info-breadcrumb a {
  color: var(--foreground-secondary);
  font-weight: var(--font-weight-semibold, 600);
}

.info-breadcrumb a:hover {
  color: var(--color-primary);
}

.info-title {
  margin: 0;
  font-size: var(--font-size-4xl, 2rem);
  font-weight: var(--font-weight-extrabold, 800);
  letter-spacing: var(--letter-spacing-tight, -0.02em);
  color: var(--color-primary);
}

.info-divider {
  height: 2px;
  background: var(--color-primary);
  margin: var(--space-6, 1.5rem) 0 var(--space-6, 1.5rem);
}

/* Policy pill tabs (shared nav across the 5 company pages) */
.policy-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--space-8, 2rem);
}

.policy-tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: var(--font-weight-semibold, 600);
  background: var(--background-secondary);
  border: 1px solid var(--border-light);
  color: var(--foreground-secondary);
  transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.policy-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.policy-tab--active,
.policy-tab--active:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: var(--font-weight-bold, 700);
}


/* ==========================================================================
   12. ANIMATION UTILITY CLASSES
   ========================================================================== */

/* Breaking news */
.breaking-news-banner {
  animation: slideInDown var(--transition-slow) ease-out;
}

.breaking-news-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Toast notifications */
.toast-enter {
  animation: slideInRight var(--transition-base) ease-out;
}

.toast-exit {
  animation: slideOutRight var(--transition-base) ease-in;
}

/* Back to top */
.back-to-top-enter {
  animation: fadeInUp var(--transition-base) ease-out;
}

.back-to-top-exit {
  animation: fadeOutDown var(--transition-base) ease-in;
}

/* Card stagger animation */
.card-fade-in {
  animation: cardFadeInUp 0.4s ease-out both;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* Intersection observer reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.revealed {
  animation: revealUp 0.5s ease-out forwards;
}

/* Reading progress bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width var(--transition-fast);
  z-index: var(--z-fixed);
  box-shadow: 0 0 10px rgba(26, 115, 232, 0.5);
}


/* ==========================================================================
   13. UTILITY CLASSES
   ========================================================================== */

/* --- Line Clamping --- */

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-5 {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Truncate (single line) --- */

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-multiline {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Scrollbar --- */

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-custom {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--background-secondary);
}

.scrollbar-custom::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scrollbar-custom::-webkit-scrollbar-track {
  background: var(--background-secondary);
  border-radius: var(--radius-full);
}

.scrollbar-custom::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
  background: var(--foreground-muted);
}

/* --- Korean Typography Optimization --- */

.ko-optimize {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: var(--line-height-relaxed);
}

.ko-heading {
  line-height: var(--line-height-snug);
  letter-spacing: var(--letter-spacing-tight);
}

/* --- Text Wrapping --- */

.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

/* --- Gradient Text --- */

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Glass Morphism --- */

.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Card Hover --- */

.card-hover {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- Aspect Ratios --- */

.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-portrait {
  aspect-ratio: 3 / 4;
}

.aspect-wide {
  aspect-ratio: 21 / 9;
}

/* --- Section Color Indicators --- */

.section-bar-politics    { border-left: 4px solid var(--color-politics); }
.section-bar-economy     { border-left: 4px solid var(--color-economy); }
.section-bar-society     { border-left: 4px solid var(--color-society); }
.section-bar-culture     { border-left: 4px solid var(--color-culture); }
.section-bar-international { border-left: 4px solid var(--color-international); }
.section-bar-sports      { border-left: 4px solid var(--color-sports); }
.section-bar-tech        { border-left: 4px solid var(--color-tech); }
.section-bar-opinion     { border-left: 4px solid var(--color-opinion); }

.section-badge-politics      { background-color: var(--color-politics); color: #fff; }
.section-badge-economy       { background-color: var(--color-economy); color: #fff; }
.section-badge-society       { background-color: var(--color-society); color: #fff; }
.section-badge-culture       { background-color: var(--color-culture); color: #fff; }
.section-badge-international { background-color: var(--color-international); color: #fff; }
.section-badge-sports        { background-color: var(--color-sports); color: #fff; }
.section-badge-tech          { background-color: var(--color-tech); color: #fff; }
.section-badge-opinion       { background-color: var(--color-opinion); color: #fff; }

/* --- Visually Hidden (Screen Reader Only) --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- No Print --- */

.no-print {
  /* Used in @media print to hide elements */
}


/* ==========================================================================
   14. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Mobile: default styles (< 640px) */

@media (max-width: 639px) {
  :root {
    --header-height-nav: 44px;
  }

  .header-container,
  .content-container {
    padding: 0 var(--space-4);
  }

  /* Header compact */
  .kakao-text {
    display: none;
  }

  .kakao-link {
    padding: 6px;
    border-radius: var(--radius-full);
  }

  .header-logo .logo-img {
    height: 36px;
  }

  .nav-section-link {
    padding: 0 var(--space-3);
    font-size: 14px;
  }

  .header-search {
    min-width: 0;
    max-width: none;
    padding: 7px 12px;
  }

  .header-search__submit {
    display: none;
  }

  .breaking-ticker__badge {
    font-size: 11px;
    padding: 4px 9px;
  }

  .breaking-ticker__title {
    font-size: 13px;
  }

  .section-title {
    font-size: 17px;
  }

  /* Footer mobile */
  .footer-top {
    padding: var(--space-8) 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-col--brand {
    padding-right: 0;
  }

  .footer-address span {
    display: block;
  }

  .footer-divider {
    display: none;
  }

  .back-to-top-btn {
    position: static;
    transform: none;
    margin-top: var(--space-2);
  }
}

/* Tablet: >= 640px */
@media (min-width: 640px) {
  .container,
  .header-container,
  .content-container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* Tablet: 640-1023px */
@media (min-width: 640px) and (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-col--brand {
    grid-column: 1 / -1;
  }
}

/* Tablet landscape: >= 768px */
@media (min-width: 768px) {
  .container,
  .header-container,
  .content-container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }

  .prose h2 {
    font-size: var(--font-size-3xl);
  }

  .prose p {
    font-size: var(--font-size-md);
  }
}

/* Desktop: >= 1024px */
@media (min-width: 1024px) {
  .container,
  .header-container,
  .content-container {
    padding-left: var(--space-10);
    padding-right: var(--space-10);
  }
}

/* Large desktop: >= 1280px */
@media (min-width: 1280px) {
  .container,
  .header-container,
  .content-container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* Prose responsive adjustments */
@media (max-width: 767px) {
  .prose h2 {
    font-size: var(--font-size-2xl);
    margin-top: 2em;
  }

  .prose h3 {
    font-size: var(--font-size-xl);
    margin-top: 1.5em;
  }

  .prose p {
    font-size: var(--font-size-base);
  }

  .prose blockquote {
    padding: var(--space-3) var(--space-4);
    margin: 1.5em 0;
  }

  .prose img {
    margin: 1.5em 0;
    border-radius: var(--radius-md);
  }
}


/* ==========================================================================
   15. PRINT STYLES
   ========================================================================== */

@media print {
  /* Hide non-essential elements */
  nav,
  header.site-header,
  footer.site-footer,
  aside,
  .sidebar,
  .advertisement,
  .ad-banner,
  .share-buttons,
  .back-to-top,
  .back-to-top-btn,
  .related-articles,
  .newsletter-signup,
  .reading-progress-bar,
  .no-print,
  .headline-nav-btn,
  .headline-pagination,
  .section-more-link,
  .header-spacer,
  button {
    display: none !important;
  }

  /* Optimize for printing */
  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.6;
  }

  .prose {
    max-width: 100%;
  }

  .prose h2 {
    page-break-after: avoid;
    margin-top: 1.5em;
  }

  .prose h3,
  .prose h4 {
    page-break-after: avoid;
  }

  .prose img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  .prose a {
    color: black;
    text-decoration: underline;
  }

  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .article-meta {
    border-bottom: 1px solid #ccc;
    padding-bottom: 1em;
    margin-bottom: 2em;
  }

  .article-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .page-break {
    page-break-after: always;
  }

  p,
  blockquote,
  li {
    orphans: 3;
    widows: 3;
  }
}
