/*
Theme Name: Mandre Portal Focus
Theme URI: https://mandre.ch/
Author: Mandre / ChatGPT
Description: Responsive Vollbild-Portal-Theme für mandre.ch. Hintergrundbild steht im Ruhezustand im Vordergrund; beim Hover/Touch über Linkboxen verschwimmt der Hintergrund und die Kacheln kommen nach vorne. Ohne Menüband, ohne sichtbaren Seitentitel.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mandre-portal-focus
*/

:root {
  --mp-bg-image: none;
  --mp-overlay-darkness: .22;
  --mp-hover-blur: 9px;
  --mp-accent: #f07a21;
  --mp-bg: #030303;
  --mp-text: #f7efe4;
  --mp-muted: rgba(247,239,228,.78);
  --mp-card: rgba(9, 10, 10, .34);
  --mp-card-hover: rgba(10, 11, 12, .84);
  --mp-border: rgba(255,255,255,.13);
  --mp-shadow: 0 24px 90px rgba(0,0,0,.64);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #000; }
body.mandre-portal-focus-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--mp-bg);
  color: var(--mp-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.mpf-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%, rgba(96,60,28,.22), transparent 38%),
    radial-gradient(circle at 50% 52%, #19130e 0, #050505 52%, #000 100%);
}

.mpf-background,
.mpf-shade,
.mpf-noise,
.mpf-embers {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.mpf-background {
  z-index: -5;
  background-image: var(--mp-bg-image);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: min(74vw, 880px) auto;
  opacity: 1;
  filter: saturate(1.06) contrast(1.06) brightness(1.02) blur(0);
  transform: scale(1);
  transition:
    filter .55s ease,
    opacity .55s ease,
    transform .8s ease,
    background-size .8s ease;
}

.mpf-stage.is-tile-active .mpf-background {
  opacity: .42;
  filter: saturate(.72) contrast(1.1) brightness(.62) blur(var(--mp-hover-blur));
  transform: scale(1.075);
  background-size: min(82vw, 960px) auto;
}

.mpf-shade {
  z-index: -4;
  background:
    radial-gradient(circle at 50% 45%, rgba(0,0,0,0) 0 32%, rgba(0,0,0,.36) 63%, rgba(0,0,0,.9) 100%),
    linear-gradient(to bottom, rgba(0,0,0,.1), rgba(0,0,0,.15) 45%, rgba(0,0,0,.8));
}
.mpf-shade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,var(--mp-overlay-darkness));
  transition: background .45s ease;
}
.mpf-stage.is-tile-active .mpf-shade::after { background: rgba(0,0,0,.62); }

.mpf-noise {
  z-index: -3;
  opacity: .28;
  mix-blend-mode: overlay;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.028) 0 1px, transparent 1px 8px),
    radial-gradient(circle at 15% 25%, rgba(255, 122, 33, .13), transparent 22%),
    radial-gradient(circle at 82% 64%, rgba(255, 255, 255, .05), transparent 24%);
}

.mpf-embers {
  z-index: -2;
  overflow: hidden;
}
.mpf-embers span {
  position: absolute;
  bottom: -5vh;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #ff8a1a;
  box-shadow: 0 0 14px #ff6a00;
  opacity: 0;
  animation: mpfEmber 9s linear infinite;
}
.mpf-embers span:nth-child(1) { left: 8%; animation-delay: -2s; animation-duration: 10s; }
.mpf-embers span:nth-child(2) { left: 19%; animation-delay: -7s; animation-duration: 13s; }
.mpf-embers span:nth-child(3) { left: 36%; animation-delay: -1s; animation-duration: 11s; }
.mpf-embers span:nth-child(4) { left: 49%; animation-delay: -8s; animation-duration: 14s; }
.mpf-embers span:nth-child(5) { left: 63%; animation-delay: -4s; animation-duration: 10s; }
.mpf-embers span:nth-child(6) { left: 78%; animation-delay: -5s; animation-duration: 12s; }
.mpf-embers span:nth-child(7) { left: 89%; animation-delay: -3s; animation-duration: 11s; }
@keyframes mpfEmber {
  0% { opacity: 0; transform: translate3d(0,0,0) scale(.6); }
  12% { opacity: .55; }
  68% { opacity: .3; }
  100% { opacity: 0; transform: translate3d(36px,-105vh,0) scale(1.5); }
}

.mpf-shell {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100vw - 34px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(28px, 5vw, 66px) 0 clamp(30px, 7vh, 82px);
}

.mpf-hero {
  width: 100%;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.mpf-fallback-panel {
  width: min(720px, 100%);
  padding: 26px;
  border: 1px solid var(--mp-border);
  background: rgba(0,0,0,.66);
  box-shadow: var(--mp-shadow);
  backdrop-filter: blur(14px);
}
.mpf-fallback-panel h2 { margin: 0 0 8px; }
.mpf-fallback-panel p { margin: 0; color: var(--mp-muted); }

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Plugin tiles */
.mpa-tiles-wrap {
  width: 100%;
  display: grid;
  gap: 16px;
}
.mpa-tiles {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 20px);
}
.mpa-tile {
  --tile-accent: #f07a21;
  position: relative;
  min-height: clamp(150px, 18vh, 196px);
  display: grid;
  align-content: end;
  overflow: hidden;
  padding: clamp(16px, 2vw, 22px);
  color: var(--mp-text);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.1);
  background:
    linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.008)),
    rgba(8,8,8,.16);
  box-shadow: 0 12px 38px rgba(0,0,0,.28);
  backdrop-filter: blur(2px);
  opacity: .68;
  transform: translateY(0) scale(1);
  transition:
    transform .28s ease,
    opacity .28s ease,
    border-color .28s ease,
    background .28s ease,
    box-shadow .28s ease,
    backdrop-filter .28s ease;
}
.mpa-tile::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 77% 18%, color-mix(in srgb, var(--tile-accent) 24%, transparent), transparent 40%),
    linear-gradient(140deg, rgba(255,255,255,.05), transparent 50%);
  opacity: .22;
  transition: opacity .28s ease;
}
.mpa-tile::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tile-accent), transparent);
  opacity: .45;
  transition: opacity .28s ease, transform .28s ease;
}
.mpf-stage.is-tile-active .mpa-tile {
  opacity: .54;
  background:
    linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.012)),
    rgba(7,8,9,.44);
  backdrop-filter: blur(10px);
}
.mpa-tile:hover,
.mpa-tile:focus-visible,
.mpa-tile.is-active {
  z-index: 5;
  opacity: 1 !important;
  transform: translateY(-8px) scale(1.025);
  border-color: color-mix(in srgb, var(--tile-accent) 70%, white);
  background:
    linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.035)),
    var(--mp-card-hover);
  box-shadow:
    0 28px 84px rgba(0,0,0,.72),
    0 0 54px color-mix(in srgb, var(--tile-accent) 27%, transparent);
  backdrop-filter: blur(18px);
}
.mpa-tile:hover::before,
.mpa-tile:focus-visible::before,
.mpa-tile.is-active::before { opacity: .58; }
.mpa-tile:hover::after,
.mpa-tile:focus-visible::after,
.mpa-tile.is-active::after { opacity: .88; transform: scaleX(1.04); }

.mpa-logo-box {
  position: absolute;
  inset: 16px 16px auto auto;
  width: clamp(58px, 7vw, 82px);
  height: clamp(58px, 7vw, 82px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 12px 26px rgba(0,0,0,.34);
}
.mpa-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}
.mpa-logo-initials {
  font-size: clamp(1.05rem, 2vw, 1.42rem);
  font-weight: 900;
  letter-spacing: .04em;
  color: #fff5e6;
  text-shadow: 0 0 22px var(--tile-accent);
}
.mpa-tile-title {
  position: relative;
  z-index: 1;
  margin: 0 clamp(74px, 8vw, 98px) 8px 0;
  text-transform: uppercase;
  letter-spacing: .115em;
  font-size: clamp(1rem, 1.45vw, 1.28rem);
  line-height: 1.22;
  text-shadow: 0 8px 28px rgba(0,0,0,.95);
}
.mpa-tile-info {
  position: relative;
  z-index: 1;
  max-width: 86%;
  margin: 0;
  color: var(--mp-muted);
  line-height: 1.52;
  font-size: clamp(.88rem, 1.12vw, .96rem);
  max-height: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: max-height .32s ease, opacity .32s ease, transform .32s ease;
}
.mpa-tile:hover .mpa-tile-info,
.mpa-tile:focus-visible .mpa-tile-info,
.mpa-tile.is-active .mpa-tile-info {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
}
.mpa-tile-url {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: color-mix(in srgb, var(--tile-accent) 70%, white);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .76;
}

.mpa-cookie {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  display: none;
  justify-content: center;
  pointer-events: none;
}
.mpa-cookie.is-visible { display: flex; }
.mpa-cookie-inner {
  width: min(780px, 100%);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 16px 18px;
  color: #f8f2e8;
  background: rgba(8,8,8,.88);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 22px 60px rgba(0,0,0,.56);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}
.mpa-cookie p { margin: 0; color: rgba(255,255,255,.83); line-height: 1.45; }
.mpa-cookie button {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(255,255,255,.2);
  color: #110b05;
  background: linear-gradient(180deg, #ffd899, #f07a21);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 12px 17px;
  cursor: pointer;
}

@media (min-width: 1180px) {
  .mpa-tiles { max-width: 1120px; margin-inline: auto; }
}

@media (max-width: 1100px) {
  .mpf-background { background-size: min(88vw, 820px) auto; }
  .mpa-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mpf-shell { padding-bottom: clamp(28px, 5vh, 58px); }
}

@media (max-width: 780px) {
  .mpf-stage { overflow-y: auto; }
  .mpf-background {
    position: fixed;
    background-position: center 12vh;
    background-size: min(105vw, 620px) auto;
  }
  .mpf-stage.is-tile-active .mpf-background {
    background-size: min(113vw, 700px) auto;
  }
  .mpf-shell {
    width: min(100% - 24px, 720px);
    align-items: flex-start;
    min-height: 100svh;
    padding-top: min(42vh, 360px);
    padding-bottom: 96px;
  }
  .mpa-tiles { grid-template-columns: 1fr; gap: 12px; }
  .mpa-tile {
    min-height: 138px;
    opacity: .78;
  }
  .mpa-tile-title { letter-spacing: .09em; }
  .mpa-tile-info { max-width: 100%; }
  .mpa-cookie-inner { flex-direction: column; align-items: flex-start; }
  .mpa-cookie button { width: 100%; }
}

@media (max-width: 420px) {
  .mpf-background {
    background-position: center 9vh;
    background-size: min(122vw, 520px) auto;
  }
  .mpf-shell { width: calc(100% - 18px); padding-top: 38vh; }
  .mpa-tile { min-height: 128px; padding: 14px; }
  .mpa-logo-box { inset: 12px 12px auto auto; }
  .mpa-tile-title { margin-right: 72px; font-size: 1rem; }
  .mpa-tile-url { font-size: .72rem; }
}

@media (hover: none) and (pointer: coarse) {
  .mpa-tile { opacity: .8; }
  .mpa-tile.is-active { transform: translateY(-4px) scale(1.012); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
