/* Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
    font-size: 0.8rem;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* Layout common to screen and print */
main {
}

article {
}

figure {
}

figcaption {
    font-family: "Cousine", monospace;
    white-space: pre-wrap;
    text-align: center;
    margin-top: 1rem;
}

figcaption > p {
    white-space: pre-wrap;
    text-align: center;
    margin-top: 0rem;
    margin-bottom: 0rem;
    padding: 0;
    width: 100%;
}

figure img {
}

p {
    width: 66%;
    line-height: 1.5;
}

em {
    font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* SCREEN VIEW */
@media screen {
    html, body {
    }

    main {
        background-color: #333;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0;
    }

    article {
        width: 177.8mm;
        /*height: 100vh;*/
        aspect-ratio: 1 / 1.414; /* A5 aspect ratio */

        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        align-items: center;
        break-before: always;
        font-size:0.9rem;
        margin-bottom: 1%;
        color: #333;
        background-color: whitesmoke;
        scroll-snap-align: start;
    }

    figure {
        margin: 0;
        display: flex;
        flex-direction: column;
        padding-top: 10%;
        padding-bottom: 6%;
        color: #444;
        font-size: smaller;
    }

    img {
        display: flex;
        flex-direction: column;
        height: auto;
        object-fit: contain;
    }

    .landscape {
        width: 78%;
    }

    .portrait {
        max-width: 52%;
    }

    .filler {
        flex-grow: 1;
    }
}

/* PRINT VIEW: Landscape A4 sheet with A5 page on right */
@media print {
    @page {
        size: A4 landscape;
        margin: 0; /* Removing default browser margins for precision */
    }

    body {
        width: 297mm;
        height: 210mm;
        font-size: 3mm;
        background-color: #333;
    }

    main {
        /*left: 153mm; /* Centering the A5 content on A4 landscape */
        margin-left:153mm;
        width: 144mm;
        top: 0mm;
        transform: none; /* Reset the screen centering */
        display: flex;
        flex-direction: column;
    }

    article {
        width: 100%;
        height: 210mm;
        display: flex;
        flex-direction: column;
        align-items: center;
        background-color: white;
    }

    img {
        display: flex;
        flex-direction: column;
        height: auto;
        object-fit: contain;
    }

    figure {
        padding-top: 15mm;
        display: flex;
        flex-direction: column;
    }

    .landscape {
        width: 116mm;
        height: auto;
    }

    .portrait {
        width: 77.3mm;
        height: auto;
    }

}
