/* technage.de — shared stylesheet
   Replaces the old table-based page frame + <font>/bgcolor soup.
   Palette/widths/fonts are carried over 1:1 from the legacy markup. */

:root {
  --color-frame: #000000;
  --color-bg: #ffffff;
  --color-brand: #005A84;
  --color-accent: #ADC6D6;
  --color-zebra: #eeeeee;
  --color-text: #000000;
  --color-muted: #555555;
  --font-sans: verdana, arial, sans-serif;

  --width-page: 780px;
  --width-nav: 192px;

  --fs-xs: 0.75rem;   /* was <font size="1pt"|"-1"> */
  --fs-base: 0.875rem; /* was <font size="2pt">, the de-facto default */
  --fs-lg: 1.0625rem;  /* was <font size="+1"> */
  --fs-xl: 1.25rem;    /* was <font size="+2"> and view.php's "5pt" title */
  --fs-xxl: 1.5rem;    /* was <font size="+3"> */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 12px 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
}

a:link, a:visited, a:active { text-decoration: none; color: var(--color-brand); }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

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

.site {
  width: var(--width-page);
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 1px; /* old cellspacing="1" put this frame around the outside too, not just between regions */
  background: var(--color-frame);
}

.site-header,
.site-footer {
  background: var(--color-brand) url("../images/main/bg_top.gif");
  color: #ffffff;
}

.site-header {
  position: relative; /* anchor for the mobile hamburger button, laid over the title */
  z-index: 10; /* stay above the open mobile nav overlay so the toggle is still tappable */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header img { display: block; }

/* flex items default to min-width:auto, which floors them at their intrinsic
   image size and keeps the header (250px + 508px logo) wider than narrow
   phone screens even though img already has max-width:100% — that's what
   causes horizontal scrolling on mobile. Let them actually shrink. */
.site-header img,
.site-header a { min-width: 0; }

/* ---- hamburger nav toggle (mobile/tablet only, see media query below) --- */

/* visually hidden but still focusable/tabbable, unlike display:none */
.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nav-toggle-btn {
  display: none; /* shown only inside the mobile/tablet media query */
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent; /* overlays the title image instead of pushing it aside */
  cursor: pointer;
}

.nav-toggle-btn span,
.nav-toggle-btn span::before,
.nav-toggle-btn span::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
}

.nav-toggle-btn span { position: relative; }
.nav-toggle-btn span::before { position: absolute; top: -7px; }
.nav-toggle-btn span::after { position: absolute; top: 7px; }

.nav-toggle-input:focus ~ .site-header .nav-toggle-btn {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.site-footer {
  text-align: center;
  padding: 6px 10px;
  font-size: var(--fs-xs);
}

.site-footer a { color: #ffffff; text-decoration: underline; }

.site-body {
  display: grid;
  grid-template-columns: var(--width-nav) 1fr;
  gap: 1px;
  background: var(--color-frame);
}

/* ---- nav -------------------------------------------------------------- */

.site-nav {
  background: var(--color-bg) url("../images/main/bg_menue.gif");
  padding: 8px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.site-nav li:last-child { border-bottom: none; }

.site-nav li.nav-home {
  margin-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 10px;
}

.site-nav a {
  display: block;
  color: var(--color-text);
  font-size: var(--fs-lg);
  font-weight: bold;
  font-style: italic;
}

.site-nav a:hover { color: var(--color-brand); text-decoration: none; }

/* current page (set via aria-current in menue.inc) */
.site-nav li.active {
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
  background: var(--color-accent);
}

.site-nav a[aria-current="page"] { color: var(--color-brand); }

/* ---- responsive: mobile & tablet ------------------------------------
   Below this width the fixed 192px nav column leaves too little room for
   the main content, so switch to a full-width, single-column layout with
   the nav collapsed behind the hamburger button (opened via the hidden
   checkbox above; no JS needed). Desktop browsers are unaffected. */
@media (max-width: 992px) {
  /* the site frame is full-bleed here, so the desktop centering padding
     would just show as a stray white bar above/below it */
  body { padding: 0; }

  .site { width: 100%; }

  .nav-toggle-btn { display: flex; }

  /* minmax(0, 1fr), not bare 1fr: a plain 1fr track has an implicit
     min-width:auto and grows to fit oversized content (a wide table, an
     image with a fixed max-width), pushing the whole page past the
     viewport instead of letting that content shrink to fit. */
  .site-body { grid-template-columns: minmax(0, 1fr); }

  /* keep the header a predictable height so the open nav below can clear it */
  .site-header { min-height: 72px; }

  .site-nav {
    display: none;
    position: fixed; /* lay the open menu over the page instead of pushing content down */
    inset: 0;
    z-index: 5;
    overflow-y: auto;
    padding: 72px 16px 20px 0;
    background-repeat: repeat-y; /* the tile is only 230px wide — don't tile it sideways across the full screen */
  }

  .site-nav a { padding-left: 10px; }

  /* a little breathing room below the header, only before the first entry —
     the rest keep their normal 4px inter-item spacing */
  .site-nav li:first-child { padding-top: 10px; }

  .nav-toggle-input:checked ~ .site-body .site-nav { display: block; }
}

/* ---- main content ------------------------------------------------- */

.site-main {
  background: var(--color-bg);
  padding: 10px 15px 16px;
}

.site-main .center { text-align: center; }

/* ---- page titles (replaces the old title_*.gif banner images) ------ */

/* the title banner is always the first thing in .site-main and was sized
   (588px) to sit flush against the frame on top/left/right, no padding —
   cancel .site-main's padding on those three sides just for this element.
   Font/color/hairline-background/bottom-rule reproduce the look of the
   old GIFs (bold italic condensed, --color-brand, subtle 1px-line texture). */
.page-title {
  display: block;
  width: calc(100% + 30px);
  margin: -10px -15px 14px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #000000;
  background-image: repeating-linear-gradient(to bottom, #ffffff 0 1px, #eeeeee 1px 2px);
  font-family: "Arial Black", Haettenschweiler, Impact, var(--font-sans);
  font-style: italic;
  font-weight: 900;
  /* keep markup in normal case (a11y: screen readers can otherwise spell out
     hard-coded caps letter-by-letter as if it were an acronym) */
  font-size: clamp(1.6rem, 4vw + 1rem, 2.6rem);
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--color-brand);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.65);
}

/* smaller in-page banners (e.g. "Neu in der Galerie", "Nutzungsbedingungen") —
   same typographic treatment as .page-title, without the full-bleed bar */
.section-title {
  margin: 0 0 10px;
  font-family: "Arial Black", Haettenschweiler, Impact, var(--font-sans);
  font-style: italic;
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
  color: var(--color-brand);
}

.fs-xs { font-size: var(--fs-xs); }
.fs-lg { font-size: var(--fs-lg); }
.fs-xl { font-size: var(--fs-xl); }
.fs-xxl { font-size: var(--fs-xxl); }
.text-brand { color: var(--color-brand); }
.text-muted { color: var(--color-muted); }

/* ---- callout banner (homepage exhibition announcement) ------------ */

.callout {
  border: 1px solid var(--color-brand);
  background: var(--color-accent);
  margin: 0 0 1em;
}

.callout__title {
  background: var(--color-brand);
  color: #ffff00;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: bold;
  padding: 4px;
}

.callout__body {
  background: var(--color-bg);
  text-align: center;
  padding: 10px;
}

/* ---- data tables (real tabular data, not layout) ------------------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 3px 6px;
  font-size: var(--fs-base);
  /* let long unbreakable cell text (e.g. venue names) wrap instead of
     forcing the table wider than its container on narrow screens */
  overflow-wrap: anywhere;
}

.data-table th { font-size: var(--fs-xs); }

.data-table tbody tr:nth-child(odd) { background: var(--color-zebra); }
.data-table tbody tr:nth-child(even) { background: var(--color-bg); }
.data-table tbody tr:hover { background: var(--color-accent); }

/* plain variant: no zebra stripe / hover, for tables that never had one (e.g. kuenstler CV) */
.data-table.data-table--plain tbody tr:nth-child(odd),
.data-table.data-table--plain tbody tr:nth-child(even),
.data-table.data-table--plain tbody tr:hover { background: transparent; }

/* ---- pagination (ausstellungen list) ------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0;
  font-size: var(--fs-base);
}

.pagination__sort { flex: 1; text-align: center; }

.pagination-pages {
  text-align: center;
  font-size: var(--fs-base);
}

.pagination-pages a,
.pagination-pages strong { margin: 0 4px; }

/* All 12 (page × sort-order) blocks are pre-rendered at build time; JS
   (src/js/pagination.js) shows only the active one. Default to the same
   page shown before JS runs: page 1, descending — matches the old server
   default so there's no flash of the wrong content. */
.ausstellungen-page { display: none; }
.ausstellungen-page[data-order="desc"][data-page="1"] { display: block; }

/* ---- key/value info blocks (contact details) ------------------------ */

.info-list {
  margin: 0;
  font-size: var(--fs-base);
}

.info-list dt { font-weight: normal; color: var(--color-text); }
.info-list dd { margin: 0 0 6px; }

/* ---- contact form (impressum/mail.php) ------------------------------ */

.contact-form { max-width: 420px; font-size: var(--fs-base); }

.field { margin-bottom: 10px; }
.field label { display: block; margin-bottom: 2px; }

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; margin-bottom: 10px; }

.techform {
  width: 100%;
  background-color: #ffffff;
  border: 2px solid var(--color-brand);
  font-family: var(--font-sans);
  color: var(--color-muted);
  font-weight: bold;
  font-size: var(--fs-xs);
  padding: 4px;
}

.techform:hover, .techform:focus { background-color: var(--color-zebra); }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: bold;
  color: var(--color-brand);
  text-decoration: underline;
  cursor: pointer;
}

.form-errors {
  color: #ff0000;
  font-size: var(--fs-xs);
  margin: 0 0 1em;
  padding-left: 1.2em;
}

/* ---- misc content helpers ------------------------------------------ */

.float-right { float: right; margin: 0 0 8px 12px; }

.tagline {
  font-family: "Times New Roman", Times, serif;
  font-size: var(--fs-xxl);
  color: var(--color-muted);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ---- image gallery with CSS-only lightbox preview (materialbilder) --- */

.pic-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 1.2em 0;
}

.pic-gallery__item {
  display: block;
  color: var(--color-text);
  font-size: var(--fs-xs);
  text-align: center;
}

.pic-gallery__item img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--color-accent);
  margin-bottom: 4px;
}

.pic-gallery__item:hover img,
.pic-gallery__item:focus img { border-color: var(--color-brand); }

.pic-gallery__item span { display: block; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.lightbox:target { display: flex; }

.lightbox img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 85vh;
  border: 2px solid #ffffff;
}

.lightbox__caption {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: var(--fs-base);
  text-align: center;
}
