/**
 * Meridian content components for use in body texts (full HTML):
 *
 *   .m-hero          Banner image with title (<div class="m-hero"><img>…<div class="m-hero__text">)
 *   .m-cards         Grid of link cards (.m-card > img + .m-card__body)
 *   .m-gallery       Image grid; <a href="big.jpg"><img src="thumb.jpg" alt=""></a> opens the lightbox
 *   .m-facts         Key facts grid (<dl class="m-facts"><div><dt>…</dt><dd>…</dd></div></dl>)
 *   .m-route         Timeline of stages (<ol class="m-route"><li>…)
 *   .m-btn           Buttons (.m-btn--accent, .m-btn--ghost), .m-actions row
 *   .m-badge         Label ("Zu verkaufen"), .m-callout highlight box, .m-lead intro
 *   .m-price         Price table, .m-split two columns
 */

.m-lead { font-size: 1.15rem; line-height: 1.65; color: var(--m-text); }

/* Hero */
.m-hero { position: relative; margin: 0 0 2rem; border-radius: var(--m-radius); overflow: hidden; box-shadow: var(--m-shadow); background: #0b2238; }
.m-hero img { display: block; width: 100%; height: clamp(220px, 42vw, 460px); object-fit: cover; opacity: .9; }
.m-hero__text { position: absolute; inset: auto 0 0 0; padding: clamp(1rem, 3vw, 2rem); color: #fff; background: linear-gradient(transparent, rgb(5 15 30 / .82)); }
.m-hero__text h2, .m-hero__text p { color: #fff; margin: 0 0 .35rem; text-shadow: 0 1px 3px rgb(0 0 0 / .4); }
.m-hero__text h2 { font-size: clamp(1.35rem, 3.2vw, 2.1rem); line-height: 1.2; }
.m-hero .m-badge { position: absolute; top: 1rem; left: 1rem; }

/* Buttons */
.m-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.m-btn, a.m-btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.3rem;
  border-radius: 999px; background: var(--m-primary); color: var(--m-on-primary) !important;
  font-weight: 600; text-decoration: none !important; border: 2px solid var(--m-primary);
  transition: transform var(--m-speed) var(--m-ease), box-shadow var(--m-speed) var(--m-ease), background var(--m-speed);
}
.m-btn:hover { transform: translateY(-1px); box-shadow: var(--m-shadow); }
.m-btn--accent, a.m-btn--accent { background: var(--m-accent); border-color: var(--m-accent); }
.m-btn--ghost, a.m-btn--ghost { background: transparent; color: var(--m-link) !important; border-color: currentColor; }

/* Badge, callout */
.m-badge { display: inline-block; padding: .3rem .75rem; border-radius: 999px; background: var(--m-accent); color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.m-callout { margin: 1.5rem 0; padding: 1.1rem 1.3rem; border-radius: var(--m-radius); background: var(--m-primary-soft); border-left: 4px solid var(--m-primary); }
.m-callout > :last-child { margin-bottom: 0; }
.m-callout--accent { background: var(--m-accent-soft); border-left-color: var(--m-accent); }

/* Cards */
.m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1.25rem; margin: 1.5rem 0 2rem; padding: 0; list-style: none; }
.m-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--m-radius); background: var(--m-surface); border: 1px solid var(--m-border); box-shadow: var(--m-shadow-sm); transition: transform var(--m-speed) var(--m-ease), box-shadow var(--m-speed) var(--m-ease); }
.m-card:hover { transform: translateY(-3px); box-shadow: var(--m-shadow); }
.m-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin: 0; }
.m-card__body { display: flex; flex: 1; flex-direction: column; gap: .4rem; padding: 1rem 1.1rem 1.15rem; }
.m-card__body h3 { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.m-card__body p { margin: 0; color: var(--m-muted); font-size: .95rem; }
.m-card__more { margin-top: auto !important; padding-top: .4rem; color: var(--m-link) !important; font-weight: 600; }
.m-card a::after { content: ""; position: absolute; inset: 0; }
.m-card a { text-decoration: none; color: inherit; }
.m-card .m-badge { position: absolute; top: .75rem; left: .75rem; z-index: 1; }

/* Gallery */
.m-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 170px), 1fr)); gap: .6rem; margin: 1.25rem 0 2rem; }
.m-gallery a { position: relative; display: block; overflow: hidden; border-radius: calc(var(--m-radius) * .6); background: var(--m-border); }
.m-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; transition: transform .4s var(--m-ease); }
.m-gallery a:hover img, .m-gallery a:focus-visible img { transform: scale(1.06); }
.m-gallery--wide a:first-child { grid-column: span 2; grid-row: span 2; }
.m-gallery--wide a:first-child img { aspect-ratio: auto; height: 100%; }

/* Lightbox (js/content.js) */
.m-lightbox { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: rgb(4 10 18 / .92); opacity: 0; transition: opacity .2s; }
.m-lightbox.is-open { opacity: 1; }
.m-lightbox__figure { margin: 0; max-width: min(94vw, 1500px); text-align: center; }
.m-lightbox__img { display: block; max-width: 100%; max-height: 82vh; margin: 0 auto; border-radius: 6px; box-shadow: 0 20px 60px rgb(0 0 0 / .5); }
.m-lightbox__caption { margin-top: .75rem; color: #dfe7f1; font-size: .95rem; }
.m-lightbox button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.m-lightbox button:hover, .m-lightbox button:focus-visible { background: rgb(255 255 255 / .25); outline: none; }
.m-lightbox__close { top: 1rem; right: 1rem; }
.m-lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.m-lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
.m-lightbox__count { position: absolute; top: 1.35rem; left: 1.25rem; color: #c3cfdc; font-size: .9rem; }

/* Facts */
.m-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .75rem; margin: 1.5rem 0; padding: 0; }
.m-facts > div { padding: .85rem 1rem; border-radius: calc(var(--m-radius) * .7); background: var(--m-surface); border: 1px solid var(--m-border); }
.m-facts dt { margin: 0; color: var(--m-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.m-facts dd { margin: .2rem 0 0; font-size: 1.15rem; font-weight: 700; color: var(--m-text); }

/* Route timeline */
.m-route { position: relative; margin: 1.5rem 0 2rem; padding: 0; list-style: none; counter-reset: none; }
.m-route li { position: relative; margin: 0; padding: 0 0 1.25rem 2.6rem; }
.m-route li::before { content: ""; position: absolute; left: .82rem; top: 1.9rem; bottom: 0; width: 2px; background: var(--m-border); }
.m-route li:last-child::before { display: none; }
.m-route__day { position: absolute; left: 0; top: .1rem; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--m-primary); color: #fff; font-size: .8rem; font-weight: 700; }
.m-route__buffer .m-route__day { background: var(--m-accent); }
.m-route h4 { margin: 0 0 .2rem; font-size: 1.02rem; }
.m-route h4 small { color: var(--m-muted); font-weight: 500; }
.m-route p { margin: 0; color: var(--m-muted); }

/* Price table, two columns */
.m-price { width: 100%; margin: 1rem 0 1.5rem; border-collapse: separate; border-spacing: 0; border: 1px solid var(--m-border); border-radius: calc(var(--m-radius) * .7); overflow: hidden; }
.m-price th, .m-price td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--m-border); }
.m-price thead th { background: var(--m-primary-soft); font-size: .9rem; }
.m-price tr:last-child td { border-bottom: 0; }
.m-price del { color: var(--m-muted); font-weight: 400; margin-left: .35rem; }
.m-price strong { color: var(--m-accent); }
.m-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.m-split > * { min-width: 0; }
.m-checks { padding: 0; list-style: none; }
.m-checks li { position: relative; margin: 0 0 .5rem; padding-left: 1.7rem; }
.m-checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--m-primary); font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .m-card, .m-gallery img, .m-btn, .m-lightbox { transition: none; }
}

/* Book navigation (templates/navigation/book-navigation.html.twig) */
.m-booknav { margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--m-border); }
.m-booknav__title { margin: 0 0 .6rem; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--m-muted); }
.m-booknav__tree ul { margin: 0 0 1.5rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.m-booknav__tree ul ul { display: none; }
.m-booknav__tree a { display: inline-block; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--m-border); background: var(--m-surface); text-decoration: none; color: var(--m-text); font-size: .92rem; }
.m-booknav__tree a:hover, .m-booknav__tree a.is-active { border-color: var(--m-primary); color: var(--m-link); }
.m-booknav__pager { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.m-booknav__pager a { display: flex; flex-direction: column; gap: .15rem; height: 100%; padding: .85rem 1rem; border-radius: calc(var(--m-radius) * .7); border: 1px solid var(--m-border); background: var(--m-surface); text-decoration: none; color: var(--m-text); transition: border-color var(--m-speed), box-shadow var(--m-speed); }
.m-booknav__pager a:hover { border-color: var(--m-primary); box-shadow: var(--m-shadow-sm); }
.m-booknav__pager small { color: var(--m-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.m-booknav__pager span { font-weight: 600; color: var(--m-link); }
.m-booknav__up { text-align: center; }
.m-booknav__next { text-align: right; }

/* Two wide cards side by side (e.g. front page teaser): image left, text right. */
.m-cards--duo { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); margin: 0; }
.m-cards--duo .m-card { flex-direction: row; }
.m-cards--duo .m-card img { flex: 0 0 44%; width: 44%; aspect-ratio: auto; height: auto; min-height: 210px; }
.m-cards--duo .m-card__body { padding: 1.1rem 1.25rem 1.2rem; justify-content: center; }
.m-card__kicker { margin: 0 !important; color: var(--m-accent) !important; font-size: .78rem !important; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 560px) {
  .m-cards--duo .m-card { flex-direction: column; }
  .m-cards--duo .m-card img { width: 100%; flex-basis: auto; aspect-ratio: 3 / 2; min-height: 0; }
}
