:root {
  color-scheme: light;
  font-family: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", "Nanum Gothic", sans-serif;
  --bg: #f7f7f7;
  --border: #d9d9d9;
  --brand: #1575f6;
  --brand-dark: #0f4eac;
  --text: #222;
  --muted: #6b7280;
  --sidebar-width: 280px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.logo-image {
  height: 52px;
  width: auto;
  display: block;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(120deg, #54b9ff, #1575f6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.logo-title {
  display: block;
  font-size: 1.05rem;
}

.logo-subtitle {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.search-form {
  flex: 1;
  display: flex;
  max-width: 500px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: white;
}

.search-form input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 0;
  font-size: 1rem;
  outline: none;
}

.search-button {
  border: 0;
  background: transparent;
  padding: 0 1rem;
  cursor: pointer;
  font-size: 1.1rem;
}

.utility-nav,
.admin-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-button,
.login-button,
.admin-toggle {
  border: 1px solid var(--border);
  background: white;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.lang-button:hover,
.admin-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.lang-button.is-active {
  background: rgba(21, 117, 246, 0.12);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(21, 117, 246, 0.18);
}

.lang-button-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.login-button {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  font-weight: 600;
}

.login-button:hover {
  background: var(--brand-dark);
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  align-items: start;
  max-width: 1400px;
  margin: 0;
  padding: 1.5rem 2rem 2.5rem;
  gap: 1.5rem;
}

.sidebar {
  position: sticky;
  top: 88px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-section {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.menu-section:hover,
.menu-section.is-active {
  border-color: var(--brand);
  transform: translateX(4px);
  background: white;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 32px rgba(25, 60, 110, 0.12);
}

.slider {
  position: relative;
}

.slides {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.slide.is-active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-video {
  width: 100%;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 16px 32px rgba(25, 60, 110, 0.12);
  aspect-ratio: 16 / 9;
}

.hero-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.slide-caption {
  position: absolute;
  left: 2rem;
  bottom: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  max-width: 360px;
}

.slide-caption h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}

.slide-caption p {
  margin: 0;
  font-size: 0.95rem;
}

.slider-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(15, 54, 108, 0.6);
  color: white;
  width: 42px;
  height: 48px;
  font-size: 1.6rem;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.slider-control:hover {
  background: rgba(15, 54, 108, 0.8);
}

.slider-control.prev {
  left: 1rem;
}

.slider-control.next {
  right: 1rem;
}

.slider-toggle {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.88);
  color: #0f1b3a;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 27, 58, 0.18);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.slider-toggle:hover {
  background: rgba(255, 255, 255, 0.98);
  color: #1743a8;
  transform: translateX(-50%) translateY(-2px);
}

.slider-toggle:active {
  transform: translateX(-50%) translateY(0);
}

.slider-toggle[hidden] {
  display: none;
}

.content-section,
.page-viewer {
  background: white;
  border-radius: 16px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 8px 16px rgba(17, 24, 39, 0.06);
}

.content-section h3,
.page-title {
  margin-top: 0;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.content-section ul {
  padding-left: 1.2rem;
  margin: 0;
}

.content-section li + li {
  margin-top: 0.35rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.media-grid figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f4ff;
  border: 1px solid rgba(21, 117, 246, 0.15);
}

.media-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.media-grid figcaption {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  text-align: left;
  padding: 1.75rem 2rem 2.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.1;
  width: 100%;
  max-width: 1400px;
  margin-left: 0;
  margin-right: auto;
}

.footer-body {
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: left;
  line-height: 1.1;
}

.footer-body p,
.footer-body ul,
.footer-body ol {
  margin: 0;
}

.footer-body p + p {
  margin-top: 0;
}

.footer-body ul,
.footer-body ol {
  display: block;
  padding-left: 1.25rem;
}

.footer-copy {
  display: block;
  text-align: left;
}

.page-header {
  border-bottom: 1px solid rgba(21, 117, 246, 0.12);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.page-body {
  font-size: 0.98rem;
  color: #374151;
}

.page-body .ql-font-noto-sans-kr {
  font-family: "Noto Sans KR", sans-serif;
}

.page-body .ql-font-nanum-gothic {
  font-family: "Nanum Gothic", sans-serif;
}

.page-body .ql-font-nanum-myeongjo {
  font-family: "Nanum Myeongjo", serif;
}

.page-body .ql-font-ibm-plex-sans-kr {
  font-family: "IBM Plex Sans KR", sans-serif;
}

.page-body .ql-font-gowun-dodum {
  font-family: "Gowun Dodum", sans-serif;
}

.page-body .ql-font-do-hyeon {
  font-family: "Do Hyeon", sans-serif;
}

.page-body a {
  color: var(--brand);
  text-decoration: underline;
  word-break: break-word;
}

.page-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.75rem 0;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.page-body .ql-align-center img {
  margin-left: auto;
  margin-right: auto;
}

.page-body .ql-align-right img {
  margin-left: auto;
  margin-right: 0;
}

.page-body .ql-align-left img,
.page-body .ql-align-justify img {
  margin-left: 0;
  margin-right: auto;
}

.page-body .ql-align-center {
  text-align: center;
}

.page-body .ql-align-right {
  text-align: right;
}

.page-body .ql-align-justify {
  text-align: justify;
}

.page-body iframe {
  max-width: 100%;
  display: block;
  margin: 1rem auto;
}

.search-results__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.search-results__header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.search-results__close {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 0.1rem 0.3rem;
}

.search-results__close:hover {
  color: var(--brand-dark);
}

.search-results__summary {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.search-results__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.search-result-item {
  border: 1px solid rgba(21, 117, 246, 0.18);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(246, 250, 255, 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.search-result-item:hover {
  border-color: rgba(21, 117, 246, 0.45);
  box-shadow: 0 12px 24px rgba(21, 117, 246, 0.12);
}

.search-result-item__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.search-result-item__meta {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.search-result-item__snippet {
  margin: 0;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.5;
}

.search-result-item mark {
  background: rgba(21, 117, 246, 0.25);
  color: inherit;
  padding: 0 0.15rem;
  border-radius: 4px;
}

.search-results__empty {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-body p {
  margin-top: 0;
}

.page-body p + p {
  margin-top: 0.85rem;
}

.footer-body.page-body p + p,
.footer .page-body p + p {
  margin-top: 0;
}

.admin-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.admin-panel[hidden] {
  display: none;
}

.admin-panel__body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-panel__container {
  background: white;
  border-radius: 20px;
  width: min(900px, 100%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(21, 117, 246, 0.2);
  box-shadow: 0 32px 64px rgba(12, 36, 84, 0.25);
}

.admin-panel__header,
.admin-panel__footer {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(21, 117, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-panel__footer {
  border-bottom: 0;
  border-top: 1px solid rgba(21, 117, 246, 0.12);
  gap: 0.75rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.admin-panel__header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.admin-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
}

.admin-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-group h3 {
  margin: 0;
  font-size: 1.1rem;
}

.admin-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 0.35rem;
}

.admin-grid input,
.admin-field input,
.admin-field textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
}

.admin-field textarea {
  min-height: 140px;
  resize: vertical;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-item {
  border: 1px solid rgba(21, 117, 246, 0.15);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(246, 250, 255, 0.9);
  display: grid;
  gap: 0.75rem;
}

.admin-item__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-button {
  border: 1px solid rgba(21, 117, 246, 0.5);
  background: white;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.admin-button.danger {
  border-color: #ef4444;
  color: #b91c1c;
}

.admin-button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-add {
  align-self: flex-start;
  border: 1px dashed var(--brand);
  color: var(--brand);
  background: rgba(21, 117, 246, 0.06);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
}

.admin-save {
  background: var(--brand);
  color: white;
  border: 0;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
}

.admin-reset {
  border: 0;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  font-weight: 600;
}

.admin-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-footer-left,
.admin-footer-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-locales {
  display: grid;
  gap: 1rem;
}

.admin-locale-block {
  background: white;
  border: 1px solid rgba(21, 117, 246, 0.18);
  border-radius: 12px;
  padding: 1rem;
}

.admin-locale-block h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--brand-dark);
}

.admin-locale-code {
  font-weight: 500;
  color: var(--muted);
}

.admin-preview {
  border-radius: 10px;
  background: rgba(21, 117, 246, 0.04);
  border: 1px dashed rgba(21, 117, 246, 0.3);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #1f2937;
}

.admin-preview p:last-child {
  margin-bottom: 0;
}

.admin-preview ul {
  margin: 0.5rem 0 0 1.2rem;
}

.admin-media-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-media-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.admin-media-item {
  border: 1px solid rgba(21, 117, 246, 0.15);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(246, 250, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-media-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.admin-media-main strong {
  font-size: 0.95rem;
}

.admin-media-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-media-main a {
  font-size: 0.85rem;
  color: var(--brand);
  text-decoration: none;
}

.admin-media-main a:hover {
  text-decoration: underline;
}

.admin-media-actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 1200px) {
  .layout {
    padding: 1.5rem;
    max-width: 1200px;
  }
}

@media (max-width: 992px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    overflow-x: auto;
    white-space: nowrap;
  }

  .menu {
    flex-direction: row;
    gap: 0.75rem;
  }

  .menu-section {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    max-width: none;
    order: 3;
  }

  .utility-nav {
    order: 2;
    justify-content: flex-end;
  }

  .layout {
    padding: 1rem;
  }

  .slide-caption {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }

  .admin-panel {
    padding: 1rem;
  }

  .admin-panel__body {
    max-height: 70vh;
  }

  .admin-panel__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-footer-left,
  .admin-footer-right {
    justify-content: space-between;
  }
}
