/* ==========================================================================
   LotRO-Raids – Stylesheet
   Farben: schiefer/dunkelgrau, waldgrün, gold; klassische, ruhige Optik.
   ========================================================================== */

:root {
  --bg: #1c1f23;
  --bg-2: #23272d;
  --surface: #292e35;
  --surface-2: #2f353d;
  --border: #3a414b;
  --text: #e6e2d6;
  --text-muted: #a8a89c;
  --text-dim: #7a7c74;
  --green: #5d8a4a;
  --green-2: #7aa365;
  --green-deep: #3e6231;
  --gold: #c9a553;
  --gold-2: #e0bd6c;
  --danger: #c94e4e;
  --warning: #d3a64a;
  --info: #6790b4;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 4px 16px rgba(0,0,0,.35);
  --max-w: 1180px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

h1, h2, h3, h4 { font-family: var(--serif); color: #efe7d2; line-height: 1.25; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.8rem, 2.2vw + 1rem, 2.6rem); letter-spacing: .3px; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }
.muted { color: var(--text-muted); }
.small { font-size: .9rem; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.container.narrow { max-width: 820px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--gold); color: #222; padding: .5rem 1rem; }
.skip-link:focus { left: 0; z-index: 9999; }

/* Header */
.site-header {
  background: linear-gradient(to bottom, #181b1f, #1c1f23 80%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  padding-top: .75rem; padding-bottom: .75rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--text); font-family: var(--serif); font-size: 1.15rem;
  text-decoration: none;
}
.brand:hover { color: var(--gold-2); text-decoration: none; }
.brand-mark { color: var(--gold); font-size: 1.3rem; }
.primary-nav { display: flex; gap: .25rem; margin-left: 1rem; flex-wrap: wrap; }
.primary-nav a {
  color: var(--text-muted); padding: .5rem .9rem; border-radius: var(--radius);
  font-size: .98rem; text-decoration: none;
}
.primary-nav a:hover, .primary-nav a.active {
  background: var(--surface); color: var(--gold-2);
}
.user-nav { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.nav-toggle {
  display: none; margin-left: auto; background: transparent; color: var(--text);
  border: 1px solid var(--border); padding: .35rem .7rem; border-radius: var(--radius); font-size: 1.1rem; cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-block; padding: .55rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  font-family: inherit;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green-deep); border-color: var(--green); color: #f3eedf; }
.btn.primary:hover { background: var(--green); }
.btn.ghost { background: transparent; }
.btn.ghost.gold { color: var(--gold); border-color: rgba(201,165,83,.5); }
.btn.ghost.gold:hover { background: rgba(201,165,83,.1); color: var(--gold-2); }
.btn.danger { background: #5a2828; border-color: #823232; color: #f3dadc; }
.btn.danger:hover { background: #7a3434; }
.btn.lg { padding: .8rem 1.5rem; font-size: 1.05rem; }
.btn.xs { padding: .25rem .55rem; font-size: .8rem; }
.inline-form { display: inline; }

/* Hero */
.hero {
  background:
    radial-gradient(circle at 30% 30%, rgba(93,138,74,.18), transparent 60%),
    radial-gradient(circle at 75% 70%, rgba(201,165,83,.10), transparent 60%),
    linear-gradient(180deg, #1f242a, #181b20);
  border-bottom: 1px solid var(--border);
  padding: 5rem 0 4rem;
}
.hero-inner { max-width: 820px; }
.hero h1 {
  font-size: clamp(2.2rem, 3vw + 1rem, 3.5rem);
  margin-bottom: .5rem;
}
.hero .lead { font-size: 1.2rem; color: var(--text-muted); max-width: 60ch; }
.hero-actions { margin-top: 1.5rem; display: flex; gap: .75rem; flex-wrap: wrap; }

/* Sections */
.section { padding: 3rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.25rem; }
.section-head .more { color: var(--gold); font-size: .95rem; }
.page-head { padding: 2rem 0 1.25rem; }
.page-head h1 { margin-bottom: .25rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mt-2 { margin-top: 2rem; }

/* Grid */
.grid { display: grid; gap: 1.25rem; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.two-cols { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.teaser-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.teaser { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.teaser h2 { color: var(--gold-2); }
.teaser-list { list-style: none; padding: 0; margin: 1rem 0; }
.teaser-list li { padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.teaser-list li:last-child { border-bottom: 0; }
.teaser-list small { color: var(--text-dim); margin-left: .5rem; }

.about-strip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.card h2, .card h3 { margin-top: 0; }

/* Guide cards */
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .12s, border-color .12s;
}
.guide-card:hover { transform: translateY(-2px); border-color: var(--green); }
.card-cover { display: block; position: relative; aspect-ratio: 16/9; background: #16191d; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2c3a30, #1f262a);
  color: rgba(201,165,83,.5); font-family: var(--serif); font-size: 4rem;
}
.card-badges {
  position: absolute; top: .5rem; left: .5rem; display: flex; flex-wrap: wrap; gap: .25rem;
}
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-title { margin: 0; font-size: 1.15rem; }
.card-title a { color: #f3ecd8; }
.card-title a:hover { color: var(--gold-2); text-decoration: none; }
.card-desc { color: var(--text-muted); margin: 0; font-size: .95rem; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; gap: .75rem; color: var(--text-dim); font-size: .82rem; margin-top: .5rem; }

/* Badges */
.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem;
  background: rgba(0,0,0,.5); color: #d8d4c4; border: 1px solid rgba(255,255,255,.1);
  letter-spacing: .3px;
}
.badge.group { background: rgba(93,138,74,.85); color: #fff; border-color: transparent; }
.badge.sub   { background: rgba(201,165,83,.8); color: #2a2207; border-color: transparent; }
.badge.class { background: rgba(103,144,180,.7); color: #f1f6ff; border-color: transparent; }
.badge.soft  { background: rgba(255,255,255,.05); }
.badge.vis-public   { background: rgba(93,138,74,.4); }
.badge.vis-internal { background: rgba(103,144,180,.4); }
.badge.vis-draft    { background: rgba(201,82,82,.45); color: #fff; }

/* Filter bar */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.filter-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; align-items: end; }
.field label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .25rem; }
.field { display: flex; flex-direction: column; }
.field.grow { flex: 1; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .55rem .75rem; font: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--green); outline-offset: 1px;
}
.checks { border: 0; padding: 0; margin: 1rem 0 0; }
.checks legend { font-size: .85rem; color: var(--text-muted); margin-bottom: .35rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--bg-2); border: 1px solid var(--border);
  padding: .35rem .8rem; border-radius: 999px; cursor: pointer;
  margin: 0 .35rem .35rem 0; transition: background .12s, border-color .12s;
}
.chip input { accent-color: var(--green); }
.chip:has(input:checked) { background: var(--green-deep); border-color: var(--green); color: #fff; }
.filter-actions { display: flex; gap: .5rem; margin-top: 1rem; }
.result-count { margin: 0 0 .75rem; }

/* Empty state */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg);
}
.empty-state h2 { margin-bottom: .5rem; color: var(--text-muted); }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: center; margin: 2rem 0; }
.pg {
  display: inline-block; min-width: 38px; text-align: center;
  padding: .45rem .7rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.pg:hover { background: var(--surface-2); text-decoration: none; }
.pg.current { background: var(--green-deep); border-color: var(--green); color: #fff; }
.pg.ellipsis { background: transparent; border-color: transparent; }

/* Forms */
.form-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem; max-width: 560px; margin: 1rem auto 2rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.form-card label { display: flex; flex-direction: column; gap: .35rem; font-size: .92rem; color: var(--text-muted); }
.form-card label.checkbox { flex-direction: row; align-items: flex-start; gap: .5rem; }
.form-card input[type=text],
.form-card input[type=email],
.form-card input[type=password],
.form-card input[type=search],
.form-card input[type=file],
.form-card textarea,
.form-card select {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .6rem .8rem; font: inherit;
}
.form-links { font-size: .9rem; color: var(--text-muted); text-align: center; }
.form-card small { font-size: .8rem; color: var(--text-dim); }

/* Guide form layout */
.guide-form .form-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.form-main label, .form-side label { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; color: var(--text-muted); font-size: .9rem; }
.form-main input, .form-main textarea, .form-main select,
.form-side input, .form-side textarea, .form-side select {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .55rem .75rem; font: inherit;
}
.form-side .card { margin-bottom: 1rem; }
.form-footer { display: flex; gap: .75rem; padding: 1rem 0 2rem; border-top: 1px solid var(--border); }
.editor-wrap { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); }
#editor { min-height: 420px; color: var(--text); }
.cover-thumb { max-width: 220px; border-radius: var(--radius); border: 1px solid var(--border); }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.table th, .table td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { background: var(--surface-2); font-weight: 600; font-size: .9rem; color: var(--text-muted); }
.table tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.row-trashed td { opacity: .55; }

/* Stat cards */
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem; display: flex; flex-direction: column; gap: .25rem;
}
.stat-num { font-size: 2rem; font-family: var(--serif); color: var(--gold-2); line-height: 1; }
.stat-label { color: var(--text-muted); font-size: .9rem; }

/* Article / Guide content */
.article h1 { margin-top: 1rem; }
.guide-article { padding: 1.5rem 1.25rem 4rem; }
.guide-head { margin-bottom: 1.5rem; }
.guide-meta-top { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.guide-meta { display: flex; flex-wrap: wrap; gap: .85rem; color: var(--text-muted); font-size: .9rem; margin-top: .5rem; }
.guide-cover { margin: 0 0 1.5rem; }
.guide-cover img { border-radius: var(--radius-lg); border: 1px solid var(--border); width: 100%; }

.prose { line-height: 1.75; font-size: 1.05rem; }
.prose h1, .prose h2, .prose h3 { margin-top: 2rem; color: var(--gold-2); }
.prose p { margin: 0 0 1.1em; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); margin: 1em auto; }
.prose iframe { width: 100%; aspect-ratio: 16/9; max-width: 720px; display: block; margin: 1em auto; border-radius: var(--radius); border: 1px solid var(--border); }
.prose blockquote {
  border-left: 4px solid var(--green); margin: 1.2rem 0; padding: .5rem 1.1rem;
  color: #d3cfbe; background: rgba(93,138,74,.07); border-radius: 0 var(--radius) var(--radius) 0;
}
.prose code { background: rgba(255,255,255,.06); padding: .1em .35em; border-radius: 4px; font-size: .92em; }
.prose pre { background: #0f1316; padding: 1rem; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--border); }
.prose pre code { background: transparent; padding: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose hr { margin: 2rem 0; }
.prose a { color: var(--gold-2); text-decoration: underline; text-decoration-color: rgba(201,165,83,.5); text-underline-offset: 2px; }

/* Breadcrumbs */
.breadcrumbs {
  font-size: .85rem; padding-top: 1.25rem; color: var(--text-dim);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs .sep { margin: 0 .35rem; color: var(--text-dim); }
.breadcrumbs span[aria-current] { color: var(--text); }

/* Alerts */
.flash-stack { padding-top: 1rem; }
.alert {
  padding: .75rem 1rem; margin: .5rem 0; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
}
.alert.success { border-color: var(--green); background: rgba(93,138,74,.18); color: #d8efc8; }
.alert.error { border-color: var(--danger); background: rgba(201,78,78,.18); color: #fbd9da; }
.alert.warning { border-color: var(--warning); background: rgba(211,166,74,.18); }
.alert.info { border-color: var(--info); background: rgba(103,144,180,.18); }

/* Affiliate strip */
.affiliate-strip {
  margin-top: 3rem;
  background: linear-gradient(90deg, #20262e, #1c2025);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}
.affiliate-placeholder {
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem; text-align: center; color: var(--text-dim);
  background: rgba(0,0,0,.15);
}
.affiliate-label {
  display: inline-block; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .35rem;
}

/* Footer */
.site-footer {
  background: #14171b;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 0;
  margin-top: 1rem;
}
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem;
}
.footer-col h4 { color: var(--gold-2); font-family: var(--serif); margin: 0 0 .75rem; font-size: 1rem; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: .35rem; }
.footer-list a { color: var(--text-muted); }
.footer-list a:hover { color: var(--gold-2); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1rem 0; color: var(--text-dim); font-size: .82rem;
}

/* Admin */
.admin-body { background: #1a1d22; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; padding: 1.5rem 0 4rem; }
.admin-side {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem; align-self: start; position: sticky; top: 5rem;
}
.side-title { font-size: .9rem; color: var(--text-muted); margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .15em; }
.admin-nav { display: flex; flex-direction: column; gap: .15rem; }
.admin-nav a { padding: .5rem .75rem; border-radius: var(--radius); color: var(--text-muted); text-decoration: none; }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { background: var(--green-deep); color: #fff; }
.admin-nav hr { border-top: 1px solid var(--border); margin: .5rem 0; }
.admin-main { min-width: 0; }

/* Install */
.install-page { background: var(--bg); color: var(--text); }
.install-page main { padding: 3rem 1rem; }

/* Quill dark adjustments */
.ql-toolbar.ql-snow { background: #2a2f37; border-color: var(--border) !important; border-radius: var(--radius) var(--radius) 0 0; }
.ql-container.ql-snow { border-color: var(--border) !important; border-radius: 0 0 var(--radius) var(--radius); }
.ql-snow .ql-stroke { stroke: var(--text); }
.ql-snow .ql-fill { fill: var(--text); }
.ql-snow .ql-picker { color: var(--text); }
.ql-snow .ql-picker-options { background: var(--surface) !important; color: var(--text); }
.ql-editor { color: var(--text); min-height: 380px; font-size: 1rem; }
.ql-editor.ql-blank::before { color: var(--text-dim); font-style: italic; }
.ql-snow a { color: var(--gold); }

/* Responsive */
@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .primary-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-2); border-top: 1px solid var(--border);
    flex-direction: column; padding: .5rem 1rem; gap: .25rem; margin: 0;
  }
  .primary-nav.open { display: flex; }
  .header-inner { position: relative; flex-wrap: wrap; }
  .user-nav { order: 5; margin-left: 0; }
  .filter-row { grid-template-columns: 1fr; }
  .teaser-row { grid-template-columns: 1fr; }
  .guide-form .form-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; }
}
