/* ============================================================================
   LAZAAR31 – Community & Forum

   Zwei Dinge, die hier frueher gefehlt haben:

   1. Seitenrand. Alles unterhalb des Hero lag ohne Abstand am Fensterrand.
      Der Inhalt steht jetzt in .forum-shell und haelt links und rechts
      denselben Abstand ein wie der Hero darueber (--gutter aus site.css).

   2. Brauchbare Fenster. Die Beitragsfenster waren <div> mit position:fixed –
      wegen des Containments an <body> (container-type:inline-size) lagen sie
      aber ueber der gesamten Dokumenthoehe statt im Fenster. Sie sind jetzt
      <dialog> und liegen in der obersten Ebene des Browsers.
   ========================================================================= */

/* --- Rahmen der Seite ----------------------------------------------------- */
.forum-hero{position:relative}

.forum-shell{
  width:100%;
  max-width:100%;
  min-width:0;
  padding:36px var(--gutter) 72px;
}

/* --- Kennzahlenleiste ----------------------------------------------------- */
.forum-stats-bar{
  position:relative;
  display:flex;
  flex-wrap:wrap;
  gap:16px 28px;
  align-items:center;
  justify-content:space-between;
  overflow:hidden;
  padding:18px 26px;
  margin-bottom:24px;
  background:var(--card-bg);
  border:1px solid var(--border-color);
  border-radius:16px;
  box-shadow:var(--shadow-sm);
}
/* Roter Streifen am linken Rand – gibt der Leiste Tiefe, ohne zu stoeren */
.forum-stats-bar::before{
  content:"";
  position:absolute;
  left:0;top:0;bottom:0;
  width:5px;
  background:linear-gradient(180deg,var(--brand),var(--brand-bright));
}

.forum-stats-item{display:flex;align-items:baseline;gap:10px;min-width:0}
.forum-stats-item strong{
  font-family:'Anton',sans-serif;
  font-weight:400;
  font-size:22px;
  line-height:1;
  letter-spacing:.02em;
  color:var(--brand);
}
.forum-stats-item span{
  font-size:11px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--text-muted);
}

.forum-stats-item--live strong{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-family:'Inter',system-ui,sans-serif;
  font-size:15px;
  font-weight:800;
  color:#15803D;
}
.forum-stats-item--live i{
  width:9px;height:9px;
  border-radius:50%;
  background:#15803D;
  box-shadow:0 0 0 4px rgba(21,128,61,.16);
  animation:livePulse 1.9s ease-in-out infinite;
}
html[data-theme="dark"] .forum-stats-item--live strong{color:#4ADE80}
html[data-theme="dark"] .forum-stats-item--live i{background:#4ADE80;box-shadow:0 0 0 4px rgba(74,222,128,.15)}

/* --- Filter und Suche ----------------------------------------------------- */
.forum-actions-bar{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:24px;
}

.forum-filter-tabs{display:flex;gap:8px;flex-wrap:wrap;min-width:0}

.forum-tab{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  padding:9px 18px;
  border:1px solid var(--border-color);
  border-radius:999px;
  background:var(--card-bg);
  color:var(--text-color);
  font-size:11.5px;
  font-weight:800;
  letter-spacing:.07em;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
  transition:color .25s var(--ease-out),border-color .25s var(--ease-out),transform .25s var(--ease-spring);
}
/* Die Fuellung waechst von unten nach oben statt hart umzuschalten. */
.forum-tab::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(135deg,var(--brand),var(--brand-bright));
  transform:scaleY(0);
  transform-origin:50% 100%;
  transition:transform .3s var(--ease-out);
}
.forum-tab:hover{color:#fff;border-color:var(--brand);transform:translateY(-2px)}
.forum-tab:hover::before{transform:scaleY(1)}
.forum-tab--active{color:#fff;border-color:var(--brand)}
.forum-tab--active::before{transform:scaleY(1)}

.forum-search-box{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 260px;
  max-width:420px;
  padding:9px 16px;
  background:var(--card-bg);
  border:1px solid var(--border-color);
  border-radius:999px;
  transition:border-color .25s var(--ease-out),box-shadow .25s var(--ease-out);
}
.forum-search-box:focus-within{border-color:var(--brand);box-shadow:0 0 0 4px var(--brand-tint)}
.forum-search-box svg{flex-shrink:0;opacity:.55;color:var(--text-muted)}
.forum-search-box input{
  width:100%;
  min-width:0;
  border:none;
  background:transparent;
  outline:none;
  font-family:inherit;
  font-size:14px;
  color:var(--text-color);
}
.forum-search-box input::placeholder{color:var(--text-muted);opacity:.8}

/* --- Aufteilung Liste / Seitenspalte -------------------------------------- */
.forum-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:26px;
  align-items:start;
}
.forum-topics{min-width:0}
.forum-sidebar{position:sticky;top:96px;min-width:0}

@media (max-width:900px){
  .forum-layout{grid-template-columns:minmax(0,1fr)}
  .forum-sidebar{position:static}
}

/* --- Themenkarte ---------------------------------------------------------- */
.topic-card{
  position:relative;
  display:flex;
  gap:16px;
  align-items:center;
  overflow:hidden;
  padding:16px 20px;
  margin-bottom:12px;
  background:var(--card-bg);
  border:1px solid var(--border-color);
  border-radius:14px;
  box-shadow:var(--shadow-sm);
  transition:transform .3s var(--ease-out),box-shadow .3s var(--ease-out),border-color .3s var(--ease-out);
}
/* Der rote Balken links faehrt beim Ueberfahren heraus. */
.topic-card::before{
  content:"";
  position:absolute;
  left:0;top:0;bottom:0;
  width:4px;
  background:linear-gradient(180deg,var(--brand),var(--brand-bright));
  transform:scaleY(0);
  transform-origin:50% 0;
  transition:transform .32s var(--ease-out);
}
.topic-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);border-color:var(--border-strong)}
.topic-card:hover::before,
.topic-card:focus-within::before{transform:scaleY(1)}

.topic-avatar{
  flex-shrink:0;
  width:46px;height:46px;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;
  border:2px solid var(--brand);
  background:#15120F;
  color:#fff;
  font-size:14px;
  font-weight:800;
  letter-spacing:.03em;
  transition:transform .35s var(--ease-spring);
}
.topic-card:hover .topic-avatar{transform:scale(1.07) rotate(-4deg)}

.topic-avatar--brand{background:var(--brand)}
.topic-avatar--teal{background:#0E7490}
.topic-avatar--amber{background:#B45309}
.topic-avatar--pink{background:#BE185D}

.topic-content{flex:1;min-width:0}

.topic-header{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}

.topic-badge{
  padding:3px 9px;
  border-radius:6px;
  background:var(--surface-2);
  color:var(--text-soft);
  font-size:10px;
  font-weight:800;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.topic-badge--fifa{background:#E0E7FF;color:#3730A3}
.topic-badge--koeln{background:#FEE2E2;color:#991B1B}
.topic-badge--tactics{background:#FEF3C7;color:#92400E}
html[data-theme="dark"] .topic-badge--fifa{background:rgba(99,102,241,.22);color:#C7D2FE}
html[data-theme="dark"] .topic-badge--koeln{background:rgba(210,20,30,.24);color:#FCA5A5}
html[data-theme="dark"] .topic-badge--tactics{background:rgba(245,158,11,.22);color:#FCD34D}

.topic-pinned{
  padding:3px 9px;
  border-radius:6px;
  background:var(--brand);
  color:#fff;
  font-size:10px;
  font-weight:800;
  letter-spacing:.07em;
}

.topic-title{margin:0 0 6px;font-size:15.5px;font-weight:800;line-height:1.35}
.topic-title a{
  color:var(--text-color);
  text-decoration:none;
  background-image:linear-gradient(var(--brand),var(--brand));
  background-repeat:no-repeat;
  background-position:0 100%;
  background-size:0% 1.5px;
  transition:color .25s var(--ease-out),background-size .35s var(--ease-out);
}
.topic-title a:hover{color:var(--brand);background-size:100% 1.5px}

.topic-meta{
  display:flex;
  gap:6px 12px;
  align-items:center;
  flex-wrap:wrap;
  font-size:12px;
  color:var(--text-muted);
}
.topic-meta strong{color:var(--text-color)}
/* Trennpunkt zwischen den Angaben unter einem Thementitel */
.topic-meta > span + span::before{content:"•";margin-right:12px;opacity:.55}

.topic-stats{
  flex-shrink:0;
  display:flex;
  gap:14px;
  align-items:center;
  font-size:13px;
  font-weight:700;
  color:var(--text-muted);
}
.topic-stat{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}

@media (max-width:560px){
  .topic-card{flex-wrap:wrap;gap:12px;padding:16px}
  .topic-stats{width:100%;justify-content:flex-start;padding-left:58px;margin-top:-4px}
}

/* --- Seitenspalte --------------------------------------------------------- */
.forum-widget{
  padding:22px;
  margin-bottom:20px;
  background:var(--card-bg);
  border:1px solid var(--border-color);
  border-radius:14px;
  box-shadow:var(--shadow-sm);
}
.forum-widget:last-child{margin-bottom:0}

.forum-widget h3{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 0 14px;
  padding-bottom:9px;
  border-bottom:2px solid var(--brand);
  font-size:13px;
  font-weight:800;
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--text-color);
}

.forum-widget__text{margin:0 0 16px;font-size:13px;line-height:1.55;color:var(--text-muted)}

.forum-cats{list-style:none;margin:0;padding:0;font-size:13px}
.forum-cat{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:9px 10px;
  margin:0 -10px;
  border-radius:8px;
  color:var(--text-color);
  transition:background-color .22s var(--ease-out),transform .22s var(--ease-out);
}
.forum-cat:hover{background:var(--surface-2);transform:translateX(3px)}
.forum-cat strong{color:var(--brand);font-size:13px}

/* --- Knoepfe -------------------------------------------------------------- */
.btn-forum{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 22px;
  border:none;
  border-radius:10px;
  background:var(--brand);
  color:#fff;
  font-family:inherit;
  font-size:13px;
  font-weight:800;
  letter-spacing:.05em;
  text-decoration:none;
  cursor:pointer;
}
.btn-forum:hover{background:var(--brand-dark);color:#fff}
.btn-forum--secondary{background:#15120F}
.btn-forum--secondary:hover{background:#2E2A25}
html[data-theme="dark"] .btn-forum--secondary{background:#2E2A25}
html[data-theme="dark"] .btn-forum--secondary:hover{background:#3D3834}
.btn-forum--block{width:100%}
.btn-forum img{width:18px;height:auto;object-fit:contain}

/* --- Fenster (Login, neues Thema, Thread) ---------------------------------
   Als <dialog>: der Browser stellt es in seine oberste Ebene, kuemmert sich
   um Escape und um den Rest der Seite. Ohne offenes Fenster blendet der
   Browser das Element von sich aus aus. */
.forum-modal{
  width:520px;
  max-width:calc(100vw - 32px);
  max-height:calc(100vh - 32px);
  padding:0;
  border:0;
  background:transparent;
  overflow:visible;
  color:var(--text-color);
}
.forum-modal--wide{width:720px}
.forum-modal::backdrop{
  background:rgba(12,9,7,.62);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
}
.forum-modal[open]{animation:lzFadeIn .2s ease both}
.forum-modal[open] .forum-modal-content{animation:lzPopIn .3s var(--ease-spring) both}

.forum-modal-content{
  position:relative;
  max-height:calc(100vh - 32px);
  overflow-y:auto;
  padding:30px;
  background:var(--card-bg);
  border:1px solid var(--border-color);
  border-radius:18px;
  box-shadow:var(--shadow-lg);
}

.forum-modal-close{
  position:absolute;
  top:14px;right:16px;
  width:34px;height:34px;
  display:grid;place-items:center;
  border-radius:50%;
  color:var(--text-muted);
  font-size:24px;
  line-height:1;
  text-decoration:none;
  transition:background-color .2s ease,color .2s ease,transform .25s var(--ease-spring);
}
.forum-modal-close:hover{background:var(--surface-2);color:var(--brand);transform:rotate(90deg)}

/* --- Thread-Detailansicht ------------------------------------------------- */
.post-view__title{
  margin:0 0 6px;
  padding-right:44px;
  font-family:'Anton',sans-serif;
  font-weight:400;
  font-size:26px;
  line-height:1.2;
  color:var(--text-color);
}
.post-view__sub{margin:0 0 20px;font-size:12px;color:var(--text-muted)}

.post-thread{border-top:1px solid var(--border-color)}

.post-item{display:flex;gap:14px;padding:18px 0;border-bottom:1px solid var(--border-color)}
.post-item__main{flex:1;min-width:0}
.post-item__head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px;font-size:13px;color:var(--text-color)}

.post-item__role{
  padding:2px 8px;
  border-radius:5px;
  background:var(--surface-2);
  color:var(--text-soft);
  font-size:10px;
  font-weight:800;
  letter-spacing:.07em;
}
.post-item__role--admin{background:var(--brand);color:#fff}

.post-item__date{margin-left:auto;font-size:12px;color:var(--text-muted)}
.post-item__body p{margin:0 0 8px;font-size:14px;line-height:1.6;color:var(--text-color)}
.post-item__body p:last-child{margin-bottom:0}

.post-reply{display:flex;flex-direction:column;gap:12px;margin-top:22px}
.post-reply__hint{margin:0;font-size:12px;color:var(--text-muted)}
.post-reply__hint a{color:var(--brand)}
.post-reply .btn-forum{align-self:flex-start}

@media (max-width:600px){
  .forum-shell{padding-bottom:56px}
  .post-item__date{margin-left:0;width:100%}
  .forum-modal-content{padding:22px}
  .post-view__title{font-size:22px;padding-right:38px}
}
