/*
 * Sankt Matthias Bruderschaft Holzbüttgen — site styles on Bootstrap 5.3.
 *
 * Same identity as since 2018 (red sidebar, seal, EB Garamond wordmark),
 * on one current base instead of the former Bootstrap 3/4 mix. Hand-written,
 * no build step: this file is the source.
 *
 * Fonts are served from the theme (fonts/), not from Google: no visitor
 * data goes to a third party.
 */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-italic-latin.woff2") format("woff2");
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin.woff2") format("woff2");
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/eb-garamond-italic-latin.woff2") format("woff2");
}

:root {
  --smb-red: #990000;
  --smb-red-dark: #6e0000;
  --smb-yellow: #ffcc00;
  --smb-ink: #252321;
  --smb-muted: #6d6863;
  --smb-line: #e7e2dc;
  --smb-paper: #f4f1ed;
  --smb-sidebar: 15rem;
  --smb-serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --smb-sans: Roboto, "Helvetica Neue", Arial, sans-serif;

  --bs-body-font-family: var(--smb-sans);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.7;
  --bs-body-color: var(--smb-ink);
  --bs-link-color: var(--smb-red);
  --bs-link-color-rgb: 153, 0, 0;
  --bs-link-hover-color: var(--smb-red-dark);
  --bs-link-hover-color-rgb: 110, 0, 0;
  --bs-border-color: var(--smb-line);
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--smb-red);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  z-index: 1100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--smb-red);
}

/* ── Header: red bar on small screens, fixed sidebar from 992px ─────────── */

.site-header {
  background: var(--smb-red);
  color: #fff;
}

.site-header :focus-visible {
  outline-color: var(--smb-yellow);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.brand:hover,
.brand:focus {
  color: #fff;
}

.brand__logo {
  width: 3rem;
  height: auto;
  flex: none;
}

.brand__name {
  font-family: var(--smb-serif);
  font-size: 1.15rem;
  line-height: 1.12;
}

.menu-toggle {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border: 0;
  background: transparent;
  color: #fff;
}

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  position: absolute;
  left: 50%;
  width: 1.5rem;
  height: 2px;
  margin-left: -0.75rem;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle__bars {
  top: 50%;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  left: 0;
  margin-left: 0;
}

.menu-toggle__bars::before {
  top: -0.45rem;
}

.menu-toggle__bars::after {
  top: 0.45rem;
}

.menu-toggle:not(.collapsed) .menu-toggle__bars {
  background: transparent;
}

.menu-toggle:not(.collapsed) .menu-toggle__bars::before {
  transform: translateY(0.45rem) rotate(45deg);
}

.menu-toggle:not(.collapsed) .menu-toggle__bars::after {
  transform: translateY(-0.45rem) rotate(-45deg);
}

.site-nav {
  padding: 0 1rem 1rem;
}

.site-nav__list,
.site-nav__sub {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__list {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: 0.5rem;
}

.site-nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__link {
  display: block;
  padding: 0.6rem 0;
  color: #fff;
  font-size: 1rem;
  line-height: 1.35;
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link:focus {
  color: var(--smb-yellow);
}

.site-nav__item--current > .site-nav__link,
.site-nav__item--current > .site-nav__row > .site-nav__link,
.site-nav__item--section > .site-nav__row > .site-nav__link {
  color: var(--smb-yellow);
}

.site-nav__toggle {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border: 0;
  background: transparent;
  color: #fff;
  position: relative;
}

.site-nav__toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.4rem 0 0 -0.25rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.site-nav__toggle.collapsed::before {
  transform: rotate(-45deg);
}

.site-nav__toggle:hover {
  color: var(--smb-yellow);
}

.site-nav__sub {
  margin: 0 0 0.35rem 0.1rem;
  padding-left: 0.9rem;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.site-nav__sub .site-nav__link {
  padding: 0.3rem 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
}

/* ── Main column ─────────────────────────────────────────────────────────── */

.site-main__inner {
  padding: 1.5rem 1.25rem 3rem;
}

.page {
  max-width: 44rem;
}

.page--wide {
  max-width: 76rem;
}

.crumbs .breadcrumb {
  --bs-breadcrumb-margin-bottom: 1.5rem;
  --bs-breadcrumb-divider-color: var(--smb-muted);
  --bs-breadcrumb-item-active-color: var(--smb-muted);
  font-size: 0.875rem;
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.page__header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--smb-line);
}

.page__title {
  margin: 0;
  font-family: var(--smb-serif);
  font-weight: 500;
  font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem);
  line-height: 1.12;
  color: var(--smb-red);
}

.page__back {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.page__hero {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 2rem;
}

/* ── Content written in the CMS ──────────────────────────────────────────── */

.typography h1,
.typography h2,
.typography h3,
.typography h4 {
  margin: 2.25rem 0 0.75rem;
  font-family: var(--smb-serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--smb-red);
}

.typography h1 { font-size: 1.9rem; }
.typography h2 { font-size: 1.6rem; }
.typography h3 { font-size: 1.35rem; }
.typography h4 { font-size: 1.15rem; }

.typography h5,
.typography h6 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.typography > :first-child {
  margin-top: 0;
}

/* Editors' spacer paragraphs (see Page::CleanContent()) and a rule placed
   above everything else: the page header already draws that line. */
.typography .gap {
  height: 0.25rem;
  margin: 0;
}

.typography > .gap:first-child,
.typography > hr:first-child {
  display: none;
}

.typography > hr:first-child + .gap,
.typography > hr:first-child + .gap + * {
  margin-top: 0;
}

.typography p,
.typography ul,
.typography ol,
.typography dl,
.typography table,
.typography blockquote {
  margin-bottom: 1.1rem;
}

.typography strong,
.typography b {
  font-weight: 700;
}

.typography ul {
  list-style: square;
}

.typography li + li {
  margin-top: 0.2rem;
}

.typography blockquote {
  padding-left: 1.25rem;
  border-left: 3px solid var(--smb-line);
  font-style: italic;
}

.typography hr {
  margin: 2rem 0;
  border-color: var(--smb-line);
  opacity: 1;
}

.typography table {
  border-collapse: collapse;
  max-width: 100%;
}

.typography td,
.typography th {
  padding: 0.55rem 1.5rem 0.55rem 0;
  border-bottom: 1px solid var(--smb-line);
  vertical-align: top;
  text-align: left;
}

.typography th {
  font-weight: 700;
}

.typography img {
  max-width: 100%;
  height: auto;
}

.typography img.leftAlone,
.typography img.center {
  display: block;
  margin: 1.5rem 0;
}

.typography img.center {
  margin-left: auto;
  margin-right: auto;
}

.typography .captionImage {
  max-width: 100%;
  margin: 1.5rem 0;
}

.typography .captionImage img {
  margin: 0;
}

.typography .captionImage .caption {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--smb-muted);
}

@media (min-width: 768px) {
  .typography img.left,
  .typography .captionImage.left {
    float: left;
    max-width: 50%;
    margin: 0.35rem 2rem 1rem 0;
  }

  .typography img.right,
  .typography .captionImage.right {
    float: right;
    max-width: 50%;
    margin: 0.35rem 0 1rem 2rem;
  }

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

@media (max-width: 767.98px) {
  /* Wide CMS tables scroll inside the column instead of the whole page. */
  .typography table {
    display: block;
    overflow-x: auto;
  }
}

/* ── Pilgerbericht: author ───────────────────────────────────────────────── */

.author {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--smb-line);
}

.author__photo {
  width: 6rem;
  height: auto;
  flex: none;
}

.author__name {
  display: block;
  font-family: var(--smb-serif);
  font-size: 1.3rem;
  line-height: 1.25;
}

.author__group {
  display: block;
  color: var(--smb-muted);
}

/* ── Photo galleries ─────────────────────────────────────────────────────── */

.gallery-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 2rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-card {
  display: block;
  color: var(--smb-ink);
  text-decoration: none;
}

.gallery-card__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--smb-paper);
  transition: opacity 0.2s ease;
}

.gallery-card__title {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--smb-serif);
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--smb-red);
}

.gallery-card:hover .gallery-card__image {
  opacity: 0.88;
}

.gallery-card:hover .gallery-card__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.gallery-grid__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--smb-paper);
  transition: opacity 0.2s ease;
}

.gallery-grid__item:hover img {
  opacity: 0.85;
}

#blueimp-gallery a {
  color: #fff;
  text-decoration: none;
}

/* ── Forms (login and the like, rendered by SilverStripe core) ───────────── */

.page__form {
  max-width: 26rem;
  margin-top: 1.5rem;
}

.page__form .field {
  margin-bottom: 1.1rem;
}

.page__form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.page__form input[type="text"],
.page__form input[type="email"],
.page__form input[type="password"],
.page__form textarea,
.page__form select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #c9c3bc;
  border-radius: 0.25rem;
  font: inherit;
  color: inherit;
  background: #fff;
}

.page__form input:focus,
.page__form textarea:focus,
.page__form select:focus {
  border-color: var(--smb-red);
  outline: 2px solid var(--smb-red);
  outline-offset: 0;
}

.page__form .checkbox label,
.page__form .field.checkbox label {
  display: inline;
  font-weight: 400;
}

.page__form input[type="submit"],
.page__form button[type="submit"],
.page__form .action {
  padding: 0.6rem 1.4rem;
  border: 0;
  border-radius: 0.25rem;
  background: var(--smb-red);
  color: #fff;
  font: inherit;
  font-weight: 500;
}

.page__form input[type="submit"]:hover,
.page__form button[type="submit"]:hover,
.page__form .action:hover {
  background: var(--smb-red-dark);
}

.page__form .btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1.5rem;
}

.page__form .btn-toolbar p {
  margin: 0;
  font-size: 0.95rem;
}

.page__form .message {
  display: block;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--smb-red);
  background: var(--smb-paper);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--smb-line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--smb-muted);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.site-footer a {
  color: var(--smb-muted);
}

.site-footer a:hover {
  color: var(--smb-red);
}

/* ── From 992px: the red column on the left, as since 2018 ───────────────── */

@media (min-width: 992px) {
  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: var(--smb-sidebar);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  }

  .site-header__bar {
    display: block;
    padding: 2.25rem 1.75rem 0;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .brand__logo {
    width: 7rem;
  }

  .brand__name {
    width: 100%;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    font-size: 1.4rem;
  }

  .menu-toggle {
    display: none;
  }

  /* Always open here; the collapse only matters on small screens. */
  .site-nav.collapse:not(.show) {
    display: block;
  }

  .site-nav {
    padding: 0.75rem 1.75rem 2.5rem;
  }

  .site-nav__list {
    border-top: 0;
    padding-top: 0;
  }

  .site-nav__link {
    padding: 0.42rem 0;
    font-size: 0.95rem;
  }

  .site-main,
  .site-footer {
    margin-left: var(--smb-sidebar);
  }

  .site-main__inner {
    padding: 3rem 4.5rem 4.5rem;
  }

  .site-footer__inner {
    padding: 1.5rem 4.5rem;
  }
}

@media print {
  .site-header,
  .site-footer,
  .crumbs {
    display: none;
  }

  .site-main,
  .site-footer {
    margin-left: 0;
  }
}
