/* KG Rüthen brand layer on top of Kadence. Fonts are self-hosted (SIL OFL, see assets/fonts). */

@font-face {
  font-family: "Lilita One";
  src: url("../fonts/lilita-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --global-heading-font-family: "Lilita One", system-ui, sans-serif;
  --global-body-font-family: "Nunito", system-ui, sans-serif;
  --kg-radius: 18px;
}

body {
  font-family: var(--global-body-font-family);
}

/* Unboxed layouts (inc/kadence.php): Kadence paints the whole .site with the white content
   background. Keep the paper instead, so text sits on paper like the homepage bands. */
body.content-style-unboxed .site {
  background: var(--global-palette8);
}

/* Lilita One ships one weight; stop the browser from faking bold. */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--global-heading-font-family);
  font-weight: 400;
  /* Long German compounds ("Jahreshauptversammlung") hyphenate instead of breaking mid-word. */
  hyphens: auto;
  overflow-wrap: break-word;
}

/* Chunky, playful buttons with a pressed-paper shadow. */
.wp-block-button__link,
.kb-button,
.button {
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--global-palette2);
  transition: transform 0.15s ease;
}

.wp-block-button__link:hover,
.kb-button:hover,
.button:hover {
  transform: translateY(-2px) rotate(-1deg);
}

/* Header: the long club name sits on two short lines so the menu fits on one row. */
.site-branding .site-title {
  max-width: 12em;
  line-height: 1.15;
  font-family: var(--global-heading-font-family);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.site-header .custom-logo {
  background: var(--global-palette9);
  border-radius: 10px;
  padding: 3px;
  transform: rotate(-5deg);
}

/* Jester-cap zigzag edges. Triangles are an SVG mask, so each edge takes its colour from
   `background` and matches the band it belongs to. Down = points hang below, up = points rise above. */
:root {
  --kg-zz-w: 28px;
  --kg-zz-h: 16px;
  --kg-zz-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 16' preserveAspectRatio='none'%3E%3Cpath d='M0 0H28L14 16Z'/%3E%3C/svg%3E");
  --kg-zz-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 16' preserveAspectRatio='none'%3E%3Cpath d='M0 16L14 0L28 16Z'/%3E%3C/svg%3E");
}

.kg-zz-down::after,
.kg-zz-up::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--kg-zz-h);
  pointer-events: none;
  mask-size: var(--kg-zz-w) var(--kg-zz-h);
  mask-repeat: repeat-x;
}

.kg-zz-down::after {
  top: calc(100% - 1px);
  mask-image: var(--kg-zz-down);
}

.kg-zz-up::before {
  bottom: calc(100% - 1px);
  mask-image: var(--kg-zz-up);
}

/* Header: red cap points with gold bells on the tips. */
#masthead {
  position: relative;
  z-index: 20;
}

#masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  height: var(--kg-zz-h);
  background: var(--global-palette1);
  mask: var(--kg-zz-down) 0 0 / var(--kg-zz-w) var(--kg-zz-h) repeat-x;
  pointer-events: none;
}

#masthead::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + var(--kg-zz-h) - 5px);
  height: 9px;
  background:
    radial-gradient(circle, var(--global-palette10) 0 3.5px, transparent 4px) 0 0 / var(--kg-zz-w)
    9px repeat-x;
  pointer-events: none;
}

/* Footer: green points rising into the page. */
.site-footer {
  position: relative;
  margin-top: var(--kg-zz-h);
}

.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 1px);
  height: var(--kg-zz-h);
  background: var(--global-palette11);
  mask: var(--kg-zz-up) 0 0 / var(--kg-zz-w) var(--kg-zz-h) repeat-x;
  pointer-events: none;
}

/* Footer on green: white text and links. */
.site-footer .site-bottom-footer-wrap,
.site-footer .site-bottom-footer-wrap a {
  color: var(--global-palette9);
}

/* TEC colours every link in a single event blue (.tribe-events-single a), which beats the
   button text colour; keep buttons in event descriptions readable. */
.tribe-events-single .wp-block-button__link {
  color: var(--global-palette-btn);
}

/* FAQ: core Details blocks as white cards with a KG-red marker (e.g. the Tanzturnier page). */
.entry-content .wp-block-details {
  background: var(--global-palette9);
  border: 2px solid color-mix(in srgb, var(--global-palette1) 18%, transparent);
  border-radius: var(--kg-radius);
  padding: 0.7rem 1.2rem;
  margin-block: 0.6rem;
}

.entry-content .wp-block-details summary {
  cursor: pointer;
  font-weight: 800;
}

.entry-content .wp-block-details summary::marker {
  color: var(--global-palette1);
}

.entry-content .wp-block-details summary:focus-visible {
  outline: 3px solid var(--global-palette1);
  outline-offset: 4px;
  border-radius: 4px;
}

.entry-content .wp-block-details[open] summary {
  margin-bottom: 0.5rem;
}

.entry-content .wp-block-details > :last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .wp-block-button__link,
  .kb-button,
  .button {
    transition: none;
  }
}

/* A centred table (block toolbar → Align centre) stays compact instead of spanning the page, e.g. Präsidenten. */
.entry-content .wp-block-table.aligncenter {
  width: min(100%, 36rem);
  margin-inline: auto;
}

.entry-content .wp-block-table.aligncenter table {
  width: 100%;
}

/* Striped tables on the paper background: card-coloured stripes and a gold rule under the header. */
.entry-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background: var(--global-palette7);
}

.entry-content .wp-block-table.is-style-stripes thead {
  border-bottom: 3px solid var(--global-palette10);
}

/* Vorverkauf: one card per event (group class "kg-ticket"), price in the club font, button to the order form. */
.entry-content .kg-ticket {
  height: 100%;
  padding: 1.5rem 1.25rem;
  background: var(--global-palette9);
  border: 3px solid var(--global-palette10);
  border-radius: var(--kg-radius);
  box-shadow: 0 12px 24px -14px rgb(29 26 43 / 35%);
}

.entry-content .kg-ticket > h2 {
  margin-top: 0;
  color: var(--global-palette1);
}

.entry-content .kg-ticket-price strong {
  font-family: var(--global-heading-font-family);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--global-palette3);
}

.entry-content .kg-ticket-more {
  font-size: 0.9rem;
}
