body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f6f8;
    color: #222;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

header {
    background: #1f2933;
    color: #fff;
    padding: 20px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 1.6rem;
}

header p {
    margin-top: 8px;
    font-size: 0.95rem;
    color: #cfd8dc;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Back button ===== */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #1565c0;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

/* ===== Content layout ===== */
.content {
    background: #ede7e2;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 20px;
}

.content h2 {
    margin-top: 0;
    font-size: 1.3rem;
}

.content p {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* ===== Images (schemes, photos) ===== */
.images {
    margin: 20px 0;
    text-align: center;
}

.images img {
    display: block;
    width: 90%;
    max-width: 900px;
    height: auto;              /* ключевое */
    object-fit: contain;       /* НИКОГДА не обрезает */
    margin: 0 auto;
    background: #e0e0e0;
    border-radius: 6px;
    cursor: zoom-in;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
}

.lightbox img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 6px;
    background: #fff;
}

/* ===== Board footer ===== */
.board-footer {
    margin-top: 12px;
}

.board-footer a {
    font-size: 0.9rem;
    font-weight: bold;
    color: #1565c0;
}

.board-footer a:hover {
    text-decoration: underline;
}

/* ===== Horizontal board layout ===== */
.board-horizontal {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.board-horizontal img {
    width: 250px;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
    border-radius: 8px;
}

.board-content {
    flex: 1;
}

/* ===== Command table ===== */
.command-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    display: none;
}

.command-table th,
.command-table td {
    border: 1px solid #bbb;
    padding: 8px;
    font-size: 0.9rem;
}

.command-table th {
    background-color: #f4f4f4;
    text-align: left;
}

.toggle-table {
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 0.9rem;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.toggle-table:hover {
    background: #0d3b7a;
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
    .board-horizontal {
        flex-direction: column;
    }

    .board-horizontal img {
        width: 100%;
        max-height: none;
    }

    .images img {
        width: 100%;
    }
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: #666;
}
.content-divider {
    border: none;
    height: 1px;
    background-color: #d0d0d0;
    margin: 30px 0;
}
