/* Wiki duings and pagination styles */
.wiki-section {
    max-width: 1000px;
    margin: 1.5em auto 3em;
    padding: 0 1em;
}

.controls {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1em;
    margin-bottom:0.75em;
}

.pager {
    display:flex;
    gap:0.5em;
    align-items:center;
}

.pager button {
    padding:0.45em 0.8em;
    border:1px solid #444;
    background:#f2f2f2;
    border-radius:6px;
    cursor:pointer;
    font-weight:600;
}
.pager button:disabled { opacity:0.45; cursor:default; }

.wiki-grid {
    display:grid;
    /* increase min column width so Kästchen become wider on desktop */
    grid-template-columns: repeat(auto-fit, minmax(13cm, 1fr));
    gap:28px;
    align-items:center;
    justify-items:center;
    place-items: center;
    min-height:84vh; /* center single box vertically */
    padding: 1.5rem 0;
}

.duing {
    width:13cm;            /* increased width: 1.5cm extra on both sides */
    height: auto;          /* allow the box to grow vertically so long text wraps in the same Kästchen */
    min-width:220px;       /* fallback for very small viewports */
    min-height:220px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
    border:1px solid rgba(10,34,90,0.06);
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:14px;    /* softer corners */
    font-size:1rem;
    text-align:center;
    padding:14px;
    box-sizing:border-box;
    box-shadow: 0 18px 40px rgba(11,22,70,0.10), 0 6px 12px rgba(2,6,23,0.07);
}

/* checkbox inside each box */
.page-info { font-size:0.95rem; color:#222; }

@media (max-width:480px){
    /* allow slightly larger on small phones for readability */
    .duing { width:4.5cm; height:4.5cm; }
}

/* Layout inside each duing for image + text */
.duing-inner {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    width:100%;
    height:100%;
    gap:14px;
    padding:16px;
}

.duing-title {
    text-align:center;
    font-size:1.2rem;
    font-weight:800;
    color:#1b2a6a;
    padding:6px 8px;
    border-bottom:1px solid rgba(11,22,70,0.06);
}

.duing-desc {
    font-size:1rem;
    color:#111;
    padding:8px 6px;
    text-align:left;
    line-height:1.45;
    /* allow wrapping and preserve line breaks so long text appears as multiple lines
       inside the same Kästchen. We allow the container to expand vertically. */
    white-space:pre-wrap;       /* preserve line breaks from code */
    overflow-wrap:break-word;   /* break long words so they don't overflow */
    word-break:break-word;
    overflow: visible;
    hyphens: auto; /* allow automatic hyphenation when words are broken */
}

@media (max-width: 720px) {
    .wiki-grid { grid-template-columns: 1fr; min-height: 0; }
    /* make the box use most of the viewport width on mobile and allow height to grow */
    .duing { width: 92vw; aspect-ratio: auto; min-height: 160px; }
    /* let description flow freely on mobile as well */
    .duing-desc { max-height: none; overflow: visible; -webkit-line-clamp: none; line-clamp: none; }
}

/* Galaxy 3D push button style applied site-wide for buttons */
button,
input[type="button"],
.pager button,
.img-btn {
    --g1: #5a2bd6; /* purple */
    --g2: #2b6cff; /* blue */
    background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
    color: #fff;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 24px rgba(43,108,255,0.16), 0 4px 8px rgba(2,6,23,0.18);
    font-weight:800;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
    display: inline-block;
}

button:hover,
input[type="button"]:hover,
.pager button:hover,
.img-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.03) saturate(1.05);
}

button:active,
input[type="button"]:active,
.pager button:active,
.img-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.35);
}

button:focus,
input[type="button"]:focus,
.pager button:focus,
.img-btn:focus {
    outline: none;
    box-shadow: 0 10px 26px rgba(43,108,255,0.22), 0 0 0 4px rgba(138,163,255,0.12);
}

button:disabled,
input[type="button"]:disabled,
.pager button:disabled,
.img-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* (Duplicate .duing-desc removed) final styles are defined earlier */
