/* === Reset a základ === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #FFC803;
    --text: #222;
    --text-light: #666;
    --bg: #fff;
    --border: #eee;
    --max-width: 780px;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: border-color 0.2s;
}

a:hover {
    border-bottom-color: var(--text);
}


/* === Header === */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1.5rem;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: none;
}

.logo-circle {
    flex-shrink: 0;
    margin-right: -18px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: normal;
    letter-spacing: 0.02em;
    position: relative;
}


/* === Obsah === */
.site-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
    width: 100%;
    flex: 1;
}


/* === Úvodní stránka === */
.hero {
    padding: 1rem 0 0;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.hero-quote {
    font-size: 1.4rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--text-light);
}

.hero-logo {
    width: 320px;
    height: auto;
    flex-shrink: 0;
}

.hero-divider {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0 auto 2rem;
    border: none;
}

@media (max-width: 600px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .hero-logo {
        width: 160px;
        height: auto;
    }
}


/* === Seznam článků === */
.post-list {
    list-style: none;
}

.post-item {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}

.post-item:first-child {
    padding-top: 0;
}

.post-item:last-child {
    border-bottom: none;
}

.post-date {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.4rem;
}

.post-title {
    font-size: 1.3rem;
    font-weight: normal;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.post-title a {
    border-bottom-width: 2px;
}

.post-summary {
    color: var(--text-light);
    font-size: 0.95rem;
}


/* === Článek === */
.post-header {
    margin-bottom: 2rem;
}

.post-header .post-date {
    margin-bottom: 0.6rem;
}

.post-header h1 {
    font-size: 1.8rem;
    font-weight: normal;
    line-height: 1.3;
}

.post-body {
    font-size: 1rem;
    line-height: 1.9;
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body h2 {
    font-size: 1.3rem;
    font-weight: normal;
    margin: 2.5rem 0 1rem;
}

.post-body h3 {
    font-size: 1.1rem;
    font-weight: normal;
    margin: 2rem 0 0.8rem;
}

.post-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.2rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.post-body ul, .post-body ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.post-nav .back-link:last-child {
    text-align: right;
}

.back-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    color: var(--text-light);
}


/* === Footer === */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    color: var(--text-light);
}


/* === Stránkování === */
.pagination {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
}

.pagination a,
.pagination span {
    color: var(--text-light);
}

.pagination .pag-spacer {
    flex: 1;
}


/* === Responzivita === */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    /* Kompaktn\u00ed hlavi\u010dka \u0165l\u00e1nku na telefonu: logo + text v jedn\u00e9 \u0159ad\u011b. */
    .site-header {
        padding: 0.5rem 1.1rem;
    }

    .header-inner {
        flex-direction: row;
        align-items: center;
        gap: 0;
    }

    .logo-circle {
        width: 36px;
        height: 36px;
        margin-right: -14px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .hero {
        padding: 2.5rem 0;
    }

    .hero-quote {
        font-size: 1.2rem;
    }

    .post-header h1 {
        font-size: 1.4rem;
    }

    .post-item {
        padding: 1.8rem 0;
    }
}


/* =========================================================
   ÚVODNÍ STRÁNKA — „svatyně"
   Plnohodnotná první obrazovka: logo + citát, nic víc.
   Deník (seznam článků) sedí pod tím, pod vlastní hlavičkou.
   ========================================================= */

body.is-home {
    background: var(--bg);
}

/* --- Svatyně: celá první obrazovka --- */
.shrine {
    min-height: 100vh;
    min-height: 100svh; /* na mobilech bez adresního řádku */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem 6rem;
    position: relative;
}

.shrine-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2.2rem;
    max-width: 620px;
}

.shrine-logo {
    width: 100%;
    max-width: 520px;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.shrine-quote {
    font-size: 1.55rem;
    line-height: 1.7;
    font-style: italic;
    color: var(--text);
    max-width: 520px;
    /* Extra dech mezi logem a cit\u00e1tem (nad r\u00e1mec flex gapu) */
    margin-top: 1.4rem;
}

/* Jemný žlutý pruh jako „pečeť" pod citátem */
.shrine-mark {
    display: block;
    width: 56px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* Odkaz dolů na deník — klidný, ne rušivý */
.shrine-down {
    position: absolute;
    bottom: 2.2rem;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--text-light);
    border-bottom: none;
    padding: 0.5rem 0.8rem;
    opacity: 0.7;
    transition: opacity 0.25s, transform 0.25s;
}

.shrine-down:hover,
.shrine-down:focus-visible {
    opacity: 1;
    border-bottom: none;
}

.shrine-down-arrow {
    display: inline-block;
    font-size: 1.1rem;
    line-height: 1;
    animation: shrine-bob 2.6s ease-in-out infinite;
}

@keyframes shrine-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(5px); }
}

@media (prefers-reduced-motion: reduce) {
    .shrine-down-arrow { animation: none; }
}


/* --- Deník: klidný seznam pod svatyní --- */
.journal {
    padding: 5rem 1.5rem 4rem;
    border-top: 1px solid var(--border);
}

.journal-inner {
    max-width: 680px;
    margin: 0 auto;
}

.journal-header {
    text-align: center;
    margin-bottom: 3rem;
}

.journal-title {
    font-size: 1.5rem;
    font-weight: normal;
    letter-spacing: 0.02em;
    margin-bottom: 0.4rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.6rem;
}

.journal-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 36px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.journal-sub {
    font-size: 0.95rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.8rem;
}

/* Seznam zápisků — jedna položka = jeden řádek */
.entry-list {
    list-style: none;
    counter-reset: none;
}

.entry {
    border-bottom: 1px solid var(--border);
}

.entry:first-child {
    border-top: 1px solid var(--border);
}

.entry-link {
    display: grid;
    grid-template-columns: 7rem 1fr;
    align-items: baseline;
    gap: 1.4rem;
    padding: 1.4rem 0.4rem;
    border-bottom: none;
    color: var(--text);
    transition: background-color 0.2s, padding 0.2s;
}

.entry-link:hover,
.entry-link:focus-visible {
    background: #fffdf3;  /* jemně nažloutlý nádech */
    padding-left: 1rem;
    padding-right: 1rem;
}

.entry-date {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.78rem;
    color: var(--text-light);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.entry-title {
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: normal;
}

.entry-link:hover .entry-title,
.entry-link:focus-visible .entry-title {
    box-shadow: inset 0 -2px 0 var(--accent);
}


/* --- Stránkování deníku --- */
.journal-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
}

.journal-pagination a {
    color: var(--text-light);
    border-bottom-color: var(--border);
}

.journal-pagination a:hover {
    border-bottom-color: var(--accent);
}

.journal-pagination-num {
    color: var(--text-light);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}


/* --- Patička na úvodní stránce: co nejtišší --- */
.shrine-footer {
    padding: 2rem 1.5rem 2.5rem;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    color: var(--text-light);
}


/* --- Responzivita úvodní stránky --- */
@media (max-width: 640px) {
    .shrine {
        padding: 3rem 1.25rem 5rem;
    }

    .shrine-inner {
        gap: 1.6rem;
    }

    .shrine-logo {
        max-width: 260px;
    }

    .shrine-quote {
        font-size: 1.15rem;
        line-height: 1.65;
        margin-top: 0.8rem;
    }

    .shrine-down {
        bottom: 1.4rem;
    }

    .journal {
        padding: 3.5rem 1.25rem 3rem;
    }

    .journal-header {
        margin-bottom: 2rem;
    }

    .entry-link {
        grid-template-columns: 1fr;
        gap: 0.2rem;
        padding: 1.2rem 0.2rem;
    }

    .entry-link:hover,
    .entry-link:focus-visible {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .entry-date {
        font-size: 0.72rem;
    }

    .entry-title {
        font-size: 1rem;
    }
}


/* Telefon na šířku (landscape) — nízká výška obrazovky.
   Problém: logo + citát + absolutně umístěná šipka „deník" se pak
   mohou překrývat. Řešení: shrine pustíme z min-height 100vh,
   šipku vložíme zpět do toku, zmenšíme mezery a logo. */
@media (max-height: 520px) and (orientation: landscape) {
    .shrine {
        min-height: auto;
        padding: 2rem 1.5rem 2.5rem;
    }

    .shrine-inner {
        gap: 1.2rem;
        max-width: 560px;
    }

    .shrine-logo {
        max-width: 280px;
    }

    .shrine-quote {
        font-size: 1.1rem;
        line-height: 1.55;
        margin-top: 0.5rem;
    }

    .shrine-mark {
        width: 44px;
        height: 2px;
    }

    .shrine-down {
        position: static;
        transform: none;
        margin-top: 1.2rem;
        bottom: auto;
        left: auto;
    }
}
