/**
 * @file
 * Page layout: header, reading column with sidebar, footer.
 */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header. */
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px var(--gutter) 18px;
}

/* Wide screens: branding and search on the first row, menu below. */
@media (min-width: 900px) {
  .site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand search"
      "nav nav";
    gap: 22px 32px;
  }

  .site-header__inner > .region--header { grid-area: brand; }
  .site-navigation { display: contents; }
  .region--primary-menu { grid-area: nav; }
  .region--secondary-menu { grid-area: search; }
}

/* A band of fine hatching, like the water line of the engraving. */
.site-header__shore {
  height: 12px;
  margin-inline: max(var(--gutter), calc((100% - 1240px) / 2 + var(--gutter)));
  background: repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 4px);
  opacity: 0.35;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.region--highlighted {
  max-width: 1240px;
  margin: 24px auto 0;
  padding: 0 var(--gutter);
}

/* Main column and sidebar. */
.layout {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px var(--gutter) 96px;
}

.layout__main {
  max-width: var(--measure);
  min-width: 0;
}

.layout__main:focus {
  outline: none;
}

.layout__sidebar {
  margin-top: 72px;
}

@media (min-width: 900px) {
  .layout--with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) minmax(240px, 280px);
    justify-content: space-between;
    gap: 72px;
  }

  .layout__sidebar {
    margin-top: 0;
  }
}

@media (min-width: 900px) and (max-width: 1099px) {
  .layout--with-sidebar {
    gap: 48px;
  }
}

/* Footer: link columns in the sky of the Ohrid engraving. */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: auto;
}

.site-footer__columns {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px var(--gutter) 0;
}

.site-footer__columns > .region {
  display: contents;
}

.site-footer__lake {
  display: block;
  width: 100%;
  height: auto;
  /* Pull the empty sky of the drawing up behind the link columns. */
  margin-top: -8%;
}

@media (max-width: 699px) {
  .site-footer__columns {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__about {
    grid-column: 1 / -1;
  }

  /* On small screens show only the church on its rock. */
  .site-footer__lake {
    height: 360px;
    margin-top: -32px;
    object-fit: cover;
    object-position: 80% bottom;
  }
}

.site-footer__bottom {
  padding: 12px var(--gutter);
  background: var(--deep);
  color: var(--paper);
  font-size: 1rem;
}

.site-footer__bottom a {
  color: inherit;
}

/* Let the menus inside the footer block take their own grid columns. */
.site-footer__columns .block--menu,
.site-footer__columns .block__content {
  display: contents;
}
