:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f0f5fb;
  --surface-tint: #f8fafc;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d8e0ea;
  --line-strong: #b7c4d4;
  --brand: #005bac;
  --brand-dark: #003f7d;
  --brand-soft: #e8f2ff;
  --accent: #0f766e;
  --warning: #a15c00;
  --warn-bg: #fff8e6;
  --warn-line: #e5c36f;
  --focus: #1d4ed8;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 18px rgba(16, 24, 40, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

html[data-font-size="large"] {
  font-size: 18.5px;
}

html[data-font-size="xlarge"] {
  font-size: 20px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.24);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--brand);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 6px solid var(--brand);
  border-right-color: var(--accent);
  border-radius: 50%;
  background: var(--surface);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
}

.nav a {
  padding: 8px 11px;
  border-radius: 6px;
  color: #344054;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus {
  background: var(--brand-soft);
  color: var(--brand-dark);
  outline: none;
}

.font-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.font-controls button {
  min-width: 40px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  font-weight: 850;
  cursor: pointer;
}

.font-controls button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.hero,
.page-title {
  display: grid;
  gap: 18px;
  padding: 34px 0 26px;
}

.hero {
  grid-template-columns: minmax(0, 820px);
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: grid;
  gap: 12px;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.hero h1,
.page-title h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(1.95rem, 3.2vw, 2.65rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.hero p,
.page-title p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  max-width: 760px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-panel.section {
  max-width: 760px;
}

.search-panel input,
.filters input,
.filters select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 13px;
  background: var(--surface);
  color: var(--ink);
}

.search-panel input::placeholder,
.filters input::placeholder {
  color: #8a95a6;
}

.search-panel input:focus,
.filters input:focus,
.filters select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(0, 91, 172, 0.14);
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 9px 16px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button.secondary {
  background: var(--surface);
  color: var(--brand-dark);
}

.button:hover,
.button:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  outline: none;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 760px;
}

.quick-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #344054;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.quick-actions a:hover,
.quick-actions a:focus {
  border-color: var(--brand);
  color: var(--brand-dark);
  outline: none;
}

.notice {
  padding: 18px 20px;
  border: 1px solid var(--warn-line);
  border-left: 5px solid var(--warning);
  border-radius: 8px;
  background: var(--warn-bg);
}

.notice-compact {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: #5f3b00;
}

.notice h2,
.notice h3 {
  margin-top: 0;
}

.notice p {
  margin: 8px 0 0;
}

.section {
  margin-top: 26px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-header h2,
.section > h2,
.page-title h2,
.plain-page h1 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.34;
}

.section > h2 {
  margin-bottom: 14px;
}

.plain-page h1 {
  margin-bottom: 18px;
}

.plain-page h2 {
  margin: 30px 0 10px;
  font-size: 1.14rem;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.action-summary {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.action-summary .section-header {
  margin-bottom: 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.action-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  text-decoration: none;
}

.action-card:hover,
.action-card:focus {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.action-card strong {
  font-size: 1rem;
}

.action-card span {
  color: var(--brand-dark);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.05;
}

.action-card small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.content-panel,
.side-panel,
.detail-main,
.detail-side {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.content-panel {
  padding: 22px;
}

.side-panel {
  padding: 20px;
}

.side-panel h2 {
  margin: 0 0 14px;
  font-size: 1.14rem;
}

.grid,
.card-list,
.compact-list {
  display: grid;
  gap: 8px;
}

.grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.card-list .card,
.compact-list .card {
  min-height: 0;
}

.card-list .card {
  align-items: stretch;
  gap: 10px;
}

.card-main {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.card-list .card .card-foot {
  flex: 0 1 auto;
}

.content-panel .card-list .card p {
  display: none;
}

.compact-list .card {
  padding: 13px;
  box-shadow: none;
}

.compact-list .card-main {
  gap: 7px;
}

.compact-list .card p {
  display: none;
}

.card:hover,
.card:focus {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(0, 91, 172, 0.12);
  outline: none;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.42;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: #344054;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.status-진행중 {
  border-color: #8cb8e8;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.badge.status-예정 {
  border-color: #d9b35f;
  background: #fff5db;
  color: #694a05;
}

.badge.status-마감 {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #667085;
}

.badge.status-상시 {
  border-color: #93c7b4;
  background: #e7f6f0;
  color: #095c43;
}

.badge.action-today {
  border-color: #f0a3a3;
  background: #fff1f1;
  color: #9f1c1c;
}

.badge.action-soon {
  border-color: #d9b35f;
  background: #fff5db;
  color: #694a05;
}

.badge.action-month {
  border-color: #8cb8e8;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.badge.action-always {
  border-color: #93c7b4;
  background: #e7f6f0;
  color: #095c43;
}

.badge.action-upcoming,
.badge.action-closed {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #667085;
}

.card-foot {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 6px;
  align-items: center;
  color: #475467;
  font-size: 0.84rem;
  font-weight: 750;
}

.card-foot span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  white-space: nowrap;
}

.card-foot span:first-child {
  overflow: visible;
  text-overflow: clip;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filters form {
  margin: 0;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.category-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 54px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.category-link:hover,
.category-link:focus {
  border-color: var(--brand);
  color: var(--brand-dark);
  outline: none;
}

.category-link span:last-child {
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  text-align: center;
  font-size: 0.86rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.detail-main,
.detail-side {
  padding: 24px;
}

.detail-side h2 {
  margin-top: 0;
  font-size: 1.12rem;
}

.detail-side a {
  color: var(--brand-dark);
  font-weight: 700;
}

.detail-main h1 {
  margin: 10px 0 12px;
  font-size: clamp(1.65rem, 2.6vw, 2.25rem);
  line-height: 1.28;
}

.detail-main h2 {
  margin: 28px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 1.16rem;
}

.detail-main ul,
.plain-page ul {
  padding-left: 1.2em;
}

.source-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  border-top: 2px solid var(--ink);
  background: var(--surface);
}

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

.source-table th {
  width: 34%;
  background: var(--surface-tint);
  color: #344054;
  font-weight: 750;
}

.source-table a {
  color: var(--brand-dark);
  overflow-wrap: anywhere;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.footer {
  border-top: 1px solid #334155;
  background: #263241;
  color: #d7dde6;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  color: #d7dde6;
  font-size: 0.92rem;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.footer-links a {
  color: #ffffff;
  font-weight: 700;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 99;
  padding: 8px 10px;
  background: var(--focus);
  color: #fff;
}

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

.top-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  width: 54px;
  height: 54px;
  border: 1px solid var(--brand-dark);
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.2);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .home-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .search-panel {
    max-width: 760px;
  }

  .grid,
  .category-list,
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .header-inner,
  .section-header,
  .notice-compact {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-inner {
    gap: 10px;
    padding: 12px 16px;
  }

  .brand {
    white-space: normal;
  }

  .nav {
    justify-content: flex-start;
  }

  .font-controls {
    order: 3;
  }

  .container {
    padding: 20px 16px 48px;
  }

  .hero,
  .page-title {
    padding-top: 20px;
  }

  .grid,
  .category-list,
  .filters,
  .quick-actions,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .card-list .card {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-list .card .card-foot {
    flex: 0 1 auto;
    width: 100%;
    justify-content: flex-start;
  }

  .content-panel,
  .side-panel,
  .detail-main,
  .detail-side,
  .action-summary,
  .notice,
  .filters {
    padding: 16px;
  }

  .top-button {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 520px) {
  .hero h1,
  .page-title h1 {
    font-size: 1.85rem;
  }

  .source-table th,
  .source-table td {
    display: block;
    width: 100%;
  }

  .source-table th {
    border-bottom: 0;
    padding-bottom: 4px;
  }
}
