/*
 * Footnote-o-matic: house overrides on top of Tabler (the Boyd Reporting approach).
 * The "printed page" uses EB Garamond, served from this site: no third-party font requests.
 */

@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("../lib/eb-garamond/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("../lib/eb-garamond/eb-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("../lib/eb-garamond/eb-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 600; font-display: swap; src: url("../lib/eb-garamond/eb-garamond-latin-600-italic.woff2") format("woff2"); }

:root {
    --app-serif: "EB Garamond", Georgia, "Times New Roman", serif;
    --app-paper: #fbfbf8;
}

[data-bs-theme="dark"] {
    --app-paper: #18202f;
}

/* ---- Shell ------------------------------------------------------------------------------- */
.app-brand { font-family: var(--app-serif); font-size: 1.35rem; font-weight: 600; }
.app-brand-product { color: var(--tblr-primary); font-weight: 600; }
.app-theme-toggle { min-width: 44px; min-height: 44px; font-size: 1.1rem; }
.app-footer { color: var(--tblr-secondary); font-size: .8125rem; padding: 1.5rem 0; }
.app-min-0 { min-width: 0; }
.app-wrap { overflow-wrap: anywhere; }

.app-page-header { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; }
.app-page-header-title { flex: 1 1 auto; min-width: 0; }
.app-page-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.app-breadcrumb { margin-bottom: .25rem; font-size: .8125rem; }

/* 16px inputs stop iOS zooming in on focus. */
.form-control, .form-select { font-size: 1rem; }

/* ---- Editor ------------------------------------------------------------------------------ */
.app-type-picker { display: flex; flex-wrap: wrap; gap: .375rem; }
.app-person-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: .5rem; align-items: end; margin-bottom: .5rem; }
.app-remove { min-height: 38px; padding: 0; font-size: 1.25rem; }
.app-summary { cursor: pointer; font-weight: 500; min-height: 44px; display: flex; align-items: center; }

/* ---- The printed page -------------------------------------------------------------------- */
@media (min-width: 992px) {
    .app-sticky { position: sticky; top: 1rem; }
}

.app-paper {
    background: var(--app-paper);
    border: 1px solid var(--tblr-border-color);
    border-radius: 4px;
    padding: clamp(1.25rem, 3vw, 2.25rem);
    box-shadow: 0 18px 40px -28px rgba(20, 27, 45, .45);
    font-family: var(--app-serif);
    font-size: 1.1875rem;
    line-height: 1.5;
}

.app-serif { font-family: var(--app-serif); font-size: 1.125rem; line-height: 1.5; }
.app-ghost { height: 9px; margin: 0 0 6px; border-radius: 2px; opacity: .1; background: repeating-linear-gradient(90deg, currentColor 0 60%, transparent 60% 64%); }
.app-ghost-short { width: 72%; }
.app-rule { width: 34%; border-top: 1px solid currentColor; margin: 1.5rem 0 .75rem; }
.app-note { display: flex; gap: .4rem; margin: 0 0 .25rem; }
.app-note sup { font-size: .7em; line-height: 2.1; }
.app-out { overflow-wrap: anywhere; }
.app-bib { padding-left: 1.5em; text-indent: -1.5em; overflow-wrap: anywhere; }
.app-paper-label {
    display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    margin: 1.25rem 0 .375rem;
    font: 500 .8125rem/1.4 var(--tblr-font-sans-serif); color: var(--tblr-secondary);
}
.app-hints { color: var(--tblr-warning-text-emphasis, #8a4b00); font-size: .875rem; padding-left: 1.1rem; margin-bottom: 0; }

.app-prose h3 { margin-top: 1.5rem; }

/* ---- Scratchpad -------------------------------------------------------------------------- */
.app-scratch-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.app-checklist { padding-left: 1.1rem; margin-bottom: 0; color: var(--tblr-secondary); font-size: .875rem; }

/* ---- Toast ------------------------------------------------------------------------------- */
.app-toast {
    position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
    background: var(--tblr-dark); color: var(--tblr-light);
    padding: .625rem 1rem; border-radius: 6px; font-size: .875rem;
    opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1080; max-width: calc(100vw - 2rem);
}
.app-toast.show { opacity: 1; }

/* ---- Phones: everything you touch is at least 44px tall ----------------------------------- */
@media (max-width: 767.98px) {
    .btn, .btn-sm, .nav-link, .form-control, .form-select { min-height: 44px; }
    .form-check { min-height: 44px; display: flex; align-items: center; gap: .5rem; }
    .app-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
    .app-tabs .nav-link { white-space: nowrap; }
}

/* The nav wraps under the brand on narrow phones rather than pushing the page sideways. */
.app-navbar .container-xl { flex-wrap: wrap; row-gap: .25rem; }
