/* Unelte de lectură: bara (rugăciuni), dock-ul (Biblie), semnul, panoul de canon, antetul paginilor de rugăciuni.
   Nu schimbă fontul și nici mărimea textului de citit. */
:root { --rd-accent:#762333; --rd-accent-dark:#4E111C; --rd-gold:#C9A24A; --rd-edge:#EADFCF; --rd-paper:#fffdf8; }

/* ---------- bara de lectură a rugăciunilor ---------- */
.prayer-sticky-toolbar {
    position: sticky; top: .5rem; z-index: 20;
    width: max-content; max-width: 100%;
    margin: 0 0 1.1rem auto; padding: .3rem;
    background: #fff; border: 1px solid var(--rd-edge); border-radius: 999px;
    box-shadow: 0 1px 2px rgba(42,36,32,.06), 0 8px 22px rgba(42,36,32,.10);
}
@media (min-width: 921px) { .prayer-sticky-toolbar { top: calc(66px + .6rem); } }   /* sub antetul fix */
.prayer-toolbar-row { display: flex; align-items: center; gap: .4rem; }
.prayer-home { display: none; }
.prayer-tools { display: flex; align-items: center; gap: .2rem; margin-left: auto; }

.reader-tool, .prayer-zoom-buttons button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 40px; min-width: 40px; padding: 0 .85rem;
    border: 0; border-radius: 999px; background: transparent; color: var(--rd-accent);
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; list-style: none;
    transition: background .15s, color .15s;
}
.reader-tool::-webkit-details-marker { display: none; }
.reader-tool:hover, .prayer-zoom-buttons button:hover:not(:disabled), .reader-canon[open] > .reader-tool { background: #F6EADF; }
.reader-tool[aria-pressed=true] { background: var(--rd-accent); color: #fff; }
.reader-mark.has-mark .ico { fill: currentColor; }
.prayer-zoom-buttons { display: flex; margin: 0 0 0 .2rem !important; padding-left: .3rem; border-left: 1px solid var(--rd-edge); gap: .1rem; }
.prayer-zoom-buttons button { padding: 0 .55rem; border: 0 !important; background: transparent !important; color: var(--rd-accent) !important; }
.prayer-zoom-buttons button:disabled { opacity: .35; cursor: default; }

.prayer-sticky-toolbar .reader-feedback {
    position: absolute; top: calc(100% + .45rem); right: 0; margin: 0;
    width: max-content; max-width: min(24rem, calc(100vw - 1.5rem));
    padding: .5rem .8rem; border-radius: .7rem;
    background: var(--rd-accent-dark); color: #fff; box-shadow: 0 8px 22px rgba(42,36,32,.2);
}
.prayer-sticky-toolbar .reader-feedback:empty { display: none; }
.feedback-action { margin-left: .35rem; padding: .2rem .65rem; border: 1px solid #ffffff66; border-radius: 999px; background: transparent; color: #fff; font-weight: 600; cursor: pointer; }
.feedback-action:hover { background: #ffffff22; }

/* panoul „Canon” */
.reader-canon { position: relative; }
.reader-canon > summary { list-style: none; }
.prayer-sticky-toolbar .reader-canon-panel { top: calc(100% + .55rem); bottom: auto; left: auto; right: 0; }
.reader-canon-panel { width: 17.5rem; padding: .85rem; border: 1px solid var(--rd-edge); border-top: 3px solid var(--rd-gold); border-radius: .9rem; background: var(--rd-paper); color: #312520; box-shadow: 0 14px 34px rgba(78,17,28,.18); }
.rcp-title { margin: 0 0 .55rem; font-weight: 600; }
.rcp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.rcp-days button, .rcp-all {
    font: inherit; font-weight: 600; min-height: 40px; border: 1px solid var(--rd-edge); border-radius: .6rem; background: #fff;
    color: var(--rd-accent); font-weight: 600; cursor: pointer; padding: 0;
}
.rcp-days button:hover, .rcp-all:hover { border-color: var(--rd-gold); }
.rcp-days button[aria-pressed=true], .rcp-all[aria-pressed=true] { background: var(--rd-accent); border-color: var(--rd-accent); color: #fff; }
.rcp-all { width: 100%; margin-top: .45rem; }
.rcp-all[aria-pressed=true]::before { content: "✓ "; }
.rcp-link { display: block; margin-top: .65rem; text-align: right; font-weight: 600; text-decoration: none; }

/* ---------- semnul pe text ---------- */
.prayer-reading .reading-passage, .bible-reading .reading-passage { position: relative; }
.passage-bookmark {
    position: absolute; top: .1em; right: -2.2rem; z-index: 1;
    display: grid; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: #B39276; cursor: pointer;
    opacity: 0; transition: opacity .15s, color .15s, background .15s;
}
.reading-passage:hover > .passage-bookmark, .passage-bookmark:focus-visible, .choosing-passage .passage-bookmark { opacity: 1; }
.passage-bookmark:hover, .choosing-passage .passage-bookmark { color: var(--rd-accent); background: #F6EADF; }
.choosing-passage .reading-marked > .passage-bookmark { background: #FBE7B5; color: #B8860B; }
.reading-passage.reading-marked { background: #FFF6E0; outline: 0; box-shadow: -.5rem 0 0 #FFF6E0, -.7rem 0 0 var(--rd-gold); padding: 0; border-radius: 0 .4rem .4rem 0; }
.reading-marked > .passage-bookmark { opacity: 1; color: #B8860B; }
.reading-marked > .passage-bookmark svg { fill: currentColor; }
.prayer-reading.choosing-passage .reading-passage, .bible-reading.choosing-passage .reading-passage { cursor: pointer; border-left: 0; padding-left: 0; border-radius: .3rem; }
.choosing-passage .reading-passage:is(:hover, :focus-visible) { background: #F8EDDB; outline: 2px dashed #C9A24A; outline-offset: 2px; }
/* titlul (Condacul/Icosul) și textul lui: fără rând gol între ele */
.prayer-reading .reading-passage:has(> [data-passage-heading]) { white-space: normal; }
.prayer-reading .reading-passage > .prayer-passage-title { margin: .45em 0 .12em; }
.prayer-intro-link { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media print { .passage-bookmark, .prayer-sticky-toolbar { display: none !important; } }

/* ---------- Biblia: dock-ul de jos ---------- */
.reader-dock .reader-tool { min-height: 2.65rem; border: 1px solid var(--rd-edge); }
.reader-dock .reader-canon-panel { top: auto; bottom: calc(100% + .65rem); right: 0; left: auto; }

/* ---------- mobil: bara preia logo-ul și butoanele ---------- */
@media (max-width: 640px) {
    .prayer-sticky-toolbar {
        top: 0; width: auto; max-width: none;
        margin: 0 calc(-1 * max(6px, env(safe-area-inset-left))) .8rem; padding: .3rem .45rem;
        border: 0; border-radius: 0; background: linear-gradient(180deg, #86222F, #6E1A27); color: #fff;
        box-shadow: 0 2px 0 var(--rd-gold), 0 6px 16px rgba(78,17,28,.2);
    }
    .library .library-panel.prayer-reader-panel { padding-top: 0; border-top: 0; }
    .prayer-sticky-toolbar.is-pinned .prayer-home { display: inline-flex; }
    .prayer-home { align-items: center; gap: .45rem; min-height: 44px; color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
    .prayer-home img { width: 30px; height: 30px; border-radius: 8px; }
    .prayer-home .tld { color: #F3D58A; }
    .reader-tool, .prayer-zoom-buttons button { min-width: 44px; min-height: 44px; padding: 0 .5rem; color: #fff !important; }
    .reader-tool > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .reader-tool:hover, .prayer-zoom-buttons button:hover:not(:disabled), .reader-canon[open] > .reader-tool, .reader-tool[aria-pressed=true] { background: #ffffff26; color: #fff; }
    .prayer-zoom-buttons { border-left-color: #ffffff40; }
    .prayer-sticky-toolbar .reader-canon { position: static; }   /* panoul se lipește de bară, pe toată lățimea */
    .prayer-sticky-toolbar .reader-canon-panel { top: calc(100% + .45rem); left: .5rem; right: .5rem; width: auto; }
    .prayer-sticky-toolbar .reader-feedback { left: .5rem; right: .5rem; width: auto; max-width: none; }
    .reader-dock .reader-tool > span { position: static; width: auto; height: auto; clip-path: none; }
    .reader-dock .reader-tool { color: var(--rd-accent) !important; }
    .passage-bookmark { right: 0; }
    .reading-marked, .choosing-passage .reading-passage { padding-right: 2rem !important; }
    .reading-passage.reading-marked { box-shadow: -.35rem 0 0 #FFF6E0, -.5rem 0 0 var(--rd-gold); }
}
@media (max-width: 380px) { .prayer-home .bname { display: none; } }

/* ---------- pagina rugăciunilor: titlu, căutare, categorii ---------- */
.prayer-crumbs { margin: .2rem 0 .3rem; }
.prayer-title { margin: 0 0 .9rem; font-size: clamp(1.5rem, 3vw, 2.35rem); line-height: 1.15; color: #312520; overflow-wrap: anywhere; }
.prayers-hero { padding: clamp(1.3rem, 4vw, 2.4rem); margin-bottom: 1rem;
    background: radial-gradient(circle at 92% 0, #ffffff14 0, transparent 40%), linear-gradient(120deg, #4E111C, #7A1E2C); box-shadow: 0 0 0 1px rgba(201,162,74,.45) inset; }
.prayers-hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.prayers-hero .reading-search { margin: 1.1rem 0 0; max-width: 40rem; }
.prayers-hero .reading-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.prayers-hero .reading-search-row { border: 0; background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.prayers-hero .reading-search-row:focus-within { box-shadow: 0 0 0 3px var(--rd-gold), 0 8px 22px rgba(0,0,0,.18); }
.prayers-hero .suggest { color: #312520; }
.library-tabs { display: flex; align-items: center; gap: .4rem; margin: 0 0 1.1rem; padding: .15rem .1rem .7rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rd-edge); }
.library-tabs::-webkit-scrollbar { display: none; }
.library-tabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .9rem; border: 1px solid var(--rd-edge); border-radius: 999px; background: #fff; color: var(--rd-accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.library-tabs a:hover { border-color: var(--rd-gold); }
.library-tabs a[aria-current] { background: var(--rd-accent); border-color: var(--rd-accent); color: #fff; }
.library-tabs .tab-extra { background: transparent; border-style: dashed; color: #6B5E52; }
.library-tabs .tab-extra .ico { width: 17px; height: 17px; }
.library-tabs-sep { flex: 0 0 1px; align-self: stretch; margin: .2rem .3rem; background: var(--rd-edge); }
.library-count small { margin-left: .35rem; padding: .1rem .55rem; border-radius: 999px; background: #EFE8DC; color: #6B5E52; font-size: .55em; vertical-align: middle; }
@media (min-width: 641px) { .library-tabs { flex-wrap: wrap; overflow: visible; } }

/* căutarea din antetul paginii: sugestiile ies peste conținutul de dedesubt, nu sub el */
.library-hero:has(.reading-search), .prayers-hero { overflow: visible; z-index: 40; }
.reading-search-row .suggest { z-index: 60; max-height: min(60vh, 26rem); overflow-y: auto; }

/* Biblia: prima, cu altă culoare */
.library-tabs .tab-bible { background: linear-gradient(180deg, #F3D58A, #C9A24A); border-color: #B8913A; color: #3E2A08; font-weight: 700; }
.library-tabs .tab-bible:hover { background: linear-gradient(180deg, #F6DE9E, #D2AD58); border-color: #8C6A1E; }
.library-tabs .tab-bible .ico { width: 17px; height: 17px; }

/* sursa textului */
.prayer-source { margin: 0 0 .8rem; color: #7A6A55; font-size: .9rem; }
.prayer-source a { color: inherit; font-weight: 600; }
.prayers-hero p a { color: #F3D58A; }
@media print { .prayer-source { display: block !important; } }
/* filele de categorii: pe mobil se văd toate (pe rânduri), nu mai fug în afara ecranului */
.library-tabs { flex-wrap: wrap; overflow: visible; }
@media (max-width: 640px) { .library-tabs a { padding: .4rem .75rem; } .library-tabs-sep { display: none; } }
