@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400;0,700;1,400&family=Lato:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;1,400&display=swap');

/* ============================================================
   TOKENS DESIGN — Palette enluminée
   navy #1a1a4a · or #c9a55a · ivoire #fdfdf6
   ============================================================ */
:root {
    --navy: #1a1a4a;
    --navy-deep: #0e0e2e;
    --navy-soft: rgba(26, 26, 74, 0.08);
    --gold: #c9a55a;
    --gold-soft: #e3c98a;
    --gold-deep: #8a6f2a;
    --ivory: #fdfdf6;
    --paper: #f7f3e8;
    --ink: #1d1d2e;
    --ink-soft: #4a4a5e;
}

/* ============================================================
   BODY & TYPO DE BASE
   ============================================================ */
body {
    background-color: var(--ivory);
    color: var(--ink);
    font-family: 'Lora', serif;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', 'Cormorant Garamond', serif;
    font-weight: 400;
    color: var(--navy);
    line-height: 1.25;
}

h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); padding: 12px 0; }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); padding: 8px 0; }

h1:focus { outline: none; }

/* ============================================================
   BORDURE ENLUMINÉE (legacy + boutons)
   ============================================================ */
.bordure {
    border: 3px solid transparent;
    border-image: url(images/bordure-bouton2.png) 5;
}

/* ============================================================
   BOUTONS — Style enluminé or/navy
   ============================================================ */
.btn-primary {
    color: var(--navy);
    background-color: var(--gold);
    border-color: var(--gold);
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.6rem 1.25rem;
    border-radius: 0;
    box-shadow: none;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:focus-visible {
    color: var(--navy) !important;
    background-color: var(--ivory) !important;
    border-color: var(--gold) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.35);
}

.btn-outline-secondary {
    color: var(--navy);
    border-color: var(--gold);
    background: transparent;
    border-radius: 0;
    transition: background-color 0.3s, color 0.3s;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: var(--navy);
    background-color: rgba(201, 165, 90, 0.15);
    border-color: var(--gold);
}

/* ============================================================
   COQUILLE PARCHEMIN — Layout partagé des pages secondaires
   .page-content-wrapper > .page-bg + .page-overlay + .page-content
   ============================================================ */
.page-content-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
    margin-top: 40px;
    min-height: 80vh;
}

.page-bg {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 80px);
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.55) saturate(0.85);
    pointer-events: none;
    margin: 0;
}

.page-overlay,
.page-content-wrapper::before {
    content: "";
    position: fixed;
    top: 80px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 80px);
    background:
        radial-gradient(ellipse at center, rgba(10, 10, 40, 0.4) 0%, rgba(10, 10, 40, 0.72) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Le « parchemin » : surface ivoire avec ornements dorés */
.page-content {
    position: relative;
    z-index: 3;
    max-width: 1100px;
    margin: 3rem auto;
    padding: 3rem 2rem;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(253, 253, 246, 0.96)),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.78 0 0 0 0 0.68 0 0 0 0 0.45 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23p)'/%3E%3C/svg%3E");
    border-radius: 4px;
    backdrop-filter: blur(2px);
    box-shadow:
        0 1px 0 rgba(201, 165, 90, 0.4),
        0 -1px 0 rgba(201, 165, 90, 0.4),
        0 40px 100px -50px rgba(26, 26, 74, 0.45);
}

@media (min-width: 768px) {
    .page-content { padding: 3.5rem 3rem; }
}

/* Titre principal de page : ornement doré sous le H1 */
.page-content h1 {
    text-align: center;
    margin: 0 0 1.5rem;
    padding: 0 0 1.25rem;
    position: relative;
}
.page-content h1::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Sous-titres */
.page-content h2,
.page-content h3 {
    color: var(--navy);
}

/* Images dans le contenu */
.page-content img {
    width: 100%;
    height: auto;
    max-width: 100%;
    margin: 1.25rem 0;
    border-radius: 2px;
}

/* Contenu d'un article (Markdown rendu) */
.post-content {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink);
}
.post-content img {
    width: 100%;
    height: auto;
    margin: 1.25rem 0;
}
.post-content iframe { max-width: 100%; }

.post-content a {
    color: var(--navy);
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: 3px;
    transition: color 0.3s;
}
.post-content a:hover { color: var(--gold-deep); }

.post-content blockquote {
    border-left: 3px solid var(--gold);
    padding: 0.75rem 1.25rem;
    margin: 1.25rem 0;
    background: rgba(201, 165, 90, 0.07);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--navy);
    line-height: 1.6;
}

.post-content table {
    width: 100%;
    border: solid 1px rgba(201, 165, 90, 0.4);
    border-collapse: collapse;
}
.post-content table td,
.post-content table th {
    border: solid 1px rgba(201, 165, 90, 0.3);
    padding: 0.5rem 0.75rem;
}
.post-content table th {
    background: rgba(201, 165, 90, 0.15);
    font-family: 'Lato', sans-serif;
    color: var(--navy);
}

/* Container global */
.container-fluid {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Verset (numérotation) */
.verse_number {
    font-size: x-small;
    color: var(--gold-deep);
    font-weight: 700;
}

/* ============================================================
   CARTES D'ARTICLES (legacy : .post-card, .posts-grid)
   ============================================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.posts-grid a {
    text-decoration: none;
    color: inherit;
}

.post-card {
    background-color: #ffffff;
    border-radius: 0;
    border: 1px solid rgba(201, 165, 90, 0.25);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(.2,.7,.2,1), box-shadow 0.3s;
    box-shadow: 0 4px 14px rgba(26, 26, 74, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px -12px rgba(26, 26, 74, 0.28), 0 0 0 1px var(--gold);
}
.post-card img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    margin: 0;
}
.post-card-content {
    padding: 1rem 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.post-card-content h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    color: var(--navy);
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}
.post-card-content .excerpt {
    font-family: 'Lora', serif;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

/* ============================================================
   BADGES (tags, etc.)
   ============================================================ */
.badge.bg-secondary {
    background-color: transparent !important;
    color: var(--gold-deep) !important;
    border: 1px solid var(--gold);
    border-radius: 0;
    padding: 0.35rem 0.7rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ============================================================
   FORMULAIRES — inputs, textarea
   ============================================================ */
.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(201, 165, 90, 0.4);
    border-radius: 0;
    color: var(--ink);
    font-family: 'Lora', serif;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: var(--gold);
    color: var(--ink);
    box-shadow: 0 0 0 3px rgba(201, 165, 90, 0.2);
    outline: none;
}
.form-control::placeholder {
    color: var(--ink-soft);
    font-style: italic;
    opacity: 0.7;
}

/* ============================================================
   LISTE GROUP (résultats de recherche)
   ============================================================ */
.list-group {
    border-radius: 0;
    border: none;
}
.list-group-item {
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(201, 165, 90, 0.25);
    border-radius: 0 !important;
    border-bottom: none;
    padding: 1.1rem 1.25rem;
    transition: background 0.3s, transform 0.3s;
}
.list-group-item:last-child {
    border-bottom: 1px solid rgba(201, 165, 90, 0.25);
}
.list-group-item:hover {
    background: #ffffff;
    transform: translateX(4px);
    box-shadow: -2px 0 0 var(--gold);
}
.list-group-item a {
    font-family: 'Playfair Display', serif;
    color: var(--navy);
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.3s;
}
.list-group-item a:hover {
    color: var(--gold-deep);
    text-decoration: none;
}
.list-group-item .text-muted {
    font-family: 'Lato', sans-serif;
    font-size: 0.7rem !important;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold-deep) !important;
    margin: 0.25rem 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .post-content table td,
    .post-content table th { font-size: 0.9rem; }
}
@media (max-width: 767.98px) {
    .page-content {
        margin: 1.5rem 0.5rem;
        padding: 2rem 1.25rem;
    }
}
@media (max-width: 500px) {
    .post-content table td,
    .post-content table th { font-size: 0.78rem; padding: 0.3rem 0.5rem; }
}
@media (max-width: 400px) {
    .post-content table td,
    .post-content table th { font-size: 0.7rem; }
}
