:root {
    --page-background: #ffe;
    --panel-background: #fff;
    --panel-border: #ddd;
    --accent: #007bff;
    --accent-hover: #005b;
}

* { box-sizing: border-box; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-size:0.95em;
    align-items: stretch;
    justify-content: flex-start;
    padding-bottom: 10px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    background: var(--page-background);
}

button,
.button-link {
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

button { padding: 5px 10px; }

button:hover,
.button-link:hover { background: var(--accent-hover); }

.button-link {
    display: inline-block;
    padding: 5px 10px;
    text-decoration: none;
}

.column-left,
.column-rigth {
    width: 100%;
    height: auto;
    padding: 25px;
    border: 1px solid var(--panel-border);
    background: var(--panel-background);
}

.column-left {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    align-content: start;
    column-gap: 25px;
}

.homepage-page .column-left {
    grid-template-columns: 148px minmax(0, 1fr);
    grid-template-areas:
        "picture header"
        "counter header"
        "toc toc";
}

.homepage-page .picture { grid-area: picture; }

.homepage-page .header { grid-area: header; }

.homepage-page .visit-counter {
    grid-area: counter;
    padding-top: 10px;
}

.homepage-page .table-of-contents { grid-area: toc; }

.picture {
    position: relative;
    grid-column: 1;
    width: 148px;
    height: 228px;
    padding-top: 11px;
}

.header {
    grid-column: 2;
    min-width: 0;

    h3 {
        font-size: 0.95rem;
    }

    h4 {
        font-size: 0.8rem;
    }
}

.actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 18px;
}

.actions .button-link { flex: none; }

.visit-counter .superbutton {
    width: 148px;
    min-width: 0;
}

.homepage-page .header h4 {
    margin-bottom: 12px;
}

.publication-page .column-left {
    grid-template-columns: 1fr;
}

.publication-page .picture,
.publication-page .header,
.publication-page .table-of-contents,
.publication-page .actions {
    grid-column: 1;
}

.table-of-contents h4 {
    margin: 12px 0 8px;
}

.table-of-contents ol {
    font-size: 0.78em;
    margin: 0;
    padding-left: 1.3em;
    font-weight: bold;
    line-height: 1.45;
}

.table-of-contents .toc-appendix {
    list-style-type: upper-alpha;
}

.table-of-contents .toc-appendix-start {
    margin-top: 1.45em;
}

.column-rigth {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.return-link {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
}

.column-rigth iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.superbutton {
    position: relative;
    width: 200px;
    padding: 10px;
    overflow: hidden;
    background: var(--panel-background);
    color: #aaa;
}

.superbutton .a,
.superbutton .b {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background: var(--panel-background);
    transition: transform ease 0.3s;
}

.superbutton .b { transform: translateY(100%); }

.superbutton:hover .a { transform: translateY(-100%); }

.superbutton:hover .b { transform: translateY(0); }

input,
textarea {
    width: 100%;
    margin-bottom: 9px;
    padding: 10px;
    border: 2px solid #aaa;
    border-radius: 6px;
}

.website-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-error { color: #a00; font-size: 12px; }

#scroll-container {
    width: 100%;
    height: 60vh;
    min-height: 320px;
    margin-top: 10px;
    overflow-y: scroll;
    padding: 10px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel-background);
    font-size: 11px;
    white-space: pre-wrap;
}

@media (min-width: 1025px) and (min-height: 560px),
       (min-width: 768px) and (min-height: 560px) and (orientation: landscape) {
    html,
    body { height: 100%; overflow: hidden; }

    body {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 20px solid var(--page-background);
    }

    .column-left,
    .column-rigth {
        height: calc(100vh - 40px);
        padding: 20px 25px;
    }

    .column-left { width: 50%; }

    .publication-page .column-left { width: 265px; flex: none; overflow-y: auto; }

    .column-rigth { width: 50%; min-height: 0; }

    .publication-page .column-rigth { width: auto; flex: 1; }

    #scroll-container { flex: 1; height: auto; min-height: 0; }
}

@media (min-width: 768px) and (max-width: 1000px) and (min-height: 560px) and (orientation: landscape),
       (max-width: 479px) {
    .column-left { grid-template-columns: 1fr; }

    .picture,
    .header,
    .visit-counter,
    .table-of-contents,
    .actions { grid-column: 1; }
}

@media (max-width: 1000px) {
    .homepage-page .column-left {
        grid-template-columns: 1fr;
        grid-template-areas:
            "picture"
            "header"
            "counter"
            "toc";
    }
}
