/* The header (app/views/layouts/net_cyc.html.erb), as Vector 2022's: the main menu's button, the logo (NetCyc's
   emblem, the wordmark in the serif and the tagline under it), the search box with its Search button, the Appearance
   menu's button (shown when its column is not) and Log out. On a narrow screen the search box folds into a button
   (nc-search-toggle) that opens it across the header (is-expanded, the netcyc-expand controller). */

.nc-header { display: flex; align-items: center; gap: 0.75rem; max-width: var(--nc-page-width); min-height: 3.125rem; margin: 0 auto; padding: 0.8125rem var(--nc-page-padding) 0.5rem; font-size: var(--nc-ui-size); }
.nc-header__start { display: flex; flex: none; align-items: center; gap: 0.875rem; }
.nc-header__end { display: flex; flex: 1; align-items: center; gap: 0.5rem; min-width: 0; }

.nc-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 2px; background: none; color: var(--nc-text); cursor: pointer; list-style: none; }
.nc-icon-button::-webkit-details-marker { display: none; }
.nc-icon-button:hover { background: var(--nc-hover); }
.nc-main-menu > summary { margin: 0 -0.375rem; }

.nc-logo { display: flex; align-items: center; gap: 0.5rem; color: var(--nc-heading); }
.nc-logo:visited { color: var(--nc-heading); }
.nc-logo:hover { text-decoration: none; }
.nc-logo__emblem { width: 2.5rem; height: 2.5rem; color: var(--nc-emblem); }
.nc-logo__text { display: flex; flex-direction: column; align-items: center; font-family: var(--nc-serif); line-height: 1; }
.nc-logo__wordmark { font-size: 1.5rem; letter-spacing: 0.04em; }
.nc-logo__tagline { margin-top: 0.25rem; font-size: 0.6875rem; letter-spacing: 0.02em; }

.nc-search { display: flex; flex: 0 1 30rem; margin-left: 1.5rem; }
.nc-search__field { position: relative; display: flex; flex: 1; min-width: 0; }
.nc-search__field .nc-icon { position: absolute; top: 50%; left: 0.5rem; width: 1.125rem; height: 1.125rem; color: var(--nc-subtle); transform: translateY(-50%); pointer-events: none; }
.nc-search__input { width: 100%; min-height: 2rem; padding: 0.25rem 0.5rem 0.25rem 2rem; border: 1px solid var(--nc-input-border); border-radius: 2px 0 0 2px; background: var(--nc-input); color: var(--nc-text); font-size: var(--nc-ui-size); }
.nc-search__input:focus { border-color: var(--nc-progressive); outline: 0; box-shadow: inset 0 0 0 1px var(--nc-progressive); }
.nc-search__button { min-height: 2rem; padding: 0 0.6875rem; border: 1px solid var(--nc-input-border); border-left: 0; border-radius: 0 2px 2px 0; background: var(--nc-button); color: var(--nc-button-text); font-size: var(--nc-ui-size); font-weight: 700; cursor: pointer; }
.nc-search__button:hover { background: var(--nc-hover); }
.nc-search-toggle { display: none; }

.nc-appearance-menu { margin-left: auto; }
.nc-user-links { display: flex; align-items: center; }
.nc-search ~ .nc-appearance-menu + .nc-user-links, .nc-appearance-menu + .nc-user-links { margin-left: 0.25rem; }
.nc-user-links__form { margin: 0; }
.nc-user-links__button { padding: 0.25rem 0.375rem; border: 0; background: none; color: var(--nc-link); font-size: var(--nc-ui-size); cursor: pointer; }
.nc-user-links__button:hover { text-decoration: underline; }

/* The Appearance menu's button is there only while its column is hidden (05-preferences and the widths below). */
@media (min-width: 87.5rem) {
  .nc-appearance-menu { visibility: hidden; }
}

@media (max-width: 40rem) {
  .nc-header { gap: 0.25rem; padding-inline: 1rem; }
  .nc-header__start { gap: 0.5rem; }
  .nc-logo__emblem { width: 2.125rem; height: 2.125rem; }
  .nc-logo__wordmark { font-size: 1.3125rem; }
  .nc-logo__tagline { font-size: 0.625rem; }
  .nc-header .nc-search { display: none; }
  .nc-search-toggle { display: inline-flex; margin-left: auto; }
  .nc-appearance-menu { margin-left: 0; }
  .nc-header.is-expanded { flex-wrap: wrap; }
  .nc-header.is-expanded .nc-header__end { flex-wrap: wrap; }
  .nc-header.is-expanded .nc-search { display: flex; order: 9; flex: 1 0 100%; margin: 0.5rem 0 0; }
}
