/* Keep the crest artwork intact; balance the adjacent typography and optical alignment. */
.header {
  --brand-scale: .9;
  --brand-base-width: 324px;
  --brand-base-height: 96px;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "brand utility" "brand navigation";
  align-items: center;
  column-gap: 36px;
  row-gap: 0;
  padding: 14px max(60px, calc((100vw - 1160px)/2));
  background: #fff;
  border-bottom: 1px solid #dce3e9;
}
.header > .brand.ipama-brand--academic {
  position: relative;
  display: block;
  flex: none;
  width: calc(var(--brand-base-width) * var(--brand-scale));
  height: calc(var(--brand-base-height) * var(--brand-scale));
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  align-self: center;
  justify-self: start;
}
.header .ipama-brand-lockup {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  width: var(--brand-base-width);
  height: var(--brand-base-height);
  align-items: center;
  gap: 12px;
  transform: scale(var(--brand-scale));
  transform-origin: left top;
}
.header .ipama-brand-lockup .ipama-academic-emblem {
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  transform: translateY(-3px);
}
.header .ipama-brand-lockup .ipama-academic-emblem img {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: contain;
  aspect-ratio: 1;
}
.header .ipama-brand-lockup .ipama-wordmark {
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  color: #0d3159;
}
.header .ipama-brand-lockup .ipama-wordmark strong {
  display: block;
  font: 700 42px/.9 Palatino, "Palatino Linotype", Georgia, serif;
  letter-spacing: .02em;
  margin: 0;
  white-space: nowrap;
}
.header .ipama-brand-lockup .ipama-brand-name {
  display: block;
  font-family: Manrope, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: 3px 0 0;
  white-space: nowrap;
  overflow-wrap: normal;
}
.header .ipama-brand-lockup .ipama-wordmark small {
  display: block;
  font: 500 9.5px/1.35 Manrope, sans-serif;
  letter-spacing: 0;
  color: #40515b;
  margin: 4px 0 0;
  white-space: nowrap;
  overflow-wrap: normal;
}
.header .header-utility {
  min-height: 44px;
  border-bottom: 0;
  align-self: start;
}
.header > #main-nav {
  grid-area: navigation;
  position: static;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  justify-self: end;
  padding: 0;
  gap: 24px;
  min-height: 44px;
  max-height: none;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
.header > #main-nav > a { font-size: 12px; min-height: 44px; display: inline-flex; align-items: center; }
.header > .menu-toggle { display: none; }
@media (max-width: 1100px) {
  .header {
    --brand-scale: .82;
    grid-template-areas: "brand utility" "brand menu";
    padding: 12px 35px;
    column-gap: 22px;
  }
  .header > .menu-toggle { display: flex; justify-self: end; margin: 0; min-width: 44px; min-height: 44px; align-items: center; gap: 9px; }
  .header > #main-nav {
    grid-area: auto;
    position: absolute;
    top: 100%; left: 0; right: 0;
    justify-self: stretch;
    width: auto;
    display: none;
    padding: 20px 28px;
    gap: 0;
    border-bottom: 1px solid #dce3e9;
    max-height: calc(100svh - var(--ipama-header-height, 140px) - 16px);
    overflow: auto;
    background: #fff;
  }
  .header > #main-nav.open { display: flex; flex-direction: column; align-items: stretch; }
  .header > #main-nav > a { font-size: 14px; border-bottom: 1px solid #edf0f3; padding: 10px 0; }
}
@media (max-width: 600px) {
  .header {
    --brand-scale: .72;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "utility utility" "brand menu";
    padding: 0 24px 14px;
    gap: 10px 14px;
  }
  .header .header-utility { border-bottom: 1px solid #edf0f3; }
  .header > #main-nav { padding: 16px 20px; }
}
@media (max-width: 380px) {
  .header { --brand-scale: .66; padding-inline: 20px; column-gap: 8px; }
  .header > #main-nav { padding-inline: 16px; }
}

.header > #main-nav > a { flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; }
.header > #main-nav > a small { font-size: 9px; line-height: 1.4; font-weight: 500; letter-spacing: .035em; color: #6b7b89; }
@media (max-width:1100px) { .header > #main-nav > a { flex-direction: row; justify-content: space-between; align-items: center; } .header > #main-nav > a small { font-size: 11px; } }

@media (min-width:601px) and (max-width:650px) { .header {padding-inline:24px;} }
