/* ==================================================
   민원109 HEADER + SEARCH BAR
================================================== */

:root {
  --header-height: 72px;
  --mobile-header-height: 62px;
  --primary: #2684ff;
  --primary-hover: #1d4ed8;
  --text: #172033;
  --muted: #667085;
  --line: #e5eaf1;
}

/* ==================================================
   1. HEADER 공간 확보
================================================== */

#header {
  height: var(--header-height);
}

/* ==================================================
   2. 고정 HEADER
================================================== */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 1000;

  height: var(--header-height);

  display: flex;
  align-items: center;

  gap: 34px;

  padding:
    0
    max(
      20px,
      calc((100% - 1240px) / 2)
    );

  background: #ffffff;

  border-bottom:
    1px solid var(--line);
}

/* ==================================================
   3. HEADER 로고
================================================== */

.brand {
  display: flex;
  align-items: center;

  gap: 10px;

  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;

  display: block;

  object-fit: contain;

  border-radius: 12px;
}

.brand span {
  display: flex;
  flex-direction: column;
}

.brand b {
  color: var(--text);
  font-size: 18px;
}

.brand small {
  margin-top: 2px;

  color: var(--muted);
  font-size: 11px;
}

/* ==================================================
   4. HEADER 메뉴
================================================== */

.top nav {
  display: flex;

  gap: 24px;
}

.top nav a {
  color: #344054;
  text-decoration: none;

  font-size: 14px;
  font-weight: 700;
}

.top nav a:hover {
  color: var(--primary);
}

/* ==================================================
   5. HEADER 우측 메뉴
================================================== */

.actions {
  margin-left: auto;

  display: flex;
  align-items: center;

  gap: 10px;
}

.actions a {
  color: #344054;
  text-decoration: none;

  font-size: 14px;
  font-weight: 800;
}

.actions .apply {
  padding: 10px 14px;

  border-radius: 11px;

  background: var(--primary);
  color: #ffffff;
}

.actions .apply:hover {
  background: var(--primary-hover);
}

/* ==================================================
   6. 기본 SEARCH BAR
================================================== */

.search-row {
  position: relative;

  z-index: 20;

  padding: 15px 20px;

  background: #ffffff;

  border-bottom:
    1px solid var(--line);
}

.search-row form {
  width: min(760px, 100%);

  margin: 0 auto;
  padding: 5px;

  display: flex;
  align-items: center;

  background: #f8fafc;

  border: 1px solid #d8e0eb;
  border-radius: 15px;
}

.search-row input {
  flex: 1;
  min-width: 0;

  height: 38px;

  padding: 0 14px;

  border: 0;
  outline: 0;

  background: transparent;
  color: var(--text);

  font-size: 14px;
}

.search-row input::placeholder {
  color: #98a2b3;
}

.search-row button {
  height: 38px;

  padding: 0 20px;

  border: 0;
  border-radius: 10px;

  background: var(--primary);
  color: #ffffff;

  font-size: 14px;
  font-weight: 800;

  cursor: pointer;
}

.search-row button:hover {
  background: var(--primary-hover);
}

/* ==================================================
   7. 스크롤 후 표시되는 SEARCH BAR
================================================== */

.search-row.is-floating {
  position: fixed;

  top: var(--header-height);
  left: 0;
  right: 0;

  z-index: 999;

  background:
    rgba(255, 255, 255, 0.97);

  box-shadow:
    0 8px 20px
    rgba(15, 23, 42, 0.08);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  animation:
    searchBarDown
    0.18s ease-out;
}

@keyframes searchBarDown {
  from {
    opacity: 0;

    transform:
      translateY(-8px);
  }

  to {
    opacity: 1;

    transform:
      translateY(0);
  }
}

/* ==================================================
   8. 접근성
================================================== */

.sr-only {
  position: absolute !important;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);

  white-space: nowrap;

  border: 0;
}

.top a:focus-visible,
.search-row input:focus-visible,
.search-row button:focus-visible {
  outline:
    3px solid
    rgba(38, 132, 255, 0.30);

  outline-offset: 2px;
}

/* ==================================================
   9. TABLET
================================================== */

@media (max-width: 900px) {
  .top nav {
    display: none;
  }
}

/* ==================================================
   10. MOBILE
================================================== */

@media (max-width: 640px) {
  #header {
    height: var(--mobile-header-height);
  }

  .top {
    height: var(--mobile-header-height);

    padding: 0 14px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;

    border-radius: 10px;
  }

  .brand b {
    font-size: 17px;
  }

  .brand small {
    display: none;
  }

  .actions > a:first-child {
    display: none;
  }

  .actions .apply {
    padding: 9px 12px;
  }

  .search-row {
    padding: 10px 14px;
  }

  .search-row.is-floating {
    top: var(--mobile-header-height);
  }

  .search-row input {
    height: 36px;

    font-size: 13px;
  }

  .search-row button {
    height: 36px;

    padding: 0 15px;

    font-size: 13px;
  }
}
