/* ═══════════════════════════════════════════════════════════════
   RULE/LEGAL DOCUMENT PAGES (Satzung, Ordnungen, Geschäftsverteilungsplan)
   Modernized layout and styling with green branding
   ─────────────────────────────────────────────────────────────── */

:root {
    --rule-primary: #2d5a27;
    --rule-primary-light: #3d7a35;
    --rule-bg: #f5f0e8;
    --rule-text: #1a2a18;
    --rule-text-mid: #4a5a48;
}

body.is-public .app-main .app-shell > h1 {
    color: #1f3320;
}

body.is-public .app-main .app-shell > p {
    color: #2f3d2f;
}

.rules-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0 24px;
}

.rules-view-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 20px;
}

.rules-view-switch .btn.is-active,
.rules-view-switch a.btn.is-active {
    background: var(--rule-primary-light);
    color: #fff;
    border-color: var(--rule-primary-light);
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.doc-grid-book {
    gap: 20px;
    padding: 10px 0;
}

.doc-grid-book::before {
    content: '';
    display: block;
    grid-column: 1 / -1;
    height: 10px;
    border-radius: 10px;
    background: linear-gradient(90deg, #4b2d18, #6b4225 35%, #7f5635 70%, #4b2d18);
    box-shadow: 0 3px 8px rgba(43, 24, 12, 0.24);
}

.doc-card {
    border: 1px solid rgba(45, 90, 39, 0.2);
    border-radius: 12px;
    padding: 18px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.08);
    color: #1f2937;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 90, 39, 0.14);
    border-color: rgba(45, 90, 39, 0.3);
}

.doc-card-book {
    position: relative;
    border: 1px solid rgba(64, 42, 20, 0.48);
    background: linear-gradient(165deg, #7c5330 0%, #6a4327 45%, #56351f 100%);
    box-shadow: 0 10px 18px rgba(41, 24, 12, 0.28), inset 0 0 0 1px rgba(255, 238, 204, 0.12);
    color: #f6e8cc;
    overflow: hidden;
}

.doc-card-book::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 7px;
    border-radius: 6px;
    background: linear-gradient(180deg, #f5e3b8 0%, #dabd8d 50%, #f2dfb1 100%);
    opacity: 0.8;
}

.doc-card-book:hover {
    transform: translateY(-4px) rotate(-0.3deg);
    box-shadow: 0 16px 26px rgba(41, 24, 12, 0.32), inset 0 0 0 1px rgba(255, 238, 204, 0.2);
    border-color: rgba(98, 67, 37, 0.6);
}

.doc-card h1,
.doc-card h2,
.doc-card h3 {
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.doc-card h3 {
    font-size: 1.2rem;
}

.doc-card-book h3,
.doc-card-book p,
.doc-card-book strong {
    color: #f6e8cc;
}

.doc-card p {
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.doc-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.pill {
    border: 1px solid rgba(45, 90, 39, 0.25);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.8rem;
    color: var(--rule-primary);
    background: rgba(45, 90, 39, 0.06);
    font-weight: 600;
}

.pill-status {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    background: rgba(61, 122, 53, 0.12);
    border-color: rgba(61, 122, 53, 0.3);
    color: var(--rule-primary-light);
}

.doc-card-book .pill {
    border-color: rgba(246, 232, 204, 0.45);
    color: #fef3da;
    background: rgba(251, 236, 205, 0.12);
}

.doc-card-book .pill-status {
    color: #f4d8a9;
    border-color: rgba(244, 216, 169, 0.55);
    background: rgba(80, 49, 28, 0.45);
}

.doc-content {
    margin: 14px 0;
    border: 1px solid rgba(45, 90, 39, 0.15);
    border-radius: 10px;
    padding: 14px;
    background: #f8fbf7;
    color: #1f2937;
    line-height: 1.6;
    max-height: 320px;
    overflow: auto;
}

.doc-card-book .doc-content {
    border-color: rgba(246, 232, 204, 0.26);
    background: rgba(44, 24, 12, 0.35);
    color: #f9ecd0;
}

.doc-content p {
    margin-bottom: 0.75rem;
}

.doc-content :is(h2, h3, h4) {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--rule-primary);
}

.doc-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

.doc-content .vg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.doc-content figcaption {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--rule-text-mid);
    line-height: 1.4;
}

.doc-content figcaption a {
    color: var(--rule-primary);
    text-decoration: underline;
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: #fff;
    border: 1px solid rgba(45, 90, 39, 0.15);
    border-radius: 6px;
    overflow: hidden;
}

.doc-content th,
.doc-content td {
    border: 1px solid rgba(45, 90, 39, 0.12);
    padding: 10px 12px;
    vertical-align: top;
    color: #1f2937;
}

.doc-content th {
    background: rgba(45, 90, 39, 0.08);
    font-weight: 700;
    color: var(--rule-primary-light);
}

.btn,
a.btn {
    display: inline-block;
    border: 1px solid var(--rule-primary);
    border-radius: 9px;
    padding: 9px 16px;
    text-decoration: none;
    color: #fff;
    background: var(--rule-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 6px rgba(45, 90, 39, 0.18);
}

.btn:hover,
a.btn:hover {
    background: var(--rule-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(45, 90, 39, 0.24);
}

.btn.secondary,
a.btn.secondary {
    background: transparent;
    color: var(--rule-primary);
    border: 1px solid var(--rule-primary);
}

.btn.secondary:hover,
a.btn.secondary:hover {
    background: rgba(45, 90, 39, 0.08);
}

.doc-card-book .btn.secondary,
.doc-card-book a.btn.secondary {
    border-color: rgba(247, 226, 186, 0.58);
    color: #f9e6bd;
    background: transparent;
}

.doc-card-book .btn.secondary:hover,
.doc-card-book a.btn.secondary:hover {
    background: rgba(249, 230, 189, 0.14);
}

.doc-card-book-open {
    position: relative;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.book-spine {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 50%;
    width: 12px;
    transform: translateX(-50%);
    border-radius: 8px;
    background: linear-gradient(180deg, #8a643c 0%, #6c4828 35%, #5a371f 70%, #8a643c 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 227, 186, 0.22);
    z-index: 1;
}

.book-pages {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(143, 110, 69, 0.42);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(50, 31, 16, 0.22);
    background: #f5e8cf;
}

.book-page {
    padding: 22px 22px 20px;
    background: linear-gradient(180deg, #f8edd7 0%, #f1e2c4 100%);
    color: #3f2d1d;
    min-height: 420px;
}

.book-page-left {
    border-right: 1px solid rgba(153, 119, 74, 0.35);
}

.book-page-right {
    box-shadow: inset 14px 0 18px -18px rgba(63, 45, 29, 0.35);
}

.book-page h2,
.book-page p,
.book-page strong {
    color: #3f2d1d;
}

.book-page-note {
    margin-top: 18px;
    font-size: 0.85rem;
    color: #755437;
    font-style: italic;
}

.doc-content-book {
    margin: 0;
    max-height: 540px;
    border: 1px solid rgba(153, 119, 74, 0.35);
    background: #fbf4e5;
    color: #3f2d1d;
}

.doc-content-book :is(h2, h3, h4) {
    color: #5b3d23;
}

@media (max-width: 900px) {
    .book-spine {
        display: none;
    }

    .book-pages {
        grid-template-columns: 1fr;
    }

    .book-page {
        min-height: 0;
    }

    .book-page-left {
        border-right: none;
        border-bottom: 1px solid rgba(153, 119, 74, 0.35);
    }
}
