:root {
    --bg-color: #ffffff;
    --panel-color: #ffffff00;
    --border-color: #cfcfcf00;
    --text-color: #333;
    --accent-color: #8b0000;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Times New Roman", Times, serif;
    background-color: var(--bg-color);
    background-image: url("images/layout/FullScreen_BorderBG.png");
    background-repeat: repeat-y;
    background-position: center top;
    background-size: 100% auto;
    color: var(--text-color);
}

.site-layout {
    max-width: 1300px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 0 12px 20px;
}

.site-header {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr) minmax(0, 280px);
    align-items: center;
    gap: 4px;
    padding: 16px 0 10px;
}

.portrait {
    width: min(100%, 150px);
    aspect-ratio: 3 / 4;
    max-height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    justify-self: center;
}

.logo {
    width: 100%;
    max-width: 800px;
    justify-self: center;
}

.main-grid {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 4px;
    align-items: stretch;
}

.control-panel,
.page-content,
.site-footer {
    background: var(--panel-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.control-panel {
    padding: 14px;
    text-align: center;
}

.left-controls .control-list {
    list-style: none;
    padding-left: 0;
}

.left-controls .control-list li {
    margin-bottom: 14px;
}

.left-controls .control-list a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 170px;
    text-align: center;
    border: 0;
    text-decoration: none;
    color: #1a3568;
    background: transparent;
    font-weight: 700;
    transition: transform 170ms ease, filter 220ms ease, text-shadow 220ms ease;
}

.left-controls .control-list a:hover {
    transform: translateY(-2px) scale(1.01);
    filter: saturate(1.1);
    text-shadow: 0 0 8px rgba(70, 129, 244, 0.45);
}

.left-controls .control-list a:focus-visible {
    outline: 2px solid #d9a932;
    outline-offset: 3px;
    border-radius: 12px;
}

.left-controls .control-list a:active {
    transform: translateY(0);
}

.left-controls .control-list a::before {
    content: "";
    display: block;
    width: 120px;
    height: 120px;
    background: url("images/layout/CrossICXCNIKA_Blue.png") center/contain no-repeat;
    filter: drop-shadow(0 3px 7px rgba(11, 45, 104, 0.28));
    transition: transform 170ms ease, filter 220ms ease;
}

.left-controls .control-list a:hover::before,
.left-controls .control-list a:focus-visible::before {
    transform: translateY(-2px) scale(1.03);
    filter: drop-shadow(0 8px 14px rgba(11, 45, 104, 0.38)) drop-shadow(0 0 10px rgba(92, 154, 255, 0.75));
}

.left-controls .control-list a:active::before {
    transform: translateY(0);
    filter: drop-shadow(0 4px 8px rgba(11, 45, 104, 0.30)) drop-shadow(0 0 6px rgba(92, 154, 255, 0.5));
}


.right-info {
    margin-bottom: 16px;
}

.right-info p {
    margin: 0 0 10px;
}

.right-control-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.right-control-buttons a,
.btn-byzantine-primary {
    display: inline-block;
    width: 100%;
    max-width: 230px;
    padding: 10px 14px;
    border: 1px solid rgba(82, 12, 17, 0.55);
    border-radius: 999px;
    text-decoration: none;
    color: #f9eec7;
    background: #8b1a1a;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(79, 9, 15, 0.22);
    transition: transform 170ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.right-control-buttons a:hover,
.btn-byzantine-primary:hover {
    transform: translateY(-2px) scale(1.01);
    filter: saturate(1.08);
    box-shadow: 0 6px 14px rgba(79, 9, 15, 0.28), 0 0 10px rgba(236, 185, 74, 0.62);
}

.right-control-buttons a:focus-visible,
.btn-byzantine-primary:focus-visible {
    outline: 2px solid #d9a932;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(217, 169, 50, 0.45), 0 8px 18px rgba(79, 9, 15, 0.42);
}

.right-control-buttons a:active,
.btn-byzantine-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(79, 9, 15, 0.24), 0 0 6px rgba(236, 185, 74, 0.45);
}

.panel-title {
    margin: 0 0 8px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.control-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    text-align: center;
}

.page-content {
    padding: 16px;
    text-align: center;
}

.page-content-image {
    display: block;
    width: min(100%, 680px);
    height: auto;
    max-height: 65vh;
    margin: 0 auto 18px;
    object-fit: contain;
    border-radius: 10px;
}

.donate-online-link {
    margin: 0 auto 14px;
}

.language-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 auto 18px;
}

.language-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(82, 12, 17, 0.55);
    border-radius: 999px;
    padding: 9px 14px;
    background: #ffffff;
    color: #5f1111;
    font-weight: 700;
    cursor: pointer;
}

.language-btn.active {
    color: #f9eec7;
    background: #8b1a1a;
}

.language-btn img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.donate-letter-image {
    display: block;
    width: min(100%, 960px);
    max-height: 78vh;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-in;
}

.donation-zoom-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 1200;
}

.donation-zoom-modal.open {
    display: flex;
}

.donation-zoom-card {
    position: relative;
    width: min(1400px, 100%);
    max-height: 96vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donation-zoom-image {
    width: auto;
    max-width: 100%;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.donation-zoom-close {
    position: absolute;
    top: -10px;
    right: -4px;
    width: 38px;
    height: 38px;
    border: 1px solid #d8c79a;
    border-radius: 999px;
    background: #8b1a1a;
    color: #f9eec7;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.header-center-sm,
.header-center-md,
.header-center-lg,
.header-center-xl {
    margin: 0 0 12px;
    text-align: center;
    font-weight: 700;
    line-height: 1.2;
    color: #B81414;
}

.header-center-sm { font-size: clamp(1.1rem, 2vw, 1.45rem); }
.header-center-md { font-size: clamp(1.35rem, 3vw, 1.9rem); }
.header-center-lg { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.header-center-xl { font-size: clamp(1.9rem, 5vw, 2.9rem); }

.text-paragraph {
    margin: 0 auto 12px;
    max-width: 70ch;
    line-height: 1.65;
    font-size: clamp(0.98rem, 1.8vw, 1.08rem);
}

.text-paragraph-lead {
    margin: 0 auto 14px;
    max-width: 72ch;
    line-height: 1.7;
    font-size: clamp(1.02rem, 2vw, 1.2rem);
    font-weight: 600;
}

.text-paragraph-muted {
    margin: 0 auto 10px;
    max-width: 70ch;
    line-height: 1.55;
    color: #555;
    font-size: clamp(0.92rem, 1.6vw, 1rem);
}

/*
 * Preformatted text blocks:
 * - Keeps line breaks/spaces exactly as typed in HTML
 * - Wraps long lines so content never overflows the page-content area
 */
.formatted-paragraph {
    margin: 0 auto 16px;
    max-width: 78ch;
    padding: 14px 16px;
    text-align: left;
    line-height: 1.65;
    font-size: clamp(0.98rem, 1.8vw, 1.08rem);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(139, 26, 26, 0.18);
    border-radius: 10px;
}

.formatted-paragraph.is-tight {
    line-height: 1.55;
}

.parallel-text {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    margin: 0 auto;
    max-width: 1150px;
}

.parallel-text .formatted-paragraph {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .parallel-text {
        grid-template-columns: 1fr;
    }
}

.footer-wrapper {
    margin-top: 16px;
}

.site-footer {
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 18px;
    text-align: center;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
}

.mobile-controls-trigger {
    display: none;
    margin: 10px 0;
    text-align: center;
}

.menu-btn {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    font-size: 1rem;
    border: 1px solid rgba(82, 12, 17, 0.55);
    border-radius: 999px;
    padding: 10px 14px;
    color: #f9eec7;
    background: #8b1a1a;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(79, 9, 15, 0.22);
    transition: transform 170ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.menu-btn:hover {
    transform: translateY(-2px) scale(1.01);
    filter: saturate(1.08);
    box-shadow: 0 6px 14px rgba(79, 9, 15, 0.28), 0 0 10px rgba(236, 185, 74, 0.62);
}

.menu-btn:focus-visible {
    outline: 2px solid #d9a932;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(217, 169, 50, 0.45), 0 8px 18px rgba(79, 9, 15, 0.42);
}

.menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(79, 9, 15, 0.24), 0 0 6px rgba(236, 185, 74, 0.45);
}

.mobile-right-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mobile-right-modal.open {
    display: flex;
}

.modal-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 12px;
    padding: 16px;
}


#mobile-right-controls-content,
#mobile-right-controls-content .right-info,
#mobile-right-controls-content .control-list,
#mobile-right-controls-content .right-control-buttons,
#mobile-right-controls-content .right-control-buttons li {
    text-align: center;
    justify-content: center;
    align-items: center;
}

#mobile-right-controls-content .right-info p {
    margin-left: auto;
    margin-right: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.close-btn {
    border: 0;
    background: none;
    font-size: 1.4rem;
    cursor: pointer;
}



@media (min-width: 901px) {
    .site-header {
        grid-template-columns: 280px 1fr 280px;
    }

    .main-grid {
        align-items: stretch;
    }

    .left-controls,
    .right-controls {
        min-height: 520px;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .left-controls .control-list,
    .right-controls .right-info,
    .right-controls .right-control-buttons {
        width: 100%;
    }
}

@media (min-width: 901px) {
    .control-panel {
        position: relative;
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .control-panel::before,
    .control-panel::after {
        content: "";
        position: absolute;
        left: 0;
        width: 100%;
        height: 54px;
        background-repeat: no-repeat;
        background-size: contain;
        background-position: center;
        pointer-events: none;
    }

    .control-panel::before {
        top: 6px;
        background-image: url("images/layout/Border_Top2.png");
    }

    .control-panel::after {
        bottom: 6px;
        background-image: url("images/layout/Border_Bot2.png");
    }
}

@media (max-width: 900px) {
    body {
        overflow-x: hidden;
    }

    .site-layout,
    .main-grid,
    .main-grid > * {
        min-width: 0;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .left-controls {
        order: 1;
        text-align: center;
    }

    .left-controls .control-list {
        list-style: none;
        padding-left: 0;
        display: flex;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .left-controls .control-list li {
        flex: 1 1 0;
        min-width: 0;
        margin-bottom: 0;
    }

    .left-controls .control-list a {
        max-width: none;
    }

    .left-controls .control-list a::before {
        width: clamp(64px, 22vw, 120px);
        height: clamp(64px, 22vw, 120px);
    }

    .mobile-controls-trigger {
        display: block;
        order: 2;
    }

    .page-content {
        order: 3;
    }

    .right-controls.desktop-only {
        display: none;
    }

    .footer-wrapper { order: 4; }
}

@media (max-width: 600px) {
    .site-layout {
        padding-left: 8px;
        padding-right: 8px;
    }

    .site-header {
        grid-template-columns: minmax(52px, 74px) 1fr minmax(52px, 74px);
        gap: 8px;
        padding-top: 12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .portrait {
        width: 100%;
        max-height: 95px;
    }
}

.page-content iframe {
    width: min(100%, 100%);
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}


.divider {
    margin: 24px 0;
}

.divider img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.divider-red {
    border: 0;
    border-top: 3px solid #9f1111;
    margin: 24px auto;
    width: min(100%, 720px);
}

.divider-image,
.divider-border-top,
.divider-border-bot,
.divider-border-top2,
.divider-border-bot2 {
    display: block;
    width: min(100%, 620px);
    min-height: 24px;
    margin: 24px auto;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.divider-border-top { background-image: url("images/layout/Border_Top.png"); }
.divider-border-bot { background-image: url("images/layout/Border_Bot.png"); }
.divider-border-top2 { background-image: url("images/layout/Border_Top2.png"); }
.divider-border-bot2 { background-image: url("images/layout/Border_Bot2.png"); }
