/* The collection shares the reader's sky, with its own quiet pink accents. */
html:has(body.highlights-page) {
    background: #030303;
    color-scheme: dark;
}

body.highlights-page {
    --highlight-pink: #f4a5c7;
    --highlight-muted: #b4b6c3;
    min-height: 100vh;
    min-height: 100dvh;
    background: #030303;
    isolation: isolate;
    overflow-wrap: anywhere;
    -webkit-text-size-adjust: 100%;
}

.highlights-page [hidden] { display: none !important; }

.highlights-page .highlights-main {
    position: relative;
    z-index: 1;
    width: min(100%, 1100px);
    margin: 0 auto;
    padding: 1.5rem 2rem calc(4rem + env(safe-area-inset-bottom, 0px));
    background: transparent;
}

.highlights-page .header { z-index: 100; }
.highlights-page .header .nav-links a[aria-current="page"] { color: var(--highlight-pink) !important; opacity: 1; }
.highlights-page .header .nav-links a[aria-current="page"]:hover { opacity: 0.8; }

.highlights-tools { display: flex; align-items: center; justify-content: space-between; gap: 1.1rem; margin-bottom: 1.25rem; }
.highlights-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: min(100%, 430px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(17, 19, 28, 0.62);
    padding: 0 0.95rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.highlights-search:focus-within { border-color: var(--highlight-pink); }
.highlights-search svg { width: 18px; height: 18px; color: var(--highlight-muted); flex: 0 0 auto; }
.highlights-search input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    background: transparent;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 0.875rem;
    letter-spacing: -0.016em;
    color: #f5f3f7;
}
.highlights-search input::placeholder { color: #a6a8b6; opacity: 1; }
.highlights-search input::-webkit-search-cancel-button { cursor: pointer; }
.highlights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }

.highlight-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(244, 165, 199, 0.19);
    border-radius: 22px;
    padding: 1.5rem 1.5rem 0.85rem;
    background: linear-gradient(135deg, rgba(35, 27, 40, 0.75), rgba(12, 16, 24, 0.78));
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.highlight-card::before {
    position: absolute;
    top: 1.65rem;
    left: 0;
    height: 2rem;
    width: 2px;
    border-radius: 0 2px 2px 0;
    background: var(--highlight-pink);
    content: "";
    opacity: 0.8;
}
.highlight-card-heading { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.highlight-reference { font-size: 1.07rem; font-weight: 640; letter-spacing: -0.025em; line-height: 1.3; }
.highlight-version { color: var(--highlight-pink); font-size: 0.69rem; line-height: 1.4; letter-spacing: 0.005em; }
.highlight-text {
    margin: 1.2rem 0 1.4rem;
    color: #eeeaf0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    line-height: 1.78;
    letter-spacing: 0;
    white-space: pre-wrap;
    text-align: start;
    unicode-bidi: plaintext;
}
.highlight-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: auto; padding-top: 0.35rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.highlight-open, .highlight-remove, .highlights-text-button, .highlight-undo, .highlight-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.highlight-open { justify-content: flex-start; color: var(--highlight-pink); }
.highlight-open svg, .highlight-remove svg { width: 15px; height: 15px; flex: 0 0 auto; }
.highlight-remove { color: var(--highlight-muted); padding: 0 0.15rem 0 0.65rem; }
.highlight-remove:hover { color: #f5d2e3; }
.highlight-open:hover, .highlights-text-button:hover { opacity: 0.75; }

.highlight-removed { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.65rem; min-height: 106px; padding: 1rem 1.1rem; border: 1px dashed rgba(244, 165, 199, 0.25); border-radius: 20px; background: rgba(18, 19, 28, 0.72); }
.highlight-removed-description { flex: 1 1 140px; }
.highlight-removed-description p { color: #c1bdc9; font-size: 0.76rem; }
.highlight-removed-description strong { display: block; margin-top: 0.3rem; font-size: 0.86rem; font-weight: 530; }
.highlight-undo { color: var(--highlight-pink); padding: 0 0.25rem; }
.highlight-dismiss { flex: 0 0 44px; color: var(--highlight-muted); padding: 0; border-radius: 50%; }
.highlight-dismiss svg { width: 16px; height: 16px; }
.highlight-dismiss:hover { background: rgba(255, 255, 255, 0.06); }

.highlights-empty { width: min(100%, 560px); padding: 3rem 1.8rem; margin: 2rem auto 0; text-align: center; border: 1px solid rgba(244, 165, 199, 0.12); border-radius: 26px; background: rgba(15, 17, 26, 0.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.highlights-empty-symbol { display: flex; align-items: center; justify-content: center; width: 65px; height: 65px; margin: 0 auto 1.5rem; border: 1px solid rgba(244, 165, 199, 0.22); border-radius: 20px; background: rgba(244, 165, 199, 0.065); color: var(--highlight-pink); transform: rotate(-5deg); }
.highlights-empty-symbol svg { width: 28px; height: 32px; }
.highlights-empty h2 { font-size: 1.5rem; font-weight: 550; letter-spacing: -0.035em; }
.highlights-empty p { max-width: 360px; margin: 0.9rem auto 1.6rem; color: var(--highlight-muted); font-size: 0.9rem; line-height: 1.75; }
.highlights-empty strong { color: #e8d5e0; font-weight: 550; }
.highlights-primary-link { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 1rem; padding: 0.65rem 1.1rem; color: #281720; font-size: 0.82rem; font-weight: 650; background: #f0accb; border-radius: 999px; }
.highlights-primary-link:hover { opacity: 0.85; }
.highlights-no-results { padding: 3rem 1rem; text-align: center; }
.highlights-no-results h2 { font-size: 1.25rem; font-weight: 550; }
.highlights-no-results p { margin-top: 0.75rem; color: var(--highlight-muted); font-size: 0.88rem; }
.highlights-text-button { color: var(--highlight-pink); margin-top: 0.75rem; }
.highlights-error { margin: 0 0 1.4rem; padding: 1rem 1.2rem; color: #ffdce9; font-size: 0.85rem; line-height: 1.6; border: 1px solid rgba(247, 152, 172, 0.35); border-radius: 15px; background: #301c2b; }

.highlights-page a:focus-visible, .highlights-page button:focus-visible { outline: 2px solid var(--highlight-pink); outline-offset: 4px; border-radius: 5px; }
.highlights-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.highlights-skip { position: fixed; z-index: 200; top: -100px; left: 1rem; padding: 0.8rem 1rem; background: #f0accb; color: #281720; border-radius: 10px; }
.highlights-skip:focus { top: calc(0.5rem + env(safe-area-inset-top, 0px)); }

@media (min-width: 821px) {
    .highlights-page .header.mobile-header > .container { grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.5rem; }
    .highlights-page .header.mobile-header nav { justify-self: end; }
    .highlights-page .header.mobile-header .logo { font-size: 1.08rem; }
    .highlights-page .header.mobile-header .nav-links { gap: clamp(1rem, 2.2vw, 2rem); }
}

@media (max-width: 820px) {
    .highlights-page .highlights-main { padding: 1.5rem 1.1rem calc(2.5rem + env(safe-area-inset-bottom, 0px)); }
    .highlights-tools { flex-direction: column; align-items: stretch; gap: 0.9rem; }
    .highlights-search { width: 100%; }
    .highlights-search input { font-size: 1rem; letter-spacing: -0.035em; }
    .highlights-grid { grid-template-columns: minmax(0, 1fr); gap: 0.95rem; }
    .highlight-card { padding: 1.35rem 1.25rem 0.65rem; border-radius: 20px; }
    .highlight-text { font-size: 1.15rem; line-height: 1.75; margin-bottom: 1.25rem; }
    .highlight-open, .highlight-remove { font-size: 0.79rem; }
    .highlights-empty { margin-top: 0.5rem; padding: 2.4rem 1.35rem; }
    .highlights-empty h2 { font-size: 1.45rem; }
    .highlights-page .header .nav-links a[aria-current="page"] { background: rgba(244, 165, 199, 0.1); }
}

@media (prefers-reduced-motion: reduce) {
    .highlights-page *, .highlights-page *::before, .highlights-page *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
    .highlights-page .header, .highlights-tools, .highlight-actions, .highlight-removed, .highlights-skip { display: none; }
    .highlights-page .highlights-main { padding: 1rem 0; }
    .highlights-page, .highlight-card { color: #111; background: white !important; }
    .highlights-grid { display: block; }
    .highlight-card { break-inside: avoid; margin: 0 0 1rem; border-color: #aaa; box-shadow: none; }
    .highlights-page h1, .highlights-page h2, .highlights-page p, .highlight-version { color: #111 !important; }
}

/* Nota propia escrita en la Biblia */
.highlight-note {
    position: relative;
    margin: 0 0 1.1rem;
    padding: 0.85rem 1rem 0.85rem 1.05rem;
    border-radius: 14px;
    border-left: 3px solid var(--highlight-pink, #ff5caa);
    background: rgba(255, 255, 255, 0.045);
    color: rgba(246, 237, 244, 0.86);
    font-size: 0.98rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.highlight-note::before {
    content: "MI NOTA";
    display: block;
    margin-bottom: 0.35rem;
    color: rgba(246, 237, 244, 0.5);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

html:not(.dark) .highlight-note {
    background: rgba(0, 0, 0, 0.04);
    color: #1d1d1f;
}

html:not(.dark) .highlight-note::before { color: #6b7280; }
