/*
Theme Name: Wolfsmonitoring
Theme URI: https://wolfsmanagement.de
Author: Michael Ohlhoff
Description: Block-Theme für wolfsmanagement.de – Wolfsmonitoring, Konfliktmanagement, Veröffentlichungen. Schriften lokal eingebunden (DSGVO).
Version: 1.6.1
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: wolfsmonitoring
*/

/* ---------- Bereiche ---------- */
.wm-dark { background: var(--wp--preset--color--dunkel); color: var(--wp--preset--color--hell); }
.wm-dark a:where(:not(.wp-element-button)) { color: #fff; }
.wm-white { background: #fff; border-top: 1px solid var(--wp--preset--color--linie); border-bottom: 1px solid var(--wp--preset--color--linie); }
.wm-sage { background: var(--wp--preset--color--salbei); }

.wm-section { padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(48px, 7vw, 80px); }

.wm-kicker { font-size: 0.82rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--wp--preset--color--gruen); margin-bottom: .25rem; }
.wm-dark .wm-kicker { color: var(--wp--preset--color--salbei-dunkel); }
.wm-muted { color: var(--wp--preset--color--grau); }
.wm-dark .wm-muted { color: #D5DDD9; }

/* ---------- Hero ---------- */
.wm-hero { gap: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; align-items: stretch !important; }
.wm-hero > .wp-block-column:first-child { padding: clamp(40px, 6vw, 80px) clamp(16px, 4vw, 56px) clamp(40px, 6vw, 80px) 0; align-self: center; }
.wm-hero h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 2.9rem); line-height: 1.15; }
.wm-hero-img { margin: 0 !important; height: 100%; }
.wm-hero-img img { width: 100%; height: 100%; min-height: 420px; max-height: 640px; object-fit: cover; object-position: 50% 40%; display: block; }
.wm-hero-img figcaption { font-size: 12px; color: #A9B5B0; margin: 4px 0 8px; text-align: right; }
@media (max-width: 781px) {
  .wm-hero > .wp-block-column:first-child { padding-right: 0; }
}

/* ---------- Qualifikationen ---------- */
.wm-quali { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.wm-quali li { border-top: 2px solid var(--wp--preset--color--gruen); padding-top: 12px; color: var(--wp--preset--color--grau); font-size: .95rem; }
.wm-quali li strong { display: block; color: var(--wp--preset--color--dunkel); font-size: 1.05rem; }

/* ---------- Karten ---------- */
.wm-cards { gap: 24px !important; align-items: stretch !important; }
.wm-card { background: #fff; border: 1px solid var(--wp--preset--color--linie); padding: 24px; box-sizing: border-box; }
.wm-card h3 { margin-top: 0; }

/* ---------- Publikationsliste ---------- */
.wp-block-group > .wm-pub { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
.wm-pub { border-top: 1px solid var(--wp--preset--color--linie); padding: 18px 0; gap: 8px 24px !important; }
.wm-pub:last-child { border-bottom: 1px solid var(--wp--preset--color--linie); }
.wm-pub p { margin: 0; }
.wm-pub .wm-pub-title { font-weight: 600; font-size: 1.08rem; }
.wm-pub .wm-pub-ref { color: var(--wp--preset--color--grau); font-size: .95rem; }
.wm-pub .wp-block-buttons { flex-shrink: 0; }
.wm-pub .wp-block-button__link { padding: 6px 16px; font-size: .9rem; }

/* ---------- Bilder ---------- */
.wm-photo img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; display: block; }
.wm-photo figcaption { font-size: 13px; color: var(--wp--preset--color--grau); }
.wm-cover-placeholder { background: var(--wp--preset--color--salbei); border: 1px solid var(--wp--preset--color--linie); aspect-ratio: 5 / 7; display: flex; align-items: center; justify-content: center; color: var(--wp--preset--color--grau); }

/* ---------- Header / Footer ---------- */
.wm-header { border-bottom: 1px solid var(--wp--preset--color--linie); background: #fff; }
.wm-header .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--dunkel); }
.wm-header .wp-block-site-tagline { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--grau); margin: 0; }
.wm-header .wp-block-navigation a { text-decoration: none; }
.wm-header .wp-block-navigation .current-menu-item > a { font-weight: 600; }
.wm-footer { font-size: .92rem; }
.wm-footer p { margin: 0; }
.wm-footer a { color: #fff; }
.wm-footer .wm-copy { border-top: 1px solid #34413C; color: #A9B5B0; font-size: .85rem; padding-top: 16px; margin-top: 32px; }

/* Polylang Sprachumschalter */
.wm-header .lang-item { list-style: none; display: inline; }
.wm-header .lang-item + .lang-item::before { content: "|"; margin: 0 6px; color: var(--wp--preset--color--grau); }
.wm-header .current-lang a { font-weight: 600; }

/* =========================================================
   Feinschliff 1.1
   ========================================================= */

/* Abstand Inhalt/Footer */
.wp-site-blocks > footer, .wp-site-blocks > .wp-block-template-part:last-child { margin-block-start: 0 !important; }
.wp-site-blocks > main { margin-block-start: 0 !important; }

/* Header etwas ruhiger */
/* Kopfzeile bleibt beim Scrollen oben stehen (sticky am äußeren <header>-Element, sonst wirkt es nicht) */
header.wp-block-template-part { position: sticky; top: 0; z-index: 100; }
.admin-bar header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar header.wp-block-template-part { top: 46px; } }
@media (max-width: 600px) { .admin-bar header.wp-block-template-part { top: 0; } }
html { scroll-padding-top: 110px; }
.wm-header .wp-block-navigation-item__content { padding: 6px 2px; border-bottom: 2px solid transparent; }
.wm-header .wp-block-navigation-item__content:hover,
.wm-header .current-menu-item > .wp-block-navigation-item__content { border-bottom-color: var(--wp--preset--color--gruen); }

/* Kicker mit Linie */
.wm-kicker::before { content: ""; display: inline-block; width: 28px; height: 2px; background: currentColor; vertical-align: middle; margin: -2px 10px 0 0; }

/* Hero */
.wm-hero > .wp-block-column:first-child { padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(56px, 8vw, 112px); }
.wm-hero h1 { font-size: clamp(2.1rem, 1.1rem + 3vw, 3.3rem); letter-spacing: -0.01em; margin: .4rem 0 1.2rem; }
.wm-hero .has-large-font-size { max-width: 30em; }
.wm-hero-img img { min-height: 520px; max-height: 720px; object-position: 50% 18%; filter: contrast(1.05); }
.wm-hero-img { position: relative; }
.wm-hero-img figcaption { position: absolute; right: 0; bottom: 0; margin: 0; padding: 4px 10px; background: rgba(27,36,33,.7); color: #D5DDD9; }
@media (max-width: 781px) {
  .wm-hero-img img { min-height: 0; max-height: 520px; aspect-ratio: 4 / 5; }
}

/* Qualifikationen */
.wm-quali li { border-top-width: 3px; padding-top: 14px; line-height: 1.45; }
.wm-quali li strong { font-family: var(--wp--preset--font-family--serif); font-size: 1.2rem; margin-bottom: 4px; }

/* Themen-Karten mit Nummer */
.wm-cards { counter-reset: wmcard; }
.wm-card { position: relative; padding: 32px 28px 28px; border-top: 3px solid var(--wp--preset--color--gruen); transition: transform .2s ease, box-shadow .2s ease; }
.wm-card::before { counter-increment: wmcard; content: "0" counter(wmcard); display: block; font-family: var(--wp--preset--font-family--serif); font-size: 2.4rem; line-height: 1; color: var(--wp--preset--color--salbei-dunkel); margin-bottom: 18px; }
.wm-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(27,36,33,.08); }

/* Publikationsliste: Button bleibt rechts */
@media (min-width: 700px) {
  .wm-pub { flex-wrap: nowrap !important; align-items: center !important; }
  .wm-pub > .wp-block-group:first-child { flex: 1 1 auto; min-width: 0; }
}
.wm-pub { transition: background-color .15s ease; }

/* Fotos */
.wm-photo img { box-shadow: 0 12px 30px rgba(27,36,33,.12); }

/* Video */
.wm-video { box-shadow: 0 12px 30px rgba(27,36,33,.12); }

@media (prefers-reduced-motion: reduce) { .wm-card, .wm-pub { transition: none; } .wm-card:hover { transform: none; } }

/* Veranstaltung */
.wm-event { border-top: 4px solid var(--wp--preset--color--gruen); }
.wm-event-date { font-family: var(--wp--preset--font-family--serif); font-weight: 600; font-size: clamp(2.4rem, 1.4rem + 3vw, 3.6rem); line-height: 1.05; margin: .3rem 0 .6rem; color: #fff; }
.wm-topics { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: flex; flex-wrap: wrap; gap: 8px; }
.wm-topics li { border: 1px solid rgba(169,194,184,.55); padding: 6px 12px; border-radius: 999px; font-size: .9rem; color: #E6EBE7; }
.wm-event .wm-facts { font-size: .98rem; color: #D5DDD9; }
.wm-event .wm-facts strong { color: #fff; }

/* Hero 1.1.1: Bild bündig mit Textblock */
.wm-hero > .wp-block-column:last-child { padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(56px, 8vw, 112px); display: flex; }
.wm-hero > .wp-block-column:first-child { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.wm-hero-img { flex: 1 1 auto; display: flex; }
.wm-hero-img img { min-height: 0 !important; max-height: none !important; height: 100%; width: 100%; object-position: 50% 20%; }
@media (max-width: 781px) {
  .wm-hero > .wp-block-column:last-child { padding-top: 0; }
  .wm-hero-img img { aspect-ratio: 4 / 5; height: auto; max-height: 480px !important; }
}

/* Abstracts 1.1.2 */
.wm-pub .wm-abstract { margin-top: 6px; font-size: .95rem; color: var(--wp--preset--color--grau); max-width: 46rem; }
.wm-pub .wm-abstract summary { cursor: pointer; font-weight: 600; color: var(--wp--preset--color--gruen); font-size: .9rem; }
.wm-pub .wm-abstract p { margin: .55em 0 0; line-height: 1.55; }
.wm-pub .wm-abstract[open] { padding-bottom: 6px; }

/* Logo im Kopfbereich */
.wm-logo { display: block; line-height: 0; }
.wm-logo img { height: 64px; width: auto; display: block; }
@media (max-width: 600px) { .wm-logo img { height: 48px; } }

/* =========================================================
   1.6 – Zitierhilfe, Filter, Nach-oben-Pfeil
   ========================================================= */
.wp-block-post-content [hidden] { display: none !important; }

/* Nach oben */
.wm-totop { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--wp--preset--color--linie); background: #fff; color: var(--wp--preset--color--gruen); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 10px rgba(27,36,33,.12); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.wm-totop.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.wm-totop:hover { background: var(--wp--preset--color--gruen); color: #fff; }
.wm-totop:focus-visible { outline: 2px solid var(--wp--preset--color--gruen); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .wm-totop { transition: none; } }

/* Filter */
.wm-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 32px; }
.wm-filter button { font: inherit; font-size: .85rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--wp--preset--color--linie); background: #fff; color: var(--wp--preset--color--dunkel); cursor: pointer; }
.wm-filter button:hover { border-color: var(--wp--preset--color--gruen); }
.wm-filter button[aria-pressed="true"] { background: var(--wp--preset--color--gruen); border-color: var(--wp--preset--color--gruen); color: #fff; }

/* Zitierhilfe */
.wm-cite { position: relative; }
.wm-cite > summary { list-style: none; cursor: pointer; font-size: .85rem; padding: .55em 1em; border: 1px solid var(--wp--preset--color--linie); color: var(--wp--preset--color--grau); white-space: nowrap; }
.wm-cite > summary::-webkit-details-marker { display: none; }
.wm-cite > summary:hover, .wm-cite[open] > summary { border-color: var(--wp--preset--color--gruen); color: var(--wp--preset--color--gruen); }
.wm-cite-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 210px; background: #fff; border: 1px solid var(--wp--preset--color--linie); box-shadow: 0 6px 20px rgba(27,36,33,.12); display: flex; flex-direction: column; }
.wm-cite-menu button { font: inherit; font-size: .88rem; text-align: left; padding: 9px 14px; background: none; border: 0; border-bottom: 1px solid var(--wp--preset--color--hell); cursor: pointer; color: var(--wp--preset--color--dunkel); }
.wm-cite-menu button:last-child { border-bottom: 0; }
.wm-cite-menu button:hover { background: var(--wp--preset--color--hell); color: var(--wp--preset--color--gruen); }
.wm-cite-wrap { align-self: flex-start; }
.wm-pub .wp-block-buttons { gap: 8px; align-items: center; }
