/* Site header: logo + tagline, open search, theme + menu */

.dica-header {
  height: var(--dica-header-h, 72px);
  box-shadow: 0 1px 0 var(--dica-border, #e2e8f0);
}

.dica-header-inner {
  gap: 18px;
}

.dica-logo {
  flex: 0 0 auto;
}

.header-tagline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 1px solid #d8dee8;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  color: var(--dica-muted, #64748b);
}

.header-tagline span {
  font-size: 13px;
  font-weight: 700;
  color: var(--dica-ink, #0f172a);
}

.header-tagline small {
  font-size: 12px;
  font-weight: 500;
}

.dica-header .dica-search,
.dica-header .dica-search.active {
  position: relative;
  inset: auto;
  flex: 1 1 280px;
  width: auto;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
  background: transparent;
}

.header-actions:has(.dica-search.active) {
  width: auto;
}

.dica-header .header-search-form {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 4px 4px 4px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dica-header .header-search-ico {
  display: flex;
  flex: 0 0 auto;
  color: var(--dica-muted, #64748b);
}

.dica-header .dica-search input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  visibility: visible;
  color: var(--dica-ink, #0f172a);
  font-size: 15px;
}

.dica-header .dica-search input::placeholder {
  color: var(--dica-muted, #64748b);
  opacity: 1;
}

.dica-header .header-search-go {
  position: static;
  left: auto;
  flex: 0 0 auto;
  width: auto;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--dica-brand, #f5c400);
  color: #101010;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  z-index: 1;
}

.dica-header .header-search-go:hover {
  filter: brightness(0.97);
}

.dica-header .search-close,
.dica-header .dica-search .icon-search,
.dica-header .header-search-submit {
  display: none !important;
}

.header-actions {
  gap: 8px;
  height: auto;
}

/* Theme toggle, desktop: sun · switch · moon. The knob sits on the active mode's side. */
.header-actions .theme-toggle {
  flex: 0 0 auto;
  gap: 10px;
  width: auto;
  height: 44px;
  margin-left: 0;
  padding: 0 12px;
  border: 1px solid #edf1f7;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.header-actions .theme-toggle .theme-toggle-icon {
  display: none;
}

.tt-sun,
.tt-moon {
  display: inline-flex;
  transition: opacity .2s ease;
}

.tt-sun {
  color: #f5b400;
}

.tt-moon {
  color: var(--dica-action, #1b4f9c);
  opacity: .5;
}

.tt-sun svg,
.tt-moon svg {
  display: block;
  max-width: none;
}

.tt-switch {
  position: relative;
  display: inline-block;
  flex: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #0f1b3d;
}

.tt-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s ease;
}

html[data-theme="dark"] .tt-knob {
  transform: translateX(20px);
}

html[data-theme="dark"] .tt-sun {
  opacity: .5;
}

html[data-theme="dark"] .tt-moon {
  opacity: 1;
}

html[data-theme="dark"] .header-actions .theme-toggle {
  border-color: var(--dica-border);
  background: var(--dica-surface-raised);
  box-shadow: none;
}

html[data-theme="dark"] .tt-switch {
  background: var(--dica-action);
}

.dica-head-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--dica-surface-raised, #fff);
  color: var(--dica-ink, #0f172a);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.dica-head-toggle svg,
.dica-head-toggle .menu-button {
  fill: currentColor;
}

.header-menu-lbl {
  line-height: 1;
}

html[data-theme="dark"] .dica-header .header-search-form {
  background: var(--dica-surface-raised);
  border-color: var(--dica-border);
}

html[data-theme="dark"] .header-tagline {
  border-left-color: var(--dica-border);
}

html[data-theme="dark"] .header-tagline span,
html[data-theme="dark"] .dica-head-toggle {
  color: var(--dica-ink);
}

@media (max-width: 1080px) {
  .header-tagline small {
    display: none;
  }
}

@media (max-width: 890px) {
  .header-tagline {
    display: none;
  }

  .header-menu-lbl {
    display: none;
  }

  /* Tablet/phone: back to a single round icon */
  .header-actions .theme-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
  }

  .header-actions .theme-toggle .theme-toggle-icon {
    display: inline;
  }

  .header-actions .theme-toggle .theme-toggle-sun,
  html[data-theme="dark"] .header-actions .theme-toggle .theme-toggle-moon {
    display: none;
  }

  html[data-theme="dark"] .header-actions .theme-toggle .theme-toggle-sun {
    display: inline;
  }

  .tt-sun,
  .tt-switch,
  .tt-moon {
    display: none;
  }

  .dica-head-toggle {
    width: 40px;
    padding: 0;
    border-radius: 50%;
  }

  .dica-header .header-search-go {
    padding: 0 12px;
    font-size: 13px;
  }
}

/* Share + search icons: mobile only */
.dica-header .hdr-share-btn,
.dica-header .hdr-search-btn {
  display: none;
}

@media (max-width: 640px) {
  :root {
    --dica-header-h: 64px;
  }

  .dica-header {
    height: var(--dica-header-h);
  }

  .dica-header-inner {
    gap: 10px;
  }

  .dica-logo .logo-img {
    width: 100px;
    height: 32px;
  }

  .header-actions {
    gap: 6px;
  }

  .dica-header .hdr-share-btn,
  .dica-header .hdr-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--dica-surface-raised, #fff);
    color: var(--dica-action, #1b4f9c);
    cursor: pointer;
  }

  .dica-header .hdr-search-btn svg {
    width: 22px;
    height: 22px;
    max-width: none;
  }

  .dica-header .hdr-share-btn svg {
    width: 20px;
    height: 20px;
    max-width: none;
  }

  .dica-header .header-actions .theme-toggle {
    flex: 0 0 40px;
    height: 40px;
    background: var(--dica-surface-raised, #fff);
  }

  .dica-header .theme-toggle-icon {
    font-size: 21px;
  }

  /* Search box drops down under the header when the icon is tapped */
  .dica-header .dica-search {
    display: none;
  }

  .dica-header .dica-search.active {
    position: absolute;
    top: calc(100% + 6px);
    left: 12px;
    right: 12px;
    z-index: 5;
    display: block;
    flex: none;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 8px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: var(--dica-surface-raised, #fff);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
  }

  .dica-header .dica-search.active form {
    width: 100%;
    margin: 0;
  }

  .dica-header .header-search-form {
    height: 44px;
    padding-left: 12px;
  }

  .dica-header .dica-search input {
    font-size: 16px;
  }

  .dica-header .header-search-go {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }

  html[data-theme="dark"] .dica-header .dica-search.active {
    border-color: var(--dica-border);
  }
}

@media (max-width: 350px) {
  .dica-header .hdr-share-btn {
    display: none;
  }
}
