/*
 * PHW Geräteausleihe gate - colour tokens from the PH Weingarten CD handbook.
 * The university website switches its theme via data-main-color="red|turquoise";
 * here both appear side by side, so each card carries its own accent.
 * Contrast (WCAG 2.2 AA): white on #e60f00 4.7:1, white on #007891 5.1:1,
 * #646464 on white 5.9:1. Highlight colours (#ff7d00, #00c2b0) are decorative only.
 */
:root {
  --font: 'Kanit', 'Segoe UI', Arial, sans-serif;

  --phw-red:            #e60f00;
  --phw-red-hover:      #ca0c00;
  --phw-red-dark:       #8a0a00;
  --phw-turquoise:      #007891;
  --phw-turquoise-hover:#006579;
  --phw-turquoise-dark: #004757;

  --grey-100: #f5f5f5;
  --grey-200: #d2d2d2;
  --grey-400: #646464;
  --grey-500: #323232;
  --white:    #ffffff;
  --black:    #000000;

  --text:   var(--grey-500);
  --muted:  var(--grey-400);
  --bg:     var(--white);
  --bg-alt: var(--grey-100);

  --container: 1140px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; }

a { color: var(--phw-red); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--phw-red-dark); }
a:focus-visible, button:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; color: var(--black); }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.375rem, 2.5vw, 1.75rem); }
p  { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }

/* Skip link (visible on focus only) */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  padding: 0.5rem 1rem; background: var(--black); color: var(--white);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 5.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--black); }
.brand__logo { width: 232px; height: auto; }
.brand__claim {
  font-weight: 500; font-size: 1.125rem;
  padding-left: 1rem; border-left: 2px solid var(--grey-200);
}
.site-nav a { color: var(--muted); font-weight: 400; }

/* Hero */
.hero { background: var(--bg-alt); padding: 3.5rem 0 2.5rem; }
.hero--small { padding: 2rem 0 1.5rem; }
.hero__title { margin-bottom: 0.75rem; }
.hero__text { max-width: 46rem; font-size: 1.25rem; margin: 0; }

/* Gate: the two system cards */
.gate { padding: 2.5rem 0 1.5rem; }
.gate__grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
.card {
  --accent: var(--phw-red);
  --accent-hover: var(--phw-red-hover);
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1.75rem;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-top: 6px solid var(--accent);
  border-radius: var(--radius);
}
.card--colilab { --accent: var(--phw-turquoise); --accent-hover: var(--phw-turquoise-hover); }
.card__logo { height: 5rem; display: flex; align-items: center; }
.card__logo img { max-height: 100%; width: auto; }
.card__title { margin: 0.25rem 0 0; }
.card__text { flex: 1; margin: 0; }
.card__links { list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; color: var(--muted); }
.card__links li { margin-top: 0.25rem; }
.card__links a { color: var(--accent); }
.card__links a:hover { color: var(--accent-hover); }

/* Buttons - same shape for both systems, colour from the card accent */
.button {
  display: inline-block; align-self: flex-start;
  padding: 0.75rem 1.5rem;
  font-weight: 500; font-size: 1.0625rem; text-decoration: none;
  color: var(--white); background: var(--accent, var(--phw-red));
  border-radius: var(--radius);
  transition: background-color 0.15s ease;
}
.button:hover { color: var(--white); background: var(--accent-hover, var(--phw-red-hover)); }

/* Editable page content below the gate (opening hours, news, …) */
.content { padding: 1.5rem 0 3rem; }
.prose { max-width: 52rem; }
.prose h2 { margin-top: 1.5em; }
.prose h3 { margin-top: 1.25em; font-size: 1.05rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.5em; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--grey-200); vertical-align: top; }
.prose th { font-weight: 500; }
.prose ul { padding-left: 1.25em; }
.prose ul li::marker { color: var(--phw-red); }
.prose .wp-block-table { overflow-x: auto; }

/* Opening hours, one box per lending point - same frame as the gate cards above, so the two
   systems read as a pair here as well. The boxes are core Spalten/Tabelle blocks (class on the
   column), so the times stay editable in the block editor. The grid is defined here because the
   site does not load the core block stylesheet. */
.prose .hours-grid {
  display: grid; gap: 1.5rem; max-width: none; margin: 0 0 1.5em;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}
.prose .hours-card {
  --accent: var(--phw-red);
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-top: 6px solid var(--accent);
  border-radius: var(--radius);
}
.prose .hours-card--colilab { --accent: var(--phw-turquoise); }
.prose .hours-card h3 { color: var(--accent); margin-top: 0; }
.prose .hours-card > :last-child { margin-bottom: 0; }
.prose .hours-card table { margin-bottom: 0; }
.prose .hours-card td:last-child { white-space: nowrap; }

/* Footer */
.site-footer { background: var(--grey-500); color: var(--white); padding: 2.5rem 0; margin-top: auto; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2rem; }
.site-footer__logo { width: 193px; height: auto; }
.site-footer__text p { margin: 0 0 0.5rem; color: var(--grey-200); }
.footer-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--grey-200); }

/* Sticky footer on short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

@media (max-width: 40rem) {
  .brand__logo { width: 180px; }
  .brand__claim { display: none; }
  .hero { padding: 2.5rem 0 2rem; }
  .card { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
