/*
Theme Name: Alpenblick
Description: Block theme for the Missionshaus Alpenblick in Hemberg SG.
Author: Benjamin Neff
Author URI: https://benjaminneff.ch
Update URI: https://stuff.coding4.coffee/wordpress-alpenblick/
Version: 0.1.5
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alpenblick
*/

/*
 * Colours, fonts, sizes and widths come from theme.json (the tokens of the static draft in
 * assets/css/style.css). This file holds the components, with class names as in the draft
 * where the blocks allow it.
 */

/*
 * Fallback for Trebuchet MS in the heading font (theme.json). Declared here because WordPress
 * names theme.json font faces after the first family of the preset, which is Trebuchet MS.
 * An installed Cabin is used through local() so that it, too, renders the bold face.
 */
@font-face {
  font-family: "Alpenblick Cabin";
  font-style: normal;
  font-weight: 700;
  font-display: fallback;
  src:
    local("Cabin Bold"),
    local("Cabin-Bold"),
    url("assets/fonts/cabin/cabin-bold.woff2") format("woff2");
}

@font-face {
  font-family: "Alpenblick Cabin";
  font-style: italic;
  font-weight: 700;
  font-display: fallback;
  src:
    local("Cabin Bold Italic"),
    local("Cabin-BoldItalic"),
    url("assets/fonts/cabin/cabin-bold-italic.woff2") format("woff2");
}

:root {
  --alpenblick-radius: 14px;
  --alpenblick-radius-sm: 8px;
  --alpenblick-shadow: 0 1px 2px rgb(29 39 33 / 6%), 0 8px 24px rgb(29 39 33 / 8%);
  --alpenblick-gutter: clamp(1rem, 4vw, 2rem);
  --paper: var(--wp--preset--color--paper);
  --surface: var(--wp--preset--color--surface);
  --ink: var(--wp--preset--color--ink);
  --muted: var(--wp--preset--color--muted);
  --line: var(--wp--preset--color--line);
  --forest: var(--wp--preset--color--forest);
  --forest-ink: var(--wp--preset--color--forest-ink);
  --green: var(--wp--preset--color--green);
  --green-soft: var(--wp--preset--color--green-soft);
  --sky: var(--wp--preset--color--sky);
  --warm: var(--wp--preset--color--warm);
  --warm-soft: var(--wp--preset--color--warm-soft);

  /*
   * The typeface of the house's logo. Its licence forbids embedding, so systems without it get
   * Cabin, bold only (theme/assets/fonts/cabin/); browsers fetch it only when they need it.
   */
  --heading-font: var(--wp--preset--font-family--heading);
}

html {
  font-size: 112.5%;
  scroll-behavior: smooth;

  /* Keeps anchor targets clear of the sticky header; update if the header grows. */
  scroll-padding-top: 5.5rem;
}

[hidden] {
  display: none !important;
}

a {
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

/* Green on forest green is too faint (about 2.4:1); light bands keep the green ring. */
:is(.hero, .facts, .callout, .quote-band) :focus-visible {
  outline-color: var(--forest-ink);
}

h1,
h2,
h3 {
  text-wrap: balance;
}

h1,
h2,
h3,
h4 {
  margin-block: 0 0.5em;
}

p {
  margin-block: 0 1em;
}

/* Header, main and footer sit flush; the block gap only spaces content. */
.wp-site-blocks > * {
  margin-block-start: 0;
}

.site-main {
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

.site-main:has(
  .wp-block-post-content > .alignfull:last-child,
  .wp-block-post-content > .alignfull + p:empty:last-child
) {
  padding-bottom: 0;
}

.site-main > :last-child,
.site-main .wp-block-post-content > :last-child {
  margin-bottom: 0;
}

/*
 * Header: WordPress wraps the part in <header class="wp-block-template-part">. An element only
 * sticks within its parent, so the wrapper is the one that has to be sticky.
 */
.wp-block-template-part:has(> .site-header) {
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header {
  position: relative;
  border-bottom: 1px solid var(--line);
}

/*
 * The blur sits on a pseudo-element: backdrop-filter on the header itself would make it the
 * containing block of the fixed mobile menu overlay and squeeze the overlay into the header.
 */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(250 248 243 / 92%);
  backdrop-filter: blur(10px);
}

.admin-bar .wp-block-template-part:has(> .site-header) {
  top: var(--wp-admin--admin-bar--height, 0);
}

.site-header-inner {
  gap: 1.5rem;
  min-height: 4.5rem;
}

.site-header-inner > .brand {
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--heading-font);
  line-height: 1;
}

.brand-kicker {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 0.25em;

  /* Shrinks only below about 360 px or with enlarged text, so the menu button stays on screen. */
  font-size: min(1.55rem, 7.8vw);
  font-style: italic;
  font-weight: 600;
}

.brand svg {
  width: auto;
  height: 0.53em;
  color: var(--green);
  flex: none;
}

/* Navigation (core/navigation with its mobile overlay) */
.site-nav {
  font-size: 0.95rem;
}

.site-nav .wp-block-navigation-item__content {
  display: block;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}

.site-nav .wp-block-navigation-item__content:hover {
  background: var(--green-soft);
  color: var(--forest);
}

.site-nav .current-menu-item > .wp-block-navigation-item__content,
.site-nav .wp-block-navigation-item__content[aria-current],
.site-nav
  .wp-block-navigation__responsive-container:not(.is-menu-open)
  .current-menu-ancestor
  > .wp-block-navigation-item__content {
  color: var(--forest);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--green);
  border-radius: 0;
}

.site-nav .wp-block-navigation__submenu-container {
  border: 1px solid var(--line) !important;
  border-radius: var(--alpenblick-radius-sm);
  box-shadow: var(--alpenblick-shadow);
  padding: 0.4rem;
}

.site-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  border-radius: var(--alpenblick-radius-sm);
}

.site-nav .wp-block-navigation__responsive-container-open,
.site-nav .wp-block-navigation__responsive-container-close {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}

/*
 * Core shows the overlay toggle below 600px only. When the full menu no longer fits on one line,
 * the toggle (which opens the complete menu) appears after the items and the trailing top-level
 * items leave the bar in reverse menu order; below 58rem only the toggle remains. The breakpoints
 * follow the width of the current labels measured in Noto Sans (Android, many Linux desktops),
 * one of the widest common system fonts, plus about 4 % spare.
 */
.site-nav .wp-block-navigation__responsive-container-open {
  order: 1;
}

@media (600px <= width < 78rem) {
  .site-nav {
    flex-wrap: nowrap;
  }

  .site-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex;
  }

  .site-nav
    .wp-block-navigation__responsive-container:not(.is-menu-open)
    .wp-block-navigation__container
    > li:nth-child(n + 4) {
    display: none;
  }
}

@media (600px <= width < 66rem) {
  .site-nav
    .wp-block-navigation__responsive-container:not(.is-menu-open)
    .wp-block-navigation__container
    > li:nth-child(n + 3) {
    display: none;
  }
}

@media (600px <= width < 58rem) {
  .site-nav .wp-block-navigation__responsive-container:not(.hidden-by-default, .is-menu-open) {
    display: none;
  }
}

.site-nav .wp-block-navigation__responsive-container.is-menu-open {
  background: var(--paper);
  padding: var(--alpenblick-gutter);
}

.site-nav .is-menu-open .wp-block-navigation__responsive-container-content {
  padding-top: 3.5rem;
}

.site-nav .is-menu-open .wp-block-navigation__container {
  gap: 0.25rem;
  width: 100%;
}

.site-nav .is-menu-open .wp-block-navigation-item {
  width: 100%;
}

.site-nav
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item__content {
  box-sizing: border-box;
  width: 100%;
  padding: 0.85rem 0.5rem;
  border-radius: var(--alpenblick-radius-sm);
  font-size: 1.05rem;
}

.site-nav .is-menu-open .current-menu-item > .wp-block-navigation-item__content {
  border-radius: 0;
  box-shadow: inset 3px 0 0 var(--green);
}

/* The header aligns the menu to the right; in the overlay it reads from the left. */
.site-nav .wp-block-navigation__responsive-container.is-menu-open,
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  --navigation-layout-justification-setting: flex-start;
  --navigation-layout-justify: flex-start;
}

.site-nav
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__responsive-container-content
  .wp-block-navigation__submenu-container {
  border: 0 !important;
  box-shadow: none;
  padding: 0 0 0 1rem;
}

.header-cta .wp-block-button__link {
  padding: 0.6rem 1.2rem;
  white-space: nowrap;
}

/* The header button leads to the contact page; the menu item only shows in the mobile overlay,
   where the button is hidden or covered. */
.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .nav-kontakt {
  display: none;
}

@media (width <= 30rem) {
  .site-header .header-cta {
    display: none;
  }
}

/* Buttons */
.wp-element-button,
.wp-block-button__link {
  border: 2px solid transparent;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.wp-block-button.is-style-ghost .wp-block-button__link {
  border-color: currentcolor;
  background: transparent;
  color: inherit;
}

.wp-block-button.is-style-ghost .wp-block-button__link:hover {
  background: rgb(255 255 255 / 12%);
  color: inherit;
}

.wp-block-button.is-style-outline .wp-block-button__link {
  border-color: var(--forest);
  color: var(--forest);
}

.hero .wp-block-button:not(.is-style-ghost) .wp-block-button__link,
.callout .wp-block-button:not(.is-style-ghost) .wp-block-button__link {
  background: #fff;
  color: var(--forest);
}

.hero .wp-block-button:not(.is-style-ghost) .wp-block-button__link:hover,
.callout .wp-block-button:not(.is-style-ghost) .wp-block-button__link:hover {
  background: var(--green-soft);
}

/* Page intro (pattern «Seitenkopf», page and archive titles) */
.page-intro {
  padding-block: clamp(3rem, 7vw, 5rem) 1rem;
}

.page-intro > p,
.page-intro .lead {
  max-width: 42rem;
}

.lead,
.page-intro > p:not(.eyebrow, .back-link, .meta) {
  font-size: 1.1rem;
  color: var(--muted);
}

.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.back-link {
  margin-bottom: 0.75rem;
}

.back-link a {
  font-weight: 600;
  text-decoration: none;
}

.back-link a::before {
  content: "← ";
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.more-link,
p.more-link a {
  font-weight: 600;
  text-decoration: none;
}

/* The link text may wrap on narrow screens or with large text; the arrow stays with it. */
span.more-link::after,
p.more-link a::after {
  content: "\00a0→";
}

/* Hero (core/cover with the class hero) */
.wp-block-cover.hero {
  min-height: min(82vh, 46rem);
  align-items: flex-end;
  padding: 6rem var(--alpenblick-gutter) 3rem;
}

/* The overlay darkens the text block and leaves the rest of the photo bright. */
.wp-block-cover.hero .wp-block-cover__background {
  background: radial-gradient(
    ellipse 60% 75% at 22% 72%,
    rgb(16 30 21 / 88%) 0%,
    rgb(16 30 21 / 80%) 50%,
    transparent 100%
  ) !important;
}

@media (width < 48rem) {
  .wp-block-cover.hero .wp-block-cover__background {
    background: linear-gradient(
      to top,
      rgb(16 30 21 / 88%) 0%,
      rgb(16 30 21 / 75%) 60%,
      transparent 95%
    ) !important;
  }
}

/* Keeps the text readable over bright spots when the overlay setting is turned down. */
.hero-content :is(h1, p) {
  text-shadow:
    0 2px 4px rgb(0 0 0 / 85%),
    0 0 0.75rem rgb(0 0 0 / 75%),
    0 0 2rem rgb(0 0 0 / 60%);
}

.hero-content > * {
  max-width: 44rem;
}

.hero .eyebrow {
  color: #d9ead0;
}

.hero .lead {
  font-size: 1.2rem;
  color: rgb(255 255 255 / 92%);
  max-width: 36rem;
}

.hero a:not(.wp-element-button) {
  color: #fff;
}

/* Facts strip */
.facts {
  background: var(--forest);
  color: var(--forest-ink);
}

.facts ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem 2rem;
  list-style: none;
  margin-block: 0;
  padding: 1.5rem 0;
}

.facts li {
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
  color: rgb(243 246 241 / 78%);
}

.facts strong {
  font-family: var(--heading-font);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--forest-ink);
}

/* Sections */
.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

/* Full-width bands (sections, hero, facts) bring their own padding and sit flush. */
.wp-block-post-content > .alignfull,
.wp-block-post-content > .alignfull + * {
  margin-block-start: 0;
}

/* The editor adds an empty paragraph as soon as one clicks below the last block; after a
   full-width band it would open a gap above the footer. */
.wp-block-post-content p:empty {
  display: none;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section-head {
  align-items: flex-end;
  gap: 1rem 2rem;
  margin-bottom: 2.25rem;
}

.section-head > .wp-block-group {
  max-width: 40rem;
}

.section-head p:not(.eyebrow, .more-link) {
  color: var(--muted);
  margin: 0;
}

/* Text and image side by side (core/columns with the class split) */
.split {
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.split .wp-block-image:not(.logo) img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--alpenblick-radius);
  box-shadow: var(--alpenblick-shadow);
}

/* Portraits and logos keep their own proportions */
.team .is-style-karte > .wp-block-image img {
  aspect-ratio: 3 / 4;
  object-position: top;
}

/*
 * Job titles such as «Hauswirtschaftsleitung» can be longer than a narrow card; they carry a soft
 * hyphen in the content, and words without one break as a last resort rather than overflow.
 */
.team .card-body p {
  overflow-wrap: break-word;
}

.split .wp-block-image.logo {
  max-width: 20rem;
  margin-inline: auto;
}

.split .wp-block-image.logo img {
  border-radius: 0;
}

/* Cards (block style «Karte» on core/group) */
.wp-block-group.is-style-karte {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--alpenblick-radius);
  overflow: hidden;
}

.wp-block-group.is-style-karte > * {
  margin: 0;
}

.is-style-karte > .wp-block-image img,
.is-style-karte > .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.is-style-karte > .wp-block-image,
.is-style-karte > .wp-block-post-featured-image {
  margin: 0;
}

.is-style-karte > :not(.wp-block-image, .wp-block-post-featured-image, .card-body) {
  padding-inline: 1.35rem;
}

.is-style-karte > :not(.wp-block-image, .wp-block-post-featured-image, .card-body):first-child {
  padding-top: 1.25rem;
}

.is-style-karte > :not(.wp-block-image, .wp-block-post-featured-image, .card-body):last-child {
  padding-bottom: 1.4rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.35rem 1.4rem;
  flex: 1;
}

.card-body > * {
  margin: 0;
}

.card-body p:not(.meta, .more-link) {
  color: var(--muted);
}

.card-body .more-link,
.card-body .wp-block-buttons {
  margin-top: auto;
  padding-top: 0.75rem;
}

.card-body h3 a,
.wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

.card-body h3 a:hover,
.wp-block-post-title a:hover {
  color: var(--forest);
}

.news-list .wp-block-post-template {
  gap: 1.5rem;
}

/* An h2 below the page's h1, sized like the other card titles (h3). */
.news-list .wp-block-post-title {
  font-size: 1.25rem;
}

.news-list .wp-block-post-excerpt__excerpt {
  margin: 0;
}

.wp-block-query-pagination {
  margin-top: 2.5rem;
  gap: 0.5rem;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .current {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.wp-block-query-pagination .current {
  background: var(--forest);
  color: var(--forest-ink);
}

/* Values */
.value {
  padding-top: 1.25rem;
  border-top: 3px solid var(--green);
}

.value p {
  color: var(--muted);
  margin: 0;
}

/* Events (theme/inc/event-blocks.php) */
.event {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--alpenblick-radius);
  padding: 1.25rem;
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 4.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--alpenblick-radius-sm);
  background: var(--green-soft);
  color: var(--forest);
  text-align: center;
  line-height: 1.1;
  align-self: start;
}

.event-date .day {
  font-family: var(--heading-font);
  font-size: 1.8rem;
  font-weight: 600;
}

.event-date .month {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-body {
  min-width: 0;
}

/* Three cards in a row leave about 170 px for the title; long compounds such as
   «Jahresschlussfreizeit» would otherwise break before their last letter. */
.event-body h3 {
  margin-bottom: 0.3rem;
  hyphens: auto;
}

.event-body p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.event-body .meta {
  margin: 0;
}

.event-desc {
  margin-top: 0.4rem;
  color: var(--muted);
}

.event-desc > * + div {
  margin-top: 0.4rem;
}

.event-desc strong {
  font-weight: 600;
  color: var(--ink);
}

.event-desc ul,
.event-desc ol {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.event-actions a {
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--sky);
  color: #24384a;
}

.tag-warm {
  background: var(--warm-soft);
  color: var(--warm);
}

.event:target {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

a.event-link {
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

a.event-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--alpenblick-shadow);
  color: inherit;
}

a.event-link:hover h3 {
  color: var(--forest);
}

.event-link .event-body {
  display: flex;
  flex-direction: column;
}

.event-link .more-link {
  margin-top: auto;
  padding-top: 0.6rem;
  align-self: flex-start;
  color: var(--forest);
}

.event.is-closed {
  background: transparent;
  border-style: dashed;
}

.event.is-closed .event-date {
  background: #eeece6;
  color: var(--muted);
}

.event-list {
  display: grid;
  gap: 1rem;
}

.month-group {
  max-width: 56rem;
}

.month-group + .month-group {
  margin-top: 2.5rem;
}

.month-group > h2 {
  font-size: 1.35rem;
  color: var(--muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

.events-unavailable {
  padding: 0.85rem 1.1rem;
  border-radius: var(--alpenblick-radius-sm);
  background: var(--warm-soft);
  color: var(--warm);
}

@media (width <= 30rem) {
  .event {
    grid-template-columns: 1fr;
  }

  .event-date {
    flex-direction: row;
    gap: 0.4rem;
    min-width: 0;
    justify-self: start;
    padding: 0.35rem 0.75rem;
  }

  .event-date .day {
    font-size: 1.1rem;
  }
}

/* Filter chips (theme/assets/js/events-filter.js) */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.chip {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--green);
}

.chip[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--forest-ink);
}

/* Quote band (core/cover with the class quote-band) */
.wp-block-cover.quote-band {
  text-align: center;
  padding-block: clamp(4rem, 10vw, 7rem);
}

.quote-band .wp-block-quote {
  border: 0;
  margin-inline: auto;
  max-width: 46rem;
  padding: 0;
}

.quote-band .wp-block-quote p {
  font-family: var(--heading-font);
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  line-height: 1.4;
  text-wrap: balance;
}

.quote-band cite {
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d9ead0;
}

/* Callout (pattern «Aufruf») */
.callout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2rem;
  align-items: center;
  background: var(--forest);
  color: var(--forest-ink);
  border-radius: var(--alpenblick-radius);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.callout > * {
  margin: 0;
}

.callout h2 {
  margin-bottom: 0.3rem;
  color: inherit;
}

.callout p {
  margin: 0;
  color: rgb(243 246 241 / 82%);
}

.callout a:not(.wp-element-button) {
  color: #fff;
}

@media (width <= 40rem) {
  .callout {
    grid-template-columns: 1fr;
  }
}

/* Price tables (block style «Preise» on core/table) */
.wp-block-table.is-style-preise {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--alpenblick-radius);
  background: var(--surface);
}

.wp-block-table.is-style-preise table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.wp-block-table.is-style-preise th,
.wp-block-table.is-style-preise td {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.wp-block-table.is-style-preise td {
  white-space: nowrap;
}

.wp-block-table.is-style-preise td:first-child {
  white-space: normal;
}

.wp-block-table.is-style-preise thead {
  border-bottom: 0;
}

.wp-block-table.is-style-preise thead th {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f4f2ec;
}

.wp-block-table.is-style-preise tbody tr:last-child td {
  border-bottom: 0;
}

.wp-block-table.is-style-preise .has-text-align-right {
  text-align: right;
}

.wp-block-table.is-style-preise tbody td[colspan] {
  font-family: var(--heading-font);
  font-weight: 600;
  color: var(--forest);
  background: var(--paper);
}

.wp-block-table.is-style-preise figcaption {
  margin: 0;
  padding: 0.6rem 1.1rem;
  text-align: left;
}

@media (width <= 36rem) {
  .wp-block-table.is-style-preise th,
  .wp-block-table.is-style-preise td {
    padding: 0.7rem 0.6rem;
  }
}

.price-hint {
  max-width: 48rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--alpenblick-radius-sm);
  background: var(--green-soft);
  color: var(--forest);
}

.notes {
  display: grid;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.notes li::before {
  content: "· ";
  color: var(--green);
  font-weight: 700;
}

.amenities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem 2rem;
  list-style: none;
  padding: 0;
}

.amenities li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

.amenities li::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--green);
  transform: translateY(-0.1rem);
}

/* Apartments */
.jump-links {
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.jump-links .wp-block-button__link {
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 400;
}

.jump-links .wp-block-button__link:hover {
  border-color: var(--green);
  background: var(--surface);
  color: var(--forest);
}

.flat-facts {
  font-size: 0.9rem;
  color: var(--muted);
}

.flat-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--alpenblick-radius);
  padding: 1.25rem 1.5rem;
}

.flat-price {
  font-family: var(--heading-font);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--forest);
}

.card-body .flat-price {
  margin-top: auto;
  padding-top: 0.75rem;
}

.flat-price small {
  display: inline-block;
  line-height: 1.5;
  font-family: var(--wp--preset--font-family--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

/*
 * Imported content: long URLs, legacy centred images (core gives `.aligncenter` display: table,
 * which ignores max-width) and fixed-width embeds must not widen the page on phones.
 */
.wp-block-post-content {
  overflow-wrap: break-word;
}

.wp-block-post-content .wp-block-image > figure {
  display: block;
  width: fit-content;
  max-width: 100%;
}

.wp-block-post-content .wp-block-image > figure.aligncenter {
  margin-inline: auto;
}

.wp-block-post-content iframe {
  max-width: 100%;
}

/* Galleries and images */
.wp-block-gallery.has-nested-images figure.wp-block-image img,
.wp-block-image.is-style-rounded img,
.wp-block-image img {
  border-radius: var(--alpenblick-radius-sm);
}

.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image {
  aspect-ratio: 4 / 3;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
  height: 100%;
  object-fit: cover;
}

.post-image img {
  border-radius: var(--alpenblick-radius);
}

/* Every image in a gallery has the same size; a short last row is not stretched. */
.wp-block-gallery.has-nested-images figure.wp-block-image {
  flex-grow: 0;
}

/* Annual programme: cover image linked to the PDF, download button below */
.pdf-card .wp-block-image img {
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: var(--alpenblick-shadow);
}

/* Core makes the link inline-block; with `sizes="auto"` the image would shrink to a thumbnail. */
.pdf-card .wp-block-image a {
  display: block;
}

.pdf-card .wp-block-file {
  justify-content: space-between;
}

/* Editor only: the fields of the block «Jahresprogramm-PDF» */
.alpenblick-programme-pdf-fields {
  margin-top: 1rem;
}

.alpenblick-media-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
}

/* Collapsible sections (core/details), e.g. excursions */
.wp-block-details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--alpenblick-radius);
  padding: 0;
}

.wp-block-details + .wp-block-details {
  margin-top: 0.75rem;
}

.wp-block-details summary {
  padding: 1rem 1.25rem;
  font-family: var(--heading-font);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
}

.wp-block-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.wp-block-details > :not(summary) {
  margin-inline: 1.25rem;
}

.wp-block-details > :last-child {
  margin-bottom: 1.25rem;
}

.wp-block-details h4 {
  margin-top: 0;
}

.wp-block-details .wp-block-separator {
  margin-block: 1.25rem 1rem;
}

.wp-block-separator {
  border: 0;
  border-top: 1px solid var(--line);
}

/* File blocks (annual programme PDFs) */
.wp-block-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--alpenblick-radius);
}

.wp-block-file:not(.wp-element-button) {
  font-size: 1rem;
}

.wp-block-file > a:first-child {
  font-weight: 600;
}

.wp-block-file .wp-block-file__button {
  margin: 0;
  font-size: 0.9rem;
}

/* Contact */
.contact-card .card-body {
  gap: 1rem;
}

.contact-card .wp-block-buttons {
  margin-top: 0.5rem;
}

.contact-card .amenities {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.contact-lines {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.contact-lines a {
  font-weight: 600;
  font-size: 1.05rem;
}

.contact-lines .label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Single news */
.post-single .page-intro {
  padding-bottom: 0;
}

.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  gap: 1rem 2rem;
}

/* Footer */
.site-footer {
  background: #17271d;
  color: #c9d3cc;
  padding-block: 3.5rem 2rem;
  font-size: 0.95rem;
}

.site-footer a {
  color: #fff;
}

.site-footer a:hover {
  color: #b9dba6;
}

.footer-grid {
  gap: 2rem;
}

.site-footer h2 {
  font-family: var(--wp--preset--font-family--sans);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fa596;
  margin-bottom: 0.9rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

/* The link list takes two columns where they fit, and two grid columns from 40rem on. */
.footer-explore {
  container-type: inline-size;
}

@media (width >= 40rem) {
  .footer-explore {
    grid-column: span 2;
  }
}

@container (width >= 22rem) {
  .footer-explore ul {
    display: block;
    columns: 2;
    column-gap: 2rem;
  }

  .footer-explore li {
    break-inside: avoid;
    margin-bottom: 0.4rem;
  }
}

/* The donation accounts get their own row below the other columns. */
.footer-donate {
  grid-column: 1 / -1;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 12%);
}

/* Two equal columns, so the second account lines up with «Entdecken» above. */
.footer-donate-accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: 1rem 2rem;
}

/* The grid gap spaces the accounts; the block gap would push the second one down. */
.footer-donate-accounts > * {
  margin-block-start: 0;
}

.site-footer .footer-donate h3 {
  font-family: var(--wp--preset--font-family--sans);
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.4rem;
}

.footer-donate p {
  margin-bottom: 0.6rem;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 12%);
  gap: 1rem;
  font-size: 0.85rem;
  color: #8fa596;
}

.footer-bottom p {
  margin: 0;
}

.site-footer .footer-links {
  display: flex;
  gap: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
