/**
 * History Page – Fixed background + single glass content box
 * Fully scoped to .page-template-page-history and .page-history.
 * Reuses the visual language of page-enter.php's .enter-page__text.
 */

/* ========================================
   Fixed full-viewport background image
   Lives behind everything (incl. the header).
   ======================================== */
.page-template-page-history .page-history::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: url('../images/BeyrouthMaVille15_1.1.18.tif.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Soft darkening veil so any content reads cleanly on the photo */
.page-template-page-history .page-history::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.30) 0%,
        rgba(0, 0, 0, 0.45) 100%
    );
    pointer-events: none;
}

/* ========================================
   Page-scoped header transparency
   So the bg image shows through the fixed header strip.
   ======================================== */
.page-template-page-history .site-header,
.page-template-page-history .site-header * {
    background-color: transparent !important;
    box-shadow: none !important;
}
.page-template-page-history .site-header {
    backdrop-filter: blur(8px) brightness(0.85);
    -webkit-backdrop-filter: blur(8px) brightness(0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* ========================================
   Page container — keep header offset, vertical breathing room
   ======================================== */
.jocelyne-page.page-history {
    min-height: 100vh;
    padding-top: calc(var(--site-header-height, 80px) + 2.5rem);
    padding-bottom: 4rem;
}

.page-history__container {
    width: min(85%, 920px);
    margin-inline: auto;
}

/* ========================================
   Single glass content box — matches .enter-page__text
   ======================================== */
.page-history__box {
    background-color: rgba(17, 24, 39, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 2.5rem 2rem 2.75rem;
    color: var(--brand-cream, #FEFEFE);
    backdrop-filter: blur(18px) brightness(0.72) saturate(1.05);
    -webkit-backdrop-filter: blur(18px) brightness(0.72) saturate(1.05);
}

/* Title now lives in its own .jocelyne-hero block ABOVE the glass box
   (matches the Text A template). Cream H1; specificity (0,3,0) beats the
   base .jocelyne-hero h1 #000 rule (0,2,0). */
.jocelyne-page.page-history .page-history__title {
    margin: 0;
    color: var(--brand-cream, #FEFEFE);
    line-height: 1.1;
}

/* Hero block: the page wrapper already offsets the fixed header, so null the
   hero's own top padding (the base rule sets it with !important) to avoid a
   double gap, and keep a small space before the content box. The inherited
   white hero background is already nulled by the section transparency rule
   below; this is belt-and-suspenders. */
.jocelyne-page.page-history .jocelyne-hero {
    min-height: 0;
    background-color: transparent;
    padding-bottom: 1.25rem;
}
.jocelyne-page.page-history section.jocelyne-hero:first-child {
    padding-top: 0 !important;
}

/* Body content typography inside the glass box */
.page-history__content,
.page-history__content p,
.page-history__content li {
    color: var(--brand-cream, #FEFEFE);
    line-height: 1.7;
}

/* H3–H6 keep cream color + slim margins (h2 gets its own block) */
.page-history__content h3,
.page-history__content h4,
.page-history__content h5,
.page-history__content h6 {
    color: var(--brand-cream, #FEFEFE);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* H2 — strip the inherited oversized type, semibold weight, slate underline,
   and the 60px ::after decorative line from jocelyne-pages.css:48-83.
   Specificity (0,3,1) beats .jocelyne-page h2 (0,1,1). */
.jocelyne-page.page-history .page-history__content h2 {
    color: var(--brand-cream, #FEFEFE);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0;
    border-bottom: none;
    position: static;
}

.jocelyne-page.page-history .page-history__content h2::after {
    content: none;
    display: none;
}

.page-history__content > *:first-child { margin-top: 0; }
.page-history__content > *:last-child  { margin-bottom: 0; }

/* Inline editor images stay inside the box and stay readable */
.page-history__content img,
.page-history__content figure,
.page-history__content .wp-block-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.75rem auto;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.page-history__content figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
    text-align: center;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .page-history__container { width: 92%; }
    .page-history__box       { padding: 1.75rem 1.25rem 2rem; }
    .jocelyne-page.page-history {
        padding-top: calc(var(--site-header-height, 80px) + 1.25rem);
    }
}

/* ========================================
   Strip inherited section backgrounds
   .jocelyne-page paints alternating fills on direct-child <section>
   (jocelyne-pages.css:154-162). On History those fills cover the
   fixed bg image; null them out so the image shows around the box.
   ======================================== */
.jocelyne-page.page-history section,
.jocelyne-page.page-history .page-history__container {
    background-color: transparent !important;
    background-image: none !important;
}

/* Defensive: keep .jocelyne-page itself transparent in case a future
   base rule paints it. The fixed-bg ::before lives ON .page-history. */
.jocelyne-page.page-history {
    background-color: transparent;
    background-image: none;
}

/* ========================================
   Editor content — image pairs, triptychs, figures
   Same .image-pair selector handles 2-cell pairs and 3-cell triptychs:
   table-layout: fixed + width: 100% auto-distributes equal columns.
   ======================================== */
.page-history__content table.image-pair,
.page-history__content table.image-pair tbody,
.page-history__content table.image-pair tr,
.page-history__content table.image-pair td {
    background: transparent;
    border: none;
}

.page-history__content table.image-pair {
    width: 100%;
    margin: 2.5rem 0;
    border-collapse: separate;
    border-spacing: 1rem 0.75rem;
    table-layout: fixed;
}

.page-history__content table.image-pair td {
    padding: 0;
    vertical-align: top;
    text-align: center;
}

/* Reset the default .page-history__content img margin/float inside cells.
   Also coerces TinyMCE's stray alignleft/alignright/alignnone back to
   block flow so cells render evenly. */
.page-history__content table.image-pair td img,
.page-history__content table.image-pair td img.alignleft,
.page-history__content table.image-pair td img.alignright,
.page-history__content table.image-pair td img.alignnone,
.page-history__content table.image-pair td img.aligncenter {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
    float: none;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* Caption row — works for colspan=2 (pair) and colspan=3 (triptych). */
.page-history__content table.image-pair tr:last-child td {
    padding-top: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--brand-slate-light, #9FB3C8);
    text-align: center;
    font-style: italic;
}

.page-history__content table.image-pair tr:last-child td em {
    font-style: italic;
    opacity: 0.95;
}

/* Standalone <figure> in editor content (single-image figures). */
.page-history__content figure {
    margin: 2.5rem auto;
    text-align: center;
    max-width: 100%;
}

.page-history__content figure img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.page-history__content figure figcaption {
    margin-top: 0.85rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--brand-slate-light, #9FB3C8);
    text-align: center;
    font-style: italic;
    opacity: 1;
}

/* Neutralize stray TinyMCE alignleft/alignright floats outside tables. */
.page-history__content > p img.alignleft,
.page-history__content > p img.alignright,
.page-history__content > p img.alignnone {
    display: block;
    float: none;
    margin: 1.75rem auto;
    max-width: 100%;
    height: auto;
}

/* Mobile — stack pair/triptych cells. */
@media (max-width: 720px) {
    .page-history__content table.image-pair,
    .page-history__content table.image-pair tbody,
    .page-history__content table.image-pair tr {
        display: block;
        width: 100%;
        border-spacing: 0;
    }
    .page-history__content table.image-pair td {
        display: block;
        width: 100%;
    }
    .page-history__content table.image-pair td + td {
        margin-top: 0.85rem;
    }
    .page-history__content table.image-pair tr + tr {
        margin-top: 0.5rem;
    }
}
