/* ICD Heritage — vzhľad pôvodného webu Inštitútu cirkevných dejín (2011), responzívne. */

@font-face {
    font-family: 'Almendra';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/almendra-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Almendra';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/almendra-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #ffb777;
    --text: #5c350b;
    --heading: #000853;
    --heading-shadow: #a57d2d;
    --link: #c62b2b;
    --link-hover: #df8e00;
    --line: rgba(92, 53, 11, .28);
    --serif: 'Book Antiqua', 'Palatino Linotype', Palatino, 'URW Palladio L', Georgia, serif;
    --script: 'Almendra', 'Book Antiqua', Palatino, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--bg) url('../images/stripe.jpg') repeat-x 0 0;
}

body {
    margin: 0;
    min-height: 100vh;
    background: url('../images/manuscript.jpg') no-repeat center top;
    color: var(--text);
    font: 17px/1.8 var(--serif);
    -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; border: 0; }

a { color: var(--link); text-decoration: none; }
a:hover, a:focus-visible { color: var(--link-hover); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--heading); outline-offset: 2px; }

strong, b { color: var(--heading); }

.skip-link {
    position: absolute;
    left: 8px;
    top: -60px;
    z-index: 10;
    padding: 8px 14px;
    background: #fff8a6;
    color: var(--heading);
    border: 1px solid var(--line);
}
.skip-link:focus { top: 8px; }

/* ---------------------------------------------------------------- rozloženie */

.page {
    max-width: 1008px;
    margin: 0 auto;
    background: url('../images/page.jpg') no-repeat center top;
}

.topbar {
    min-height: 67px;
    padding: 10px 23px 0;
    font-size: 13px;
    line-height: 2;
}

.site-head a { display: block; }
.site-head img { display: block; width: 100%; }

.content {
    display: flex;
    align-items: flex-start;
    /* oranžový panel v obrázku zaberá 21–982 px z 1008 px, obsah musí ostať vnútri */
    padding-right: 2.6%;
    background: url('../images/content.png') repeat-y 0 0 / 100% 3px;
}

.menu {
    flex: 0 0 191px;
    margin-left: 23px;
    padding-top: 12px;
    text-align: center;
}

.text {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 20px 32px;
}
.text:focus { outline: none; }

.site-foot {
    min-height: 57px;
    padding: 16px 20px 10px;
    background: url('../images/footer.png') no-repeat 0 0 / 100% 57px;
    text-align: center;
    font-size: 13px;
}
.site-foot small { display: block; }
.footer-component { margin-bottom: 4px; }

/* ---------------------------------------------------------------- menu (tlačidlá ako na pôvodnom webe) */

.menu ul { margin: 0; padding: 0; list-style: none; }

.menu li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 178px;
    height: 61px;
    margin: 0 auto 10px;
    padding: 3px 14px 0;
    background: url('../images/button.png') no-repeat 0 0;
    color: var(--text);
    font: 20px/1.05 var(--script);
    text-align: center;
}
.menu li a:hover,
.menu li a:focus-visible,
.menu li.current > a {
    background-image: url('../images/button-hover.png');
    color: var(--text);
}

/* podstránky v menu */
.menu li ul a { height: 44px; font-size: 16px; background-size: 100% 100%; width: 158px; }

.menu-toggle { display: none; }

.menu-component { margin: 10px 4px 0; font-size: 14px; line-height: 1.6; }

/* ---------------------------------------------------------------- obsah */

h1, h2, h3, h4, h5 {
    margin: 4px 0 .6em;
    color: var(--heading);
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-shadow: -1px 1px 2px var(--heading-shadow);
}
h1 { font-size: 2em; margin-top: 8px; }
.prose h2 { font-size: 1.4em; margin-top: 1.4em; }
.prose h3 { font-size: 1.15em; margin: 1.2em 0 .2em; }

.prose { text-align: justify; hyphens: auto; overflow-wrap: break-word; }
.prose p { margin: 0 0 1em; }
.prose .lead { font-size: 1.08em; }
.prose img { vertical-align: middle; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose blockquote { margin: 1em 0; padding: .5em 1em; border-left: 3px solid var(--heading-shadow); background: rgba(255, 248, 166, .35); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }

.prose table { border-collapse: collapse; margin: 1em auto; background: rgba(255, 248, 166, .25); }
.prose th, .prose td { padding: .35em .8em; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--heading); }
.table-scroll { overflow-x: auto; }

/* zoznam dokumentov (PDF, obrázky) — ikony z pôvodného webu */
.doc-list { list-style: none; margin: .4em 0 1.2em; padding: 0; }
.doc-list li { margin: .35em 0; }
.doc {
    display: inline-block;
    padding-left: 38px;
    min-height: 30px;
    line-height: 30px;
    background: url('../images/icon-pdf.png') no-repeat 0 50% / 30px 30px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.doc-img { background-image: url('../images/icon-jpg.png'); }
.doc-photo { background-image: url('../images/icon-photo.png'); }

.event { margin-bottom: 1.4em; text-align: center; }
.event .doc-list { display: table; margin: .2em auto 0; text-align: left; }
.event-meta { text-align: center; margin: 0; }
.prose .event-meta { text-align: center; margin: 0; }

.banner { text-align: center; }
.banner a { display: inline-block; }

.contact-card { text-align: center; font-size: 1.1em; }
.prose .contact-card p { text-align: center; }
.contact-name { font-size: 1.25em; letter-spacing: .03em; }

.back-link { font-size: .95em; }

ul.gallery {
    list-style: none;
    margin: 1em 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}
ul.gallery a { display: block; border: 2px solid #fff8a6; box-shadow: 0 1px 4px rgba(92, 53, 11, .35); background: #fff8a6; }
ul.gallery a:hover { border-color: var(--link-hover); }
ul.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* plugin I18N Gallery (Fancybox aj prettyPhoto) — náhľady v rovnakom štýle; selektory s .prose, aby prebili vložené štýly pluginu */
.prose div.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin: 1em 0;
}
.prose div.gallery > div[style*="clear"] { display: none; }
.prose div.gallery .gallery-thumb {
    float: none;
    margin: 0;
    padding: 0;
    border: 2px solid #fff8a6;
    background: #fff8a6;
    box-shadow: 0 1px 4px rgba(92, 53, 11, .35);
    transition: border-color .15s;
}
.prose div.gallery .gallery-thumb:hover { border-color: var(--link-hover); }
.prose div.gallery .gallery-thumb a { display: block; height: auto; }
.prose div.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.prose div.gallery .gallery-title { padding: 2px 6px; font-size: .85em; line-height: 1.4; text-align: center; }
.prose div.gallery .gallery-image { float: none; max-width: 100%; border-color: var(--line); background: #fff8a6; }
.prose div.gallery div.pagify { grid-column: 1 / -1; text-align: center; }
.prose div.gallery div.pagify a { background: #fff8a6; color: var(--text); border-color: var(--line); }
.prose div.gallery div.pagify a.current { color: var(--link); }

/* okno lightboxu: popis písmom webu, tmavohnedé pozadie */
#fancybox-wrap #fancybox-title, #fancybox-wrap .fancybox-title-inside, div.pp_default .pp_description { font-family: var(--serif); color: var(--text); }
#fancybox-overlay, div.pp_overlay { background-color: #3a2208 !important; }

/* ---------------------------------------------------------------- šablóna full-width: menu nad textom */

.content-wide { flex-direction: column; align-items: stretch; }
.content-wide .menu { flex: none; margin: 0; padding: 12px 10px 0; }
.content-wide #main-navigation > ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 8px; }
.content-wide .menu li a { margin-bottom: 6px; }
.content-wide .menu li ul { display: none; }

/* ---------------------------------------------------------------- mobil a tablet */

@media (max-width: 820px) {
    body { font-size: 16px; }
    .page { background: none; }
    .topbar { min-height: 0; padding: 6px 12px; font-size: 12px; }
    .content { flex-direction: column; align-items: stretch; padding-right: 0; background: rgba(255, 124, 36, .12); }
    .menu { flex: none; margin: 0; padding: 10px 10px 0; }
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 178px;
        height: 61px;
        padding: 3px 0 0;
        border: 0;
        background: url('../images/button.png') no-repeat 0 0;
        color: var(--text);
        font: 22px/1 var(--script);
        cursor: pointer;
    }
    .menu-toggle[aria-expanded="true"] { background-image: url('../images/button-hover.png'); }
    .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 20px; height: 2px; background: currentColor; position: relative; }
    .menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
    .menu-icon::before { top: -6px; }
    .menu-icon::after { top: 6px; }
    .js .menu nav { display: none; }
    .js .menu nav.is-open { display: block; }
    #main-navigation > ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 8px; padding-top: 8px; }
    .menu li ul { flex-basis: 100%; }
    .text { padding: 4px 14px 28px; }
    h1 { font-size: 1.6em; }
    .prose { text-align: left; }
    .prose table { font-size: .92em; }
    .org-table, .org-table tbody, .org-table tr, .org-table th, .org-table td { display: block; border: 0; }
    .org-table { background: none; }
    .org-table tr { padding: .5em .6em; border-bottom: 1px solid var(--line); }
    .org-table th:empty { display: none; }
    .org-table th, .org-table td { padding: 0; }
    .org-table td:empty { display: none; }
}

@media (max-width: 420px) {
    ul.gallery, .prose div.gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
    html, body, .page, .content, .site-foot { background: #fff !important; }
    .topbar, .menu, .skip-link { display: none !important; }
    body { color: #000; font-size: 12pt; }
    h1, h2, h3 { text-shadow: none; }
    a { color: #000; }
}
