/* 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 the user menu or "Log in". 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; }
/* For a reader without the login, a discreet "Log in" link, as Wikipedia's; for a logged-in user the user menu, its
   button marked "Viewing as reader" while the reader's view is on, with "View as reader" (or "Stop viewing as reader")
   and Log out. */
.nc-user-links { display: flex; align-items: center; margin-left: 0.25rem; }
.nc-user-links__link { padding: 0.25rem 0.375rem; font-size: var(--nc-ui-size); }
.nc-user-menu { margin-left: 0.25rem; }
.nc-user-menu__button { width: auto; min-width: 2rem; gap: 0.25rem; }
.nc-user-menu__state { padding-right: 0.375rem; color: var(--nc-subtle); font-size: var(--nc-small-size); white-space: nowrap; }
.nc-user-menu--reader-view .nc-user-menu__button { box-shadow: inset 0 -2px 0 var(--nc-progressive); }
.nc-user-menu__form { margin: 0; }
.nc-user-menu__action { display: block; width: 100%; padding: 0.3125rem 0; border: 0; background: none; color: var(--nc-link); font: inherit; text-align: left; cursor: pointer; }
.nc-user-menu__action: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-user-menu__state { display: none; }
  .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; }
}
