@font-face {
    font-family: "HebrewLibrary";
    src: url("/static/fonts/hebrew.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

.hebrew-library {
    --hebrew-ink: #28271f;
    --hebrew-muted: #6f6c60;
    --hebrew-paper: #fffef8;
    --hebrew-card: #fffdf5;
    --hebrew-line: #302f27;
    --hebrew-accent: #a78935;
    --hebrew-soft: #f2ecd9;
    color: var(--hebrew-ink);
    font-family: var(--font-body, "Source Serif 4", Georgia, serif);
    padding-bottom: 3rem !important;
}

.hebrew-glyph {
    font-family: "HebrewLibrary", serif;
    font-weight: 400;
    direction: rtl;
    unicode-bidi: isolate;
}

.hebrew-masthead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.5rem, 5vw, 3.8rem);
    border: 3px solid var(--hebrew-line);
    background: #f4eed9;
    box-shadow: 6px 6px 0 var(--hebrew-line);
}

.hebrew-kicker {
    margin: 0 0 .7rem;
    color: #756439;
    font-family: "Courier New", monospace;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1.5;
    text-transform: uppercase;
}

.hebrew-masthead h1,
.hebrew-admin h1,
.hebrew-detail h1,
.hebrew-form-heading h1 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 900;
    letter-spacing: -.045em;
    line-height: .98;
}

.hebrew-intro {
    max-width: 42rem;
    margin: 1rem 0 0;
    color: #555247;
    font-size: 1.12rem;
    line-height: 1.6;
}

.hebrew-back,
.hebrew-back-link {
    color: var(--hebrew-ink);
    font-size: .95rem;
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    white-space: nowrap;
}

.hebrew-back:focus-visible,
.hebrew-back-link:focus-visible,
.hebrew-card-link:focus-visible,
.hebrew-edit-link:focus-visible,
.hebrew-view-link:focus-visible,
.hebrew-search button:focus-visible,
.hebrew-admin-public:focus-visible,
.hebrew-save:focus-visible,
.hebrew-cancel:focus-visible {
    outline: 3px solid #8a6a00;
    outline-offset: 3px;
}

.hebrew-search {
    margin: 2.2rem 0 1.2rem;
    padding: 1.25rem 1.4rem;
    border: 2px solid var(--hebrew-line);
    background: var(--hebrew-card);
    box-shadow: 4px 4px 0 var(--hebrew-line);
}

.hebrew-search label,
.hebrew-field label {
    display: block;
    margin-bottom: .45rem;
    font-size: .92rem;
    font-weight: 700;
}

.hebrew-search-controls {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.hebrew-search input,
.hebrew-field input,
.hebrew-field textarea {
    width: 100%;
    min-width: 0;
    padding: .75rem .85rem;
    border: 2px solid #aaa48e;
    border-radius: 0;
    background: #fffef9;
    color: var(--hebrew-ink);
    font: inherit;
}

.hebrew-search input:focus,
.hebrew-field input:focus,
.hebrew-field textarea:focus {
    border-color: #826700;
    outline: 3px solid rgba(167, 137, 53, .23);
}

.hebrew-search button,
.hebrew-save {
    flex: 0 0 auto;
    padding: .72rem 1.15rem;
    border: 2px solid var(--hebrew-line);
    border-radius: 0;
    background: #e1cd8b;
    color: #211e14;
    font: inherit;
    font-weight: 800;
    box-shadow: 3px 3px 0 var(--hebrew-line);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.hebrew-search button:hover,
.hebrew-save:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--hebrew-line);
}

.hebrew-clear {
    color: var(--hebrew-muted);
    font-size: .9rem;
}

.hebrew-results-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 .8rem;
    color: var(--hebrew-muted);
    font-family: "Courier New", monospace;
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.hebrew-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.hebrew-card {
    display: flex;
    min-height: 265px;
    flex-direction: column;
    padding: 1.15rem;
    border: 2px solid var(--hebrew-line);
    background: var(--hebrew-card);
    box-shadow: 4px 4px 0 var(--hebrew-line);
    transition: transform .16s ease, box-shadow .16s ease;
}

.hebrew-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--hebrew-line);
}

.hebrew-card-top {
    display: flex;
    min-height: 6rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d8d0b8;
}

.hebrew-number {
    padding: .26rem .42rem;
    background: var(--hebrew-soft);
    color: #67571d;
    font-family: "Courier New", monospace;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
}

.hebrew-card .hebrew-glyph {
    color: #62542b;
    font-size: clamp(3.75rem, 7vw, 5rem);
    line-height: 1;
}

.hebrew-card-copy {
    flex: 1;
    padding: .8rem 0 .9rem;
}

.hebrew-card h2 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1.12;
}

.hebrew-transliteration {
    margin: .35rem 0 0;
    color: #746b50;
    font-size: .94rem;
    font-style: italic;
}

.hebrew-tripletta-note {
    margin: .4rem 0 0;
    color: #706849;
    font-size: .79rem;
    font-style: italic;
}

.hebrew-subtitle {
    margin: .5rem 0 0;
    color: #746b50;
    font-size: .92rem;
    font-style: italic;
}

.hebrew-variant-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .7rem;
}

.hebrew-label {
    display: block;
    color: #776f5a;
    font-family: "Courier New", monospace;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.hebrew-variant {
    display: inline-flex;
    min-width: 1.7rem;
    min-height: 1.65rem;
    align-items: center;
    justify-content: center;
    padding: .1rem .35rem;
    border: 1px solid #d3c9ad;
    background: #f5f0e2;
    color: #4f482f;
    font-family: "HebrewLibrary", serif;
    font-size: 1.2rem;
    unicode-bidi: isolate;
}

.hebrew-spelling-variant {
    color: #4f482f;
    direction: ltr;
    font-family: inherit;
    font-size: .95rem;
    unicode-bidi: isolate;
}

.hebrew-abstract {
    margin: .75rem 0 0;
    color: #4f4c42;
    font-size: .94rem;
    line-height: 1.5;
}

.hebrew-card-link {
    display: flex;
    justify-content: space-between;
    padding-top: .7rem;
    border-top: 1px solid #d8d0b8;
    color: var(--hebrew-ink);
    font-size: .86rem;
    font-weight: 800;
    text-decoration: none;
}

.hebrew-card-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hebrew-empty {
    margin: 2rem 0;
    padding: 3rem 1.5rem;
    border: 2px dashed #aaa48e;
    background: #f8f3e4;
    text-align: center;
}

.hebrew-empty-mark {
    display: block;
    color: #8d7934;
    font-family: Georgia, serif;
    font-size: 3rem;
    line-height: 1;
}

.hebrew-empty h2 {
    margin: .6rem 0;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 900;
}

.hebrew-empty p {
    color: var(--hebrew-muted);
}

.hebrew-empty a {
    color: #5c4b0d;
    font-weight: 700;
}

.hebrew-context {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(14rem, .7fr);
    gap: 2rem;
    margin-top: 2.4rem;
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid #c9c0a7;
    background: #f8f4e8;
}

.hebrew-context h2,
.hebrew-context h3 {
    margin: 0 0 .65rem;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 800;
}

.hebrew-context h2 { font-size: 1.45rem; }
.hebrew-context h3 { font-size: 1.1rem; }
.hebrew-context p { margin: 0; color: #555247; line-height: 1.65; }
.hebrew-sources ul { margin: 0; padding-left: 1.1rem; }
.hebrew-sources li { margin: .35rem 0; color: var(--hebrew-muted); }
.hebrew-sources a { color: #5c4b0d; font-weight: 700; text-underline-offset: 3px; }

.hebrew-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin: 0 0 1.4rem;
    color: var(--hebrew-muted);
    font-size: .9rem;
}

.hebrew-breadcrumb a {
    color: #5f501b;
    font-weight: 700;
}

.hebrew-detail {
    display: grid;
    grid-template-columns: minmax(150px, .65fr) 1.6fr;
    gap: clamp(2rem, 7vw, 6rem);
    align-items: start;
    padding: clamp(1.5rem, 6vw, 4.5rem);
    border: 3px solid var(--hebrew-line);
    background: var(--hebrew-card);
    box-shadow: 7px 7px 0 var(--hebrew-line);
}

.hebrew-detail-glyph {
    display: flex;
    min-height: 10rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 1rem;
    border: 1px solid #ddd3b9;
    background: #f7f2e4;
    text-align: center;
}

.hebrew-detail-glyph .hebrew-glyph {
    color: #77651f;
    font-size: clamp(5rem, 15vw, 10rem);
    line-height: 1;
}

.hebrew-detail-glyph p {
    max-width: 15rem;
    margin: 0;
    color: var(--hebrew-muted);
    font-size: .84rem;
}

.hebrew-detail-content { max-width: 48rem; }
.hebrew-detail h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); }
.hebrew-detail-transliteration { margin: .65rem 0 0; color: #625b48; font-size: 1.05rem; font-style: italic; }
.hebrew-detail-subtitle { margin: 1rem 0 0; color: #746b50; font-size: clamp(1.1rem, 2vw, 1.4rem); font-style: italic; }
.hebrew-detail-abstract { margin: 1.6rem 0 2rem; color: #454238; font-size: 1.12rem; line-height: 1.75; white-space: pre-line; }
.hebrew-detail-variants { margin-top: 1.6rem; }
.hebrew-detail-variants h2 { margin: 0 0 .7rem; font-family: "Playfair Display", Georgia, serif; font-size: 1.2rem; }
.hebrew-variant-list { display: flex; flex-wrap: wrap; gap: .55rem; margin: .45rem 0; }
.hebrew-variant-item { display: flex; align-items: center; gap: .45rem; padding: .35rem .5rem; border: 1px solid #d3c9ad; background: #f8f4e8; }
.hebrew-variant-item small { color: #716951; font-size: .72rem; }
.hebrew-back-link { display: inline-block; }
.hebrew-detail-context { margin-top: 2rem; }

.hebrew-admin h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.hebrew-admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin: .5rem 0 2rem; }
.hebrew-admin-head p:not(.hebrew-kicker),
.hebrew-form-heading p:not(.hebrew-kicker) { margin: .7rem 0 0; color: var(--hebrew-muted); }
.hebrew-admin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.hebrew-admin-public,
.hebrew-edit-link { color: #5c4b0d; font-size: .9rem; font-weight: 800; }
.hebrew-admin-summary { padding: .85rem 1rem; margin-bottom: .75rem; border-block: 1px solid #c9c0a7; color: var(--hebrew-muted); font-family: "Courier New", monospace; font-size: .8rem; }
.hebrew-admin-summary strong { color: var(--hebrew-ink); font-size: 1rem; }
.hebrew-admin-list { border-top: 2px solid var(--hebrew-line); }
.hebrew-admin-row { display: grid; grid-template-columns: 3.3rem 3rem minmax(0, 1fr) 7rem auto; align-items: center; gap: 1rem; min-height: 78px; padding: .8rem .55rem; border-bottom: 1px solid #d8d0b8; background: rgba(255, 253, 245, .8); }
.hebrew-admin-glyph { color: #645723; font-family: "HebrewLibrary", serif; font-size: 1.75rem; text-align: center; unicode-bidi: isolate; }
.hebrew-admin-name strong,
.hebrew-admin-name small { display: block; }
.hebrew-admin-name strong { font-family: "Playfair Display", Georgia, serif; font-size: 1.1rem; }
.hebrew-admin-name small { margin-top: .15rem; color: var(--hebrew-muted); }
.hebrew-status { justify-self: start; padding: .3rem .5rem; font-family: "Courier New", monospace; font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.hebrew-status.is-live { background: #e8efdc; color: #40552b; }
.hebrew-status.is-draft { background: #eee9df; color: #71695b; }
.hebrew-row-actions { display: flex; align-items: center; gap: .8rem; white-space: nowrap; }
.hebrew-view-link { color: #666054; font-size: .82rem; }

.hebrew-form-heading { display: flex; align-items: center; gap: 1.4rem; margin: .5rem 0 2rem; }
.hebrew-form-heading h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); }
.hebrew-form-glyph { display: grid; width: 5.5rem; height: 5.5rem; flex: 0 0 auto; place-items: center; border: 2px solid var(--hebrew-line); background: var(--hebrew-soft); color: #645723; font-size: 3rem; }
.hebrew-editor { border: 2px solid var(--hebrew-line); background: var(--hebrew-card); box-shadow: 5px 5px 0 var(--hebrew-line); }
.hebrew-fixed-fields { padding: clamp(1.2rem, 4vw, 2.2rem); border-bottom: 1px solid #d8d0b8; background: #faf7ed; }
.hebrew-fixed-fields h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: 1.3rem; }
.hebrew-fixed-fields dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0 0; }
.hebrew-fixed-fields dl > div { min-width: 0; padding: .75rem; border: 1px solid #ded6c2; background: #fffef9; }
.hebrew-fixed-fields dt { color: #746b50; font-family: "Courier New", monospace; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.hebrew-fixed-fields dd { margin: .35rem 0 0; overflow-wrap: anywhere; }
.hebrew-readonly-wide { grid-column: span 2; }
.hebrew-readonly-separator { color: #aaa48e; }
.hebrew-editor-main { display: grid; gap: 1.2rem; padding: clamp(1.2rem, 4vw, 2.2rem); }
.hebrew-field textarea { resize: vertical; }
.hebrew-field small { display: block; margin-top: .4rem; color: var(--hebrew-muted); font-size: .84rem; }
.hebrew-editor-seo { display: grid; gap: 1rem; padding: 1.4rem clamp(1.2rem, 4vw, 2.2rem); border-top: 1px solid #d8d0b8; background: #f8f3e4; }
.hebrew-editor-seo h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: 1.35rem; }
.hebrew-editor-seo .hebrew-kicker { margin-bottom: .25rem; }
.hebrew-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.3rem clamp(1.2rem, 4vw, 2.2rem); border-top: 1px solid #d8d0b8; }
.hebrew-publish-toggle { display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.hebrew-publish-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hebrew-toggle-box { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; border: 2px solid #746b50; background: #fffef9; }
.hebrew-publish-toggle input:checked + .hebrew-toggle-box { border-color: #4f632f; background: #60783b; box-shadow: inset 0 0 0 3px #fffef9; }
.hebrew-publish-toggle input:focus-visible + .hebrew-toggle-box { outline: 3px solid rgba(167, 137, 53, .45); outline-offset: 2px; }
.hebrew-publish-toggle strong,
.hebrew-publish-toggle small { display: block; }
.hebrew-publish-toggle small { margin-top: .15rem; color: var(--hebrew-muted); font-size: .82rem; }
.hebrew-form-actions { display: flex; align-items: center; gap: 1rem; }
.hebrew-cancel { color: #555247; font-weight: 700; }
.hebrew-save { font-size: .95rem; }

@media (max-width: 991.98px) {
    .hebrew-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .hebrew-masthead,
    .hebrew-admin-head { align-items: flex-start; flex-direction: column; }
    .hebrew-grid { grid-template-columns: 1fr; }
    .hebrew-card { min-height: 230px; }
    .hebrew-results-line { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .hebrew-context { grid-template-columns: 1fr; gap: 1.25rem; }
    .hebrew-detail { grid-template-columns: 1fr; gap: 1rem; }
    .hebrew-detail-glyph { min-height: 8rem; align-items: flex-start; }
    .hebrew-detail-glyph .hebrew-glyph { align-self: center; }
    .hebrew-admin-row { grid-template-columns: 2.7rem 2.4rem minmax(0, 1fr) auto; gap: .55rem; }
    .hebrew-admin-glyph { font-size: 1.45rem; }
    .hebrew-admin-name strong { font-size: 1rem; }
    .hebrew-admin-name small { font-size: .82rem; }
    .hebrew-status { grid-column: 3; grid-row: 2; }
    .hebrew-row-actions { grid-column: 4; grid-row: 1 / span 2; align-items: flex-end; flex-direction: column; gap: .3rem; }
    .hebrew-editor-footer { align-items: stretch; flex-direction: column; }
    .hebrew-form-actions { justify-content: flex-end; }
    .hebrew-search-controls { flex-wrap: wrap; }
    .hebrew-search input { flex-basis: 100%; }
    .hebrew-fixed-fields dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 479.98px) {
    .hebrew-fixed-fields dl { grid-template-columns: 1fr; }
    .hebrew-readonly-wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .hebrew-card,
    .hebrew-search button,
    .hebrew-save { transition: none; }
}