/* 자격달력 — mobile-first production stylesheet */
:root {
  --indigo: #1b2a4a;
  --indigo-deep: #121c33;
  --indigo-mid: #243658;
  --indigo-soft: #3a4d73;
  --amber: #e8a317;
  --amber-hover: #d4920f;
  --amber-soft: #fff4d6;
  --amber-line: #f0c86a;
  --paper: #f7f6f2;
  --card: #ffffff;
  --ink: #1a1d26;
  --ink-soft: #4a5060;
  --muted: #8b90a0;
  --line: #e4e6ec;
  --line-strong: #c5c9d4;
  --slot-bg: #f3f4f7;
  --ok: #1f7a4d;
  --ok-bg: #e8f6ee;
  --soon: #b45309;
  --soon-bg: #fff4e5;
  --live: #1d4ed8;
  --live-bg: #e8efff;
  --week: #9a3412;
  --week-bg: #ffedd5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(18, 28, 51, 0.08);
  --shadow-sm: 0 2px 10px rgba(18, 28, 51, 0.05);
  --max: 1080px;
  --header-h: 68px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
}

a {
  color: var(--indigo);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--amber-hover);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--amber);
  color: var(--indigo-deep);
  padding: 8px 12px;
  z-index: 100;
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  background: var(--indigo);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 12px rgba(18, 28, 51, 0.25);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.logo span {
  color: var(--amber);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}

.nav a {
  color: #d7deea;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--amber);
}

.search-wrap {
  margin-left: auto;
  min-width: min(100%, 240px);
  flex: 1 1 200px;
  max-width: 320px;
}

.search-wrap input {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.9rem;
  background: var(--indigo-mid);
  color: #fff;
  outline: none;
}

.search-wrap input::placeholder {
  color: #9aa6bf;
}

.search-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(232, 163, 23, 0.45);
  background: #2c4268;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.page {
  flex: 1;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.hero {
  padding: 36px 0 12px;
}

.kicker {
  display: inline-block;
  background: var(--amber-soft);
  color: #8a5a00;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--indigo);
}

.lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 40rem;
  margin: 0 0 8px;
}

.today-line {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.section {
  margin-top: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--indigo);
}

.section-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-kind {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--indigo-soft);
  letter-spacing: 0.02em;
}

.dday {
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--indigo);
}

.dday.is-live {
  color: var(--live);
  font-size: clamp(1.6rem, 4vw, 2rem);
}

.dday.is-week {
  color: var(--week);
}

.card h3 {
  margin: 4px 0 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.card .when {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-week {
  background: var(--week-bg);
  color: var(--week);
}

.badge-live {
  background: var(--live-bg);
  color: var(--live);
}

.badge-soon {
  background: var(--soon-bg);
  color: var(--soon);
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-mute {
  background: var(--slot-bg);
  color: var(--muted);
}

.card-link {
  margin-top: auto;
  padding-top: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--indigo);
}

.card-link:hover {
  color: var(--amber-hover);
}

.card.is-hidden {
  display: none;
}

.exam-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.exam-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.exam-card:hover {
  border-color: var(--amber-line);
  box-shadow: var(--shadow);
  color: inherit;
}

.exam-card strong {
  font-size: 1.05rem;
  color: var(--indigo);
  letter-spacing: -0.02em;
}

.exam-card span {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

.notice {
  margin-top: 28px;
  padding: 14px 16px;
  background: #fff;
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.disclaimer {
  margin-top: 36px;
  font-size: 0.85rem;
  color: var(--muted);
}

.ad-slot {
  min-height: 120px;
  background: #f3f4f7;
  border: 1px dashed #c5c9d4;
  display: grid;
  place-items: center;
  color: #8b90a0;
  font-size: 13px;
  border-radius: var(--radius-sm);
  margin: 28px 0;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--indigo);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

tr:nth-child(even) td {
  background: #fafafc;
}

tr.is-current td {
  background: var(--amber-soft);
}

caption {
  text-align: left;
  padding: 14px 16px 8px;
  font-weight: 700;
  color: var(--indigo);
}

.fine {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 12px 0 0;
}

.prose {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  max-width: 720px;
}

.prose h2 {
  font-size: 1.2rem;
  color: var(--indigo);
  margin: 28px 0 8px;
}

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

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose ul {
  padding-left: 1.2rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
}

.btn-primary {
  background: var(--amber);
  color: var(--indigo-deep);
}

.btn-primary:hover {
  background: var(--amber-hover);
  color: var(--indigo-deep);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--indigo);
}

.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--indigo);
}

.jump-grid {
  display: grid;
  gap: 14px;
}

.jump-card {
  background: var(--indigo);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  display: block;
}

.jump-card:hover {
  color: #fff;
  background: var(--indigo-mid);
}

.jump-card h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.jump-card p {
  margin: 0;
  color: #c5cede;
  font-size: 0.92rem;
}

.site-footer {
  background: var(--indigo-deep);
  color: #c5cede;
  padding: 36px 20px 40px;
  margin-top: auto;
  font-size: 0.88rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.site-footer a {
  color: var(--amber);
}

.site-footer p {
  margin: 6px 0;
}

.footer-legal {
  margin-top: 16px;
  color: #8d97ab;
  font-size: 0.82rem;
}

.empty-search {
  display: none;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
}

.empty-search.is-visible {
  display: block;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .exam-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .hero {
    padding-top: 52px;
  }

  .prose {
    padding: 36px 40px;
  }
}

@media (min-width: 960px) {
  .card-grid.now-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.logo span {
  background: var(--amber);
  color: var(--indigo-deep);
  padding: 2px 8px 3px;
  border-radius: 8px;
  line-height: 1.2;
}
.ad-slot.in-article { min-height: 120px; }
.ad-slot.aside {
  min-height: 250px;
  margin: 0 0 16px;
}
.layout-with-aside {
  display: grid;
  gap: 24px;
}
.event-feed { display: grid; gap: 10px; margin-top: 12px; }
.event-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}
.event-row:hover { border-color: var(--amber-line); color: inherit; }
.event-row.is-hidden { display: none; }
.event-when { font-size: 0.82rem; font-weight: 700; color: var(--indigo-soft); }
.event-when span { display: block; color: var(--muted); font-weight: 500; }
.event-name { font-weight: 700; color: var(--indigo); }
.event-sub { font-size: 0.86rem; color: var(--muted); }
.event-dd { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--indigo); }
.nav-qnet {
  color: var(--indigo-deep) !important;
  background: var(--amber);
  border-radius: 999px;
  padding: 4px 10px !important;
  border-bottom: 0 !important;
  font-weight: 700;
}
.nav-qnet:hover { background: var(--amber-hover); color: var(--indigo-deep) !important; }
@media (min-width: 960px) {
  .layout-with-aside { grid-template-columns: minmax(0,1fr) 300px; align-items: start; }
}
@media (max-width: 719px) {
  .event-row { grid-template-columns: 1fr; gap: 4px; }
}
