/* =========================================================
   OLGIERD JAXA — strona autorska
   Styl wspólny dla wszystkich podstron
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Oswald:wght@400;600;700&family=Lora:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
    --color-red:        #E10600;
    --color-red-dark:   #B80500;
    --color-bg:         #000000;
    --color-text:       #ffffff;
    --color-muted:      rgba(255, 255, 255, 0.78);
    --color-overlay:    rgba(0, 0, 0, 0.55);
    --font-display:     'Archivo Black', 'Arial Black', sans-serif;
    --font-menu:        'Oswald', 'Arial Narrow', sans-serif;
    --font-body:        'Lora', Georgia, serif;
    --max-width:        1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100%;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    background-image: linear-gradient(var(--color-overlay), var(--color-overlay)), url('tlo.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.chapter {
    background-image: linear-gradient(rgba(0,0,0,0.78), rgba(0,0,0,0.85)), url('tlo.jpg');
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; height: auto; }

/* =========================================================
   TOP NAV
   ========================================================= */
.site-header {
    padding: 28px 24px 0;
}

.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 56px;
    flex-wrap: wrap;
}

.nav a {
    font-family: var(--font-menu);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.18em;
    color: var(--color-red);
    text-transform: uppercase;
    padding: 8px 4px;
    transition: color .25s ease, transform .25s ease;
    position: relative;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 0;
    height: 2px;
    background: var(--color-red);
    transition: width .3s ease, left .3s ease;
}

.nav a:hover,
.nav a.active {
    color: #ff2a1f;
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
    left: 0;
}

/* =========================================================
   HERO / TYTUŁ
   ========================================================= */
.brand {
    padding: 60px 16px 50px;
    text-align: center;
}

.brand h1 {
    font-family: var(--font-display);
    color: var(--color-red);
    font-weight: 900;
    font-size: clamp(48px, 11vw, 150px);
    letter-spacing: 0.02em;
    line-height: 0.95;
    text-transform: uppercase;
    text-shadow: 0 4px 24px rgba(0,0,0,0.6);
}

.brand h1 a { display: inline-block; }

.brand .tagline {
    margin-top: 18px;
    color: var(--color-muted);
    font-style: italic;
    font-size: clamp(15px, 1.6vw, 19px);
    letter-spacing: 0.04em;
}

/* =========================================================
   GŁÓWNA TREŚĆ
   ========================================================= */
main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

.section-label {
    font-family: var(--font-menu);
    color: var(--color-red);
    font-weight: 700;
    font-size: clamp(22px, 2.6vw, 32px);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: center;
    margin: 50px 0 36px;
    position: relative;
}

.section-label::before,
.section-label::after {
    content: "";
    display: inline-block;
    width: 60px;
    height: 2px;
    background: var(--color-red);
    vertical-align: middle;
    margin: 0 22px;
    opacity: 0.7;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 28px 18px;
    align-items: start;
}

.books-grid.other-books {
    grid-template-columns: repeat(3, 1fr);
    max-width: 820px;
    margin: 0 auto;
}

.book-card {
    text-align: center;
    transition: transform .35s ease;
}

.book-card:hover { transform: translateY(-6px); }

.book-card .cover {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.6);
    aspect-ratio: 2/3;
    background: #111;
    transition: box-shadow .35s ease;
}

.book-card:hover .cover {
    box-shadow: 0 18px 42px rgba(225, 6, 0, 0.35),
                0 0 0 2px rgba(225, 6, 0, 0.7);
}

.book-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.book-card:hover .cover img { transform: scale(1.04); }

.book-card .caption {
    margin-top: 14px;
    font-family: var(--font-menu);
    color: var(--color-red);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    line-height: 1.35;
}

/* "w przygotowaniu" - nieklikalna karta z banderolą */
.book-card.upcoming {
    cursor: default;
    pointer-events: none;
    position: relative;
}

.book-card.upcoming .cover { position: relative; }

.book-card.upcoming .cover::after {
    content: "Wkrótce";
    position: absolute;
    top: 14px;
    right: -38px;
    transform: rotate(35deg);
    background: var(--color-red);
    color: #fff;
    font-family: var(--font-menu);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 5px 44px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 2;
}

.book-card.upcoming .cover img {
    filter: grayscale(0.4) brightness(0.75);
}

.book-card.upcoming:hover { transform: none; }
.book-card.upcoming:hover .cover { box-shadow: 0 12px 36px rgba(0,0,0,0.6); }
.book-card.upcoming:hover .cover img { transform: none; }

.book-card.upcoming .caption { color: rgba(225, 6, 0, 0.7); }

/* =========================================================
   STRONA "O MNIE"
   ========================================================= */
.about-wrap {
    max-width: 820px;
    margin: 50px auto 0;
    text-align: center;
}

.about-wrap p {
    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.85;
    color: var(--color-text);
    margin-bottom: 28px;
}

.about-photo {
    margin: 50px auto 0;
    max-width: 720px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(0,0,0,0.7);
}

/* =========================================================
   STRONA KONTAKT
   ========================================================= */
.contact-wrap {
    max-width: 720px;
    margin: 80px auto;
    text-align: center;
}

.contact-wrap h2 {
    font-family: var(--font-display);
    color: var(--color-red);
    font-size: clamp(30px, 5vw, 56px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.contact-wrap .email-display {
    font-family: var(--font-menu);
    font-size: clamp(20px, 2.4vw, 30px);
    letter-spacing: 0.06em;
    color: var(--color-text);
    margin-top: 12px;
    word-break: break-word;
}

.contact-wrap .email-display a {
    color: var(--color-text);
    border-bottom: 2px solid var(--color-red);
    padding-bottom: 4px;
    transition: color .25s;
}

.contact-wrap .email-display a:hover { color: var(--color-red); }

.contact-wrap .lead {
    font-size: clamp(15px, 1.4vw, 18px);
    color: var(--color-muted);
    margin-bottom: 8px;
}

/* =========================================================
   PODSTRONA KSIĄŻKI
   ========================================================= */
.book-page {
    max-width: 860px;
    margin: 30px auto 0;
}

.book-page .chapter-back {
    display: inline-block;
    font-family: var(--font-menu);
    color: var(--color-red);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 24px;
    transition: color .2s;
}

.book-page .chapter-back:hover { color: #ff3127; }

.book-page > h1 {
    font-family: var(--font-display);
    color: var(--color-red);
    font-size: clamp(34px, 5.5vw, 64px);
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.book-page .book-sub {
    font-family: var(--font-menu);
    color: var(--color-muted);
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 30px;
}

/* Pasek z przyciskami akcji */
.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 40px;
    padding: 22px 0;
    border-top: 1px solid rgba(225, 6, 0, 0.35);
    border-bottom: 1px solid rgba(225, 6, 0, 0.35);
}

.btn-book {
    display: inline-block;
    font-family: var(--font-menu);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 12px 22px;
    border-radius: 2px;
    transition: background .25s, color .25s, transform .25s, box-shadow .25s;
    text-align: center;
    border: 1px solid var(--color-red);
    flex: 0 1 auto;
}

.btn-book.btn-buy {
    background: var(--color-red);
    color: #fff !important;
}

.btn-book.btn-buy:hover {
    background: var(--color-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(225,6,0,0.4);
}

.btn-book.btn-ghost {
    background: transparent;
    color: var(--color-red) !important;
}

.btn-book.btn-ghost:hover {
    background: var(--color-red);
    color: #fff !important;
    transform: translateY(-2px);
}

/* Sekcje strony książki */
.book-section {
    margin: 50px 0;
    scroll-margin-top: 30px;
}

.book-section-title {
    font-family: var(--font-menu);
    font-weight: 700;
    color: var(--color-red);
    font-size: clamp(22px, 2.6vw, 30px);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(225, 6, 0, 0.35);
}

.book-description p {
    font-size: 17px;
    line-height: 1.85;
    color: #fff;
    margin-bottom: 1.1em;
}

.book-description p:first-of-type {
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
}

/* Metadane */
.book-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(225, 6, 0, 0.30);
    border-radius: 4px;
    padding: 24px 28px;
    margin: 40px 0;
}

.book-meta .meta-item dt {
    font-family: var(--font-menu);
    font-weight: 600;
    color: var(--color-red);
    font-size: 12px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.book-meta .meta-item dd {
    font-family: var(--font-menu);
    font-size: 18px;
    color: #fff;
    letter-spacing: 0.04em;
}

/* Spis treści */
.toc {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.toc.toc-multicol {
    column-count: 2;
    column-gap: 36px;
}

.toc li {
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(225, 6, 0, 0.20);
    break-inside: avoid;
    line-height: 1.5;
}

.toc li:last-child { border-bottom: none; }

.toc li.toc-special {
    color: var(--color-red);
    font-style: italic;
    border-bottom-style: solid;
    border-bottom-color: rgba(225, 6, 0, 0.30);
}

/* =========================================================
   ROZDZIAŁ — TREŚĆ KSIĄŻKI
   ========================================================= */
.chapter-page {
    max-width: 760px;
    margin: 30px auto 0;
}

.chapter-content {
    font-size: 18px;
    line-height: 1.9;
    color: #ffffff;
}

.chapter-content p {
    margin-bottom: 1.25em;
}

.chapter-content h2 {
    font-family: var(--font-menu);
    font-weight: 600;
    color: var(--color-red);
    font-size: clamp(22px, 2.6vw, 30px);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    margin: 2.4em 0 1em;
    text-align: center;
}

.chapter-content h3 {
    font-family: var(--font-menu);
    font-weight: 600;
    color: var(--color-red);
    font-size: clamp(18px, 2vw, 22px);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    margin: 2em 0 0.8em;
}

.chapter-content .scene-break {
    text-align: center;
    color: var(--color-red);
    letter-spacing: 1em;
    margin: 2em 0;
    opacity: 0.8;
}

.chapter-content em { color: rgba(255, 255, 255, 0.95); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    background: rgba(0, 0, 0, 0.78);
    border-top: 1px solid rgba(225, 6, 0, 0.35);
    padding: 56px 24px 40px;
    margin-top: auto;
}

.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    text-align: center;
}

.footer-col h3 {
    font-family: var(--font-menu);
    color: var(--color-red);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.footer-col p {
    color: var(--color-red);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 12px;
}

.footer-col .copy {
    color: var(--color-red);
    font-size: 13px;
    letter-spacing: 0.04em;
    line-height: 1.65;
}

.footer-email {
    color: var(--color-red);
    font-weight: 600;
    word-break: break-word;
}

.footer-email:hover { text-decoration: underline; }

.btn-newsletter,
.btn-primary {
    display: inline-block;
    background: var(--color-red);
    color: #fff !important;
    border: none;
    cursor: pointer;
    padding: 11px 30px;
    font-family: var(--font-menu);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: background .25s, transform .25s, box-shadow .25s;
    margin-top: 8px;
}

.btn-newsletter:hover,
.btn-primary:hover {
    background: var(--color-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(225,6,0,0.4);
}

/* =========================================================
   MODAL NEWSLETTER
   ========================================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn .25s ease;
}

.modal-overlay.is-open { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    background: #0a0a0a;
    border: 1px solid rgba(225, 6, 0, 0.45);
    border-radius: 6px;
    padding: 44px 36px 36px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 28px 60px rgba(0,0,0,0.7);
    position: relative;
    animation: slideUp .35s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.modal h3 {
    font-family: var(--font-menu);
    color: var(--color-red);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.modal p {
    color: var(--color-muted);
    font-size: 15px;
    margin-bottom: 22px;
    line-height: 1.55;
}

.modal input[type="email"] {
    width: 100%;
    padding: 13px 16px;
    background: #161616;
    border: 1px solid #333;
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    border-radius: 3px;
    margin-bottom: 18px;
    transition: border-color .2s;
}

.modal input[type="email"]:focus {
    outline: none;
    border-color: var(--color-red);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--color-red);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s;
}

.modal-close:hover { transform: rotate(90deg); }

.modal-message {
    margin-top: 14px;
    font-size: 14px;
    color: var(--color-muted);
    min-height: 20px;
}

.modal-message.success { color: #4ade80; }
.modal-message.error   { color: #ff6b6b; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    .nav { gap: 28px; }
    .nav a { font-size: 15px; }

    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px 16px;
    }

    .books-grid.other-books { grid-template-columns: repeat(3, 1fr); }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .section-label::before,
    .section-label::after { width: 30px; margin: 0 14px; }
}

@media (max-width: 540px) {
    .site-header { padding: 18px 16px 0; }

    .brand { padding: 36px 14px 32px; }

    .nav { gap: 18px; }
    .nav a { font-size: 13px; letter-spacing: 0.14em; }

    main { padding: 0 16px 60px; }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 14px;
    }

    .books-grid.other-books { grid-template-columns: repeat(2, 1fr); }

    .book-card .caption { font-size: 12px; }

    .section-label { margin: 38px 0 26px; font-size: 18px; }
    .section-label::before, .section-label::after { display: none; }

    .site-footer { padding: 40px 18px 28px; }

    .chapter-content { font-size: 17px; line-height: 1.8; }

    .book-actions { gap: 8px; padding: 18px 0; }
    .btn-book { font-size: 12px; padding: 10px 16px; flex: 1 1 auto; min-width: 130px; }
    .book-meta { grid-template-columns: 1fr; padding: 18px 20px; gap: 16px; }
    .toc.toc-multicol { column-count: 1; }
    .book-section { margin: 36px 0; }
    .book-section-title { font-size: 18px; letter-spacing: 0.14em; }
    .book-card.upcoming .cover::after {
        font-size: 9px;
        padding: 3px 36px;
        right: -34px;
        top: 10px;
    }
}
