/* ---------------------------------------------
   PNP – GŁÓWNY MOTYW: ZŁOTO, KREM, SERIF
   + RESPONSYWNOŚĆ (DESKTOP / TABLET / MOBILE)
--------------------------------------------- */

/* RESET Szerokości / Scroll w poziomie wyłączony globalnie */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ---------------------------------------------
   TŁO STRONY + PODSTAWOWA TYPOGRAFIA
--------------------------------------------- */

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top,
        #fff5d7 0%,
        #f8d98a 35%,
        #edc065 60%,
        #e2ad48 100%);
    color: #3b2b1a;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.6;
}

/* Kontener strony z wersetem */
.page-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0 40px 0;
    background: rgba(255, 249, 237, 0.9);
    box-shadow: 0 0 20px rgba(0,0,0,0.12);
    box-sizing: border-box;
}

/* ---------------------------------------------
   NAGŁÓWKI I LINKI
--------------------------------------------- */

h1, h2, h3 {
    font-family: Georgia, "Times New Roman", serif;
    color: #5b3a16;
    text-shadow: 0 1px 0 rgba(255,255,255,0.85);
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

a {
    color: #b2791f; /* złoty brąz */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------
   BREADCRUMB
--------------------------------------------- */

.breadcrumb {
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #7a5b33;
}

/* ---------------------------------------------
   BLOKI TEKSTOWE – ZŁOTE PUDEŁKA
--------------------------------------------- */

.verse-block {
    position: relative;
    padding: 15px 18px;
    margin: 18px 0;
    background: linear-gradient(135deg,
        #fffaf0 0%,
        #ffe4b0 50%,
        #f8cf7a 100%);
    border: 1px solid #d79b39;
    border-radius: 10px;
    box-shadow:
        0 3px 6px rgba(116, 88, 47, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

/* delikatny pasek nad każdym kolejnym blokiem */
.verse-block + .verse-block::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: linear-gradient(to right, #e2bf75, #f9edd0, #e2bf75);
    opacity: 0.8;
    border-radius: 1px;
    pointer-events: none;
}

.verse-text {
    font-size: 1.15rem;
    color: #3b2b1a;
}

/* „Nasz przekład” – pierwszy blok, większa i ładniejsza czcionka */
.verse-block:first-of-type .verse-text {
    font-family: "Cormorant Garamond","Georgia","Times New Roman",serif;
    font-size: 1.4rem;
    line-height: 1.9;
}

/* Pierwsza litera – złoty dropcap */
.verse-block:first-of-type p:first-of-type::first-letter {
    font-family: "IM Fell English SC","Cormorant Garamond","Georgia","Times New Roman",serif !important;
    font-size: 1.4em !important;
    font-weight: 400 !important;
    letter-spacing: 0.05em;
    color: #d4a951 !important;
    text-shadow:
        0 0 1px #5b1a0f,
        0 1px 0 #fff6d5;
}

/* alternatywna klasa dropcap (gdy potrzebna ręcznie) */
.pp-dropcap {
    font-family: "IM Fell English SC","Cormorant Garamond","Georgia","Times New Roman",serif;
    font-size: 1.6em;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: #d4a951;
    text-shadow:
        0 0 1px #5b1a0f,
        0 1px 0 #fff6d5,
        0 2px 2px rgba(0,0,0,0.25);
}

.external {
    color: #4b3a22;
}

/* Tekst „Nasz przekład” – złoto–czarny */
.verse-block:first-of-type p:first-of-type {
    color: #2b1a06 !important;
    text-shadow:
        0 0 1px #000000,
        0 1px 0 #ffe7b3;
}

/* ---------------------------------------------
   NAWIGACJA WERSETÓW – UKŁAD FLEX (DESKTOP)
--------------------------------------------- */

.verse-header {
    margin-top: 0;
}

.verse-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
}

.nav-left,
.nav-center,
.nav-right {
    flex: 1;
}

.nav-left {
    text-align: left;
}

.nav-center {
    text-align: center;
    font-weight: 600;
    font-size: 1.15rem;
    color: #5b3a16;
}

.nav-right {
    text-align: right;
}

/* Środkowy „przycisk” z ref. (Mateusz 1:1) */
.verse-label {
    display: inline-block;
    padding: 10px 32px;
    border-radius: 999px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #3b0b00;
    background: linear-gradient(to bottom, #ffcc88, #d4681b);
    border: 1px solid #891f07;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
    text-shadow: 0 1px 0 #ffe9c5;
    white-space: nowrap;
}

.verse-label:hover {
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

/* ---------------------------------------------
   PRZYCISKI POPRZEDNI / NASTĘPNY
--------------------------------------------- */

.nav-prev,
.nav-next {
    display: inline-block;
    font-size: 1.0rem;
    padding: 7px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg,
        #fff5cf 0%,
        #f3c66b 40%,
        #e5a33a 100%);
    border: 1px solid #c4882d;
    color: #3e2810;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.8);
    text-shadow: 0 1px 0 rgba(255,255,255,0.9);
    font-weight: 600;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.nav-prev:hover,
.nav-next:hover {
    background: linear-gradient(to bottom, #ffc86a, #e0932e);
    box-shadow: 0 3px 6px rgba(0,0,0,0.45);
    transform: translateY(-1px);
}

.nav-prev:active,
.nav-next:active {
    transform: translateY(0);
    box-shadow:
        0 1px 2px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.7);
}

/* ---------------------------------------------
   WYSZUKIWARKA POD PRZYCISKIEM (DESKTOP)
--------------------------------------------- */

.verse-search-panel {
    margin: 8px 0 18px 0;
    text-align: center;
}

.verse-search-panel form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 22px;
    border-radius: 999px;
    background: linear-gradient(to bottom, #ffe9a4, #f1c65a);
    border: 1px solid #c9952c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    font-size: 0.95em;
    font-family: "Cormorant Garamond","Georgia","Times New Roman",serif;
    letter-spacing: 0.03em;
}

.verse-search-panel label {
    margin-right: 4px;
    font-weight: bold;
    color: #5b3a07;
}

.verse-search-panel select {
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #c8aa6a;
    background: #fffdf7;
    font-size: 0.95em;
}

.verse-search-panel select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 169, 81, 0.4);
}

@media (max-width: 600px) {
    .verse-search-panel form {
        padding: 4px 12px;
        gap: 4px;
    }
}

/* Stary okrągły panel (verse-picker) – wyłączony */
.verse-picker {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}
.verse-search-panel::before,
.verse-search-panel::after,
.verse-picker::before,
.verse-picker::after {
    display: none !important;
    background: none !important;
    box-shadow: none !important;
}

/* ---------------------------------------------
   TABELA INTERLINEARNA + ZEBRA
--------------------------------------------- */

.interlinear-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
}

.interlinear-table th,
.interlinear-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e4cda3;
}

/* globalny nagłówek tabeli */
table thead th {
    background: #f5d89a !important;
    font-weight: bold !important;
    border-bottom: 1px solid #d4a951 !important;
}

/* zebra – wszystkie tabelki */
table tr:nth-child(even) td {
    background-color: #fff7e4 !important;
}
table tr:nth-child(odd) td {
    background-color: #fffaf0 !important;
}
table tr:hover td {
    background-color: #ffefd0 !important;
}

/* dodatkowo wymuszenie dla 4. bloku (interlinia) */
.verse-block:nth-of-type(4) table thead th,
.verse-block:nth-of-type(4) table th {
    background: #f5d89a !important;
    font-weight: bold;
    border-bottom: 1px solid #d4a951;
}

/* ---------------------------------------------
   MORFOLOGIA – TOOLTIP
--------------------------------------------- */

.cell-morph {
    position: relative;
    white-space: nowrap;
}

.morph-code {
    font-weight: 700;
    color: #5b3a16;
}

.morph-help-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.9em;
    width: 1.2em;
    height: 1.2em;
    line-height: 1.2em;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #7b633a;
    cursor: pointer;
    user-select: none;
    background: radial-gradient(circle at 30% 20%,
        #fff8e5 0%,
        #f1cf7f 45%,
        #d6aa4b 100%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* szeroki tooltip */
.morph-tooltip {
    display: none;
    position: absolute;
    z-index: 50;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    width: 620px;
    max-width: 90vw;
    padding: 14px 16px;
    border: 1px solid #d9b36a;
    background: #fffdf8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    font-size: 1.05rem;
    line-height: 1.55;
    white-space: normal;
}

.cell-morph:hover .morph-tooltip,
.cell-morph:focus-within .morph-tooltip {
    display: block;
}

.morph-header {
    margin-bottom: 8px;
    font-size: 1.08rem;
    font-weight: 700;
    color: #4a3215;
}

.morph-list {
    margin-left: 1.4em;
}
.morph-list li {
    margin-bottom: 6px;
}

.morph-comment,
.morph-summary {
    margin-top: 10px;
    font-size: 0.98rem;
}

.morph-help-text {
    font-size: 0.95rem;
    color: #6d5330;
}

/* ---------------------------------------------
   DROBNE ROZMIARY KOMÓREK
--------------------------------------------- */

.cell-greek {
    font-size: 1.1rem;
}
.cell-lemma,
.cell-strong,
.cell-polish,
.cell-lexicon {
    font-size: 1.0rem;
}

/* ============================================
   POWIĄZANE WERSETY – BLOK
============================================ */

#related-verses,
.related-verses {
    margin: 30px 0;
    padding: 20px 24px;
    border: 1px solid #d4a951;
    border-radius: 10px;
    background: #fffaf0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

#related-verses h3,
.related-verses h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: bold;
    color: #8a5a10;
}

#related-verses ul,
.related-verses ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#related-verses li,
.related-verses li {
    padding: 10px 0;
    border-top: 1px dotted #e2c27a;
}

#related-verses li:first-child,
.related-verses li:first-child {
    border-top: none;
}

.related-verses__ref {
    font-weight: bold;
    color: #8a5a10;
    display: block;
    margin-bottom: 3px;
}

.related-verses__text {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

@media print {
    #related-verses,
    .related-verses {
        box-shadow: none;
        border-color: #cccccc;
        background: #ffffff;
    }
}

/* ============================================
   GLOBALNY TOP BANNER – Pisma Nowego Przymierza
============================================ */

.global-top-banner {
  max-width: 1200px;
  margin: 10px auto 20px;
  padding: 18px 30px 12px;
  border-radius: 20px;
  border: 1px solid #e1c28b;
  background: linear-gradient(to bottom, #fdf2d7, #f6ddb0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  text-align: center;
}

.global-top-line1 {
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b4b08;
  text-shadow: 0 1px 0 #fbe9c5;
}

.global-top-line2 {
  margin-top: 4px;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b07c1e;
}

/* stara belka RBX – chowamy */
#rbx-top-brand,
#rbx-topSub,
#rbx-line1,
#rbx-line2 {
  display: none !important;
}

/* Mobile – mniejszy banner */
@media (max-width: 800px) {
  .global-top-banner {
    margin: 6px 6px 14px;
    padding: 12px 10px 8px;
    border-radius: 14px;
  }
  .global-top-line1 {
    font-size: 20px;
    letter-spacing: 0.10em;
  }
  .global-top-line2 {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  /* ukryj H1 pod belką */
  .global-top-banner + h1 {
    display: none !important;
  }
}

/* Mobile: napis „Biblia” z podtytułem – jeśli RBX jednak coś generuje */
@media (max-width: 800px) {
  #rbx-line1 {
    display: inline-block;
    line-height: 1.1;
  }
  #rbx-line1::after {
    content: "\A Pisma Nowego Przymierza";
    white-space: pre;
    font-size: 0.65em;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: #c5972b;
  }
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 0.60em;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #c5972b;
}

@media (min-width: 801px) {
  .brand-subtitle {
    display: none;
  }
}

/* ---------------------------------------------
   GLOBALNY PASEK PRZEWIJANIA – ZŁOTY
--------------------------------------------- */

::-webkit-scrollbar {
    width: 11px;
}
::-webkit-scrollbar-track {
    background: #f8e9c4;
}
::-webkit-scrollbar-thumb {
    background: #c9952c;
    border-radius: 999px;
    border: 2px solid #f8e9c4;
}
::-webkit-scrollbar-thumb:hover {
    background: #a86f18;
}
html {
    scrollbar-color: #c9952c #f8e9c4;
    scrollbar-width: thin;
}

/* ============================================
   MOBILE – GŁÓWNE ZASADY (max 800px)
============================================ */

@media (max-width: 800px) {

    body {
        font-size: 1.08em;
        line-height: 1.5;
        padding-bottom: 80px; /* miejsce na belkę */
    }

    .page-container {
        width: 100%;
        max-width: 100%;
        padding: 10px 6px 24px 6px;
        box-shadow: none;
    }

    .verse-block {
        padding: 10px 10px;
        margin: 10px 0;
        font-size: 1.08em;
        line-height: 1.8;
    }

    .verse-block p,
    .verse-block li {
        font-size: 1em;
    }

    table, th, td {
        font-size: 0.96em;
    }

    .breadcrumb {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    /* chowamy górną nawigację – używamy dolnej belki */
    .verse-nav {
        display: none;
    }

    /* wyszukiwarka jako „popup” nad belką mobilną */
    .verse-search-panel {
        position: fixed;
        left: 50%;
        bottom: 60px;
        transform: translateX(-50%);
        z-index: 999;
        margin: 0;
        display: none;
        width: calc(100% - 40px);
        max-width: 540px;
    }
    .verse-search-panel.mobile-open {
        display: block;
    }

    /* powiększone pola w popupie */
    .verse-search-panel .vsp-field,
    .verse-search-panel .vsp-verse-card {
        padding: 14px 16px;
        border-radius: 20px;
    }
    .verse-search-panel .vsp-field label,
    .verse-search-panel .vsp-verse-label {
        font-size: 1.12em;
    }
    .verse-search-panel select {
        padding: 14px 18px;
        font-size: 1.24em;
        border-radius: 12px;
    }
}

/* ============================================
   MOBILE – DOLNA BELKA NAWIGACYJNA (.mobile-bottom-bar)
============================================ */

.mobile-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 10px;
    display: none; /* pokazujemy dopiero w media-query */
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to top, #f1c65a, #ffe9a4);
    border-top: 1px solid #c9952c;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.35);
    z-index: 1000;
}

.mobile-bottom-bar .mb-group-left,
.mobile-bottom-bar .mb-group-right {
    display: flex;
    gap: 6px;
}

.mb-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    min-height: 34px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #c9952c;
    background: linear-gradient(to bottom, #ffe9a4, #f1c65a);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-size: 1.3em;
    color: #4a1a00;
    text-decoration: none;
}
.mb-btn:active {
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
    transform: translateY(1px);
}

/* aktywacja belki na mobile */
@media (max-width: 800px) {
    .mobile-bottom-bar {
        display: flex;
    }
}

/* stara .mobile-nav-bar – wyłączona, gdyby była w HTML */
.mobile-nav-bar {
    display: none !important;
}

/* ============================================
   MOBILE – INTERLINIA + PRAWA KOLUMNA
============================================ */

/* przesunięcie layoutu w lewo, żeby prawa kolumna nie była ucięta */
@media (max-width: 768px) {

    .pnp-wrapper,
    .page-container,
    .verse-layout,
    .interlinear-container {
        margin-left: -30px;
        margin-right: 0;
        padding-left: 8px;
        padding-right: 8px;
        overflow-x: visible;
        box-sizing: border-box;
    }

    .pnp-layout,
    .verse-layout-2col {
        display: block;
    }

    .sidebar-right,
    .right-column,
    .layout-right {
        margin-left: -30px;
        padding-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .content-main,
    .layout-main {
        margin-right: 0;
        max-width: 100%;
    }
}

/* bardzo małe ekrany – interlinia przewijana poziomo */
@media (max-width: 640px) {

    .interlinear-table {
        display: block;
        width: auto;
        min-width: 100%;
        overflow-x: auto;
        font-size: 0.96rem;
        margin-left: -8px;
        margin-right: -8px;
    }

    .interlinear-table th,
    .interlinear-table td {
        white-space: nowrap;
    }

    .morph-tooltip {
        left: 0;
        transform: none;
        width: 96vw;
    }
}

/* PNP 2025-12-10 – usuwamy stary, okrągły przycisk Mateusz 1:1 (duplikat) */
#verse-picker,
#verse-picker::before,
#verse-picker::after {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}

/* === PNP 2025-12-10 – morfologia na desktopie: nie urywać tooltipa === */
@media (min-width: 801px) {
    /* kontener interlinii nie może ciąć zawartości w pionie */
    .interlinear-container,
    .table-responsive,
    .interlinear-wrapper,
    .interlinear-table {
        overflow: visible !important;
    }

    /* dymek morfologii ponad wszystkim */
    .morph-tooltip {
        z-index: 3000 !important;
    }
}

/* === PNP – MOBILNY GRUBY ZŁOTY PASEK PRZEWIJANIA === */
@media (max-width: 800px) {
    #pnp-scrollbar {
        position: fixed;
        right: 3px;              /* odstęp od prawej krawędzi */
        top: 10px;               /* górny margines toru */
        width: 10px;             /* GRUBOŚĆ paska */
        height: 80px;            /* będzie nadpisywana w JS */
        border-radius: 999px;
        background: linear-gradient(to bottom, #ffe9a4, #c9952c);
        box-shadow: 0 0 6px rgba(0,0,0,0.6);
        z-index: 9999;
        pointer-events: none;    /* nie blokuje klikania w stronę */
    }
}


