/* ==========================================================================
   Vfa — Vavaka Fanamasinana ny Andro
   --------------------------------------------------------------------------
   Même écriture éditoriale que Fihirana : papier ivoire, serif, filets fins.
   Bootstrap reste la structure (grille, boutons, formulaires, breadcrumb).
   ========================================================================== */

.vfa {
    --vfa-paper: var(--kat-soft, #fbf6ea);
    --vfa-surface: #fffdf8;
    --vfa-ink: var(--kat-ink, #241c14);
    --vfa-muted: var(--kat-muted, #6f6353);
    --vfa-line: var(--kat-line, #dfcfb2);
    --vfa-line-soft: #ece1cc;
    --vfa-accent: #8b2e25;
    --vfa-accent-deep: #6c2019;
    --vfa-gold: var(--kat-gold, #8a6718);
    --vfa-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --vfa-serif: Georgia, "Times New Roman", Times, serif;
    --vfa-sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
    --vfa-mono: "SFMono-Regular", Menlo, Consolas, monospace;

    color: var(--vfa-ink);
    font-family: var(--vfa-serif);
    line-height: 1.65;
}

.vfa *,
.vfa *::before,
.vfa *::after {
    box-sizing: border-box;
}

.vfa h1,
.vfa h2,
.vfa h3,
.vfa h4,
.vfa h5,
.vfa h6 {
    color: var(--vfa-ink);
    font-family: var(--vfa-display);
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.15;
}

.vfa p {
    margin-bottom: 1rem;
}

.vfa a {
    color: var(--vfa-accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

.vfa a:hover {
    color: var(--vfa-accent-deep);
}

.vfa :focus-visible {
    outline: 2px solid var(--vfa-gold);
    outline-offset: 2px;
}

.vfa .btn {
    color: var(--bs-btn-color);
    font-family: var(--vfa-sans);
}

.vfa .btn:hover {
    color: var(--bs-btn-hover-color);
}

/* --------------------------------------------------------------------------
   En-tête, fil d'Ariane
   -------------------------------------------------------------------------- */

.vfa-crumbs {
    font-family: var(--vfa-sans);
    font-size: 0.67rem;
    letter-spacing: 0.09em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.vfa-crumbs .breadcrumb-item + .breadcrumb-item::before {
    color: var(--vfa-line);
    content: "/";
    padding: 0 0.3rem;
}

.vfa-crumbs a {
    color: var(--vfa-muted);
}

.vfa-crumbs a:hover {
    color: var(--vfa-accent);
}

.vfa-crumbs .active {
    color: var(--vfa-ink);
}

.vfa-eyebrow {
    color: var(--vfa-gold);
    font-family: var(--vfa-sans);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.vfa-pagehead {
    border-bottom: 1px solid var(--vfa-line);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.vfa-pagehead h1 {
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.08;
    max-width: 26ch;
}

.vfa-lede {
    color: var(--vfa-muted);
    font-size: 1rem;
    margin: 0.55rem 0 0;
    max-width: 64ch;
}

.vfa-meta {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    margin: 0.75rem 0 0;
}

.vfa-meta .sep {
    color: var(--vfa-line);
    margin: 0 0.45rem;
}

/* --------------------------------------------------------------------------
   Accueil du bréviaire
   -------------------------------------------------------------------------- */

.vfa-date-form .form-control {
    background: var(--vfa-surface);
    border-color: var(--vfa-line);
    color: var(--vfa-ink);
    font-family: var(--vfa-sans);
}

.vfa-date-form .form-control:focus {
    border-color: var(--vfa-gold);
    box-shadow: 0 0 0 3px rgba(138, 103, 24, 0.12);
}

.vfa-day {
    background: var(--vfa-surface);
    border: 1px solid var(--vfa-line);
    border-left: 5px solid var(--vfa-day-color, var(--vfa-accent));
    border-radius: 3px;
    margin-bottom: 1.5rem;
    padding: clamp(1.1rem, 3vw, 1.6rem);
}

.vfa-day-date {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    margin: 0 0 0.35rem;
    text-transform: uppercase;
}

.vfa-day h2 {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    margin: 0 0 0.55rem;
}

.vfa-day-meta {
    align-items: center;
    color: var(--vfa-muted);
    display: flex;
    flex-wrap: wrap;
    font-family: var(--vfa-sans);
    font-size: 0.7rem;
    gap: 0.35rem 0.55rem;
    margin: 0;
}

.vfa-color-dot {
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 50%;
    display: inline-block;
    height: 0.62em;
    vertical-align: 0.02em;
    width: 0.62em;
}

.vfa-day .sep {
    color: var(--vfa-line);
}

.vfa-day-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Choix propre / férie */
.vfa-choice-wrap {
    margin-bottom: 1.5rem;
}

.vfa-choice-label {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.vfa-choice {
    background: var(--vfa-surface);
    border: 1px solid var(--vfa-line);
    border-radius: 3px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vfa-choice-link {
    color: var(--vfa-ink);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.8rem 1rem;
}

.vfa-choice-link + .vfa-choice-link {
    border-left: 1px solid var(--vfa-line);
}

.vfa-choice-link:hover {
    background: var(--vfa-paper);
    color: var(--vfa-ink);
}

.vfa-choice-link.is-active {
    box-shadow: inset 0 -2px 0 var(--vfa-accent);
}

.vfa-choice-kicker {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.vfa-choice-title {
    font-family: var(--vfa-display);
    font-size: 1rem;
    line-height: 1.3;
}

.vfa-choice-meta {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.65rem;
}

/* Mode feuilleter */
.vfa-browse {
    background: var(--vfa-paper);
    border: 1px solid var(--vfa-line);
    border-radius: 3px;
    margin-bottom: 1.75rem;
    padding: clamp(1rem, 3vw, 1.4rem);
}

.vfa-browse-group {
    margin-top: 0.9rem;
}

.vfa-browse-label {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.vfa-browse-note {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.72rem;
    margin: 1rem 0 0;
}

.vfa-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.95rem;
}

.vfa-tags a {
    border-bottom: 1px solid transparent;
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.78rem;
    line-height: 1.9;
}

.vfa-tags a:hover {
    border-color: currentColor;
    color: var(--vfa-accent);
}

.vfa-tags a.is-active {
    border-color: var(--vfa-accent);
    color: var(--vfa-accent);
}

/* Liste des offices */
.vfa-section {
    margin-bottom: 2.5rem;
}

.vfa-section-head {
    border-bottom: 1px solid var(--vfa-line);
    margin-bottom: 0.35rem;
    padding-bottom: 0.5rem;
}

.vfa-section-head h2 {
    font-size: 1.35rem;
    margin: 0;
}

.vfa-muted {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.vfa-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vfa-list li {
    border-bottom: 1px solid var(--vfa-line-soft);
}

.vfa-list a {
    align-items: baseline;
    color: var(--vfa-ink);
    display: flex;
    gap: 1rem;
    padding: 0.8rem 0.1rem;
}

.vfa-list-num {
    color: var(--vfa-muted);
    flex: 0 0 2.2rem;
    font-family: var(--vfa-mono);
    font-size: 0.67rem;
    letter-spacing: 0.02em;
}

.vfa-list-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.vfa-list-title {
    font-family: var(--vfa-display);
    font-size: 1.08rem;
    line-height: 1.3;
    transition: color 0.15s ease;
}

.vfa-list-sub {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.73rem;
}

.vfa-list-arrow {
    color: var(--vfa-line);
    flex: 0 0 auto;
    font-size: 0.85rem;
}

.vfa-list a:hover .vfa-list-title {
    color: var(--vfa-accent);
}

.vfa-list a:hover .vfa-list-arrow {
    color: var(--vfa-accent);
}

.vfa-empty {
    border: 1px dashed var(--vfa-line);
    color: var(--vfa-muted);
    padding: 2rem 1rem;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Lecture d'un office
   -------------------------------------------------------------------------- */

.vfa-reader-head {
    border-bottom: 1px solid var(--vfa-line);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.vfa-reader-head h1 {
    font-size: clamp(1.8rem, 3.6vw, 2.7rem);
    line-height: 1.08;
    max-width: 30ch;
}

.vfa-reader-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vfa-reader {
    background: var(--vfa-surface);
    border: 1px solid var(--vfa-line);
    border-radius: 3px;
    font-size: 17px;
    line-height: 1.85;
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 2.75rem);
}

.vfa-reader-section {
    border-bottom: 1px solid var(--vfa-line-soft);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
}

.vfa-reader-section:last-of-type {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.vfa-rubric {
    color: var(--vfa-accent);
    font-family: var(--vfa-sans);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin: 0 0 0.6rem;
    text-transform: uppercase;
}

.vfa-dialogue {
    font-size: 1.02rem;
    line-height: 1.9;
}

.vfa-speaker {
    color: var(--vfa-accent);
    font-weight: 700;
}

.vfa-antiphon {
    background: var(--vfa-paper);
    border-left: 2px solid var(--vfa-accent);
    margin: 1rem 0;
    padding: 0.65rem 0.9rem;
}

.vfa-antiphon-label {
    color: var(--vfa-accent);
    display: block;
    font-family: var(--vfa-sans);
    font-size: 0.59rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.vfa-antiphon-text {
    font-style: italic;
}

.vfa-psalm {
    margin-bottom: 2rem;
}

.vfa-psalm:last-child {
    margin-bottom: 0;
}

.vfa-psalm-ref {
    font-size: 1.12rem;
    margin: 0 0 0.2rem;
}

.vfa-psalm-title {
    color: var(--vfa-ink);
    font-family: var(--vfa-sans);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.vfa-psalm-caption {
    color: var(--vfa-muted);
    font-size: 0.84rem;
    font-style: italic;
    margin-bottom: 0.6rem;
}

.vfa-verses p {
    line-height: 1.9;
    margin-bottom: 0.35rem;
}

.vfa-doxology {
    color: var(--vfa-muted);
    font-style: italic;
    margin-top: 0.8rem;
}

.vfa-hymn-text {
    border-left: 2px solid var(--vfa-line);
    font-style: italic;
    padding-left: 1rem;
}

.vfa-reading {
    font-size: 1.02rem;
}

.vfa-responsory {
    background: var(--vfa-paper);
    border: 1px solid var(--vfa-line);
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
}

.vfa-responsory-label {
    color: var(--vfa-accent);
    font-family: var(--vfa-sans);
    font-size: 0.59rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.vfa-note {
    background: var(--vfa-paper);
    border: 1px solid var(--vfa-line);
    font-size: 0.86rem;
    font-style: italic;
    padding: 0.7rem 0.9rem;
}

.vfa-intercessions {
    line-height: 1.9;
}

.vfa-prayer {
    font-style: italic;
    line-height: 1.9;
}

.vfa-blessing {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.78rem;
    font-style: italic;
    text-align: center;
}

.vfa-edit-link {
    border-top: 1px solid var(--vfa-line-soft);
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Formulaire d'édition
   -------------------------------------------------------------------------- */

.vfa-form {
    border-top: 1px solid var(--vfa-ink);
    padding-top: 1.5rem;
}

.vfa-panel {
    background: var(--vfa-surface);
    border: 1px solid var(--vfa-line);
    border-radius: 3px;
    margin-bottom: 1.5rem;
    padding: clamp(1rem, 3vw, 1.4rem);
}

.vfa-panel-head {
    border-bottom: 1px solid var(--vfa-line);
    margin-bottom: 1rem;
    padding-bottom: 0.45rem;
}

.vfa-panel-head h2 {
    font-size: 1.15rem;
    margin: 0;
}

.vfa-panel-note {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.72rem;
    margin: 0.35rem 0 0;
}

.vfa-form-section {
    margin-bottom: 1.5rem;
}

.vfa-form-section:last-child {
    margin-bottom: 0;
}

.vfa-form .form-label {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.vfa-form .form-control {
    background: var(--vfa-surface);
    border-color: var(--vfa-line);
    color: var(--vfa-ink);
    font-family: var(--vfa-serif);
}

.vfa-form .form-control:focus {
    border-color: var(--vfa-gold);
    box-shadow: 0 0 0 3px rgba(138, 103, 24, 0.12);
}

.vfa-form textarea.form-control {
    line-height: 1.8;
    resize: vertical;
}

.vfa-form-actions {
    align-items: center;
    border-top: 1px solid var(--vfa-line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.vfa-edit-context {
    color: var(--vfa-muted);
    font-family: var(--vfa-sans);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.vfa-psalm-editor {
    border-top: 1px solid var(--vfa-line-soft);
    margin-top: 1rem;
    padding-top: 1rem;
}

.vfa-psalm-editor:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .vfa-choice {
        grid-template-columns: 1fr;
    }

    .vfa-choice-link + .vfa-choice-link {
        border-left: 0;
        border-top: 1px solid var(--vfa-line);
    }

    .vfa-reader-head {
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .vfa-crumbs .breadcrumb-item.active {
        display: none;
    }

    .vfa-pagehead h1 {
        font-size: clamp(1.8rem, 9vw, 2.4rem);
    }

    .vfa-reader {
        padding: 1rem;
    }

    .vfa-reader-actions {
        width: 100%;
    }

    .vfa-form-actions {
        flex-direction: column-reverse;
    }

    .vfa-form-actions .btn {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Impression
   -------------------------------------------------------------------------- */

@media print {
    .vfa-crumbs,
    .vfa-reader-actions,
    .vfa-date-form,
    .vfa-browse,
    .vfa-choice-wrap,
    .vfa-edit-link,
    .vfa-form-actions {
        display: none !important;
    }

    .vfa-reader {
        border: 0;
        max-width: none;
        padding: 0;
    }

    .vfa-reader-section {
        break-inside: avoid;
    }
}
