/* Shared public header, loaded after each page family's styles. */
:root:has(.site-header) { --header-height: 0px; }
body:has(> .site-header) { margin: 0; }
.site-header, .site-header * { box-sizing: border-box; }
.site-header {
  position: relative; inset: auto; display: block; width: 100%; max-width: none;
  height: auto; margin: 0; padding: 0; z-index: 100;
  background: #f8f7f3; border-bottom: 1px solid #dbdfd9;
  color: #232c35; font-family: "Inter", "Noto Sans KR", sans-serif; font-size: 16px; line-height: 1.5;
  backdrop-filter: none;
}
.site-header .header-inner {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 24px; max-width: 1200px; height: auto; margin: 0 auto; padding: 22px 32px;
}
.site-header .logo { display: flex; align-items: center; gap: 10px; color: #232c35; text-decoration: none; }
.site-header .logo-mark { display: block; width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.site-header .logo-text { font-size: 1.15rem; font-weight: 800; line-height: 1.1; letter-spacing: normal; color: #232c35; }
.site-header .logo-text span { display: block; margin-top: 4px; font-size: .65rem; font-weight: 500; line-height: 1.3; letter-spacing: .05em; color: #5d6b73; }
.site-header .course-nav { display: block; width: auto; order: initial; overflow: visible; }
.site-header .nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; width: auto; list-style: none; margin: 0; padding: 0; }
.site-header .nav-links li { margin: 0; padding: 0; }
.site-header .nav-links a { display: block; padding: 9px 0; border-radius: 0; font-size: .88rem; font-weight: 600; line-height: 1.5; color: #4d6254; text-decoration: none; white-space: nowrap; background: none; }
.site-header .nav-links a:hover, .site-header .nav-links a.active { color: #263e2e; text-decoration: underline; text-underline-offset: 5px; background: none; }
.site-header .nav-links a[aria-current=page] { color: #263e2e; font-weight: 700; }
.site-header .nav-links a[aria-current=page]::after { content: none; }
.site-header .header-actions { display: flex; align-items: center; gap: 10px; margin: 0; }
.site-header .search-bar { display: flex; align-items: center; gap: 8px; width: 240px; min-width: 0; margin: 0; padding: 6px 10px; background: #fff; border: 1px solid #d4dbd3; border-radius: 8px; position: relative; }
.site-header .search-bar input { width: 100%; min-width: 0; padding: 3px 0; background: none; border: none; outline: none; color: #232c35; font: inherit; font-size: .85rem; }
.site-header .search-bar input::placeholder { color: #5d6b73; }
.site-header .search-submit-btn { margin: 0; padding: 5px 8px; border: none; border-radius: 5px; background: #edf1eb; color: #314e3a; font: inherit; font-size: .78rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.site-header .icon-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid #d4dbd3; border-radius: 8px; background: #fff; color: #232c35; cursor: pointer; }
.site-header a:focus-visible, .site-header button:focus-visible, .site-header .search-bar:focus-within { outline: 2px solid #4d6254; outline-offset: 4px; }
/* Guides and the error page do not load the old app stylesheet. */
.lang-modal-overlay { display: none; position: fixed; inset: 0; z-index: 2000; background: rgb(0 0 0 / 55%); align-items: center; justify-content: center; }
.lang-modal-overlay.open { display: flex; }
.lang-modal { display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; width: min(90%, 320px); max-height: 90vh; overflow-y: auto; padding: 24px; background: #fff; border: 1px solid #d4dbd3; border-radius: 16px; color: #232c35; font-family: "Inter", sans-serif; }
.lang-modal-title { margin: 0 0 8px; font-size: .85rem; font-weight: 600; color: #5d6b73; }
.lang-modal-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: none; border-radius: 8px; background: transparent; color: #232c35; font: inherit; font-size: .95rem; text-align: start; cursor: pointer; }
.lang-modal-item:hover, .lang-modal-item:focus-visible { background: #edf1eb; }
.lang-modal-item.active { color: #314e3a; font-weight: 700; }
.lang-modal-item.active::after { content: "✓"; margin-inline-start: auto; }
.lang-modal .flag-svg { width: 24px; height: 16px; }
@media (max-width: 1050px) {
  .site-header .header-inner { grid-template-columns: 1fr auto; gap: 12px 20px; }
  .site-header .course-nav { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .site-header .header-inner { padding: 18px 20px; gap: 12px; }
  .site-header .header-actions { display: contents; }
  .site-header .lang-toggle-btn { grid-column: 2; grid-row: 1; }
  .site-header .search-bar { grid-column: 1 / -1; grid-row: 3; width: 100%; }
  .site-header .nav-links { gap: 4px 18px; }
  .site-header #search-dropdown { min-width: 0 !important; }
}
@media print { .site-header { display: none; } }
