/* Publiczny widok dokumentow oraz wspolny sklad podgladu/wydruku.
   Reguly sa celowo bardziej szczegolowe od ogolnych styli w main.css. */

/* EB Garamond (Google Fonts, OFL) — krzyzyki † w intencjach. Ladujemy
   z CDN Google Fonts, bo font jest dostepny na kazdym urzadzeniu
   z polaczeniem internetowym, a † jest metrycznie blizszy Times New Roman
   niz Carlito/Calibri. Waga 400 i 700, bo krzyzyk dziedziczy wage
   kontekstu (np. bold w naglowku dnia). */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;700&display=swap');

/* Carlito jest metrycznie zgodnym, otwartym zamiennikiem Calibri. Osadzamy
   wszystkie odmiany uzywane w tresci, aby sklad nie zalezal od fontow systemu. */
@font-face {
    font-family: "Parafia Carlito";
    src: url("/fonts/Carlito-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Parafia Carlito";
    src: url("/fonts/Carlito-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Parafia Carlito";
    src: url("/fonts/Carlito-Italic.ttf") format("truetype");
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Parafia Carlito";
    src: url("/fonts/Carlito-BoldItalic.ttf") format("truetype");
    font-style: italic;
    font-weight: 700;
    font-display: swap;
}

/* Pasek nawigacji zachowuje szerokosc i wyglad poprzedniego widoku Office. */
#containerNav {
    width: calc(100% - 2rem);
    max-width: 21cm;
    margin: 1rem auto 0;
    padding: 0;
    box-sizing: border-box;
}

#wsteczDalej {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    padding: 0;
}

#wsteczDalej > a,
#wsteczDalej > span {
    flex: 0 0 50%;
    width: 50%;
}

.wsteczDalej {
    float: none;
    display: block;
    padding: 1em 0;
    background: rgb(146, 146, 146);
    color: #fff;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    opacity: .8;
}

.wsteczDalej:hover,
.wsteczDalej:focus-visible {
    background: rgb(129, 129, 129);
    color: #fff;
    text-decoration: none;
}

.wsteczDalej:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -4px;
}

/* Biala kartka A4. display:block neutralizuje globalne article { display:flex },
   ktore rozkladalo tytul, podtytuly i tresc w osobnych kolumnach. */
.sheet {
    display: block;
    width: calc(100% - 2rem);
    max-width: 21cm;
    min-height: 29.7cm;
    margin: 0 auto 3rem;
    padding: 2cm 1.8cm 1.5cm;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 0 14px rgba(0, 0, 0, .18);
    color: #1a1a1a;
    font-family: "Parafia Carlito", Calibri, Carlito, "Segoe UI", sans-serif;
    font-size: 11pt;
    font-weight: 400;
    font-synthesis: none;
    text-align: left;
    overflow-wrap: break-word;
}

.sheet__title {
    display: block;
    width: auto;
    margin: 0 0 6pt;
    color: #1a1a1a;
    font-family: Cambria, Caladea, Georgia, serif;
    font-size: 24pt;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

.sheet--intencje .sheet__title {
    font-size: 26pt;
}

.sheet__subtitle {
    display: block;
    width: auto;
    margin: 0 0 4pt;
    color: #1a1a1a;
    font-family: Cambria, Caladea, Georgia, serif;
    font-size: 14pt;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
}

.sheet__empty {
    margin-top: 2em;
    color: #666;
    text-align: center;
}

/* Krzyzyki w intencjach zachowuja ksztalt znaku z Times New Roman,
   niezaleznie od kroju pozostalej tresci. Glowny font to EB Garamond
   (Google Fonts, OFL) — ladowny z CDN, znak † metrycznie blizszy TNR
   niz Carlito/Calibri. Fallbacki systemowe zachowane na wypadek, gdyby
   CDN nie odpowiadal (font-display: swap). Dziedzicza wage i rozmiar
   kontekstu, zeby nie rozjezdzac sie w pogrubionych naglowkach dni. */
.sheet__cross {
    font-family: "EB Garamond", "Times New Roman", "Tinos", "Liberation Serif", Times, serif;
    font-style: normal;
    font-weight: inherit;
    font-size: inherit;
    line-height: inherit;
    font-variant-emoji: text;
    vertical-align: baseline;
}

.sheet__divider {
    display: block;
    border: 0;
    border-top: 1.5pt solid #1a1a1a;
    margin: 1.1em 0 1.1em;
    box-sizing: border-box;
}

.sheet__divider--intencje {
    width: 100%;
    margin-left: 0;
}

.sheet__divider--ogloszenia {
    margin-left: 1.27cm;
    width: calc(100% - 1.27cm);
}

/* Ogloszenia: wciecie 1,27 cm i wysuniecie numeru 0,635 cm jak w Wordzie. */
.sheet__items {
    counter-reset: item;
    display: block;
    width: 100%;
    margin: 0.8em 0 0;
}

.sheet__item {
    display: block;
    width: 100%;
    margin: 0 0 .15em;
    font-family: Cambria, Caladea, Georgia, serif;
    line-height: var(--doc-line-height, 1.5);
    text-align: justify;
}

.sheet__item--top {
    counter-increment: item;
    padding-left: 1.27cm;
    text-indent: -.75cm;
}

.sheet__item--top::before {
    content: counter(item) ".";
    display: inline-block;
    width: .75cm;
    text-indent: 0;
}

.sheet__item--indent {
    padding-left: 1.27cm;
}

/* Surowy HTML z importera musi byc odporny na globalne style menu (ol/li/h2). */
.sheet__body--raw {
    display: block;
    width: 100%;
    margin-top: 0.8em;
    line-height: var(--doc-line-height, 1.5);
    text-align: justify;
}

.sheet__body--raw p,
.sheet__body--raw h1,
.sheet__body--raw h2,
.sheet__body--raw h3,
.sheet__body--raw h4,
.sheet__body--raw h5,
.sheet__body--raw h6 {
    margin: 0 0 .15em;
    line-height: inherit;
    text-align: justify;
}

.sheet__body--raw ol,
.sheet__body--raw ul {
    display: block;
    height: auto;
    margin: 0;
    padding-left: 1.27cm;
    font-size: inherit;
    line-height: inherit;
}

.sheet__body--raw ol {
    list-style: decimal;
}

.sheet__body--raw ul {
    list-style: disc;
}

.sheet__body--raw ol > li,
.sheet__body--raw ul > li {
    float: none;
    position: static;
    width: auto;
    height: auto;
    border: 0;
    margin: 0 0 .15em;
    background: transparent;
    line-height: inherit;
    text-align: justify;
}

/* Intencje: naglowki dni i wiersze bez wciec, z tabulatorem po godzinie.
   Naglowek dnia i wiersze intencji sa zlozone krojem Cambria (jak w
   oryginalnych .docx), a nie dziedziczonym Calibri/Carlito z .sheet. */
.sheet--intencje .sheet__day-header {
    display: block;
    width: 100%;
    margin: 1em 0 .15em;
    font-family: Cambria, Caladea, Georgia, serif;
    font-weight: 700;
    line-height: var(--doc-line-height, 1.25);
    text-align: justify;
}

.sheet--intencje .sheet__day-header:first-of-type {
    margin-top: 0.8em;
}

/* Tylko data (Dzien, data) jest pogrubiona; opis dnia / wspomnienie
   po myślniku ma normalną wagę — tak jak w oryginalnych .docx. */
.sheet--intencje .sheet__day-desc {
    font-weight: 400;
}

.sheet--intencje .sheet__entry {
    display: block;
    width: 100%;
    margin: 0 0 .1em;
    padding-left: 5.0em;
    text-indent: -3.8em;
    font-family: Cambria, Caladea, Georgia, serif;
    line-height: var(--doc-line-height, 1.25);
    text-align: justify;
}

.sheet--intencje .sheet__entry-time {
    display: inline-block;
    min-width: 3.15em;
    text-indent: 0;
    font-variant-numeric: tabular-nums;
}

@page {
    size: A4;
    margin: 20mm 18mm 15mm;
}

@media (max-width: 840px) {
    #containerNav {
        width: calc(100% - 1rem);
        max-width: none;
        margin-top: .75rem;
    }

    .sheet {
        width: calc(100% - 1rem);
        max-width: none;
        min-height: 0;
        margin: 0 auto 2rem;
        padding: 1.5rem 1.25rem 2rem;
    }
}

@media (max-width: 520px) {
    .sheet {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .sheet__title,
    .sheet--intencje .sheet__title {
        font-size: 21pt;
    }

    .sheet__subtitle {
        font-size: 12.5pt;
    }

    .sheet__item--top,
    .sheet__item--indent {
        padding-left: .9cm;
    }

    .sheet__item--top {
        text-indent: -.65cm;
    }

    .sheet__item--top::before {
        width: .65cm;
    }

    .sheet__divider--ogloszenia {
        margin-left: .9cm;
        width: calc(100% - .9cm);
    }
}

@media print {
    header,
    footer,
    #containerNav,
    .wsteczDalej,
    .print-controls,
    .admin-header {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .sheet {
        width: auto;
        max-width: none;
        min-height: 0;
        margin: 0 auto;
        padding: 0;
        box-shadow: none;
    }
}
