/*
 * Die Murmel – Spiele und Verspieltes
 * Responsive re-make of the old layout: marble background, cream header with
 * the red logo, colourful hand-written menu, wavy edges, red footer.
 */

/* Hand-lettered font, close to the menu images of the old site. */
@font-face {
  font-family: "Griffy";
  src: url(../fonts/griffy.woff2) format("woff2");
  font-display: swap;
}

:root {
  --cream: #fdefae;
  --red: #e20916;
  --red-dark: #b8000c;
  --yellow: #ffe14d;
  --ink: #3b3b3b;
  --hand: "Griffy", "Comic Sans MS", cursive;
  --menu: var(--hand);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream) url(../sites/default/themes/die_murmel/images/background.png);
  color: var(--ink);
  font: 1rem/1.65 var(--sans);
}

img { max-width: 100%; height: auto; }
a { color: var(--red); text-underline-offset: .15em; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid #2f76d8; outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ------------------------------------------------------------ page frame */

.page {
  max-width: 1100px;
  margin: clamp(0px, 6vw, 70px) auto;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 3px rgb(0 0 0 / .85), 0 14px 40px rgb(80 40 0 / .35);
}

/* ------------------------------------------------------------ header */

.top {
  position: relative;
  background: var(--cream);
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  min-height: 130px;
  padding: 12px 24px 0 12px;
}

.logo { display: block; position: relative; z-index: 3; margin-bottom: -60px; align-self: start; }
.logo img { display: block; width: 175px; filter: drop-shadow(0 4px 8px rgb(0 0 0 / .25)); transition: transform .3s; }
.logo:hover img { transform: rotate(-6deg) scale(1.03); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: space-around; gap: .2rem .6rem; }
.nav a {
  display: block;
  padding: .3rem .55rem;
  font: 1.6rem/1.2 var(--menu);
  color: var(--c, var(--red));
  -webkit-text-stroke: .6px currentColor;  /* a little bolder, like the old menu images */
  text-decoration: none;
  border-radius: 999px;
  transition: transform .2s, background .2s;
}
.nav a:hover, .nav a:focus-visible { transform: translateY(-2px) rotate(-2deg); background: rgb(255 255 255 / .6); }
.nav a.is-active::before { content: "•"; margin-right: .25em; }

/* ------------------------------------------------------------ main with waves */

.main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 460px;
}
.no-photo .main { grid-template-columns: minmax(0, 1fr); }

.wave { position: absolute; left: 0; width: 100%; height: clamp(28px, 4vw, 48px); z-index: 2; pointer-events: none; }
.wave--top { top: -1px; fill: var(--cream); }
.wave--bottom { bottom: -1px; fill: var(--red); }

.text { padding: clamp(56px, 7vw, 80px) clamp(20px, 3.5vw, 44px) clamp(56px, 7vw, 80px) clamp(20px, 3.5vw, 30px); }
.has-photo .text { padding-left: clamp(20px, 3.5vw, 30px); }
.no-photo .text { max-width: 52rem; margin: 0 auto; padding-left: clamp(20px, 4vw, 48px); padding-right: clamp(20px, 4vw, 48px); }

h1, h2, h3 { font-family: var(--hand); color: var(--red); font-weight: 400; line-height: 1.2; -webkit-text-stroke: .5px currentColor; letter-spacing: .01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.3rem); margin: 0 0 .6em; }
h2 { font-size: 1.45rem; margin: 1.4em 0 .4em; }
h3 { font-size: 1.2rem; }
.red { color: var(--red); }

.photo { margin: 0; position: relative; overflow: hidden; background: var(--cream); }
.photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.photo img.on { opacity: 1; }

/* ------------------------------------------------------------ content bits */

.center { text-align: center; }
.text table { margin: .4rem auto; border-collapse: collapse; }
.text td { padding: .1rem .6rem; }
.text td:first-child { text-align: right; font-weight: 600; }
.map-link { margin-top: 1.4rem; text-align: center; }
.map-link a { display: inline-flex; align-items: center; gap: 1rem; padding: .6rem 1rem; border-radius: 14px; background: var(--cream); text-decoration: none; font-family: var(--hand); font-size: 1.2rem; }
.map-link img { border-radius: 8px; width: 120px; }

/* Spieletipp */
.views-row::after { content: ""; display: block; clear: both; }
.views-field-field-tipp-fid img { float: left; margin: .2rem 1.1rem .6rem 0; border-radius: 6px; box-shadow: 2px 3px 10px rgb(0 0 0 / .25); }
.pager { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; justify-content: center; align-items: center; gap: .8rem; font-family: var(--hand); font-size: 1.15rem; }
.pager a { display: inline-block; min-width: 2.4rem; text-align: center; padding: .15rem .7rem; border-radius: 999px; background: var(--cream); text-decoration: none; }
.pager a:hover { background: var(--red); color: #fff; }
.pager li:empty { display: none; }

/* Team detail page */
.no-photo .text img { border-radius: 10px; }

.credits { margin-top: 2rem; font-size: .88rem; opacity: .85; }
.stand { margin-top: 2rem; font-size: .9rem; opacity: .8; }
.text ul, .main ul { padding-left: 1.3rem; }

/* ------------------------------------------------------------ footer */

.foot {
  background: var(--red);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .5rem 1.5rem;
  align-items: center;
  padding: 1rem clamp(20px, 3vw, 32px) 1.3rem;
  font-size: .92rem;
}
.foot p { margin: 0; }
.foot a { color: #fff; }
.foot__links { font: 1.35rem var(--menu); -webkit-text-stroke: .4px currentColor; }
.foot__links a { color: var(--yellow); text-decoration: none; }
.foot__links a:hover { text-decoration: underline; color: #fff; }
.foot__hours { text-align: right; }

/* ------------------------------------------------------------ marbles following the mouse */

.marbles img { position: absolute; width: 40px; height: 40px; left: 0; top: 0; will-change: transform; pointer-events: none; z-index: 20; }
@media (hover: none), (prefers-reduced-motion: reduce) { .marbles { display: none; } }

/* ------------------------------------------------------------ small screens */

@media (max-width: 820px) {
  .page { border-radius: 0; margin: 0; box-shadow: none; }
  .top { grid-template-columns: 1fr; justify-items: center; padding: 14px 12px 6px; min-height: 0; }
  .logo { margin: 0; }
  .logo img { width: 120px; }
  .nav ul { justify-content: center; }
  .nav a { font-size: 1.4rem; padding: .25rem .5rem; }

  .main, .has-photo .main { grid-template-columns: 1fr; min-height: 0; }
  .photo { order: -1; aspect-ratio: 4 / 3; }
  .has-photo .text { padding-top: 1.6rem; }
  .has-photo .wave--top { top: -1px; }

  .foot { grid-template-columns: 1fr; text-align: center; }
  .foot__hours { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  body { background: #fff; }
  .page { box-shadow: none; margin: 0; }
  .nav, .wave, .photo, .marbles { display: none; }
  .main { display: block; }
  .foot { background: #fff; color: #000; }
  .foot a, .foot__links a { color: #000; }
}
