/**
 * @file
 * Components: branding, navigation, nodes, sidebar blocks, footer menus,
 * pager, tabs and messages.
 */

/* Branding. */
.branding__link {
  display: flex;
  align-items: center;
  gap: 18px;
  color: inherit;
  text-decoration: none;
}

.branding__logo {
  flex: none;
  width: 56px;
  height: 64px;
  padding: 3px;
  border: 1px solid var(--mist);
  background: var(--paper-lift);
  object-fit: cover;
  /* Tint the portrait towards the engraving blue. */
  filter: grayscale(1) sepia(0.2) hue-rotate(185deg) saturate(1.6) contrast(1.05);
}

.branding__name {
  display: block;
  color: var(--deep);
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
}

.branding__slogan {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.3;
}

.branding__link:hover .branding__name {
  color: var(--ink);
}

/* Main navigation. */
.main-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav__link {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  color: var(--deep);
  font-size: 1.15rem;
  text-decoration: none;
}

.main-nav__link:hover {
  border-color: var(--mist);
  color: var(--deep);
}

.main-nav__link.is-active-trail {
  border-color: var(--ink);
  color: var(--ink);
}

.nav-toggle {
  padding: 4px 16px;
  border: 1px solid var(--mist);
  border-radius: 999px;
  background: var(--paper-lift);
  color: var(--deep);
  cursor: pointer;
}

.nav-toggle[aria-expanded="true"] {
  border-color: var(--ink);
  color: var(--ink);
}

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

@media (max-width: 899px) {
  .site-header__inner {
    align-items: center;
  }

  .branding__logo {
    width: 40px;
    height: 46px;
  }

  .branding__slogan {
    display: none;
  }

  /* Without JavaScript the navigation simply stays visible. */
  html:not(.no-js) .site-navigation {
    display: none;
  }

  html:not(.no-js) .is-nav-open .site-navigation {
    display: flex;
  }

  .site-navigation {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 8px 0 4px;
  }

  .main-nav__list {
    flex-direction: column;
    gap: 0;
  }

  .main-nav__item + .main-nav__item {
    border-top: 1px solid var(--mist);
  }

  .main-nav__link {
    display: block;
    padding: 8px 0;
    border-bottom: 0;
  }

  .main-nav__link.is-active-trail {
    font-weight: 600;
  }
}

/* Search form in the header. */
.search-block-form form,
.search-form .container-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-block-form .form-item {
  margin: 0;
}

.search-block-form input[type="search"] {
  width: 9em;
  padding-block: 0.15em;
  font-size: 1rem;
}

.search-block-form input[type="submit"] {
  padding: 0.15em 0.9em;
  font-size: 1rem;
}

@media (max-width: 899px) {
  .search-block-form input[type="search"] {
    flex: 1;
    width: auto;
  }
}

/* Page title. */
.page-title {
  margin: 0 0 0.35em;
}

/* Nodes. */
.node__header {
  margin-bottom: 18px;
}

.node__date {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1.1rem;
  font-style: italic;
}

.node__date--full {
  margin: -0.2em 0 1.6em;
  font-size: 1.2rem;
}

.node__title {
  margin: 0;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.08;
}

.node__title a {
  color: inherit;
  text-decoration: none;
}

.node__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.node--teaser + .node--teaser,
.views-row + .views-row {
  margin-top: 56px;
  padding-top: 52px;
  /* A short wave between stories. */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 12'%3E%3Cpath d='M0 4c8 0 8-3 16-3s8 3 16 3 8-3 16-3 8 3 16 3M8 10c6 0 6-2 12-2s6 2 12 2 6-2 12-2 6 2 12 2' fill='none' stroke='%232443A0' stroke-opacity='.6' stroke-width='1'/%3E%3C/svg%3E") left top / 64px 12px no-repeat;
}

.node--unpublished {
  padding: 16px;
  background: #f5e9e3;
}

/* Running text inside nodes and blocks. */
.text-content img {
  padding: 8px;
  border: 1px solid var(--mist);
  background: var(--paper-lift);
}

.text-content img[style*="float: left"],
.text-content img[style*="float:left"] {
  margin: 0.3em 1.2em 0.8em 0 !important;
}

.text-content img[style*="float: right"],
.text-content img[style*="float:right"] {
  margin: 0.3em 0 0.8em 1.2em !important;
}

.text-content figcaption,
.text-content .caption {
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
}

.text-content::after {
  content: "";
  display: table;
  clear: both;
}

/* A drop cap in engraving ink when a full page opens with plain prose. */
.node--full .field--name-body > p:first-child:not(:has(img, a:first-child, strong:first-child, em:first-child, br))::first-letter {
  float: left;
  margin: 0.08em 0.1em 0 0;
  color: var(--ink);
  font-size: 4.6em;
  font-weight: 600;
  line-height: 0.78;
}

.node__links ul,
ul.links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.node__links {
  margin-top: 1em;
  font-style: italic;
}

/* File attachments. */
.field--name-upload {
  margin-top: 1.5em;
  font-size: 1.05rem;
}

/* Sidebar blocks. */
.layout__sidebar .block + .block {
  margin-top: 44px;
}

.layout__sidebar .block__title {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.layout__sidebar .block__content {
  font-size: 1.05rem;
  line-height: 1.45;
}

.layout__sidebar .block__content > :last-child,
.layout__sidebar .block__content p:last-child {
  margin-bottom: 0;
}

.layout__sidebar img {
  height: auto;
}

.layout__sidebar a img {
  border: 1px solid var(--mist);
}

/* Link lists (recent content and similar views). */
.layout__sidebar .item-list ul,
.layout__sidebar .views-element-container ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.layout__sidebar .item-list li,
.layout__sidebar .views-element-container li {
  padding: 9px 0;
  border-top: 1px solid var(--mist);
}

.layout__sidebar .item-list li a,
.layout__sidebar .views-element-container li a {
  color: var(--text);
  text-decoration: none;
}

.layout__sidebar .item-list li a:hover,
.layout__sidebar .views-element-container li a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.layout__sidebar .views-row {
  padding: 9px 0;
  border-top: 1px solid var(--mist);
}

.layout__sidebar .views-row + .views-row {
  margin-top: 0;
  background: none;
}

.layout__sidebar .views-row a {
  color: var(--text);
  text-decoration: none;
}

.layout__sidebar .views-row a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Travelogue: the route through the journey. */
.route {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  padding: 0;
  list-style: none;
  counter-reset: route;
}

.route__step {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--mist);
  counter-increment: route;
}

.route__step::before {
  content: counter(route);
  color: var(--ink);
  font-style: italic;
}

.route__step a {
  color: var(--text);
  text-decoration: none;
}

.route__step a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.route__step.is-current a {
  color: var(--ink);
  font-weight: 600;
}

/* Footer menus. */
.site-footer__name {
  margin: 0;
  color: var(--deep);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
}

.site-footer__dates {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
}

.footer-nav {
  font-size: 1.05rem;
  line-height: 1.6;
}

.footer-nav__title {
  margin: 0 0 4px;
  font-weight: 600;
}

.footer-nav__title a {
  color: var(--deep);
}

.footer-nav__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: var(--text);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Pager. */
.pager {
  margin-top: 64px;
}

.pager__items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager__item a {
  display: inline-block;
  min-width: 2.2em;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
}

.pager__item a:hover {
  border-color: var(--mist);
}

.pager__item.is-active a {
  border-color: var(--ink);
  color: var(--deep);
  font-weight: 600;
}

/* Local tasks (tabs for editors). */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  font-size: 1.05rem;
}

.tabs a {
  display: inline-block;
  padding: 2px 14px;
  border: 1px solid var(--mist);
  border-radius: 999px;
  background: var(--paper-lift);
  text-decoration: none;
}

.tabs a.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-lift);
}

.action-links {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

/* Status messages. */
.messages {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--ink);
  background: var(--paper-lift);
}

.messages--error {
  border-color: var(--danger);
}

.messages--warning {
  border-color: #a5741b;
}

/* Comments. */
.comment {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--mist);
}

/* Search results. */
.search-results {
  padding: 0;
  list-style: none;
}

.search-results li {
  margin-bottom: 24px;
}
