/*
Theme Name: Tischmesse – area for makers
Theme URI: https://tischmesse.sh
Author: Tischmesse
Description: Eigenständiges WordPress-Theme für das Tischmesse-Ausstellerverzeichnis. Die Startseite zeigt alle Firmen als Visitenkarten mit Suche und Branchen-Filter, im CI/CD «Schaffhausen – area for makers» (Gelb als Leitfarbe, Manrope, Kreis für die Tischnummer). Daten kommen live aus Airtable (server-seitig, gecacht) mit eingebauter Fallback-Liste.
Version: 1.2.0
Requires at least: 5.5
Tested up to: 6.6
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tischmesse
*/

:root {
  --paper:#fefafa; --surface:#ffffff; --ink:#111111; --ink-2:#575757;
  --gray:#9d9d9d; --line:#dadada; --black:#000000; --yellow:#ffdd00;
  --tq:#00a8b0; --green:#bccf00; --orange:#ee7203; --pink:#e5005b;
  --r-box:10px; --r-pill:999px;
  --f:"Manrope", Arial, "Helvetica Neue", sans-serif;
  --shadow:0 1px 2px rgba(17,17,17,.05), 0 8px 22px rgba(17,17,17,.07);
  --shadow-lift:0 4px 8px rgba(17,17,17,.08), 0 18px 40px rgba(17,17,17,.14);
}

* , *::before, *::after { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  margin:0; background:var(--paper); color:var(--ink);
  font-family:var(--f); font-weight:400; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
img { max-width:100%; height:auto; }
a { color:inherit; }
button { font-family:inherit; cursor:pointer; }

#tm-app { display:block; }

/* ---------- Hero ---------- */
.hero { max-width:1180px; margin:0 auto; padding:30px 18px 4px; }
.eyebrow {
  font-weight:700; font-size:.74rem; letter-spacing:.14em; text-transform:uppercase;
  color:var(--ink); margin:0 0 12px; display:inline-flex; align-items:center; gap:8px;
}
.eyebrow::before { content:""; width:10px; height:10px; background:var(--yellow); border-radius:50%; flex:0 0 auto; }
.hero h1 {
  font-weight:800; text-transform:uppercase; letter-spacing:-.02em; line-height:.92;
  font-size:clamp(2.5rem, 12vw, 5.4rem); margin:0; color:var(--ink);
}
.hero-underline {
  height:8px; width:96px; background:var(--yellow); margin:18px 0 16px;
  transform:scaleX(0); transform-origin:left center; animation:tm-draw .7s .15s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-sub { margin:0; color:var(--ink-2); font-size:1rem; max-width:46ch; }
.hero-sub b { color:var(--ink); font-weight:700; }
.hero-hint { margin:12px 0 0; font-size:.88rem; font-weight:600; color:var(--ink-2); padding:8px 14px; background:#fff; border-left:4px solid var(--yellow); border-radius:0 var(--r-box) var(--r-box) 0; display:inline-block; }

/* ---------- Sticky controls ---------- */
.controls {
  overflow:visible;
  position:sticky; top:0; z-index:30;
  background:var(--paper);
  background:color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter:saturate(1.15) blur(8px);
  border-bottom:1.5px solid var(--line);
  padding:12px 18px; margin-top:14px;
}
.controls-inner { max-width:1180px; margin:0 auto; }
.search {
  display:flex; align-items:center; gap:10px; background:var(--surface);
  border:1.5px solid var(--gray); border-radius:var(--r-pill); padding:11px 16px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.search svg { color:var(--ink-2); flex:0 0 auto; }
.search input { border:0; outline:0; background:transparent; width:100%; font-size:1rem; color:var(--ink); font-weight:500; }
.search input::placeholder { color:var(--gray); font-weight:400; }
.search:focus-within { border-color:var(--ink); box-shadow:0 0 0 4px rgba(255,221,0,.40); }
.search-clear { border:0; background:transparent; color:var(--ink-2); font-size:1.3rem; line-height:1; padding:0 2px; display:none; }
.search-clear.show { display:block; }

/* ---------- Filter Dropdown ---------- */
.filter-dropdown { position:relative; margin-top:20px; }
.filter-toggle {
  display:inline-flex; align-items:center; gap:8px;
  border:1.5px solid var(--line); background:var(--surface); color:var(--ink);
  cursor:pointer; transition:border-color .15s ease, box-shadow .15s ease;
}
.filter-toggle:hover { border-color:var(--ink); }
.filter-toggle.open { border-color:var(--ink); box-shadow:0 0 0 4px rgba(255,221,0,.35); }
.filter-toggle.has-value { background:var(--yellow); border-color:var(--black); color:var(--black); }
.filter-chevron { transition:transform .2s ease; flex:0 0 auto; }
.filter-toggle.open .filter-chevron { transform:rotate(180deg); }
.filter-panel {
  position:absolute; top:calc(100% + 10px); left:0; z-index:100;
  min-width:300px; max-width:400px; width:max-content;
  background:var(--surface); border:1.5px solid var(--line); border-radius:12px;
  box-shadow:0 12px 40px rgba(17,17,17,.18), 0 0 0 1px rgba(17,17,17,.04); padding:10px;
}
.filter-search {
  width:100%; border:1.5px solid var(--line); border-radius:var(--r-pill);
  padding:8px 12px; font-size:.88rem; font-weight:500; color:var(--ink);
  font-family:inherit; outline:none; margin-bottom:6px;
}
.filter-search:focus { border-color:var(--ink); box-shadow:0 0 0 3px rgba(255,221,0,.3); }
.filter-search::placeholder { color:var(--gray); }
.filter-list { max-height:260px; overflow-y:auto; scrollbar-width:thin; }
.filter-opt {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; border:0; background:none; text-align:left; color:var(--ink);
  padding:8px 10px; border-radius:8px; font-size:.88rem; font-weight:500;
  cursor:pointer; transition:background .1s ease;
}
.filter-opt:hover { background:#f4f2ec; }
.filter-opt.active { background:var(--yellow); font-weight:700; }
.filter-opt .fo-count { font-size:.78em; color:var(--gray); font-weight:600; }
.filter-opt.active .fo-count { color:var(--ink-2); }
.filter-no { padding:10px; color:var(--gray); font-size:.86rem; text-align:center; }

/* ---------- Grid ---------- */
main.tm-main { padding:22px 0 0; display:block; }
.hint { text-align:center; color:var(--ink-2); padding:44px 14px; font-size:.96rem; }
.hint a { color:var(--ink); font-weight:700; border-bottom:2px solid var(--yellow); text-decoration:none; }
.grid { display:grid; grid-template-columns:1fr; gap:14px; }
@media (min-width:620px)  { .grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; } }
@media (min-width:1000px) { .grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; } }

/* ---------- Card ---------- */
.card {
  background:var(--surface); border:1.5px solid var(--line); border-radius:var(--r-box);
  box-shadow:var(--shadow); padding:16px; display:flex; flex-direction:column; gap:12px;
  transition:box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card.hide { display:none; }
.card.reveal { opacity:0; transform:translateY(14px); }
.card.reveal.in { opacity:1; transform:none; transition:opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
@media (hover:hover) { .card:hover { transform:translateY(-3px); box-shadow:var(--shadow-lift); border-color:var(--ink); } }
.card.flash { border-color:var(--black); box-shadow:0 0 0 4px var(--yellow), var(--shadow-lift); }

.card-head { display:flex; align-items:flex-start; gap:13px; }
.num-wrap { flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:4px; }
.num { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; font-weight:800; font-size:1.05rem; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.n-cap { font-size:.52rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--gray); }
.head-text { flex:1; min-width:0; padding-top:2px; }
.name { font-weight:800; font-size:1.16rem; line-height:1.15; margin:0; letter-spacing:-.01em; overflow-wrap:anywhere; }
.place { margin:4px 0 0; font-size:.82rem; font-weight:500; color:var(--ink-2); }
.badge { flex:0 0 auto; width:100px; height:100px; border-radius:11px; overflow:hidden; display:grid; place-items:center; border:1.5px solid var(--line); background:#fff; }
.badge img { width:100%; height:100%; object-fit:contain; padding:4px; }
.badge .mono { width:100%; height:100%; display:grid; place-items:center; font-weight:800; font-size:1.7rem; letter-spacing:-.02em; color:#fff; }
.inserat-wrap { display:block; }
.inserat { width:100%; height:auto; display:block; border:1px solid var(--line); border-radius:8px; }
.tags { display:flex; flex-wrap:wrap; gap:6px; }
.tag { font-size:.68rem; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--ink-2); background:#f4f2ec; border:1px solid var(--line); border-radius:var(--r-pill); padding:3px 9px; }
.desc { margin:0; font-size:.9rem; font-weight:400; line-height:1.5; color:#333; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.desc.open { -webkit-line-clamp:unset; overflow:visible; }
.more { align-self:flex-start; background:0; border:0; padding:0; color:var(--ink); font-weight:700; font-size:.82rem; border-bottom:2px solid var(--yellow); line-height:1.2; }
.more:hover { background:var(--yellow); }
.contact { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:auto; padding-top:4px; font-size:.83rem; font-weight:600; }
.contact a { display:inline-flex; align-items:center; gap:5px; text-decoration:none; color:var(--ink); border-bottom:2px solid transparent; }
.contact a:hover { border-color:var(--yellow); }
.contact svg { color:var(--ink-2); }

/* ---------- Layout (cards + inserate sidebar) ---------- */
.tm-layout { max-width:1440px; margin:0 auto; padding:0 18px; display:block; }
@media (min-width:1100px) {
  .tm-layout { display:grid; grid-template-columns:1fr 280px; gap:24px; align-items:start; }
}

/* ---------- Inserate (sidebar) ---------- */
.inserate { margin-top:28px; }
@media (min-width:1100px) { .inserate { margin-top:0; padding-top:22px; } }
.inserate-sticky { position:sticky; top:80px; }
.inserate-grid { display:flex; flex-direction:column; gap:14px; }
@media (max-width:1099px) {
  .inserate-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); }
}
.inserat-tile { display:block; border:1.5px solid var(--line); border-radius:10px; overflow:hidden; background:#fff; box-shadow:var(--shadow); transition:box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
@media (hover:hover){ .inserat-tile:hover{ transform:translateY(-3px); box-shadow:var(--shadow-lift); border-color:var(--ink);} }
.inserat-tile img { width:100%; height:auto; display:block; }

/* ---------- Footer ---------- */
.foot { max-width:1180px; margin:34px auto 0; padding:0 18px 40px; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; color:var(--ink-2); font-size:.76rem; font-weight:500; }
.foot-brand { font-weight:700; color:var(--ink); display:inline-flex; align-items:center; gap:8px; }
.foot-brand::before { content:""; width:9px; height:9px; background:var(--yellow); border-radius:50%; flex:0 0 auto; }

/* ---------- normal pages (falls Unterseiten angelegt werden) ---------- */
.tm-page { max-width:760px; margin:0 auto; padding:40px 18px 60px; }
.tm-page-inner h1 { font-weight:800; letter-spacing:-.01em; margin:0 0 16px; }
.tm-page-inner a { color:var(--ink); border-bottom:2px solid var(--yellow); text-decoration:none; }
.tm-topbar { max-width:1180px; margin:0 auto; padding:16px 18px 0; }
.tm-topbar a { font-weight:700; text-decoration:none; color:var(--ink); display:inline-flex; align-items:center; gap:8px; }
.tm-topbar a::before { content:""; width:9px; height:9px; background:var(--yellow); border-radius:50%; }

/* ---------- focus / reduced motion ---------- */
:focus-visible { outline:3px solid var(--black); outline-offset:2px; border-radius:4px; }
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  * { animation:none !important; transition:none !important; }
  .card.reveal { opacity:1; transform:none; }
  .hero-underline { transform:scaleX(1); }
}
@keyframes tm-draw { to { transform:scaleX(1); } }
