/* ==========================================================================
   OIC Statements — Page Layouts
   --------------------------------------------------------------------------
   Shared by THREE consumers so they can never drift apart:
     • reader  (.oic-page  is the flip page root)
     • print   (.print-page is the PDF page root)
     • builder (.builder-page-preview is the canvas root)
   Each layout fills its page root (100% x 100%). Full-bleed layouts position
   an absolute .lay__bg; flow layouts use a padded flex column.
   ========================================================================== */

.lay {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Shared atoms ------------------------------------------------------------ */
.lay__kicker {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.lay__title {
  margin: 0 0 14px;
  line-height: 1.18;
  font-weight: 800;
}
.lay__body {
  margin: 0;
  overflow: hidden;
}
.lay__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
  display: block;
}

/* Divider (markup comes from PHP/JS, base spacing here) */
.lay .oic-page__divider { margin: 4px 0 16px; }
.oic-page__divider--line { height: 3px; width: 60px; border-radius: 3px; }
.oic-page__divider--dots { letter-spacing: 6px; font-size: 1rem; line-height: 1; }
.oic-page__divider--ornament { font-size: 1.5rem; line-height: 1; }

/* Full-bleed helpers ------------------------------------------------------ */
.lay__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.lay__bg--empty {
  /* Background set via inline style from builder (bgColor/gradient). No hardcoded fallback. */
}
.lay__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 14, 20, 0.92) 0%, rgba(8, 14, 20, 0.45) 38%, rgba(8, 14, 20, 0) 64%);
}
.lay__scrim--full {
  background: linear-gradient(to top, rgba(8, 14, 20, 0.95) 6%, rgba(8, 14, 20, 0.15) 52%, rgba(8, 14, 20, 0.4) 100%);
}
.lay__kicker--light { color: #ffd9a8; }
.lay__title--light,
.lay__body--light { color: #ffffff; }
.lay__body--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
  opacity: 0.92;
}

/* ── Standard ───────────────────────────────────────────────────────────── */
.lay--standard { justify-content: flex-start; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.lay--hero { justify-content: flex-end; }
.lay--hero .lay__overlay { position: relative; z-index: 2; margin-top: auto; }
.lay--hero .lay__title--light { font-weight: 800; text-shadow: 0 2px 18px rgba(0,0,0,0.5); }

/* ── Feature ────────────────────────────────────────────────────────────── */
.lay--feature .lay__title--xl {
  font-size: 2.2em;
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.lay--feature .lay__img--wide {
  height: 180px;
  border-radius: 6px;
}
.lay__body--cols {
  column-count: 2;
  column-gap: 22px;
  column-rule: 1px solid rgba(0,0,0,0.08);
  text-align: justify;
}

/* ── Editorial ──────────────────────────────────────────────────────────── */
.lay--editorial { justify-content: flex-start; }
.lay__img--inset {
  float: inline-start;
  width: 42%;
  height: 150px;
  margin: 4px 16px 10px 0;
}
.lay__body--dropcap::first-letter {
  float: inline-start;
  font-size: 3.4em;
  line-height: 0.78;
  font-weight: 800;
  padding: 4px 10px 0 0;
  color: var(--oic-accent-600, #0e7c6b);
}

/* ── Gallery ────────────────────────────────────────────────────────────── */
.lay--gallery { justify-content: flex-end; }
.lay--gallery .lay__caption {
  position: relative;
  z-index: 2;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 3px solid var(--oic-accent-600, #0e7c6b);
}
/* Caption at top of full-bleed image */
.lay--gallery-cap-top { justify-content: flex-start; }
.lay--gallery-cap-top .lay__caption {
  margin-top: 0;
  margin-bottom: auto;
  border-top: none;
  border-bottom: 3px solid var(--oic-accent-600, #0e7c6b);
}
/* Flow mode: image is inline, acts like a standard flow layout */
.lay--gallery-flow { justify-content: flex-start; }

.lay__caption-title { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.lay__caption-text { font-size: 0.82rem; color: #56616b; line-height: 1.5; }

/* ── Cover ──────────────────────────────────────────────────────────────── */
.lay--cover { justify-content: space-between; }
.lay__masthead {
  position: relative;
  z-index: 2;
  padding: 20px 24px 0;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.95;
}
.lay__cover-foot {
  position: relative;
  z-index: 2;
  margin-top: auto;
  text-align: center;
}
.lay__title--cover {
  margin: 0 0 10px;
  color: #fff;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-shadow: 0 3px 24px rgba(0,0,0,0.55);
}
.lay__cover-meta {
  display: inline-block;
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  padding: 4px 14px;
}

/* ── Custom (free-form canvas) ──────────────────────────────────────────── */
.lay--custom { position: relative; overflow: hidden; }
.lay__custom-el { margin: 0; padding: 0; word-break: break-word; }
.lay__custom-el--title { font-weight: 700; }

/* ── Page Builder (visual layout) — frontend block styles ─────────────────── */
.lay--builder { position: relative; overflow: hidden; display: block; }
.lay--builder .pb-canvas { position: relative; z-index: 1; }
.pb-row { display: block; }
.pb-row__inner,
.pb-col,
.pb-el { box-sizing: border-box; }
.pb-el:last-child { margin-bottom: 0 !important; }
.pb-el__dropcap::first-letter {
  float: inline-start;
  font-size: 3.4em;
  line-height: 0.8;
  font-weight: 800;
  padding-inline-end: 8px;
  margin-top: 4px;
  color: var(--pb-dropcap, #0e7c6b);
}
.pb-el__gallery img { display: block; }

/* ==========================================================================
   OIC statement layouts (call / condemnation / condolence / photo / plain).
   Most styling is inline (schema-driven, fully customizable). These rules
   are only structural safety nets shared by reader, print/PDF and builder.

   NOTE: the front-end main.css sets a global `img { display:block; height:auto }`
   which is loaded in the reader but NOT in the builder or the print template.
   To keep the OIC layouts pixel-identical in all three contexts we override
   image behaviour with these scoped rules (layouts.css is loaded everywhere).
   ========================================================================== */
.oic-stmt,
.oic-stmt * { box-sizing: border-box; }
.oic-stmt { width: 100%; height: 100%; }
.oic-stmt__frame { z-index: 2; }
.oic-stmt__banner { z-index: 3; }
.oic-stmt__phone svg { width: 100%; height: auto; display: block; }
.oic-stmt__paragraph { white-space: pre-line; }

.oic-stmt__frame::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 4px solid #fff;
	box-sizing: border-box;
	padding: 10px;
}

/* Logo: keep it inline-block so the wrapper's text-align:center centers it
   regardless of the global `img { display:block }` rule (which would push it
   to the start edge in the reader only). */
.oic-stmt__logo { text-align: center; line-height: 0; }
.oic-stmt__logo img { display: inline-block; height: auto; max-width: 100%; }

/* Photo frames: the image must always fill and cover its frame in every
   context (the global `img { height:auto }` would otherwise letterbox it in
   the reader). */
.oic-stmt__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }

