/* Site Header */
.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 max(calc((100vw - 1280px) / 2 + 24px), 24px);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -.04em;
  font-size: 19px;
  color: var(--navy);
  white-space: nowrap;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f68e5, #795bea);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(65, 105, 225, .23);
  flex-shrink: 0;
}

.brand-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.main-nav a, .header-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .15s;
}

.main-nav a:hover, .header-link:hover, .site-footer nav a:hover {
  color: var(--primary);
}

.header-link {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

/* Family Sites Navigation Dropdown */
.family-sites {
  position: relative;
  flex: none;
  font-size: 12px;
  color: #65718a;
  z-index: 90;
  min-width: 0;
}

.family-sites > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: white;
  transition: all .15s;
  user-select: none;
}
.family-sites > summary::-webkit-details-marker { display: none; }
.family-sites > summary:hover { border-color: var(--primary); color: var(--primary); }

.family-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 175px;
  animation: fadeInMenu .18s ease-out;
}
@keyframes fadeInMenu {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.family-list a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .12s, color .12s;
}
.family-list a:hover {
  background: var(--wash);
  color: var(--primary);
}
.family-list a[aria-current="page"] {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
}
.family-list a[aria-current="page"]::after {
  content: '✓';
  font-size: 12px;
  color: var(--primary);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  white-space: nowrap;
  gap: 12px;
  scrollbar-width: none;
}
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--wash);
}
.mobile-nav a.active {
  background: var(--primary);
  color: white;
}

@media (max-width: 768px) {
  .site-header { padding: 0 16px; gap: 12px; }
  .main-nav, .header-link { display: none; }
  .mobile-nav { display: flex; }
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
}

/* Hero Section */
.hero {
  padding: 48px 0 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 28px 0 20px; }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  width: fit-content;
}
.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.hero h1 {
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.03em;
  color: var(--navy);
  margin: 0;
}
.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Hero Search Box */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
  max-width: 600px;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.search-icon {
  font-size: 18px;
  color: var(--muted);
}
.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  padding: 8px 0;
}
.search-box kbd {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--wash);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

/* Hero Quick Access Chips */
.hero-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-tags-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.hero-tag-btn {
  background: white;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hero-tag-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Hero Visual Badge Card */
.hero-visual {
  display: flex;
  justify-content: center;
}
.visual-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 290px;
}
.visual-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.visual-card-top .badge-live {
  background: var(--success-bg);
  color: var(--success);
  padding: 2px 7px;
  border-radius: 6px;
}
.visual-number {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.35;
}
.visual-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding-top: 8px;
  border-top: 1px solid var(--wash);
}
.visual-row span { color: var(--text-muted); }
.visual-row b { color: var(--navy); }

/* Category Navigation Tabs */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: all .15s;
}
.cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.cat-tab.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}
.cat-tab .count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--text-muted);
}
.cat-tab.active .count {
  background: rgba(255, 255, 255, .2);
  color: white;
}

/* Forms Grid */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
@media (max-width: 640px) {
  .forms-grid { grid-template-columns: 1fr; }
}

.form-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  text-decoration: none;
}
.form-card:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(82, 101, 232, .12);
  transform: translateY(-3px);
}

.form-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.form-id-badge {
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 6px;
}
.form-class-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.class-A { background: #fee2e2; color: #991b1b; } /* 법정지정 */
.class-B { background: #e0e7ff; color: #3730a3; } /* 공공표준 */
.class-C { background: #dcfce7; color: #166534; } /* 실무보조 */

.form-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
  line-height: 1.35;
}
.form-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.form-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--wash);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.form-card-footer .agency {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.form-card-footer .open-link {
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Trust Strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 32px 0;
  margin: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 768px) {
  .trust-strip { grid-template-columns: 1fr; gap: 20px; }
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.trust-num {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  background: var(--primary-light);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.trust-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trust-info b {
  font-size: 15px;
  color: var(--navy);
  font-weight: 800;
}
.trust-info small {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Site Footer */
.site-footer {
  background: white;
  border-top: 1px solid var(--line);
  padding: 48px 0 36px;
  margin-top: 60px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  text-decoration: none;
}
.footer-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 6px 0 0;
  line-height: 1.6;
}
.footer-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.footer-legal-notice {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--wash);
  border: 1px solid var(--line);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* Ad Slot Isolation */
.ad-slot-container {
  margin: 24px 0;
  text-align: center;
}
.ad-slot-container[data-ad-status="disabled"],
.ad-slot-container.hidden {
  display: none !important;
}
