/* WWIIonline.de Statistik-CMS 1.13.30
   Gemeinsames helles Community-Hub-Design für Handbuch-Unterseiten.
   Vollständig auf .handbook-page begrenzt: keine Änderung an Frontseite/Footer. */

.handbook-page{
  --hb-bg:#e7e2d6;
  --hb-surface:#f8f6ef;
  --hb-card:#fffef9;
  --hb-card-soft:#f1eee5;
  --hb-line:#d6d0c2;
  --hb-line-strong:#bbb3a2;
  --hb-gold:#a88434;
  --hb-gold-dark:#755b20;
  --hb-text:#252823;
  --hb-muted:#666961;
  --hb-dark:#31352f;
  min-width:0;
}

.handbook-page-head{
  border-top:4px solid var(--hb-gold);
}

.handbook-page-head h1{
  text-transform:none;
}

.handbook-chapter-nav{
  position:sticky;
  top:var(--frontend-header-height,72px);
  z-index:90;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) minmax(210px,320px);
  align-items:center;
  gap:14px;
  margin:10px 0 16px;
  padding:10px 12px;
  background:rgba(248,246,239,.97);
  border:1px solid var(--hb-line);
  border-left:3px solid var(--hb-gold);
  box-shadow:0 8px 18px rgba(33,35,31,.07);
  backdrop-filter:blur(8px);
}
.handbook-chapter-nav__label{
  color:var(--hb-gold-dark);
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.handbook-chapter-nav__current{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--hb-text);
  font-size:.92rem;
}
.handbook-chapter-nav__select-wrap{min-width:0}
.handbook-chapter-nav__select{
  width:100%;
  min-height:40px;
  padding:8px 34px 8px 10px;
  border:1px solid var(--hb-line-strong);
  border-radius:2px;
  background:#fff;
  color:var(--hb-text);
  font:inherit;
  font-size:.86rem;
  cursor:pointer;
}
.handbook-chapter-nav__select:focus-visible{
  outline:3px solid rgba(168,132,52,.22);
  outline-offset:1px;
  border-color:var(--hb-gold);
}

.handbook-content{
  min-width:0;
  color:var(--hb-text);
  line-height:1.62;
}
.handbook-content > :first-child{margin-top:0!important}

/* Jede bereits vorhandene Legacy-Section wird zu einer hellen Community-Card. */
.handbook-page .handbook-content-section,
.handbook-page .handbook-empty-section,
.handbook-page .handbook-content > .card,
.handbook-page .handbook-content > .cms-panel{
  display:block!important;
  margin:0 0 14px!important;
  padding:20px!important;
  background:var(--hb-surface)!important;
  color:var(--hb-text)!important;
  border:1px solid var(--hb-line)!important;
  border-radius:2px!important;
  box-shadow:none!important;
  scroll-margin-top:150px;
}

.handbook-page .handbook-content-section > .section-head:first-child,
.handbook-page .handbook-content-section > .section-header:first-child{
  position:relative;
  margin:-1px 0 16px!important;
  padding:2px 0 11px!important;
  border-bottom:1px solid var(--hb-line)!important;
  background:transparent!important;
}
.handbook-page .handbook-content-section > .section-head:first-child::before,
.handbook-page .handbook-content-section > .section-header:first-child::before{
  content:"";
  display:block;
  width:46px;
  height:3px;
  margin:0 0 9px;
  background:var(--hb-gold);
}

.handbook-page .handbook-content h2,
.handbook-page .handbook-content h3,
.handbook-page .handbook-content h4{
  color:var(--hb-text)!important;
  font-family:inherit!important;
  text-shadow:none!important;
}
.handbook-page .handbook-content h2{
  margin:22px 0 10px;
  font-size:clamp(1.25rem,2.2vw,1.75rem);
  line-height:1.2;
}
.handbook-page .handbook-content h3{
  margin:18px 0 7px;
  font-size:1.08rem;
  line-height:1.3;
}
.handbook-page .handbook-content h4{margin:15px 0 6px;font-size:.98rem}
.handbook-page .handbook-content p,
.handbook-page .handbook-content li,
.handbook-page .handbook-content dd,
.handbook-page .handbook-content dt{
  color:var(--hb-text)!important;
}
.handbook-page .handbook-content p{margin:.45rem 0 .9rem}
.handbook-page .handbook-content ul,
.handbook-page .handbook-content ol{margin:.6rem 0 1rem;padding-left:1.4rem}
.handbook-page .handbook-content li+li{margin-top:.32rem}
.handbook-page .handbook-content a{color:#71591f!important;text-decoration-color:rgba(113,89,31,.45)}
.handbook-page .handbook-content a:hover{text-decoration-color:#71591f}
.handbook-page .handbook-content .content-body{
  width:100%!important;
  max-width:none!important;
}
.handbook-page .handbook-content code,
.handbook-page .handbook-content kbd{
  padding:.12em .35em;
  color:#322d20!important;
  background:#ece6d8!important;
  border:1px solid #d4c9af!important;
  border-radius:2px;
}

/* Kicker / Legacy-Eyebrows */
.handbook-page .handbook-content .eyebrow,
.handbook-page .handbook-content .category,
.handbook-page .handbook-content .community-kicker,
.handbook-page .handbook-content .overview-title{
  color:var(--hb-gold-dark)!important;
  background:transparent!important;
  font-size:calc(.73rem + 5px)!important;
  font-weight:900!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
  text-shadow:none!important;
}

/* Cards / Panels aus älteren Handbuchseiten */
.handbook-page .handbook-content .card,
.handbook-page .handbook-content .cms-panel,
.handbook-page .handbook-content .overview-card,
.handbook-page .handbook-content .screenshot-frame,
.handbook-page .handbook-content .formula-box,
.handbook-page .handbook-content .formula-desc{
  background:var(--hb-card)!important;
  color:var(--hb-text)!important;
  border:1px solid var(--hb-line)!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
.handbook-page .handbook-content .card,
.handbook-page .handbook-content .cms-panel,
.handbook-page .handbook-content .overview-card{padding:14px!important}

/* Gemeinsame Darstellung und Zustandssteuerung für importierte Reiter. */
.handbook-page .handbook-content .main-tabs,
.handbook-page .handbook-content .sub-tabs{
  display:flex!important;
  flex-wrap:wrap;
  gap:7px;
}
.handbook-page .handbook-content .main-tabs{
  margin:0 0 14px;
  padding:0 0 11px;
  border-bottom:1px solid var(--hb-line);
}
.handbook-page .handbook-content .sub-tabs{
  margin:0 0 14px;
}
.handbook-page .handbook-content :is(.main-tab,.sub-tab){
  appearance:none;
  min-height:38px;
  max-width:100%;
  padding:8px 12px;
  border:1px solid var(--hb-line-strong);
  border-radius:2px;
  background:var(--hb-card-soft);
  color:var(--hb-text);
  font:inherit;
  font-size:.86rem;
  font-weight:800;
  line-height:1.2;
  text-align:left;
  cursor:pointer;
}
.handbook-page .handbook-content :is(.main-tab,.sub-tab):hover{
  border-color:var(--hb-gold);
}
.handbook-page .handbook-content :is(.main-tab,.sub-tab):focus-visible{
  outline:3px solid rgba(168,132,52,.22);
  outline-offset:1px;
}
.handbook-page .handbook-content :is(.main-tab,.sub-tab).active{
  border-color:var(--hb-gold-dark);
  background:var(--hb-gold-dark);
  color:#fff;
}
.handbook-page .handbook-content .main-panel:not(.active),
.handbook-page .handbook-content .sub-panel:not(.active){
  display:none!important;
}
.handbook-page .handbook-content :is(.main-panel,.sub-panel).active{
  display:block!important;
}
.handbook-page .handbook-content .overview-grid,
.handbook-page .handbook-content .grid-2,
.handbook-page .handbook-content .media-split{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;
  margin:12px 0!important;
}
.handbook-page .handbook-content .grid-3{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
}

/* Hinweise: einheitliche, kontraststarke Semantik für alle Legacy-Varianten. */
.handbook-page .handbook-content :is(
  .warning,
  .warning-box,
  .ag-warning,
  .rdp-warning,
  .ag-note,
  .rdp-tip,
  .info-box,
  .military-info-box,
  blockquote
){
  margin:14px 0!important;
  padding:13px 15px!important;
  background:#fff4d6!important;
  color:#49370f!important;
  border:1px solid #d6bd79!important;
  border-left:4px solid var(--hb-gold)!important;
  border-radius:4px!important;
  box-shadow:none!important;
}
.handbook-page .handbook-content :is(
  .warning,.warning-box,.ag-warning,.rdp-warning,.ag-note,.rdp-tip,.info-box,.military-info-box,blockquote
) :is(p,li,span,strong,small,h3,h4){
  color:inherit!important;
}
.handbook-page .handbook-content :is(.warning,.warning-box,.ag-warning,.rdp-warning) strong{
  color:#6b3d0c!important;
}
.handbook-page .handbook-content :is(.success-box,.rdp-good){
  background:#eaf5ed!important;
  color:#234d30!important;
  border:1px solid #aac9b2!important;
  border-left:4px solid #3f7652!important;
}
.handbook-page .handbook-content :is(.success-box,.rdp-good) :is(p,li,span,strong,small,h3,h4){
  color:inherit!important;
}

/* Häufige Handbuch-Komponenten bleiben auch ohne ihr altes Inline-CSS lesbar. */
.handbook-page .handbook-content :is(
  .ag-card,.ag-step,.rdp-card,.rdp-subcard,.rdp-step,.capture-card,
  .command-level,.order-card,.mission-card,.supply-step,.panel
){
  min-width:0!important;
  padding:16px!important;
  background:var(--hb-card)!important;
  color:var(--hb-text)!important;
  border:1px solid var(--hb-line)!important;
  border-radius:4px!important;
  box-shadow:none!important;
}
.handbook-page .handbook-content :is(
  .ag-grid,.rdp-grid,.capture-grid,.intro-grid,.order-cards,.mission-grid,.supply-flow
){
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:14px!important;
  margin:14px 0!important;
}
.handbook-page .handbook-content :is(.ag-steps,.rdp-steps,.capture-steps,.command-structure){
  display:grid!important;
  gap:10px!important;
  margin:14px 0!important;
}
.handbook-page .handbook-content :is(.ag-table-wrap,.summary-table-wrap){
  max-width:100%!important;
  overflow-x:auto!important;
}

/* Semantic variants win over a combined legacy card class. */
.handbook-page .handbook-content :is(.rdp-card,.capture-card,.ag-card):is(
  .warning,.warning-box,.ag-warning,.rdp-warning,.ag-note,.rdp-tip
){
  background:#fff4d6!important;
  color:#49370f!important;
  border-color:#d6bd79!important;
  border-left:4px solid var(--hb-gold)!important;
}
.handbook-page .handbook-content :is(.rdp-card,.capture-card,.ag-card):is(.success-box,.rdp-good){
  background:#eaf5ed!important;
  color:#234d30!important;
  border-color:#aac9b2!important;
  border-left:4px solid #3f7652!important;
}
.handbook-page .handbook-content .rdp-bad{
  background:#f9e9e6!important;
  color:#6f2f29!important;
  border-color:#ddb5ae!important;
  border-left:4px solid #9b3a34!important;
}
.handbook-page .handbook-content .rdp-bad :is(p,li,span,strong,small,h3,h4){color:inherit!important}
.handbook-page .handbook-content .military-info-box .mib-header,
.handbook-page .handbook-content .military-info-box .mib-body,
.handbook-page .handbook-content .mib-header-title{
  background:transparent!important;
  color:var(--hb-text)!important;
  border:0!important;
  padding:0!important;
}
.handbook-page .handbook-content .mib-header-stripes{display:none!important}
.handbook-page .handbook-content .mib-icon-info{color:var(--hb-gold-dark)!important}

/* Tabellen */
.handbook-page .handbook-content .military-table-wrap{
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  background:transparent!important;
  border:0!important;
  padding:0!important;
}
.handbook-page .handbook-content table,
.handbook-page .handbook-content .military-table,
.handbook-page .handbook-content .handbook-table{
  width:100%!important;
  min-width:620px;
  border-collapse:collapse!important;
  border-spacing:0!important;
  background:#fff!important;
  color:var(--hb-text)!important;
  box-shadow:none!important;
}
.handbook-page .handbook-content th{
  padding:10px 11px!important;
  background:#ebe7dd!important;
  color:#363832!important;
  border:1px solid #d2ccbf!important;
  font-size:.76rem!important;
  font-weight:900!important;
  text-align:left!important;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.handbook-page .handbook-content td{
  padding:10px 11px!important;
  background:#fff!important;
  color:var(--hb-text)!important;
  border:1px solid #ded9ce!important;
  vertical-align:top!important;
}
.handbook-page .handbook-content tr:nth-child(even) td{background:#fbfaf6!important}

/* Bilder: Position bleibt im ursprünglichen DOM, Darstellung wird modernisiert. */
.handbook-page .handbook-content img,
.handbook-page .handbook-content .responsive-img,
.handbook-page .handbook-image{
  display:block!important;
  width:auto!important;
  max-width:100%!important;
  height:auto!important;
  margin:12px auto!important;
  border:1px solid var(--hb-line)!important;
  background:#ede9df!important;
  box-shadow:none!important;
}
.handbook-page .handbook-content img[role="button"]{cursor:zoom-in}
.handbook-page .handbook-content .screenshot-caption{
  padding:8px 10px!important;
  color:var(--hb-muted)!important;
  background:#efebe1!important;
  border-top:1px solid var(--hb-line)!important;
  font-size:.8rem!important;
  text-align:center!important;
}

.handbook-page-state{
  margin:8px 2px 18px;
  color:var(--hb-muted);
  font-size:.76rem;
  text-align:right;
}
.handbook-notice{margin-bottom:14px}

.handbook-lightbox{
  width:min(1100px,94vw);
  max-height:90%;
  padding:42px 16px 16px;
  border:1px solid #8b826e;
  background:#151714;
}
.handbook-lightbox::backdrop{background:rgba(0,0,0,.78)}
.handbook-lightbox img{display:block;max-width:100%;max-height:78vh;margin:auto}
.handbook-lightbox button{
  position:absolute;
  top:7px;
  right:9px;
  width:34px;
  height:34px;
  border:1px solid #777062;
  background:#2d302c;
  color:#fff;
  font-size:1.25rem;
  cursor:pointer;
}

@media(max-width:800px){
  .handbook-chapter-nav{
    top:var(--frontend-header-height,64px);
    grid-template-columns:1fr minmax(170px,45%);
    gap:8px 10px;
  }
  .handbook-chapter-nav__label{display:none}
  .handbook-page .handbook-content .overview-grid,
  .handbook-page .handbook-content .grid-2,
  .handbook-page .handbook-content .grid-3,
  .handbook-page .handbook-content .media-split,
  .handbook-page .handbook-content :is(.ag-grid,.rdp-grid,.capture-grid,.intro-grid,.order-cards,.mission-grid,.supply-flow){
    grid-template-columns:1fr!important;
  }
}

@media(max-width:560px){
  .handbook-chapter-nav{
    position:relative;
    top:auto;
    grid-template-columns:1fr;
    padding:10px;
  }
  .handbook-chapter-nav__current{white-space:normal}
  .handbook-chapter-nav__select{min-height:44px;font-size:16px}
  .handbook-page .handbook-content-section,
  .handbook-page .handbook-empty-section{padding:15px!important}
  .handbook-page .handbook-content table,
  .handbook-page .handbook-content .military-table,
  .handbook-page .handbook-content .handbook-table{min-width:560px}
}
