/*
Theme Name: Slavyanskoe Cemetery
Theme URI: https://example.com/
Author: OpenAI
Author URI: https://openai.com/
Description: Редактируемая WordPress-тема для информационного сайта кладбища: Gutenberg-контент, классические меню WordPress, Customizer и расширенные визуальные секции Stackable.
Version: 1.8.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
Text Domain: slavyanskoe-cemetery
*/

:root {
  --cem-bg: #ffffff;
  --cem-surface: #f4f7fa;
  --cem-surface-strong: #eaf0f6;
  --cem-ink: #12223a;
  --cem-muted: #5f6e80;
  --cem-line: #dbe4ec;
  --cem-primary: #2d5f9f;
  --cem-primary-hover: #244f85;
  --cem-footer: #15283d;
  --cem-radius: 18px;
  --cem-shadow: 0 16px 40px rgba(18, 34, 58, .08);
  --cem-container: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--cem-ink);
  background: var(--cem-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.admin-bar .site-header { top: 32px; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(45, 95, 159, .42);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 10000;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--cem-ink);
  transform: translateY(-150%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }
.site-container { width: min(calc(100% - 40px), var(--cem-container)); margin-inline: auto; }
[id] { scroll-margin-top: 100px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219, 228, 236, .8);
}
.header-row {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
}
.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; }
.custom-logo-link, .default-brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--cem-surface-strong);
  overflow: hidden;
}
.custom-logo-link img { width: 100%; height: 100%; object-fit: cover; }
.default-brand-mark svg { width: 25px; height: 25px; }
.brand-copy { min-width: 0; }
.site-title {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.08;
  white-space: nowrap;
}
.site-description { display: block; margin-top: 4px; color: var(--cem-muted); font-size: 12px; line-height: 1.2; }
.primary-navigation { justify-self: center; min-width: 0; }
.primary-menu, .primary-menu ul, .footer-menu { list-style: none; margin: 0; padding: 0; }
.primary-menu { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.primary-menu > li { position: relative; }
.primary-menu a { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.primary-menu > li > a { position: relative; min-height: 82px; }
.primary-menu > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 2px;
  background: var(--cem-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.primary-menu > li:hover > a::after,
.primary-menu > li:focus-within > a::after,
.primary-menu > .current-menu-item > a::after,
.primary-menu > .current-menu-ancestor > a::after { transform: scaleX(1); }
.primary-menu .menu-item-has-children > a::before,
.primary-menu .page_item_has_children > a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  order: 2;
  opacity: .65;
}
.primary-menu .sub-menu, .primary-menu .children {
  position: absolute;
  top: calc(100% - 9px);
  left: -18px;
  z-index: 120;
  min-width: 230px;
  padding: 10px;
  border: 1px solid var(--cem-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(18, 34, 58, .13);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.primary-menu .sub-menu .sub-menu, .primary-menu .children .children { top: -11px; left: calc(100% + 8px); }
.primary-menu li:hover > .sub-menu,
.primary-menu li:hover > .children,
.primary-menu li:focus-within > .sub-menu,
.primary-menu li:focus-within > .children { opacity: 1; visibility: visible; transform: translateY(0); }
.primary-menu .sub-menu a, .primary-menu .children a { min-height: 42px; padding: 9px 12px; border-radius: 9px; font-size: 14px; }
.primary-menu .sub-menu a:hover, .primary-menu .sub-menu a:focus-visible, .primary-menu .children a:hover, .primary-menu .children a:focus-visible { background: var(--cem-surface); }
.submenu-toggle { display: none; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-phone { display: flex; align-items: center; gap: 10px; }
.header-phone svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--cem-primary); }
.header-phone-number { display: block; font-size: 16px; font-weight: 800; }
.header-phone-hours { display: block; margin-top: 2px; color: var(--cem-muted); font-size: 11px; font-weight: 500; }
.site-button, .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 750;
  cursor: pointer;
  transition: .2s ease;
  text-decoration: none;
}
.site-button--dark { color: #fff; background: var(--cem-ink); }
.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--cem-line);
  border-radius: 12px;
  background: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.menu-toggle-bar, .menu-toggle-bar::before, .menu-toggle-bar::after {
  display: block;
  width: 21px;
  height: 2px;
  border-radius: 2px;
  background: var(--cem-ink);
  content: "";
  transition: .2s ease;
}
.menu-toggle-bar { position: relative; }
.menu-toggle-bar::before { position: absolute; left: 0; top: -7px; }
.menu-toggle-bar::after { position: absolute; left: 0; top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar::after { top: 0; transform: rotate(-45deg); }

/* Gutenberg homepage */
.cemetery-home > * { margin-block-start: 0; }
.cemetery-hero.wp-block-cover {
  position: relative;
  min-height: 590px;
  padding: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.cemetery-hero > img.wp-block-cover__image-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cemetery-hero .wp-block-cover__background {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(7,18,30,.84) 0%, rgba(7,18,30,.58) 38%, rgba(7,18,30,.15) 72%, rgba(7,18,30,.03) 100%) !important;
  opacity: 1 !important;
}
.cemetery-hero .wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 40px), var(--cem-container));
  margin-inline: auto;
  color: #fff;
}
.cemetery-hero-content { max-width: 660px; padding: 88px 0 96px; }
.cemetery-eyebrow { margin: 0 0 10px !important; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cem-primary); }
.cemetery-hero .cemetery-eyebrow { color: #d7e6f8; }
.cemetery-hero-title { margin: 0 !important; font-size: clamp(48px, 7vw, 78px) !important; line-height: .96 !important; letter-spacing: -.05em; }
.cemetery-hero-copy { max-width: 620px; margin: 22px 0 0 !important; color: rgba(255,255,255,.9); font-size: 20px; line-height: 1.5; }
.cemetery-hero .wp-block-buttons { display: flex; flex-wrap: wrap; align-items: center; margin-top: 30px; gap: 12px; }
.cemetery-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link { color: #fff; background: var(--cem-primary); box-shadow: 0 8px 20px rgba(45,95,159,.24); }
.cemetery-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { background: var(--cem-primary-hover); transform: translateY(-1px); }
.cemetery-hero .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255,255,255,.8); background: rgba(15,28,45,.22); backdrop-filter: blur(8px); }
.cemetery-section { padding: 90px 20px 92px; }
.cemetery-section > .cemetery-section-head, .cemetery-section > .advantages-grid, .cemetery-faq > .cemetery-faq-grid { width: min(100%, var(--cem-container)); margin-inline: auto; }
.cemetery-section-head { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 44px; }
.cemetery-section-title { margin: 0 !important; font-size: clamp(34px, 4vw, 54px) !important; line-height: 1.04 !important; letter-spacing: -.04em; }
.cemetery-section-copy { margin: 14px 0 0 !important; max-width: 700px; color: var(--cem-muted); font-size: 18px; }
.advantages-grid { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.advantage-card {
  min-width: 0;
  padding: 28px !important;
  border: 1px solid var(--cem-line);
  border-radius: var(--cem-radius);
  background: #fff;
  transition: .2s ease;
}
.advantage-card:hover { transform: translateY(-3px); box-shadow: var(--cem-shadow); border-color: #cdd9e5; }
.advantage-icon { width: 54px !important; height: 54px !important; margin: 0 0 24px !important; padding: 13px; border-radius: 50%; background: var(--cem-surface-strong); }
.advantage-icon img { width: 100%; height: 100%; object-fit: contain; }
.advantage-card h3 { margin: 0 !important; font-size: 20px !important; letter-spacing: -.02em; }
.advantage-card p { margin: 10px 0 0 !important; color: var(--cem-muted); font-size: 15px; }
.cemetery-faq { padding: 92px 20px; background: var(--cem-surface); }
.cemetery-faq-grid { display: grid !important; grid-template-columns: minmax(0,.86fr) minmax(0,1.14fr); gap: 54px; align-items: start; }
.cemetery-faq-image { margin: 0 !important; border-radius: 24px; overflow: hidden; box-shadow: var(--cem-shadow); }
.cemetery-faq-image img { width: 100%; min-height: 520px; object-fit: cover; }
.cemetery-faq-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.cemetery-faq-link { margin: 0 !important; white-space: nowrap; color: var(--cem-primary); font-size: 14px; font-weight: 800; }
.cemetery-faq-list { display: grid; gap: 10px; }
.cemetery-faq-list .wp-block-details { margin: 0; border: 1px solid var(--cem-line); border-radius: 12px; background: #fff; overflow: hidden; }
.cemetery-faq-list .wp-block-details summary { position: relative; list-style: none; cursor: pointer; padding: 20px 58px 20px 20px; font-size: 17px; font-weight: 800; }
.cemetery-faq-list .wp-block-details summary::-webkit-details-marker { display: none; }
.cemetery-faq-list .wp-block-details summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cem-primary);
  background: var(--cem-surface-strong);
  font-size: 20px;
  font-weight: 500;
}
.cemetery-faq-list .wp-block-details[open] summary::after { content: "–"; }
.cemetery-faq-list .wp-block-details > :not(summary) { margin: 0 !important; padding: 0 20px 20px; color: var(--cem-muted); font-size: 15px; }

/* Standard content */
.site-main--standard { width: min(calc(100% - 40px), 900px); margin: 0 auto; padding: 70px 0 90px; }
.entry-title { font-size: clamp(38px, 6vw, 64px); line-height: 1.04; letter-spacing: -.04em; }
.entry-content > * { max-width: 760px; margin-inline: auto; }
.entry-content > .alignwide { max-width: var(--cem-container); }
.entry-content > .alignfull { max-width: none; }

/* Footer */
.site-footer { padding: 54px 0 26px; color: #fff; background: var(--cem-footer); }
.footer-main { display: grid; grid-template-columns: 1.05fr .75fr .9fr 1.3fr; gap: 36px; align-items: start; padding-bottom: 34px; }
.site-footer .site-title { color: #fff; }
.site-footer .site-description, .footer-meta, .footer-menu a { color: rgba(255,255,255,.65); }
.footer-heading { margin: 0 0 14px; color: rgba(255,255,255,.48); font-size: 13px; letter-spacing: .11em; text-transform: uppercase; }
.footer-phone { font-size: 20px; font-weight: 800; }
.footer-meta { margin-top: 6px; font-size: 13px; }
.footer-address { margin: 0; }
.footer-menu { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 18px; font-size: 14px; }
.footer-menu .sub-menu { list-style: none; margin: 7px 0 0; padding-left: 14px; display: grid; gap: 6px; }
.footer-menu a:hover, .footer-menu a:focus-visible { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.5); font-size: 12px; }
.footer-legal-menu { display: flex; gap: 18px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.footer-legal-menu a:hover, .footer-legal-menu a:focus-visible { color: #fff; }

@media (max-width: 1220px) {
  .header-row { grid-template-columns: minmax(0,1fr) auto; }
  .primary-navigation, .header-cta { display: none; }
  .header-actions { justify-self: end; gap: 14px; }
  .menu-toggle { display: flex; flex: 0 0 auto; }
  .site-header.is-menu-open .primary-navigation {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100svh - 82px);
    overflow-y: auto;
    background: #fff;
    border-top: 1px solid var(--cem-line);
    border-bottom: 1px solid var(--cem-line);
    box-shadow: 0 18px 35px rgba(18,34,58,.10);
  }
  .primary-menu { width: min(calc(100% - 40px), var(--cem-container)); margin: auto; padding: 8px 0 12px; display: grid; gap: 0; }
  .primary-menu li { position: relative; }
  .primary-menu li + li { border-top: 1px solid var(--cem-line); }
  .primary-menu a { width: 100%; min-height: 52px; padding: 12px 48px 12px 4px; font-size: 16px; font-weight: 700; white-space: normal; }
  .primary-menu > li > a { min-height: 52px; }
  .primary-menu > li > a::after, .primary-menu .menu-item-has-children > a::before,
.primary-menu .page_item_has_children > a::before { display: none; }
  .submenu-toggle {
    position: absolute;
    top: 4px;
    right: 0;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--cem-surface);
    color: var(--cem-ink);
    cursor: pointer;
  }
  .submenu-toggle::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px,-2px); transition: transform .18s ease; }
  .submenu-toggle[aria-expanded="true"]::before { transform: rotate(225deg) translate(-1px,-1px); }
  .primary-menu .sub-menu, .primary-menu .children {
    position: static;
    display: none;
    min-width: 0;
    padding: 0 0 9px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .primary-menu .sub-menu .sub-menu, .primary-menu .children .children { position: static; }
  .primary-menu .sub-menu li, .primary-menu .children li { border-top: 0; }
  .primary-menu .sub-menu a, .primary-menu .children a { min-height: 44px; padding: 9px 48px 9px 12px; color: var(--cem-muted); font-size: 15px; font-weight: 650; }
  .primary-menu li.submenu-open > .sub-menu, .primary-menu li.submenu-open > .children { display: block; }
  .advantages-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cemetery-faq-grid { grid-template-columns: 1fr; }
  .cemetery-faq-image img { min-height: 420px; max-height: 520px; }
  .footer-main { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

@media (max-width: 720px) {
  /* Mobile header deliberately scrolls with the page instead of staying pinned over content. */
  .site-header { position: relative; top: auto !important; backdrop-filter: none; }
  .site-container { width: min(calc(100% - 28px), var(--cem-container)); }
  .header-row { min-height: 70px; gap: 10px; }
  .custom-logo-link, .default-brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .site-title { font-size: 17px; }
  .site-description { font-size: 10px; }
  .header-phone { display: none; }
  .site-header.is-menu-open .primary-navigation {
    max-height: min(72svh, 620px);
    overscroll-behavior: contain;
  }
  .primary-menu { width: min(calc(100% - 28px), var(--cem-container)); padding-top: 6px; }
  .primary-menu a { min-height: 54px; font-size: 17px; }
  .primary-menu > li > a { min-height: 54px; }
  .cemetery-hero.wp-block-cover { min-height: 610px !important; }
  .cemetery-hero .wp-block-cover__inner-container { width: min(calc(100% - 28px), var(--cem-container)); }
  .cemetery-hero img.wp-block-cover__image-background { object-position: 68% center !important; }
  .cemetery-hero-content { padding: 76px 0 70px !important; }
  .cemetery-hero-title { font-size: clamp(44px,14vw,62px) !important; }
  .cemetery-hero-copy { font-size: 17px; }
  .cemetery-hero .wp-block-buttons { display: grid; grid-template-columns: 1fr; max-width: 340px; }
  .cemetery-hero .wp-block-button { width: 100%; }
  .cemetery-hero .wp-block-button__link { width: 100%; }
  .cemetery-section, .cemetery-faq { padding: 68px 14px; }
  .cemetery-section-head { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
  .cemetery-section-copy { margin-top: 0 !important; max-width: 100%; font-size: 16px; }
  .advantages-grid { grid-template-columns: 1fr; }
  .advantage-card { padding: 22px !important; }
  .cemetery-faq-grid { gap: 28px; }
  /* Questions come first on phones; the supporting image no longer pushes the FAQ below the fold. */
  .cemetery-faq-grid > .wp-block-group { order: 1; }
  .cemetery-faq-image { order: 2; border-radius: 18px; }
  .cemetery-faq-image img { min-height: 250px; max-height: 320px; }
  .cemetery-faq-head { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 18px; }
  .cemetery-faq-list { gap: 8px; }
  .cemetery-faq-list .wp-block-details summary { padding: 17px 54px 17px 16px; font-size: 16px; line-height: 1.35; }
  .cemetery-faq-list .wp-block-details summary::after { right: 14px; width: 30px; height: 30px; }
  .cemetery-faq-list .wp-block-details > :not(summary) { padding: 0 16px 17px; font-size: 14px; }
  .footer-main { grid-template-columns: 1fr; gap: 28px; }
  .footer-menu { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 420px) {
  .site-description { display: none; }
  .site-title { font-size: 16px; }
  .menu-toggle { width: 44px; height: 44px; }
  .cemetery-section-title { font-size: clamp(31px,10vw,40px) !important; }
  .cemetery-hero-title { font-size: clamp(42px,13.5vw,56px) !important; }
  .cemetery-hero img.wp-block-cover__image-background { object-position: 72% center !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Stackable comparison section (v1.1.0)
   The structural blocks are Stackable Columns/Column. These rules provide the
   theme's default visual language; Stackable-generated inline styles can safely
   override them when an editor changes settings in the inspector. */
.cemetery-stackable-showcase {
  position: relative;
  width: min(calc(100% - 40px), var(--cem-container));
  margin: 12px auto 94px;
  padding: 54px;
  border-radius: 32px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(circle at 86% 10%, rgba(113, 167, 235, .30), transparent 32%),
    radial-gradient(circle at 7% 92%, rgba(112, 192, 183, .15), transparent 28%),
    linear-gradient(135deg, #11243a 0%, #183454 54%, #234e7e 100%);
  box-shadow: 0 30px 70px rgba(18, 34, 58, .16);
}
.cemetery-stackable-showcase::before,
.cemetery-stackable-showcase::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  pointer-events: none;
}
.cemetery-stackable-showcase::before { width: 360px; height: 360px; right: -150px; top: -180px; }
.cemetery-stackable-showcase::after { width: 260px; height: 260px; left: -140px; bottom: -170px; }
.cemetery-stackable-showcase > .stk-row,
.cem-stack-lead,
.cem-stack-lead > .stk-column-wrapper { width: 100%; }
.cem-stack-lead > .stk-column-wrapper { background: transparent; }
.cem-stack-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 16px !important;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #d9e8f8;
  background: rgba(255,255,255,.08);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.cem-stack-title {
  max-width: 820px;
  margin: 0 !important;
  color: #fff;
  font-size: clamp(36px, 5vw, 60px) !important;
  line-height: .98 !important;
  letter-spacing: -.045em;
}
.cem-stack-intro {
  max-width: 760px;
  margin: 18px 0 0 !important;
  color: rgba(236,244,252,.82);
  font-size: 18px;
  line-height: 1.55;
}
.cemetery-stackable-cards { margin-top: 38px; }
.cemetery-stackable-cards > .stk-row {
  display: flex;
  align-items: stretch;
  gap: 16px;
}
.cem-stack-card { flex: 1 1 0; min-width: 0; }
.cem-stack-card > .stk-column-wrapper {
  height: 100%;
  padding: 25px !important;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  background: rgba(255,255,255,.075);
  backdrop-filter: blur(10px);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.cem-stack-card:hover > .stk-column-wrapper {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.26);
  background: rgba(255,255,255,.11);
}
.cem-stack-card--two > .stk-column-wrapper {
  color: var(--cem-ink);
  border-color: transparent;
  background: #fff;
  box-shadow: 0 20px 42px rgba(4,16,31,.16);
}
.cem-stack-number {
  width: 48px;
  height: 48px;
  margin: 0 0 36px !important;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.12);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
}
.cem-stack-card--two .cem-stack-number { color: #fff; background: var(--cem-primary); }
.cem-stack-card-title { margin: 0 !important; color: inherit; font-size: 23px !important; line-height: 1.12 !important; letter-spacing: -.025em; }
.cem-stack-card-copy { min-height: 72px; margin: 12px 0 0 !important; color: rgba(235,244,252,.72); font-size: 15px; line-height: 1.55; }
.cem-stack-card--two .cem-stack-card-copy { color: var(--cem-muted); }
.cem-stack-card-meta { margin: 24px 0 0 !important; color: #dcecff; font-size: 13px; font-weight: 800; }
.cem-stack-card--two .cem-stack-card-meta { color: var(--cem-primary); }
.cem-stack-footer-note {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.12);
  gap: 18px;
}
.cem-stack-footer-note p { margin: 0 !important; color: rgba(236,244,252,.72); font-size: 13px; }
.cem-stack-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff !important;
  background: rgba(255,255,255,.09);
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: .04em;
}
@media (max-width: 900px) {
  .cemetery-stackable-showcase { padding: 38px; border-radius: 26px; }
  .cemetery-stackable-cards > .stk-row { flex-wrap: wrap; }
  .cem-stack-card { flex: 1 1 calc(50% - 8px); }
  .cem-stack-card--three { flex-basis: 100%; }
  .cem-stack-card-copy { min-height: 0; }
}
@media (max-width: 620px) {
  .cemetery-stackable-showcase { width: calc(100% - 28px); margin-bottom: 68px; padding: 28px 20px; border-radius: 22px; }
  .cem-stack-title { font-size: clamp(32px, 10vw, 44px) !important; }
  .cem-stack-intro { font-size: 16px; }
  .cemetery-stackable-cards { margin-top: 28px; }
  .cemetery-stackable-cards > .stk-row { display: block; }
  .cem-stack-card { width: 100%; margin-top: 12px; }
  .cem-stack-card:first-child { margin-top: 0; }
  .cem-stack-card > .stk-column-wrapper { padding: 22px !important; }
  .cem-stack-number { margin-bottom: 26px !important; }
  .cem-stack-footer-note { align-items: flex-start !important; flex-direction: column; }
}


/* ==========================================================
   Stackable visual system — v1.2
   ========================================================== */
.cem-stack-hero-anchor { margin: 0 !important; padding: 0 !important; }
.cem-stack-hero { width: 100%; max-width: none !important; margin: 0 !important; color: #fff; }
.cem-stack-hero > .stk-row,
.cem-stack-hero-shell,
.cem-stack-hero-shell > .stk-column-wrapper { width: 100%; }
.cem-stack-hero-shell > .stk-column-wrapper { position: relative; min-height: 650px; overflow: hidden; background: #14263b; }
.cem-stack-hero-shell > .stk-column-wrapper::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(8,20,33,.88) 0%, rgba(8,20,33,.68) 43%, rgba(8,20,33,.26) 72%, rgba(8,20,33,.08) 100%);
}
.cem-stack-hero-media { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; margin: 0 !important; }
.cem-stack-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 52%; }
.cem-stack-hero-grid { position: relative; z-index: 2; width: min(calc(100% - 40px), var(--cem-container)); margin: 0 auto !important; }
.cem-stack-hero-grid > .stk-row { min-height: 650px; display: flex; align-items: center; gap: clamp(42px, 7vw, 110px); padding: 88px 0 82px; }
.cem-stack-hero-copycol { flex: 1 1 62%; min-width: 0; }
.cem-stack-hero-infocol { flex: 0 1 390px; min-width: 320px; }
.cem-stack-hero-copycol > .stk-column-wrapper,
.cem-stack-hero-infocol > .stk-column-wrapper { background: transparent; }
.cem-stack-hero-kicker { margin: 0 0 18px !important; color: #d9e8f8; font-size: 12px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.cem-stack-hero-title { max-width: 760px; margin: 0 !important; color: #fff !important; font-size: clamp(58px, 6vw, 88px) !important; line-height: .92 !important; letter-spacing: -.055em; }
.cem-stack-hero-text { max-width: 650px; margin: 24px 0 0 !important; color: rgba(244,248,252,.84); font-size: 19px; line-height: 1.6; }
.cem-stack-hero-actions { margin-top: 34px; gap: 12px; }
.cem-stack-hero-actions .wp-block-button__link { min-height: 50px; padding: 13px 20px; border-radius: 12px; font-weight: 780; }
.cem-stack-primary-button .wp-block-button__link { color: #fff; background: #3976bd; }
.cem-stack-primary-button .wp-block-button__link:hover { background: #4a87cf; }
.cem-stack-outline-button .wp-block-button__link { color: #fff !important; border-color: rgba(255,255,255,.62) !important; }
.cem-stack-outline-button .wp-block-button__link:hover { background: rgba(255,255,255,.10) !important; }
.cem-stack-hero-infocol > .stk-column-wrapper {
  position: relative; padding: 30px !important; border: 1px solid rgba(255,255,255,.20); border-radius: 24px;
  background: rgba(17,35,55,.58) !important; backdrop-filter: blur(18px); box-shadow: 0 24px 55px rgba(5,16,29,.18);
}
.cem-stack-info-label { margin: 0 0 9px !important; color: #b9d4f0; font-size: 11px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.cem-stack-info-title { margin: 0 !important; color: #fff !important; font-size: 31px !important; line-height: 1.08 !important; letter-spacing: -.035em; }
.cem-stack-info-list { margin-top: 25px; }
.cem-stack-info-list p { display: grid; grid-template-columns: 34px 1fr; align-items: start; gap: 12px; margin: 0 !important; padding: 15px 0; border-top: 1px solid rgba(255,255,255,.13); color: rgba(244,248,252,.87); }
.cem-stack-info-list p:last-child { border-bottom: 1px solid rgba(255,255,255,.13); }
.cem-stack-info-list strong { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: rgba(107,164,224,.26); font-size: 11px; }
.cem-stack-info-list span { padding-top: 4px; }
.cem-stack-info-note { margin: 20px 0 0 !important; color: rgba(230,239,248,.60); font-size: 12px; line-height: 1.5; }

.cem-stack-orient,
.cem-stack-territory,
.cem-stack-contact { width: min(calc(100% - 40px), var(--cem-container)); margin: 82px auto !important; }
.cem-stack-orient > .stk-row,
.cem-stack-orient-shell,
.cem-stack-orient-shell > .stk-column-wrapper,
.cem-stack-territory > .stk-row,
.cem-stack-contact > .stk-row,
.cem-stack-contact-shell,
.cem-stack-contact-shell > .stk-column-wrapper { width: 100%; }
.cem-stack-blue-kicker { margin: 0 0 9px !important; color: var(--cem-primary); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }

.cem-stack-orient-shell > .stk-column-wrapper { padding: 46px !important; border: 1px solid #dce7f0; border-radius: 30px; background: linear-gradient(145deg,#f7fafc,#edf4fa) !important; overflow: hidden; }
.cem-stack-orient-head { align-items: end !important; gap: 30px; }
.cem-stack-orient-head > *:first-child { flex: 1 1 52%; }
.cem-stack-orient-title { max-width: 700px; margin: 0 !important; font-size: clamp(38px,4vw,58px) !important; line-height: .98 !important; letter-spacing: -.045em; }
.cem-stack-orient-copy { flex: 0 1 430px; margin: 0 !important; color: var(--cem-muted); font-size: 16px; line-height: 1.6; }
.cem-stack-orient-grid { margin-top: 36px; }
.cem-stack-orient-grid > .stk-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.cem-stack-orient-card > .stk-column-wrapper { height: 100%; padding: 26px !important; border: 1px solid rgba(18,34,58,.08); border-radius: 20px; background: rgba(255,255,255,.82) !important; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.cem-stack-orient-card:hover > .stk-column-wrapper { transform: translateY(-4px); border-color: rgba(45,95,159,.23); box-shadow: 0 18px 38px rgba(18,34,58,.08); }
.cem-stack-orient-card--two > .stk-column-wrapper { color: #fff; background: linear-gradient(145deg,#214b78,#2d659f) !important; }
.cem-stack-orient-no { margin: 0 0 32px !important; font-size: 12px; font-weight: 900; color: var(--cem-primary); letter-spacing: .08em; }
.cem-stack-orient-card--two .cem-stack-orient-no { color: #cfe2f5; }
.cem-stack-orient-card h3 { margin: 0 !important; color: inherit; font-size: 22px !important; line-height: 1.1 !important; }
.cem-stack-orient-card p:not(.cem-stack-orient-no):not(.cem-stack-orient-link) { min-height: 76px; margin: 12px 0 0 !important; color: var(--cem-muted); font-size: 14px; line-height: 1.55; }
.cem-stack-orient-card--two p:not(.cem-stack-orient-no):not(.cem-stack-orient-link) { color: rgba(255,255,255,.72); }
.cem-stack-orient-link { margin: 24px 0 0 !important; color: var(--cem-primary); font-size: 13px; font-weight: 820; }
.cem-stack-orient-card--two .cem-stack-orient-link { color: #fff; }

.cem-stack-territory > .stk-row { display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(30px,5vw,72px); align-items: center; }
.cem-stack-territory-imagecol > .stk-column-wrapper { position: relative; min-height: 600px; overflow: hidden; border-radius: 28px; background: #dce7ef !important; }
.cem-stack-territory-image { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0 !important; }
.cem-stack-territory-image img { width: 100%; height: 100%; object-fit: cover; }
.cem-stack-photo-note { position: absolute; left: 24px; right: 24px; bottom: 24px; z-index: 2; max-width: 410px; padding: 20px 22px; border: 1px solid rgba(255,255,255,.50); border-radius: 18px; color: #fff; background: rgba(16,35,55,.72); backdrop-filter: blur(14px); }
.cem-stack-photo-note p { margin: 0 !important; color: rgba(255,255,255,.86); font-size: 14px; }
.cem-stack-photo-note-label { margin-bottom: 7px !important; color: #fff !important; font-size: 11px !important; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.cem-stack-territory-copycol > .stk-column-wrapper { padding: 24px 0 !important; background: transparent; }
.cem-stack-territory-title { max-width: 640px; margin: 0 !important; font-size: clamp(42px,4.4vw,64px) !important; line-height: .98 !important; letter-spacing: -.05em; }
.cem-stack-territory-intro { max-width: 650px; margin: 20px 0 0 !important; color: var(--cem-muted); font-size: 17px; line-height: 1.65; }
.cem-stack-territory-list { margin-top: 30px; }
.cem-stack-territory-list > .stk-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cem-stack-territory-item > .stk-column-wrapper { padding: 18px 20px !important; border: 1px solid var(--cem-line); border-radius: 16px; background: #fff !important; }
.cem-stack-territory-item .stk-block-content { display: grid; grid-template-columns: 42px minmax(0,1fr); column-gap: 14px; align-items: center; }
.cem-stack-territory-index { grid-row: 1 / span 2; display: grid; place-items: center; width: 38px; height: 38px; margin: 0 !important; border-radius: 12px; color: var(--cem-primary); background: var(--cem-surface-strong); font-size: 13px; font-weight: 900; }
.cem-stack-territory-item h3 { margin: 0 !important; font-size: 18px !important; }
.cem-stack-territory-item p:not(.cem-stack-territory-index) { margin: 4px 0 0 !important; color: var(--cem-muted); font-size: 14px; }
.cem-stack-territory-actions { margin-top: 26px; }
.cem-stack-territory-actions .wp-block-button__link { padding: 13px 20px; border-radius: 12px; background: var(--cem-primary); }

.cem-stack-contact-shell > .stk-column-wrapper { position: relative; padding: 46px !important; overflow: hidden; border-radius: 30px; color: #fff; background: linear-gradient(125deg,#10243b 0%,#193a5d 55%,#2d629b 100%) !important; box-shadow: 0 22px 55px rgba(18,34,58,.13); }
.cem-stack-contact-shell > .stk-column-wrapper::before { content:""; position:absolute; width:420px; height:420px; right:-180px; top:-220px; border-radius:50%; background:rgba(255,255,255,.08); }
.cem-stack-contact-grid { position: relative; z-index: 2; }
.cem-stack-contact-grid > .stk-row { display: grid; grid-template-columns: 1.2fr .8fr; gap: 54px; align-items: center; }
.cem-stack-contact-main > .stk-column-wrapper { background: transparent; }
.cem-stack-contact-kicker { margin: 0 0 11px !important; color: #bfd8f0; font-size: 11px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.cem-stack-contact-title { max-width: 690px; margin: 0 !important; color: #fff !important; font-size: clamp(40px,4.5vw,64px) !important; line-height: .98 !important; letter-spacing: -.05em; }
.cem-stack-contact-copy { max-width: 680px; margin: 20px 0 0 !important; color: rgba(236,244,252,.74); font-size: 16px; line-height: 1.62; }
.cem-stack-contact-card > .stk-column-wrapper { padding: 28px !important; border: 1px solid rgba(255,255,255,.19); border-radius: 22px; background: rgba(255,255,255,.08) !important; backdrop-filter: blur(12px); }
.cem-stack-contact-label { margin: 0 !important; color: #c8dcef; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.cem-stack-contact-phone { margin: 10px 0 0 !important; color: #fff !important; font-size: clamp(28px,3vw,38px) !important; letter-spacing: -.035em; }
.cem-stack-contact-hours { margin: 8px 0 0 !important; color: rgba(255,255,255,.67); font-size: 14px; }
.cem-stack-contact-actions { margin-top: 24px; gap: 10px; }
.cem-stack-contact-actions .wp-block-button__link { min-height: 46px; padding: 11px 16px; border-radius: 11px; font-weight: 780; }
.cem-stack-contact-actions .wp-block-button:not(.is-style-outline) .wp-block-button__link { color: #17324f; background: #fff; }
.cem-stack-contact-actions .is-style-outline .wp-block-button__link { color: #fff !important; border-color: rgba(255,255,255,.55) !important; }

@media (max-width: 1020px) {
  .cem-stack-hero-grid > .stk-row { gap: 34px; }
  .cem-stack-hero-infocol { flex-basis: 340px; min-width: 290px; }
  .cem-stack-orient-grid > .stk-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cem-stack-orient-card p:not(.cem-stack-orient-no):not(.cem-stack-orient-link) { min-height: 0; }
  .cem-stack-territory > .stk-row { gap: 36px; }
  .cem-stack-territory-imagecol > .stk-column-wrapper { min-height: 520px; }
}
@media (max-width: 780px) {
  .cem-stack-hero-shell > .stk-column-wrapper { min-height: 0; }
  .cem-stack-hero-shell > .stk-column-wrapper::after { background: linear-gradient(180deg,rgba(8,20,33,.55),rgba(8,20,33,.88) 68%,rgba(8,20,33,.96)); }
  .cem-stack-hero-media img { object-position: 62% center; }
  .cem-stack-hero-grid > .stk-row { min-height: 0; display: block; padding: 74px 0 34px; }
  .cem-stack-hero-copycol, .cem-stack-hero-infocol { width: 100%; min-width: 0; }
  .cem-stack-hero-title { font-size: clamp(48px,12vw,70px) !important; }
  .cem-stack-hero-text { font-size: 17px; }
  .cem-stack-hero-infocol { margin-top: 46px; }
  .cem-stack-hero-infocol > .stk-column-wrapper { padding: 24px !important; }
  .cem-stack-orient, .cem-stack-territory, .cem-stack-contact { margin: 62px auto !important; }
  .cem-stack-orient-shell > .stk-column-wrapper, .cem-stack-contact-shell > .stk-column-wrapper { padding: 32px !important; border-radius: 24px; }
  .cem-stack-orient-head { align-items: flex-start !important; flex-direction: column; }
  .cem-stack-orient-copy { flex-basis: auto; }
  .cem-stack-territory > .stk-row { display: block; }
  .cem-stack-territory-imagecol > .stk-column-wrapper { min-height: 480px; }
  .cem-stack-territory-copycol { margin-top: 34px; }
  .cem-stack-contact-grid > .stk-row { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 560px) {
  .cem-stack-hero-grid { width: min(calc(100% - 28px), var(--cem-container)); }
  .cem-stack-hero-grid > .stk-row { padding-top: 58px; }
  .cem-stack-hero-title { font-size: clamp(44px,14vw,60px) !important; }
  .cem-stack-hero-actions { align-items: stretch; flex-direction: column; }
  .cem-stack-hero-actions .wp-block-button, .cem-stack-hero-actions .wp-block-button__link { width: 100%; }
  .cem-stack-orient, .cem-stack-territory, .cem-stack-contact { width: calc(100% - 28px); }
  .cem-stack-orient-shell > .stk-column-wrapper, .cem-stack-contact-shell > .stk-column-wrapper { padding: 24px 20px !important; border-radius: 21px; }
  .cem-stack-orient-grid > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-orient-title, .cem-stack-territory-title, .cem-stack-contact-title { font-size: clamp(34px,10vw,46px) !important; }
  .cem-stack-territory-imagecol > .stk-column-wrapper { min-height: 400px; border-radius: 22px; }
  .cem-stack-photo-note { left: 14px; right: 14px; bottom: 14px; padding: 16px; }
  .cem-stack-territory-item .stk-block-content { grid-template-columns: 38px minmax(0,1fr); column-gap: 10px; }
  .cem-stack-contact-actions { align-items: stretch; flex-direction: column; }
  .cem-stack-contact-actions .wp-block-button, .cem-stack-contact-actions .wp-block-button__link { width: 100%; }
}

/* --------------------------------------------------------------------------
   Compact spacing and photo-rich Stackable refinements (v1.3.0)
   -------------------------------------------------------------------------- */
.cemetery-hero-content { padding: 76px 0 82px; }
.cemetery-hero-copy { margin-top: 18px !important; font-size: 18px; }
.cemetery-hero .wp-block-buttons { margin-top: 24px; gap: 10px; }
.cemetery-section { padding: 72px 20px 74px; }
.cemetery-section-head { gap: 22px; margin-bottom: 28px; }
.cemetery-section-copy { margin-top: 10px !important; font-size: 17px; line-height: 1.58; }
.advantages-grid { gap: 14px; }
.advantage-card { padding: 22px !important; }
.advantage-icon { margin-bottom: 18px !important; }
.cemetery-faq { padding: 74px 20px; }
.cemetery-faq-grid { gap: 34px; }
.cemetery-faq-head { margin-bottom: 18px; }
.cemetery-faq-list { gap: 8px; }
.cemetery-faq-list .wp-block-details summary { padding: 17px 54px 17px 18px; font-size: 16px; }
.cemetery-faq-list .wp-block-details > :not(summary) { padding: 0 18px 18px; }

.cemetery-stackable-showcase {
  margin: 8px auto 58px;
  padding: 38px;
  border-radius: 28px;
}
.cem-stack-kicker { margin-bottom: 12px !important; }
.cem-stack-intro { margin-top: 14px !important; font-size: 17px; }
.cemetery-stackable-cards { margin-top: 24px; }
.cemetery-stackable-cards > .stk-row { gap: 12px; }
.cem-stack-card > .stk-column-wrapper { padding: 22px !important; border-radius: 18px; }
.cem-stack-number { width: 42px; height: 42px; margin-bottom: 22px !important; border-radius: 12px; }
.cem-stack-card-title { font-size: 21px !important; }
.cem-stack-card-copy { min-height: 0; margin-top: 10px !important; }
.cem-stack-card-meta { margin-top: 16px !important; }
.cem-stack-footer-note { margin-top: 16px; padding-top: 14px; }

.cem-stack-hero-grid > .stk-row { min-height: 0; gap: 28px; padding: 82px 0 38px; align-items: end; }
.cem-stack-hero-copycol { flex: 1 1 0; }
.cem-stack-hero-title { max-width: 640px; }
.cem-stack-hero-text { max-width: 620px; margin: 14px 0 0 !important; font-size: 18px; line-height: 1.58; }
.cem-stack-hero-actions { gap: 10px; margin-top: 22px; }
.cem-stack-hero-tags { margin-top: 16px; gap: 8px; }
.cem-stack-hero-tags p {
  margin: 0 !important;
  padding: 7px 12px;
  border-radius: 999px;
  color: #e6f0fb;
  background: rgba(255,255,255,.11);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.cem-stack-hero-infocol { flex: 0 1 340px; }
.cem-stack-hero-infocol > .stk-column-wrapper { padding: 24px !important; border-radius: 20px; }
.cem-stack-info-title { font-size: 28px !important; }
.cem-stack-info-list { margin-top: 20px; }
.cem-stack-info-list p { padding: 12px 0; gap: 10px; }
.cem-stack-info-note { margin-top: 14px !important; }

.cem-stack-orient,
.cem-stack-territory,
.cem-stack-hall,
.cem-stack-fleet,
.cem-stack-contact { width: min(calc(100% - 40px), var(--cem-container)); margin: 54px auto !important; }
.cem-stack-orient-shell > .stk-column-wrapper,
.cem-stack-contact-shell > .stk-column-wrapper { padding: 34px !important; border-radius: 24px; }
.cem-stack-orient-head { gap: 18px; }
.cem-stack-orient-grid { margin-top: 24px; }
.cem-stack-orient-grid > .stk-row { gap: 12px; }
.cem-stack-orient-card > .stk-column-wrapper { padding: 18px !important; border-radius: 18px; }
.cem-stack-orient-no { margin-bottom: 14px !important; }
.cem-stack-orient-media { margin: 0 0 14px !important; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; }
.cem-stack-orient-media img { width: 100%; height: 100%; object-fit: cover; }
.cem-stack-orient-card h3 { font-size: 20px !important; }
.cem-stack-orient-card p:not(.cem-stack-orient-no):not(.cem-stack-orient-link) { min-height: 0; margin-top: 8px !important; font-size: 14px; }
.cem-stack-orient-link { margin-top: 12px !important; }

.cem-stack-territory > .stk-row { gap: 34px; }
.cem-stack-territory-imagecol > .stk-column-wrapper { min-height: 500px; border-radius: 24px; }
.cem-stack-territory-copycol > .stk-column-wrapper { padding: 10px 0 !important; }
.cem-stack-territory-title { font-size: clamp(38px, 4vw, 56px) !important; }
.cem-stack-territory-intro { margin-top: 14px !important; font-size: 16px; line-height: 1.6; }
.cem-stack-territory-list { margin-top: 20px; }
.cem-stack-territory-list > .stk-row { gap: 8px; }
.cem-stack-territory-item > .stk-column-wrapper { padding: 16px 18px !important; }
.cem-stack-territory-item p:not(.cem-stack-territory-index) { margin-top: 3px !important; }
.cem-stack-territory-actions { margin-top: 18px; }

.cem-stack-hall-shell > .stk-column-wrapper {
  padding: 34px !important;
  border: 1px solid var(--cem-line);
  border-radius: 26px;
  background: linear-gradient(145deg,#ffffff,#f4f8fb) !important;
}
.cem-stack-hall-grid > .stk-row {
  display: grid;
  grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr);
  gap: 24px;
  align-items: start;
}
.cem-stack-hall-title {
  margin: 0 !important;
  font-size: clamp(36px,4vw,52px) !important;
  line-height: .98 !important;
  letter-spacing: -.045em;
}
.cem-stack-hall-copytext { margin: 14px 0 0 !important; color: var(--cem-muted); font-size: 16px; line-height: 1.62; }
.cem-stack-hall-facts { margin-top: 18px; }
.cem-stack-hall-facts > .stk-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cem-stack-hall-fact > .stk-column-wrapper { padding: 16px 18px !important; border: 1px solid var(--cem-line); border-radius: 16px; background: #fff !important; }
.cem-stack-hall-fact-label { margin: 0 0 5px !important; color: var(--cem-primary); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.cem-stack-hall-fact p:not(.cem-stack-hall-fact-label) { margin: 0 !important; color: var(--cem-muted); font-size: 14px; line-height: 1.55; }
.cem-stack-hall-gallery-grid > .stk-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.cem-stack-hall-photo-media { margin: 0 !important; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; }
.cem-stack-hall-photo-media img { width: 100%; height: 100%; object-fit: cover; }

.cem-stack-fleet-shell > .stk-column-wrapper {
  padding: 34px !important;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(128deg,#0f2439 0%,#173554 50%,#2a5f96 100%) !important;
  box-shadow: 0 18px 48px rgba(18,34,58,.12);
}
.cem-stack-fleet-grid > .stk-row {
  display: grid;
  grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr);
  gap: 26px;
  align-items: center;
}
.cem-stack-fleet-title { margin: 0 !important; color: #fff !important; font-size: clamp(36px,4vw,54px) !important; line-height: .98 !important; letter-spacing: -.045em; }
.cem-stack-fleet-text { margin: 14px 0 0 !important; color: rgba(236,244,252,.78); font-size: 16px; line-height: 1.6; }
.cem-stack-fleet-stats { margin-top: 18px; }
.cem-stack-fleet-stats > .stk-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cem-stack-fleet-stat > .stk-column-wrapper { padding: 16px 18px !important; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; background: rgba(255,255,255,.08) !important; }
.cem-stack-fleet-stat-value { margin: 0 0 5px !important; color: #d8e9fb; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.cem-stack-fleet-stat p:not(.cem-stack-fleet-stat-value) { margin: 0 !important; color: rgba(255,255,255,.82); font-size: 14px; line-height: 1.55; }
.cem-stack-fleet-mainphoto { margin: 0 !important; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 10; }
.cem-stack-fleet-mainphoto img,
.cem-stack-fleet-miniphoto img { width: 100%; height: 100%; object-fit: cover; }
.cem-stack-fleet-mini { margin-top: 10px; }
.cem-stack-fleet-mini > .stk-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.cem-stack-fleet-miniphoto { margin: 0 !important; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; }

.cem-stack-contact-shell > .stk-column-wrapper { padding: 34px !important; border-radius: 26px; }
.cem-stack-contact-grid > .stk-row { gap: 34px; }
.cem-stack-contact-copy { margin-top: 14px !important; }
.cem-stack-contact-card > .stk-column-wrapper { padding: 24px !important; border-radius: 18px; }
.cem-stack-contact-actions { margin-top: 18px; }

@media (max-width: 1020px) {
  .cem-stack-hall-grid > .stk-row,
  .cem-stack-fleet-grid > .stk-row { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .cem-stack-hero-grid > .stk-row { padding: 70px 0 28px; }
  .cem-stack-hero-text { font-size: 17px; }
  .cem-stack-hero-infocol { margin-top: 28px; }
  .cem-stack-orient,
  .cem-stack-territory,
  .cem-stack-hall,
  .cem-stack-fleet,
  .cem-stack-contact { margin: 44px auto !important; }
  .cem-stack-hall-shell > .stk-column-wrapper,
  .cem-stack-fleet-shell > .stk-column-wrapper,
  .cem-stack-contact-shell > .stk-column-wrapper,
  .cem-stack-orient-shell > .stk-column-wrapper { padding: 26px !important; }
}

@media (max-width: 720px) {
  .cemetery-section,
  .cemetery-faq { padding: 58px 14px; }
  .cemetery-section-head { margin-bottom: 22px; }
}

@media (max-width: 620px) {
  .cemetery-stackable-showcase { width: calc(100% - 28px); margin-bottom: 44px; padding: 26px 20px; }
}

@media (max-width: 560px) {
  .cem-stack-orient,
  .cem-stack-territory,
  .cem-stack-hall,
  .cem-stack-fleet,
  .cem-stack-contact { width: calc(100% - 28px); }
  .cem-stack-hall-shell > .stk-column-wrapper,
  .cem-stack-fleet-shell > .stk-column-wrapper { padding: 24px 20px !important; border-radius: 22px; }
  .cem-stack-hall-gallery-grid > .stk-row,
  .cem-stack-fleet-mini > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-hall-photo-media,
  .cem-stack-fleet-mainphoto,
  .cem-stack-fleet-miniphoto { border-radius: 14px; }
  .cem-stack-territory-imagecol > .stk-column-wrapper { min-height: 360px; }
}

/* --------------------------------------------------------------------------
   Density pass (v1.3.1)
   Goal: information-rich layout with visibly less unused vertical space.
   -------------------------------------------------------------------------- */

/* Core Gutenberg sections */
.cemetery-section {
  padding: 50px 20px 52px;
}
.cemetery-section-head {
  gap: 18px;
  margin-bottom: 20px;
}
.cemetery-section-copy {
  margin-top: 7px !important;
  font-size: 16px;
  line-height: 1.5;
}
.advantages-grid {
  gap: 10px;
}
.advantage-card {
  padding: 18px !important;
  border-radius: 15px;
}
.advantage-icon {
  width: 46px !important;
  height: 46px !important;
  margin-bottom: 13px !important;
  padding: 11px;
}
.advantage-card h3 {
  font-size: 18px !important;
}
.advantage-card p {
  margin-top: 7px !important;
  font-size: 14px;
  line-height: 1.48;
}

/* Hero: keep impact, remove unnecessary depth below the content */
.cem-stack-hero-shell > .stk-column-wrapper {
  min-height: 560px;
}
.cem-stack-hero-grid > .stk-row {
  padding: 62px 0 26px;
  gap: 22px;
}
.cem-stack-hero-kicker {
  margin-bottom: 10px !important;
}
.cem-stack-hero-title {
  font-size: clamp(52px, 5.5vw, 78px) !important;
}
.cem-stack-hero-text {
  margin-top: 11px !important;
  line-height: 1.5;
}
.cem-stack-hero-actions {
  margin-top: 16px;
}
.cem-stack-hero-actions .wp-block-button__link {
  min-height: 44px;
  padding: 10px 17px;
}
.cem-stack-hero-tags {
  margin-top: 11px;
  gap: 6px;
}
.cem-stack-hero-tags p {
  padding: 5px 9px;
  font-size: 11px;
}
.cem-stack-hero-infocol > .stk-column-wrapper {
  padding: 19px !important;
  border-radius: 18px;
}
.cem-stack-info-label {
  margin-bottom: 6px !important;
}
.cem-stack-info-title {
  font-size: 25px !important;
}
.cem-stack-info-list {
  margin-top: 13px;
}
.cem-stack-info-list p {
  padding: 9px 0;
}
.cem-stack-info-list strong {
  width: 27px;
  height: 27px;
}
.cem-stack-info-note {
  margin-top: 10px !important;
  line-height: 1.42;
}

/* Top-level visual section rhythm */
.cemetery-stackable-showcase,
.cem-stack-orient,
.cem-stack-territory,
.cem-stack-hall,
.cem-stack-fleet,
.cem-stack-contact {
  margin-top: 26px !important;
  margin-bottom: 26px !important;
}

/* Visit plan */
.cemetery-stackable-showcase {
  padding: 28px;
  border-radius: 23px;
}
.cem-stack-kicker {
  min-height: 25px;
  margin-bottom: 8px !important;
  padding-inline: 9px;
}
.cem-stack-title {
  font-size: clamp(33px, 4.2vw, 50px) !important;
}
.cem-stack-intro {
  margin-top: 9px !important;
  font-size: 15px;
  line-height: 1.48;
}
.cemetery-stackable-cards {
  margin-top: 16px;
}
.cemetery-stackable-cards > .stk-row {
  gap: 9px;
}
.cem-stack-card > .stk-column-wrapper {
  padding: 17px !important;
  border-radius: 15px;
}
.cem-stack-number {
  width: 35px;
  height: 35px;
  margin-bottom: 14px !important;
  border-radius: 10px;
  font-size: 11px;
}
.cem-stack-card-title {
  font-size: 19px !important;
}
.cem-stack-card-copy {
  margin-top: 7px !important;
  font-size: 14px;
  line-height: 1.48;
}
.cem-stack-card-meta {
  margin-top: 10px !important;
  font-size: 12px;
}
.cem-stack-footer-note {
  margin-top: 11px;
  padding-top: 10px;
  gap: 10px;
}
.cem-stack-footer-note p {
  font-size: 12px;
}

/* Quick navigation */
.cem-stack-orient-shell > .stk-column-wrapper {
  padding: 24px !important;
  border-radius: 20px;
}
.cem-stack-orient-head {
  gap: 14px;
}
.cem-stack-orient-title {
  font-size: clamp(32px, 3.6vw, 48px) !important;
}
.cem-stack-orient-copy {
  max-width: 380px;
  font-size: 14px;
  line-height: 1.5;
}
.cem-stack-orient-grid {
  margin-top: 16px;
}
.cem-stack-orient-grid > .stk-row {
  gap: 8px;
}
.cem-stack-orient-card > .stk-column-wrapper {
  padding: 14px !important;
  border-radius: 14px;
}
.cem-stack-orient-no {
  margin-bottom: 8px !important;
  font-size: 10px;
}
.cem-stack-orient-media {
  margin-bottom: 10px !important;
  border-radius: 11px;
  aspect-ratio: 16 / 10;
}
.cem-stack-orient-card h3 {
  font-size: 17px !important;
}
.cem-stack-orient-card p:not(.cem-stack-orient-no):not(.cem-stack-orient-link) {
  margin-top: 6px !important;
  font-size: 12.5px;
  line-height: 1.42;
}
.cem-stack-orient-link {
  margin-top: 8px !important;
  font-size: 11.5px;
}

/* Territory/navigation: compact and fix the previously blank photo panel */
.cem-stack-territory > .stk-row {
  grid-template-columns: .82fr 1.18fr;
  gap: 24px;
  align-items: stretch;
}
.cem-stack-territory-imagecol > .stk-column-wrapper {
  min-height: 390px;
  border-radius: 20px;
}
.cem-stack-territory-imagecol .stk-block-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cem-stack-territory-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.cem-stack-territory-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.cem-stack-photo-note {
  left: 14px;
  right: 14px;
  bottom: 14px;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 13px;
}
.cem-stack-photo-note p {
  font-size: 12.5px;
  line-height: 1.45;
}
.cem-stack-territory-copycol > .stk-column-wrapper {
  padding: 0 !important;
}
.cem-stack-territory-title {
  font-size: clamp(34px, 3.7vw, 50px) !important;
}
.cem-stack-territory-intro {
  margin-top: 9px !important;
  font-size: 14.5px;
  line-height: 1.5;
}
.cem-stack-territory-list {
  margin-top: 14px;
}
.cem-stack-territory-list > .stk-row {
  gap: 6px;
}
.cem-stack-territory-item > .stk-column-wrapper {
  padding: 12px 14px !important;
  border-radius: 13px;
}
.cem-stack-territory-item .stk-block-content {
  grid-template-columns: 34px minmax(0,1fr);
  column-gap: 10px;
}
.cem-stack-territory-index {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  font-size: 11px;
}
.cem-stack-territory-item h3 {
  font-size: 16px !important;
}
.cem-stack-territory-item p:not(.cem-stack-territory-index) {
  font-size: 12.5px;
  line-height: 1.42;
}
.cem-stack-territory-actions {
  margin-top: 12px;
}
.cem-stack-territory-actions .wp-block-button__link {
  min-height: 42px;
  padding: 9px 15px;
}

/* Farewell hall */
.cem-stack-hall-shell > .stk-column-wrapper {
  padding: 24px !important;
  border-radius: 20px;
}
.cem-stack-hall-grid > .stk-row {
  gap: 18px;
}
.cem-stack-hall-title {
  font-size: clamp(32px, 3.6vw, 46px) !important;
}
.cem-stack-hall-copytext {
  margin-top: 9px !important;
  font-size: 14px;
  line-height: 1.5;
}
.cem-stack-hall-facts {
  margin-top: 13px;
}
.cem-stack-hall-facts > .stk-row {
  gap: 6px;
}
.cem-stack-hall-fact > .stk-column-wrapper {
  padding: 12px 14px !important;
  border-radius: 12px;
}
.cem-stack-hall-fact-label {
  margin-bottom: 3px !important;
  font-size: 10px;
}
.cem-stack-hall-fact p:not(.cem-stack-hall-fact-label) {
  font-size: 12.5px;
  line-height: 1.42;
}
.cem-stack-hall-gallery-grid > .stk-row {
  gap: 7px;
}
.cem-stack-hall-photo-media {
  border-radius: 13px;
  aspect-ratio: 16 / 10;
}

/* Fleet */
.cem-stack-fleet-shell > .stk-column-wrapper {
  padding: 24px !important;
  border-radius: 20px;
}
.cem-stack-fleet-grid > .stk-row {
  gap: 20px;
}
.cem-stack-fleet-title {
  font-size: clamp(32px, 3.6vw, 47px) !important;
}
.cem-stack-fleet-text {
  margin-top: 9px !important;
  font-size: 14px;
  line-height: 1.5;
}
.cem-stack-fleet-stats {
  margin-top: 13px;
}
.cem-stack-fleet-stats > .stk-row {
  gap: 6px;
}
.cem-stack-fleet-stat > .stk-column-wrapper {
  padding: 12px 14px !important;
  border-radius: 12px;
}
.cem-stack-fleet-stat-value {
  margin-bottom: 3px !important;
  font-size: 10px;
}
.cem-stack-fleet-stat p:not(.cem-stack-fleet-stat-value) {
  font-size: 12.5px;
  line-height: 1.42;
}
.cem-stack-fleet-mainphoto {
  border-radius: 14px;
  aspect-ratio: 16 / 9;
}
.cem-stack-fleet-mini {
  margin-top: 7px;
}
.cem-stack-fleet-mini > .stk-row {
  gap: 7px;
}
.cem-stack-fleet-miniphoto {
  border-radius: 12px;
  aspect-ratio: 16 / 9;
}

/* Contact CTA */
.cem-stack-contact-shell > .stk-column-wrapper {
  padding: 24px !important;
  border-radius: 20px;
}
.cem-stack-contact-grid > .stk-row {
  gap: 24px;
}
.cem-stack-contact-title {
  font-size: clamp(34px, 3.8vw, 52px) !important;
}
.cem-stack-contact-copy {
  margin-top: 8px !important;
  font-size: 14px;
  line-height: 1.48;
}
.cem-stack-contact-card > .stk-column-wrapper {
  padding: 18px !important;
  border-radius: 14px;
}
.cem-stack-contact-phone {
  margin-top: 6px !important;
}
.cem-stack-contact-hours {
  margin-top: 4px !important;
}
.cem-stack-contact-actions {
  margin-top: 12px;
}

/* FAQ and footer */
.cemetery-faq {
  padding: 46px 20px 50px;
}
.cemetery-faq-grid {
  gap: 26px;
  grid-template-columns: minmax(0,.72fr) minmax(0,1.28fr);
}
.cemetery-faq-image {
  border-radius: 18px;
}
.cemetery-faq-image img {
  min-height: 365px;
  max-height: 430px;
}
.cemetery-faq-head {
  gap: 12px;
  margin-bottom: 12px;
}
.cemetery-faq-list {
  gap: 6px;
}
.cemetery-faq-list .wp-block-details {
  border-radius: 10px;
}
.cemetery-faq-list .wp-block-details summary {
  padding: 13px 48px 13px 15px;
  font-size: 14px;
}
.cemetery-faq-list .wp-block-details summary::after {
  right: 12px;
  width: 24px;
  height: 24px;
  font-size: 17px;
}
.cemetery-faq-list .wp-block-details > :not(summary) {
  padding: 0 15px 14px;
  font-size: 13px;
}
.site-footer {
  padding: 40px 0 20px;
}
.footer-main {
  gap: 24px;
  padding-bottom: 24px;
}
.footer-bottom {
  padding-top: 18px;
}

@media (max-width: 1020px) {
  .cem-stack-territory-imagecol > .stk-column-wrapper {
    min-height: 340px;
  }
}

@media (max-width: 780px) {
  .cem-stack-hero-grid > .stk-row {
    padding: 50px 0 22px;
  }
  .cem-stack-hero-infocol {
    margin-top: 20px;
  }
  .cemetery-stackable-showcase,
  .cem-stack-orient,
  .cem-stack-territory,
  .cem-stack-hall,
  .cem-stack-fleet,
  .cem-stack-contact {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
  }
  .cem-stack-territory-copycol {
    margin-top: 18px;
  }
  .cem-stack-hall-shell > .stk-column-wrapper,
  .cem-stack-fleet-shell > .stk-column-wrapper,
  .cem-stack-contact-shell > .stk-column-wrapper,
  .cem-stack-orient-shell > .stk-column-wrapper {
    padding: 20px !important;
  }
}

@media (max-width: 720px) {
  .cemetery-section,
  .cemetery-faq {
    padding: 40px 14px;
  }
  .cemetery-section-head {
    gap: 10px;
    margin-bottom: 16px;
  }
  .advantage-card {
    padding: 16px !important;
  }
  .cemetery-faq-grid {
    gap: 18px;
  }
  .cemetery-faq-image img {
    min-height: 210px;
    max-height: 250px;
  }
}

@media (max-width: 620px) {
  .cemetery-stackable-showcase {
    margin-top: 18px !important;
    margin-bottom: 18px !important;
    padding: 20px 16px;
  }
  .cemetery-stackable-cards {
    margin-top: 13px;
  }
  .cem-stack-card {
    margin-top: 8px;
  }
  .cem-stack-card > .stk-column-wrapper {
    padding: 15px !important;
  }
}

@media (max-width: 560px) {
  .cem-stack-hero-grid > .stk-row {
    padding-top: 42px;
  }
  .cem-stack-hero-title {
    font-size: clamp(40px, 13vw, 54px) !important;
  }
  .cem-stack-hero-actions {
    margin-top: 14px;
  }
  .cem-stack-territory-imagecol > .stk-column-wrapper {
    min-height: 285px;
  }
  .cem-stack-hall-gallery-grid > .stk-row,
  .cem-stack-fleet-mini > .stk-row {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

/* --------------------------------------------------------------------------
   Readability and alignment refinement (v1.3.2)
   Compact layout stays compact; type is no longer compressed to tiny sizes.
   -------------------------------------------------------------------------- */

/* General Stackable readability floor */
.cem-stack-hero-kicker,
.cem-stack-info-label,
.cem-stack-blue-kicker,
.cem-stack-contact-kicker,
.cem-stack-contact-label,
.cem-stack-photo-note-label,
.cem-stack-hall-fact-label,
.cem-stack-fleet-stat-value,
.cem-stack-faq-note-label {
  font-size: 13px !important;
  line-height: 1.25;
  letter-spacing: .09em;
}
.cem-stack-hero-tags p,
.cem-stack-card-meta,
.cem-stack-footer-note p,
.cem-stack-orient-link,
.cem-stack-orient-no,
.cem-stack-territory-index,
.cem-stack-info-note {
  font-size: 13px !important;
}
.cem-stack-orient-copy,
.cem-stack-orient-card p:not(.cem-stack-orient-no):not(.cem-stack-orient-link),
.cem-stack-territory-intro,
.cem-stack-territory-item p:not(.cem-stack-territory-index),
.cem-stack-photo-note p,
.cem-stack-hall-copytext,
.cem-stack-hall-fact p:not(.cem-stack-hall-fact-label),
.cem-stack-fleet-text,
.cem-stack-fleet-stat p:not(.cem-stack-fleet-stat-value),
.cem-stack-contact-copy,
.cem-stack-contact-hours {
  font-size: 15px !important;
  line-height: 1.5;
}

/* Keep compact cards compact by reducing empty space, not font size. */
.cem-stack-orient-card > .stk-column-wrapper,
.cem-stack-territory-item > .stk-column-wrapper,
.cem-stack-hall-fact > .stk-column-wrapper,
.cem-stack-fleet-stat > .stk-column-wrapper {
  padding: 13px 15px !important;
}
.cem-stack-orient-grid > .stk-row,
.cem-stack-territory-list > .stk-row,
.cem-stack-hall-facts > .stk-row,
.cem-stack-fleet-stats > .stk-row {
  gap: 5px !important;
}
.cem-stack-orient-card h3,
.cem-stack-territory-item h3 {
  font-size: 18px !important;
}

/* Farewell hall: left content and photo mosaic occupy the same visual height. */
.cem-stack-hall-grid > .stk-row {
  align-items: stretch !important;
  gap: 16px !important;
}
.cem-stack-hall-copy,
.cem-stack-hall-gallery,
.cem-stack-hall-copy > .stk-column-wrapper,
.cem-stack-hall-gallery > .stk-column-wrapper,
.cem-stack-hall-copy .stk-block-content,
.cem-stack-hall-gallery .stk-block-content {
  height: 100%;
}
.cem-stack-hall-copy > .stk-column-wrapper,
.cem-stack-hall-gallery > .stk-column-wrapper {
  display: flex;
}
.cem-stack-hall-copy .stk-block-content,
.cem-stack-hall-gallery .stk-block-content {
  width: 100%;
}
.cem-stack-hall-copy .stk-block-content {
  display: flex;
  flex-direction: column;
}
.cem-stack-hall-facts {
  margin-top: 12px !important;
}
.cem-stack-hall-gallery-grid,
.cem-stack-hall-gallery-grid > .stk-row {
  height: 100%;
}
.cem-stack-hall-gallery-grid > .stk-row {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px !important;
}
.cem-stack-hall-photo,
.cem-stack-hall-photo > .stk-column-wrapper,
.cem-stack-hall-photo .stk-block-content,
.cem-stack-hall-photo-media {
  height: 100%;
}
.cem-stack-hall-photo-media {
  min-height: 0;
  aspect-ratio: auto !important;
  border-radius: 12px;
}
.cem-stack-hall-photo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fleet: larger text inside plaques and tighter plaque rhythm. */
.cem-stack-fleet-stats {
  margin-top: 12px !important;
}
.cem-stack-fleet-stat-value {
  margin-bottom: 4px !important;
}
.cem-stack-fleet-stat p:not(.cem-stack-fleet-stat-value) {
  margin: 0 !important;
}

/* FAQ is now a Stackable section; Details remain core Gutenberg for simplicity. */
.cem-stack-faq-anchor {
  padding: 0;
  background: var(--cem-surface);
}
.cem-stack-faq {
  width: min(calc(100% - 40px), var(--cem-container));
  margin: 26px auto !important;
}
.cem-stack-faq-shell > .stk-column-wrapper {
  padding: 24px !important;
  border: 1px solid var(--cem-line);
  border-radius: 20px;
  background: #f4f7fa !important;
}
.cem-stack-faq-grid > .stk-row {
  display: grid;
  grid-template-columns: minmax(0,.72fr) minmax(0,1.28fr);
  align-items: stretch;
  gap: 22px;
}
.cem-stack-faq-media,
.cem-stack-faq-content,
.cem-stack-faq-media > .stk-column-wrapper,
.cem-stack-faq-content > .stk-column-wrapper,
.cem-stack-faq-media .stk-block-content,
.cem-stack-faq-content .stk-block-content {
  height: 100%;
}
.cem-stack-faq-media > .stk-column-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #dbe5ee !important;
}
.cem-stack-faq-media .stk-block-content {
  min-height: 420px;
}
.cem-stack-faq-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0 !important;
}
.cem-stack-faq-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cem-stack-faq-note {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  margin: 0 !important;
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 13px;
  color: #fff;
  background: rgba(15,35,55,.76);
  backdrop-filter: blur(12px);
}
.cem-stack-faq-note-label {
  margin: 0 0 5px !important;
  color: #fff !important;
  text-transform: uppercase;
  font-weight: 850;
}
.cem-stack-faq-note p:not(.cem-stack-faq-note-label) {
  margin: 0 !important;
  color: rgba(255,255,255,.9);
  font-size: 15px;
  line-height: 1.48;
}
.cem-stack-faq-content > .stk-column-wrapper {
  padding: 2px 0 !important;
  background: transparent !important;
}
.cem-stack-faq-title {
  margin: 0 !important;
  font-size: clamp(34px,3.7vw,50px) !important;
  line-height: 1 !important;
  letter-spacing: -.04em;
}
.cem-stack-faq-intro {
  margin: 9px 0 0 !important;
  color: var(--cem-muted);
  font-size: 15px;
  line-height: 1.5;
}
.cem-stack-faq-list {
  display: grid;
  gap: 5px;
  margin-top: 14px;
}
.cem-stack-faq-list .wp-block-details {
  margin: 0 !important;
  border: 1px solid var(--cem-line);
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
}
.cem-stack-faq-list .wp-block-details summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 14px 48px 14px 15px;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 800;
}
.cem-stack-faq-list .wp-block-details summary::-webkit-details-marker { display: none; }
.cem-stack-faq-list .wp-block-details summary::after {
  content: "+";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--cem-primary);
  background: var(--cem-surface-strong);
  font-size: 18px;
  font-weight: 600;
}
.cem-stack-faq-list .wp-block-details[open] summary::after { content: "–"; }
.cem-stack-faq-list .wp-block-details > :not(summary) {
  margin: 0 !important;
  padding: 0 15px 14px;
  color: var(--cem-muted);
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .cem-stack-faq-grid > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-faq-media .stk-block-content { min-height: 300px; }
  .cem-stack-hall-grid > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-hall-gallery-grid > .stk-row { min-height: 420px; }
}

@media (max-width: 720px) {
  .cem-stack-faq { width: calc(100% - 28px); margin: 20px auto !important; }
  .cem-stack-faq-shell > .stk-column-wrapper { padding: 18px !important; border-radius: 18px; }
  .cem-stack-faq-content { order: 1; }
  .cem-stack-faq-media { order: 2; }
  .cem-stack-faq-media .stk-block-content { min-height: 250px; }
  .cem-stack-faq-list .wp-block-details summary { font-size: 16px; }
  .cem-stack-hall-gallery-grid > .stk-row { min-height: 340px; }
}

@media (max-width: 560px) {
  .cem-stack-hall-gallery-grid > .stk-row {
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-template-rows: repeat(2, minmax(135px, 1fr));
    min-height: 300px;
  }
}

/* --------------------------------------------------------------------------
   Mobile full-width + menu contact panel (v1.3.3)
   -------------------------------------------------------------------------- */
.mobile-menu-meta { display: none; }

@media (max-width: 1220px) {
  .mobile-menu-meta {
    width: min(calc(100% - 40px), var(--cem-container));
    margin: 4px auto 14px;
    padding: 16px 4px 4px;
    border-top: 1px solid var(--cem-line);
  }
  .mobile-menu-meta__eyebrow {
    margin: 0 0 4px;
    color: var(--cem-primary);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  .mobile-menu-meta__title {
    margin: 0;
    color: var(--cem-ink);
    font-size: 21px;
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: -.02em;
  }
  .mobile-menu-meta__grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    margin-top: 12px;
  }
  .mobile-menu-meta__item {
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid var(--cem-line);
    border-radius: 12px;
    background: var(--cem-surface);
  }
  .mobile-menu-meta__label {
    display: block;
    margin-bottom: 4px;
    color: var(--cem-muted);
    font-size: 11px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .mobile-menu-meta__value,
  .mobile-menu-meta__phone,
  .mobile-menu-meta__hours {
    display: block;
    color: var(--cem-ink);
    font-size: 14px;
    line-height: 1.4;
  }
  .mobile-menu-meta__phone {
    color: var(--cem-primary);
    font-size: 17px;
    font-weight: 850;
  }
  .mobile-menu-meta__hours { margin-top: 3px; color: var(--cem-muted); font-size: 13px; }
  .site-header.is-menu-open .mobile-menu-meta { display: block; }
}

@media (max-width: 720px) {
  /* Allow the whole menu, including contacts, to use the available viewport. */
  .site-header.is-menu-open .primary-navigation {
    max-height: calc(100svh - 70px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .primary-menu,
  .mobile-menu-meta {
    width: calc(100% - 20px);
  }
  .mobile-menu-meta { margin-bottom: 10px; padding-top: 12px; }
  .mobile-menu-meta__grid { grid-template-columns: 1fr; gap: 7px; }
  .mobile-menu-meta__item { padding: 11px 12px; }

  /* Full-width mobile content: sections reach the viewport edges. */
  .cemetery-stackable-showcase,
  .cem-stack-orient,
  .cem-stack-territory,
  .cem-stack-hall,
  .cem-stack-fleet,
  .cem-stack-contact,
  .cem-stack-faq {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .cem-stack-orient-shell > .stk-column-wrapper,
  .cem-stack-hall-shell > .stk-column-wrapper,
  .cem-stack-fleet-shell > .stk-column-wrapper,
  .cem-stack-contact-shell > .stk-column-wrapper,
  .cem-stack-faq-shell > .stk-column-wrapper {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .cemetery-stackable-showcase {
    border-radius: 0;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .cem-stack-orient-shell > .stk-column-wrapper,
  .cem-stack-hall-shell > .stk-column-wrapper,
  .cem-stack-fleet-shell > .stk-column-wrapper,
  .cem-stack-contact-shell > .stk-column-wrapper,
  .cem-stack-faq-shell > .stk-column-wrapper {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Territory has no outer visual shell, so the image can be edge-to-edge while copy stays readable. */
  .cem-stack-territory-imagecol > .stk-column-wrapper { border-radius: 0; }
  .cem-stack-territory-copycol > .stk-column-wrapper {
    padding: 18px 16px 4px !important;
  }

  /* Gutenberg information section remains full width with only a minimal text-safe gutter. */
  .cemetery-section { padding-left: 10px; padding-right: 10px; }
  .cemetery-section > .cemetery-section-head,
  .cemetery-section > .advantages-grid { width: 100%; }

  /* FAQ full bleed; questions retain internal padding only. */
  .cem-stack-faq-anchor { width: 100%; overflow: hidden; }

  /* Hard mobile geometry guard for the farewell hall. */
  .cem-stack-hall,
  .cem-stack-hall > .stk-row,
  .cem-stack-hall-shell,
  .cem-stack-hall-shell > .stk-column-wrapper,
  .cem-stack-hall-shell .stk-block-content,
  .cem-stack-hall-grid,
  .cem-stack-hall-grid > .stk-row,
  .cem-stack-hall-copy,
  .cem-stack-hall-gallery,
  .cem-stack-hall-gallery > .stk-column-wrapper,
  .cem-stack-hall-gallery .stk-block-content,
  .cem-stack-hall-gallery-grid,
  .cem-stack-hall-gallery-grid > .stk-row,
  .cem-stack-hall-photo,
  .cem-stack-hall-photo > .stk-column-wrapper,
  .cem-stack-hall-photo .stk-block-content,
  .cem-stack-hall-photo-media {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .cem-stack-hall-grid > .stk-row {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    width: 100% !important;
    gap: 14px !important;
  }
  .cem-stack-hall-copy,
  .cem-stack-hall-gallery {
    width: 100% !important;
    flex: none !important;
  }
  .cem-stack-hall-gallery-grid > .stk-row {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-template-rows: repeat(2,minmax(126px,1fr)) !important;
    width: 100% !important;
    min-height: 276px !important;
    gap: 6px !important;
  }
  .cem-stack-hall-photo { width: 100% !important; }
  .cem-stack-hall-photo-media {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    overflow: hidden;
  }
  .cem-stack-hall-photo-media img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
  }

  /* The other Stackable grids should never carry intrinsic width outside the viewport. */
  .cem-stack-orient *,
  .cem-stack-territory *,
  .cem-stack-fleet *,
  .cem-stack-contact *,
  .cem-stack-faq * {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .cem-stack-hall-gallery-grid > .stk-row {
    grid-template-rows: repeat(2,minmax(112px,1fr)) !important;
    min-height: 248px !important;
  }
  .cem-stack-hall-shell > .stk-column-wrapper,
  .cem-stack-fleet-shell > .stk-column-wrapper,
  .cem-stack-contact-shell > .stk-column-wrapper,
  .cem-stack-orient-shell > .stk-column-wrapper,
  .cem-stack-faq-shell > .stk-column-wrapper {
    padding-left: 13px !important;
    padding-right: 13px !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile transparent header + browser chrome color (v1.3.4)
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  /* On phones the brand text/logo is intentionally removed: the hero becomes
     the visual identity and only the navigation control remains. */
  .site-header .site-branding { display: none; }
  .site-header .header-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    min-height: 62px;
    padding-inline: 12px;
  }
  .site-header .header-actions {
    margin-left: auto;
    justify-self: auto;
  }
  .site-header .menu-toggle {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  /* Static front page: remove the white strip entirely and float the menu
     button on top of the Stackable hero. */
  body.cem-front-page .site-header {
    position: absolute;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 160;
    width: 100%;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    backdrop-filter: none;
  }
  body.cem-front-page.admin-bar .site-header { top: 46px !important; }
  body.cem-front-page .site-header .site-container {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  body.cem-front-page .menu-toggle {
    border: 1px solid rgba(255,255,255,.30);
    background: rgba(8,22,37,.38);
    color: #fff;
    box-shadow: 0 8px 24px rgba(4,15,28,.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  body.cem-front-page .menu-toggle:hover,
  body.cem-front-page .menu-toggle:focus-visible {
    background: rgba(8,22,37,.56);
    border-color: rgba(255,255,255,.52);
  }
  body.cem-front-page .menu-toggle-bar,
  body.cem-front-page .menu-toggle-bar::before,
  body.cem-front-page .menu-toggle-bar::after {
    background: #fff;
  }
  body.cem-front-page .menu-toggle[aria-expanded="true"] .menu-toggle-bar {
    background: transparent;
  }

  /* The opened menu remains a proper readable surface; only the closed header
     is transparent. It starts directly under the floating control row. */
  body.cem-front-page .site-header.is-menu-open .primary-navigation {
    top: 62px;
    max-height: calc(100svh - 62px - env(safe-area-inset-top, 0px));
    background: rgba(255,255,255,.985);
    border-top: 1px solid rgba(219,228,236,.75);
    box-shadow: 0 20px 44px rgba(12,29,48,.15);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  /* On non-front pages keep a very compact header: no branding, only the
     hamburger, while preserving a visible control on a light page. */
  body:not(.cem-front-page) .site-header {
    min-height: 62px;
  }
  body:not(.cem-front-page) .menu-toggle {
    background: var(--cem-surface);
  }
}

@media (max-width: 420px) {
  .site-header .header-row { min-height: 58px; padding-inline: 9px; }
  .site-header .menu-toggle { width: 44px; height: 44px; border-radius: 13px; }
  body.cem-front-page .site-header.is-menu-open .primary-navigation {
    top: 58px;
    max-height: calc(100svh - 58px - env(safe-area-inset-top, 0px));
  }
}

/* Keep the floating mobile menu button clear of iPhone / Android display cutouts
   when the browser exposes safe-area insets. */
@media (max-width: 720px) {
  body.cem-front-page .site-header .header-row {
    min-height: calc(62px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  body.cem-front-page .site-header.is-menu-open .primary-navigation {
    top: calc(62px + env(safe-area-inset-top, 0px));
    max-height: calc(100svh - 62px - env(safe-area-inset-top, 0px));
  }
}
@media (max-width: 420px) {
  body.cem-front-page .site-header .header-row {
    min-height: calc(58px + env(safe-area-inset-top, 0px));
  }
  body.cem-front-page .site-header.is-menu-open .primary-navigation {
    top: calc(58px + env(safe-area-inset-top, 0px));
    max-height: calc(100svh - 58px - env(safe-area-inset-top, 0px));
  }
}

/* --------------------------------------------------------------------------
   Mobile image UX normalization (v1.3.5)
   Large, predictable photos; consistent frames; no awkward tiny thumbnails.
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  /* All photo figures must respect their card width and never inherit a stray
     browser/Stackable figure margin. */
  .cem-stack-orient-media,
  .cem-stack-territory-image,
  .cem-stack-hall-photo-media,
  .cem-stack-fleet-mainphoto,
  .cem-stack-fleet-miniphoto,
  .cem-stack-faq-photo {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .cem-stack-orient-media img,
  .cem-stack-territory-image img,
  .cem-stack-hall-photo-media img,
  .cem-stack-fleet-mainphoto img,
  .cem-stack-fleet-miniphoto img,
  .cem-stack-faq-photo img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    object-fit: cover;
  }

  /* Quick orientation cards: photo becomes a strong full-width visual instead
     of a small image floating inside a padded plaque. */
  .cem-stack-orient-card > .stk-column-wrapper {
    overflow: hidden;
    padding: 13px 15px 15px !important;
  }
  .cem-stack-orient-media {
    width: calc(100% + 30px) !important;
    max-width: none !important;
    aspect-ratio: 16 / 9 !important;
    margin: 9px -15px 13px !important;
    border-radius: 0 !important;
    background: #dfe8f0;
  }
  .cem-stack-orient-media img { object-position: center center; }
  .cem-stack-orient-card--one .cem-stack-orient-media img { object-position: 54% center; }
  .cem-stack-orient-card--two .cem-stack-orient-media img { object-position: center 48%; }
  .cem-stack-orient-card--three .cem-stack-orient-media img { object-position: center 48%; }
  .cem-stack-orient-card--four .cem-stack-orient-media img { object-position: 48% center; }

  /* Territory photo uses aspect ratio rather than an arbitrary fixed height,
     so the frame stays proportional on 320–430px phones. */
  .cem-stack-territory-imagecol > .stk-column-wrapper {
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
    overflow: hidden;
  }
  .cem-stack-territory-imagecol .stk-block-content,
  .cem-stack-territory-image,
  .cem-stack-territory-image img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
  }
  .cem-stack-territory-image img { object-position: center 52%; }
  .cem-stack-photo-note {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 11px 12px;
  }

  /* Farewell hall: one coherent mosaic. Remove the forced equal-height desktop
     mechanics and let each mobile photo keep a natural 4:3 frame. */
  .cem-stack-hall-gallery,
  .cem-stack-hall-gallery > .stk-column-wrapper,
  .cem-stack-hall-gallery .stk-block-content,
  .cem-stack-hall-gallery-grid,
  .cem-stack-hall-gallery-grid > .stk-row,
  .cem-stack-hall-photo,
  .cem-stack-hall-photo > .stk-column-wrapper,
  .cem-stack-hall-photo .stk-block-content,
  .cem-stack-hall-photo-media {
    height: auto !important;
    min-height: 0 !important;
  }
  .cem-stack-hall-gallery > .stk-column-wrapper {
    overflow: hidden;
    border-radius: 14px;
    background: #dbe5ee !important;
  }
  .cem-stack-hall-gallery-grid > .stk-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    gap: 4px !important;
    min-height: 0 !important;
  }
  .cem-stack-hall-photo-media {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    border-radius: 0 !important;
    overflow: hidden;
    background: #dbe5ee;
  }
  .cem-stack-hall-photo:nth-child(1) .cem-stack-hall-photo-media img { object-position: center 48%; }
  .cem-stack-hall-photo:nth-child(2) .cem-stack-hall-photo-media img { object-position: center 50%; }
  .cem-stack-hall-photo:nth-child(3) .cem-stack-hall-photo-media img { object-position: 42% center; }
  .cem-stack-hall-photo:nth-child(4) .cem-stack-hall-photo-media img { object-position: center 48%; }

  /* Fleet: one strong hero photo, followed by two proper landscape photos.
     On mobile the small desktop thumbnails no longer stay tiny. */
  .cem-stack-fleet-mainphoto {
    width: 100% !important;
    aspect-ratio: 16 / 10 !important;
    border-radius: 14px;
    overflow: hidden;
  }
  .cem-stack-fleet-mainphoto img { object-position: center 52%; }
  .cem-stack-fleet-mini { margin-top: 6px !important; }
  .cem-stack-fleet-mini > .stk-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .cem-stack-fleet-minicard,
  .cem-stack-fleet-minicard > .stk-column-wrapper,
  .cem-stack-fleet-minicard .stk-block-content {
    min-width: 0 !important;
    width: 100% !important;
  }
  .cem-stack-fleet-miniphoto {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 13px;
    overflow: hidden;
  }
  .cem-stack-fleet-minicard:first-child .cem-stack-fleet-miniphoto img { object-position: center 52%; }
  .cem-stack-fleet-minicard:last-child .cem-stack-fleet-miniphoto img { object-position: center 50%; }

  /* FAQ photo follows the same predictable mobile framing. */
  .cem-stack-faq-media > .stk-column-wrapper { border-radius: 14px; }
  .cem-stack-faq-media .stk-block-content {
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
  }
  .cem-stack-faq-photo img { object-position: center 48%; }
  .cem-stack-faq-note {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 11px 12px;
  }

  /* Images should visually align with the full-width mobile sections rather
     than looking like nested tiny cards. */
  .cem-stack-hall-grid > .stk-row,
  .cem-stack-fleet-grid > .stk-row,
  .cem-stack-faq-grid > .stk-row { gap: 12px !important; }
}

@media (max-width: 360px) {
  /* At 320–360px a 2-column funeral-hall mosaic becomes too small. Use full
     width photos instead; the page is longer but the images are useful. */
  .cem-stack-hall-gallery-grid > .stk-row {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
  .cem-stack-hall-photo-media { aspect-ratio: 16 / 10 !important; }
}

@media (min-width: 361px) and (max-width: 720px) {
  /* Mobile hall mosaic: the first and last shots are full width, while the
     middle pair forms a compact row. This keeps photos large without making
     the page excessively long. */
  .cem-stack-hall-photo:nth-child(1),
  .cem-stack-hall-photo:nth-child(4) {
    grid-column: 1 / -1;
  }
  .cem-stack-hall-photo:nth-child(1) .cem-stack-hall-photo-media,
  .cem-stack-hall-photo:nth-child(4) .cem-stack-hall-photo-media {
    aspect-ratio: 16 / 9 !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile geometry + full-screen navigation refinement (v1.3.6)
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  /* A hard geometry reset for Stackable on phones. This prevents plugin
     flex-basis/min-content rules from ever pushing a visual block beyond the
     viewport, while still allowing normal vertical growth. */
  html,
  body,
  .cemetery-home {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .cemetery-home > *,
  .cemetery-home .wp-block-stackable-columns,
  .cemetery-home .wp-block-stackable-column,
  .cemetery-home .stk-row,
  .cemetery-home .stk-column-wrapper,
  .cemetery-home .stk-block-content,
  .cemetery-home .wp-block-group,
  .cemetery-home figure,
  .cemetery-home img {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .cemetery-home .wp-block-stackable-columns,
  .cemetery-home .stk-row {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .cemetery-home h1,
  .cemetery-home h2,
  .cemetery-home h3,
  .cemetery-home p,
  .cemetery-home a {
    overflow-wrap: anywhere;
  }

  /* Remove the deliberate negative-margin photo bleed from the quick cards.
     It looked good in the isolated preview but can interact with Stackable's
     generated widths on a real phone and create a few pixels of overflow. */
  .cem-stack-orient-media {
    width: 100% !important;
    max-width: 100% !important;
    margin: 8px 0 12px !important;
    border-radius: 12px !important;
  }

  /* On actual phone widths the hall gallery is one clean column. This is more
     robust and gives every photo enough visual weight than a squeezed 2x2. */
  .cem-stack-hall-gallery-grid > .stk-row {
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    min-height: 0 !important;
    gap: 6px !important;
  }
  .cem-stack-hall-photo,
  .cem-stack-hall-photo > .stk-column-wrapper,
  .cem-stack-hall-photo .stk-block-content,
  .cem-stack-hall-photo-media {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
  }
  .cem-stack-hall-photo-media {
    aspect-ratio: 16 / 10 !important;
    border-radius: 12px !important;
  }

  /* The floating hamburger must never sit over the hero copy. */
  .cem-stack-hero-grid > .stk-row {
    padding-top: calc(84px + env(safe-area-inset-top, 0px)) !important;
  }

  /* Full-screen mobile navigation. The white navigation surface now starts at
     the very top of the viewport instead of appearing below the old header
     height. Content begins below the floating close button. */
  .site-header .menu-toggle {
    position: relative;
    z-index: 220;
  }
  body.cem-front-page .site-header.is-menu-open .primary-navigation,
  body:not(.cem-front-page) .site-header.is-menu-open .primary-navigation {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 200;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 10px calc(14px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    background: rgba(255,255,255,.99);
    border: 0;
    box-shadow: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  body.admin-bar.cem-front-page .site-header.is-menu-open .primary-navigation,
  body.admin-bar:not(.cem-front-page) .site-header.is-menu-open .primary-navigation {
    padding-top: calc(118px + env(safe-area-inset-top, 0px));
  }
  body.mobile-menu-open {
    overflow: hidden;
  }
  .site-header.is-menu-open .primary-menu,
  .site-header.is-menu-open .mobile-menu-meta {
    width: 100% !important;
    max-width: none !important;
  }
  .site-header.is-menu-open .primary-menu {
    padding: 0 2px 8px;
  }
  .site-header.is-menu-open .mobile-menu-meta {
    margin: 4px 0 0;
    padding: 14px 2px 4px;
  }
  body.cem-front-page .site-header.is-menu-open .menu-toggle {
    background: #10243b;
    border-color: rgba(255,255,255,.22);
    box-shadow: 0 8px 24px rgba(4,15,28,.18);
  }
}

@media (max-width: 420px) {
  .cem-stack-hero-grid > .stk-row {
    padding-top: calc(78px + env(safe-area-inset-top, 0px)) !important;
  }
  body.cem-front-page .site-header.is-menu-open .primary-navigation,
  body:not(.cem-front-page) .site-header.is-menu-open .primary-navigation {
    padding-top: calc(68px + env(safe-area-inset-top, 0px));
  }
  body.admin-bar.cem-front-page .site-header.is-menu-open .primary-navigation,
  body.admin-bar:not(.cem-front-page) .site-header.is-menu-open .primary-navigation {
    padding-top: calc(114px + env(safe-area-inset-top, 0px));
  }
}

/* --------------------------------------------------------------------------
   Five additional Stackable sections (v1.4.0)
   Dense spacing, readable typography, same visual system as the existing page.
   -------------------------------------------------------------------------- */
.cem-stack-facts,
.cem-stack-docs,
.cem-stack-route,
.cem-stack-infra,
.cem-stack-links {
  width: min(calc(100% - 40px), var(--cem-container));
  margin: 26px auto !important;
}
.cem-stack-facts > .stk-row,
.cem-stack-docs > .stk-row,
.cem-stack-route > .stk-row,
.cem-stack-infra > .stk-row,
.cem-stack-links > .stk-row,
.cem-stack-facts-shell,
.cem-stack-docs-shell,
.cem-stack-route-shell,
.cem-stack-infra-shell,
.cem-stack-links-shell,
.cem-stack-facts-shell > .stk-column-wrapper,
.cem-stack-docs-shell > .stk-column-wrapper,
.cem-stack-route-shell > .stk-column-wrapper,
.cem-stack-infra-shell > .stk-column-wrapper,
.cem-stack-links-shell > .stk-column-wrapper {
  width: 100%;
  min-width: 0;
}

/* Quick facts */
.cem-stack-facts-shell > .stk-column-wrapper {
  padding: 28px !important;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 12%, rgba(120,178,235,.22), transparent 30%),
    linear-gradient(130deg,#10243b 0%,#1b3d61 58%,#2d659f 100%) !important;
  box-shadow: 0 16px 42px rgba(18,34,58,.12);
}
.cem-stack-facts-head { align-items: end !important; gap: 18px; }
.cem-stack-facts-head > *:first-child { flex: 1 1 52%; }
.cem-stack-facts-kicker,
.cem-stack-route-kicker,
.cem-stack-links-kicker {
  margin: 0 0 7px !important;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.cem-stack-facts-kicker { color: #c8dcf1; }
.cem-stack-facts-title,
.cem-stack-links-title {
  margin: 0 !important;
  font-size: clamp(32px,3.6vw,48px) !important;
  line-height: 1 !important;
  letter-spacing: -.04em;
}
.cem-stack-facts-title { color: #fff !important; }
.cem-stack-facts-copy {
  flex: 0 1 430px;
  margin: 0 !important;
  color: rgba(239,246,252,.76);
  font-size: 15px;
  line-height: 1.55;
}
.cem-stack-facts-grid { margin-top: 20px; }
.cem-stack-facts-grid > .stk-row {
  display: grid !important;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px !important;
}
.cem-stack-fact-card > .stk-column-wrapper {
  height: 100%;
  padding: 17px !important;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(255,255,255,.075) !important;
}
.cem-stack-fact-label {
  margin: 0 0 8px !important;
  color: #c8dcf1;
  font-size: 12.5px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cem-stack-fact-card h3 {
  margin: 0 !important;
  color: #fff !important;
  font-size: 19px !important;
  line-height: 1.12 !important;
}
.cem-stack-fact-card p:not(.cem-stack-fact-label) {
  margin: 7px 0 0 !important;
  color: rgba(240,246,252,.75);
  font-size: 14.5px;
  line-height: 1.45;
}

/* Documents */
.cem-stack-docs-shell > .stk-column-wrapper {
  padding: 28px !important;
  border: 1px solid var(--cem-line);
  border-radius: 24px;
  background: linear-gradient(145deg,#fff,#f5f8fb) !important;
}
.cem-stack-docs-grid > .stk-row {
  display: grid !important;
  grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr);
  gap: 22px !important;
  align-items: stretch;
}
.cem-stack-docs-title,
.cem-stack-route-title,
.cem-stack-infra-title {
  margin: 0 !important;
  font-size: clamp(34px,3.8vw,52px) !important;
  line-height: 1 !important;
  letter-spacing: -.045em;
}
.cem-stack-docs-copy,
.cem-stack-infra-text {
  margin: 12px 0 0 !important;
  color: var(--cem-muted);
  font-size: 15.5px;
  line-height: 1.58;
}
.cem-stack-docs-list { margin-top: 18px; }
.cem-stack-docs-list > .stk-row { display: grid !important; gap: 7px !important; }
.cem-stack-doc-row > .stk-column-wrapper {
  padding: 13px 15px !important;
  border: 1px solid var(--cem-line);
  border-radius: 14px;
  background: #fff !important;
}
.cem-stack-doc-row .stk-block-content {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  align-items: start;
  gap: 10px;
}
.cem-stack-doc-check {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin: 1px 0 0 !important;
  border-radius: 9px;
  color: var(--cem-primary);
  background: var(--cem-surface-strong);
  font-size: 14px;
  font-weight: 900;
}
.cem-stack-doc-row p:not(.cem-stack-doc-check) {
  margin: 0 !important;
  color: var(--cem-muted);
  font-size: 14.5px;
  line-height: 1.45;
}
.cem-stack-doc-row strong { color: var(--cem-ink); font-size: 15px; }
.cem-stack-docs-note > .stk-column-wrapper {
  height: 100%;
  padding: 22px !important;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg,#1e4a77,#2f6ca8) !important;
}
.cem-stack-docs-note-label {
  margin: 0 0 20px !important;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #d7e8f8;
}
.cem-stack-docs-note-title { margin: 0 !important; color: #fff !important; font-size: 26px !important; line-height: 1.06 !important; }
.cem-stack-docs-note p:not(.cem-stack-docs-note-label):not(.cem-stack-docs-note-link) { margin: 10px 0 0 !important; color: rgba(255,255,255,.8); font-size: 15px; line-height: 1.52; }
.cem-stack-docs-note-link { margin: 20px 0 0 !important; color: #fff; font-size: 14px; font-weight: 800; }

/* Visitor route */
.cem-stack-route-shell > .stk-column-wrapper {
  padding: 26px !important;
  border-radius: 22px;
  background: #f1f5f8 !important;
}
.cem-stack-route-head { align-items: end !important; gap: 18px; }
.cem-stack-route-head > *:first-child { flex: 1 1 55%; }
.cem-stack-route-kicker { color: var(--cem-primary); }
.cem-stack-route-copy { flex: 0 1 420px; margin: 0 !important; color: var(--cem-muted); font-size: 15px; line-height: 1.55; }
.cem-stack-route-grid { margin-top: 20px; }
.cem-stack-route-grid > .stk-row { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px !important; }
.cem-stack-route-step > .stk-column-wrapper {
  height: 100%;
  padding: 16px !important;
  border: 1px solid #d7e2eb;
  border-radius: 15px;
  background: #fff !important;
}
.cem-stack-route-step--accent > .stk-column-wrapper { color: #fff; border-color: transparent; background: var(--cem-primary) !important; }
.cem-stack-route-no {
  display: inline-grid;
  place-items: center;
  min-width: 31px;
  height: 31px;
  margin: 0 0 13px !important;
  padding: 0 7px;
  border-radius: 9px;
  color: var(--cem-primary);
  background: var(--cem-surface-strong);
  font-size: 12.5px;
  font-weight: 900;
}
.cem-stack-route-step--accent .cem-stack-route-no { color: #fff; background: rgba(255,255,255,.16); }
.cem-stack-route-step h3 { margin: 0 !important; color: inherit; font-size: 18px !important; line-height: 1.15 !important; }
.cem-stack-route-step p:not(.cem-stack-route-no) { margin: 7px 0 0 !important; color: var(--cem-muted); font-size: 14.5px; line-height: 1.45; }
.cem-stack-route-step--accent p:not(.cem-stack-route-no) { color: rgba(255,255,255,.82); }

/* Infrastructure bento */
.cem-stack-infra-shell > .stk-column-wrapper {
  padding: 28px !important;
  border: 1px solid var(--cem-line);
  border-radius: 24px;
  background: #fff !important;
}
.cem-stack-infra-grid > .stk-row { display: grid !important; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 24px !important; align-items: center; }
.cem-stack-infra-notes { margin-top: 18px; }
.cem-stack-infra-notes > .stk-row { display: grid !important; gap: 7px !important; }
.cem-stack-infra-note > .stk-column-wrapper { padding: 13px 14px !important; border: 1px solid var(--cem-line); border-radius: 14px; background: var(--cem-surface) !important; }
.cem-stack-infra-note .stk-block-content { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 9px; align-items: start; }
.cem-stack-infra-note-no { margin: 0 !important; color: var(--cem-primary); font-size: 12.5px; font-weight: 900; }
.cem-stack-infra-note p:not(.cem-stack-infra-note-no) { margin: 0 !important; color: var(--cem-muted); font-size: 14.5px; line-height: 1.45; }
.cem-stack-infra-note strong { color: var(--cem-ink); }
.cem-stack-infra-mainphoto,
.cem-stack-infra-miniphoto { margin: 0 !important; overflow: hidden; background: var(--cem-surface-strong); }
.cem-stack-infra-mainphoto { aspect-ratio: 16 / 9; border-radius: 18px; }
.cem-stack-infra-mini { margin-top: 8px; }
.cem-stack-infra-mini > .stk-row { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px !important; }
.cem-stack-infra-miniphoto { aspect-ratio: 16 / 9; border-radius: 14px; }
.cem-stack-infra-mainphoto img,
.cem-stack-infra-miniphoto img { width: 100%; height: 100%; object-fit: cover; }
.cem-stack-infra-mainphoto img { object-position: center 52%; }
.cem-stack-infra-miniphoto img { object-position: center center; }

/* Quick links */
.cem-stack-links-shell > .stk-column-wrapper {
  padding: 26px !important;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(120deg,#11243a,#1a3959) !important;
}
.cem-stack-links-head { align-items: end !important; gap: 18px; }
.cem-stack-links-head > *:first-child { flex: 1 1 50%; }
.cem-stack-links-kicker { color: #bcd4ec; }
.cem-stack-links-title { color: #fff !important; }
.cem-stack-links-copy { flex: 0 1 420px; margin: 0 !important; color: rgba(239,246,252,.72); font-size: 15px; line-height: 1.5; }
.cem-stack-links-grid { margin-top: 18px; }
.cem-stack-links-grid > .stk-row { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px !important; }
.cem-stack-link-card > .stk-column-wrapper { height: 100%; padding: 15px !important; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.065) !important; }
.cem-stack-link-card--accent > .stk-column-wrapper { background: rgba(73,133,194,.3) !important; border-color: rgba(171,208,240,.24); }
.cem-stack-link-icon { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 0 11px !important; border-radius: 9px; color: #fff; background: rgba(255,255,255,.12); font-size: 15px; font-weight: 900; }
.cem-stack-link-card h3 { margin: 0 !important; color: #fff !important; font-size: 17px !important; line-height: 1.15 !important; }
.cem-stack-link-card p:not(.cem-stack-link-icon) { margin: 6px 0 0 !important; color: rgba(239,246,252,.7); font-size: 14px; line-height: 1.4; }

@media (max-width: 1020px) {
  .cem-stack-facts-grid > .stk-row,
  .cem-stack-route-grid > .stk-row,
  .cem-stack-links-grid > .stk-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cem-stack-docs-grid > .stk-row,
  .cem-stack-infra-grid > .stk-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .cem-stack-facts,
  .cem-stack-docs,
  .cem-stack-route,
  .cem-stack-infra,
  .cem-stack-links {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 18px 0 !important;
  }
  .cem-stack-facts-shell > .stk-column-wrapper,
  .cem-stack-docs-shell > .stk-column-wrapper,
  .cem-stack-route-shell > .stk-column-wrapper,
  .cem-stack-infra-shell > .stk-column-wrapper,
  .cem-stack-links-shell > .stk-column-wrapper {
    padding: 20px 14px !important;
    border-radius: 0;
  }
  .cem-stack-facts-head,
  .cem-stack-route-head,
  .cem-stack-links-head { align-items: flex-start !important; flex-direction: column; gap: 9px; }
  .cem-stack-facts-copy,
  .cem-stack-route-copy,
  .cem-stack-links-copy { flex-basis: auto; max-width: none; }
  .cem-stack-facts-grid,
  .cem-stack-route-grid,
  .cem-stack-links-grid { margin-top: 14px; }
  .cem-stack-facts-grid > .stk-row,
  .cem-stack-route-grid > .stk-row,
  .cem-stack-links-grid > .stk-row { gap: 7px !important; }
  .cem-stack-fact-card > .stk-column-wrapper,
  .cem-stack-route-step > .stk-column-wrapper,
  .cem-stack-link-card > .stk-column-wrapper { padding: 14px !important; }
  .cem-stack-docs-grid > .stk-row,
  .cem-stack-infra-grid > .stk-row { gap: 14px !important; }
  .cem-stack-docs-note > .stk-column-wrapper { padding: 18px !important; }
  .cem-stack-docs-note-label { margin-bottom: 12px !important; }
  .cem-stack-docs-note-link { margin-top: 14px !important; }
  .cem-stack-infra-mainphoto { aspect-ratio: 16 / 10; border-radius: 14px; }
  .cem-stack-infra-mini > .stk-row { gap: 6px !important; }
  .cem-stack-infra-miniphoto { border-radius: 11px; }
}

@media (max-width: 420px) {
  .cem-stack-facts-grid > .stk-row,
  .cem-stack-route-grid > .stk-row,
  .cem-stack-links-grid > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-infra-mini > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-infra-miniphoto { aspect-ratio: 16 / 9; }
  .cem-stack-facts-title,
  .cem-stack-docs-title,
  .cem-stack-route-title,
  .cem-stack-infra-title,
  .cem-stack-links-title { font-size: clamp(30px,9vw,39px) !important; }
}

/* v1.4 final density audit */
.cem-stack-docs-grid > .stk-row { align-items: start; }
.cem-stack-docs-note > .stk-column-wrapper { height: auto; }

/* --------------------------------------------------------------------------
   Structured data, prices, charts and photo cards (v1.5.0)
   -------------------------------------------------------------------------- */
.cem-stack-pricing,
.cem-stack-costtable,
.cem-stack-chart,
.cem-stack-servicelist,
.cem-stack-compare,
.cem-stack-transportprices,
.cem-stack-dashboard {
  width: min(calc(100% - 40px), var(--cem-container));
  margin: 26px auto !important;
  min-width: 0;
  max-width: 100%;
}
.cem-stack-pricing > .stk-row,
.cem-stack-costtable > .stk-row,
.cem-stack-chart > .stk-row,
.cem-stack-servicelist > .stk-row,
.cem-stack-compare > .stk-row,
.cem-stack-transportprices > .stk-row,
.cem-stack-dashboard > .stk-row,
.cem-stack-pricing-shell,
.cem-stack-costtable-shell,
.cem-stack-chart-shell,
.cem-stack-servicelist-shell,
.cem-stack-compare-shell,
.cem-stack-transportprices-shell,
.cem-stack-dashboard-shell,
.cem-stack-pricing-shell > .stk-column-wrapper,
.cem-stack-costtable-shell > .stk-column-wrapper,
.cem-stack-chart-shell > .stk-column-wrapper,
.cem-stack-servicelist-shell > .stk-column-wrapper,
.cem-stack-compare-shell > .stk-column-wrapper,
.cem-stack-transportprices-shell > .stk-column-wrapper,
.cem-stack-dashboard-shell > .stk-column-wrapper { width: 100%; min-width: 0; max-width: 100%; }
.cem-stack-v15-head { align-items: end !important; gap: 18px; }
.cem-stack-v15-head > *:first-child { flex: 1 1 54%; }
.cem-stack-v15-title,
.cem-stack-chart-title,
.cem-stack-compare-title,
.cem-stack-dashboard-title {
  margin: 0 !important;
  font-size: clamp(34px,3.8vw,52px) !important;
  line-height: 1 !important;
  letter-spacing: -.045em;
}
.cem-stack-v15-copy,
.cem-stack-chart-copy,
.cem-stack-compare-copy,
.cem-stack-dashboard-copytext {
  margin: 0 !important;
  color: var(--cem-muted);
  font-size: 15.5px;
  line-height: 1.55;
}
.cem-stack-v15-copy { flex: 0 1 430px; }
.cem-stack-v15-copy--wide { max-width: 800px; margin-top: 11px !important; }
.cem-stack-demo-disclaimer { margin: 12px 0 0 !important; color: var(--cem-muted); font-size: 13.5px; line-height: 1.45; }

/* Pricing cards */
.cem-stack-pricing-shell > .stk-column-wrapper {
  padding: 28px !important;
  border: 1px solid var(--cem-line);
  border-radius: 24px;
  background: #fff !important;
}
.cem-stack-price-grid { margin-top: 20px; }
.cem-stack-price-grid > .stk-row { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px !important; align-items: stretch; }
.cem-stack-price-card > .stk-column-wrapper {
  height: 100%;
  padding: 20px !important;
  border: 1px solid var(--cem-line);
  border-radius: 17px;
  background: var(--cem-surface) !important;
}
.cem-stack-price-card--accent > .stk-column-wrapper {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg,#1e4a77,#2f6ca8) !important;
  box-shadow: 0 16px 36px rgba(18,34,58,.12);
}
.cem-stack-price-label { margin: 0 0 13px !important; color: var(--cem-primary); font-size: 13px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.cem-stack-price-card--accent .cem-stack-price-label { color: #d7e8f8; }
.cem-stack-price-value { margin: 0 !important; font-size: clamp(27px,3vw,38px) !important; line-height: 1 !important; letter-spacing: -.04em; }
.cem-stack-price-card--accent .cem-stack-price-value { color: #fff !important; }
.cem-stack-price-note { margin: 7px 0 0 !important; color: var(--cem-muted); font-size: 13.5px; line-height: 1.4; }
.cem-stack-price-card--accent .cem-stack-price-note { color: rgba(255,255,255,.72); }
.cem-stack-price-list { margin: 16px 0 0 !important; padding-left: 18px !important; color: var(--cem-muted); font-size: 15px; line-height: 1.45; }
.cem-stack-price-list li + li { margin-top: 6px; }
.cem-stack-price-card--accent .cem-stack-price-list { color: rgba(255,255,255,.84); }
.cem-stack-price-link { margin: 16px 0 0 !important; color: var(--cem-primary); font-size: 14px; font-weight: 800; }
.cem-stack-price-card--accent .cem-stack-price-link { color: #fff; }

/* Cost table */
.cem-stack-costtable-shell > .stk-column-wrapper {
  padding: 28px !important;
  border-radius: 24px;
  background: linear-gradient(145deg,#f7fafc,#eef4f8) !important;
}
.cem-stack-table { margin-top: 18px; border: 1px solid var(--cem-line); border-radius: 17px; overflow: hidden; background: #fff; }
.cem-stack-table-row { display: grid !important; grid-template-columns: 1.05fr 1.55fr .45fr .7fr !important; gap: 0 !important; align-items: center; border-top: 1px solid var(--cem-line); }
.cem-stack-table-row:first-child { border-top: 0; }
.cem-stack-table-row > * { margin: 0 !important; padding: 13px 15px; min-width: 0; color: var(--cem-muted); font-size: 14.5px; line-height: 1.35; }
.cem-stack-table-row > * + * { border-left: 1px solid var(--cem-line); }
.cem-stack-table-row strong { color: var(--cem-ink); }
.cem-stack-table-row--head { background: #e7eef5; }
.cem-stack-table-row--head > * { color: var(--cem-ink); font-size: 13px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cem-stack-table-row--total { background: #f3f7fb; }
.cem-stack-table-row--total > *:last-child { color: var(--cem-primary); font-size: 16px; }

/* Chart */
.cem-stack-chart-shell > .stk-column-wrapper {
  padding: 28px !important;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(125deg,#10243b 0%,#183958 58%,#2c649d 100%) !important;
}
.cem-stack-chart-grid > .stk-row { display: grid !important; grid-template-columns: minmax(0,.82fr) minmax(0,1.18fr); gap: 30px !important; align-items: center; }
.cem-stack-chart-title { color: #fff !important; }
.cem-stack-chart-copy { margin-top: 12px !important; color: rgba(240,247,253,.77); }
.cem-stack-chart-legend { margin: 18px 0 0 !important; color: rgba(255,255,255,.72); font-size: 13.5px; }
.cem-stack-chart-legend strong { color: #fff; }
.cem-stack-chart-bars > .stk-column-wrapper { padding: 20px !important; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.07) !important; }
.cem-stack-bar { margin: 0 0 14px !important; }
.cem-stack-bar:last-child { margin-bottom: 0 !important; }
.cem-stack-bar p { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 6px !important; color: rgba(255,255,255,.78); font-size: 14.5px; }
.cem-stack-bar p strong { color: #fff; }
.cem-stack-bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.12); }
.cem-stack-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#9ec7ec,#fff); }

/* Service list */
.cem-stack-servicelist-shell > .stk-column-wrapper { padding: 28px !important; border: 1px solid var(--cem-line); border-radius: 24px; background: #fff !important; }
.cem-stack-service-grid { margin-top: 20px; }
.cem-stack-service-grid > .stk-row { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px !important; }
.cem-stack-service-col > .stk-column-wrapper { background: transparent !important; }
.cem-stack-service-row { display: grid !important; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px !important; align-items: center; min-height: 72px; padding: 11px 13px; border: 1px solid var(--cem-line); border-radius: 14px; background: var(--cem-surface); }
.cem-stack-service-row + .cem-stack-service-row { margin-top: 7px !important; }
.cem-stack-service-row > * { margin: 0 !important; min-width: 0; }
.cem-stack-service-code { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: var(--cem-primary); background: #fff; font-size: 12.5px; font-weight: 900; }
.cem-stack-service-name { color: var(--cem-muted); font-size: 13.5px; line-height: 1.35; }
.cem-stack-service-name strong { color: var(--cem-ink); font-size: 15px; }
.cem-stack-service-name span { display: inline-block; margin-top: 3px; }
.cem-stack-service-price { color: var(--cem-primary); font-size: 14.5px; font-weight: 850; white-space: nowrap; }

/* Comparison */
.cem-stack-compare-shell > .stk-column-wrapper { padding: 28px !important; border-radius: 24px; color: #fff; background: linear-gradient(125deg,#11243a,#1a3959) !important; }
.cem-stack-compare-title { max-width: 850px; color: #fff !important; }
.cem-stack-compare-copy { max-width: 800px; margin-top: 11px !important; color: rgba(239,246,252,.74); }
.cem-stack-compare-table { margin-top: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 17px; }
.cem-stack-compare-row { display: grid !important; grid-template-columns: 1.45fr repeat(3,1fr) !important; gap: 0 !important; border-top: 1px solid rgba(255,255,255,.12); }
.cem-stack-compare-row:first-child { border-top: 0; }
.cem-stack-compare-row > * { margin: 0 !important; padding: 12px 14px; min-width: 0; color: rgba(255,255,255,.78); font-size: 14.5px; line-height: 1.35; text-align: center; }
.cem-stack-compare-row > *:first-child { text-align: left; }
.cem-stack-compare-row > * + * { border-left: 1px solid rgba(255,255,255,.12); }
.cem-stack-compare-row--head { background: rgba(255,255,255,.09); }
.cem-stack-compare-row--head > * { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.cem-stack-compare-row--price { background: rgba(91,151,211,.18); }
.cem-stack-compare-row--price > * { color: #fff; font-size: 15px; }

/* Photo tariff cards */
.cem-stack-transportprices-shell > .stk-column-wrapper { padding: 28px !important; border: 1px solid var(--cem-line); border-radius: 24px; background: #fff !important; }
.cem-stack-transport-grid { margin-top: 20px; }
.cem-stack-transport-grid > .stk-row { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px !important; align-items: stretch; }
.cem-stack-transport-card > .stk-column-wrapper { height: 100%; overflow: hidden; border: 1px solid var(--cem-line); border-radius: 17px; background: var(--cem-surface) !important; }
.cem-stack-transport-photo { margin: 0 !important; aspect-ratio: 16 / 10; overflow: hidden; }
.cem-stack-transport-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }
.cem-stack-transport-card:nth-child(1) .cem-stack-transport-photo img { object-position: 58% center; }
.cem-stack-transport-body { padding: 17px !important; }
.cem-stack-transport-body .cem-stack-price-label { margin-bottom: 8px !important; }
.cem-stack-transport-body h3 { margin: 0 !important; font-size: 20px !important; line-height: 1.1 !important; }
.cem-stack-transport-body > p:not(.cem-stack-price-label):not(.cem-stack-transport-price) { margin: 8px 0 0 !important; color: var(--cem-muted); font-size: 14.5px; line-height: 1.45; }
.cem-stack-transport-price { margin: 13px 0 0 !important; color: var(--cem-primary); font-size: 17px; }

/* Dashboard */
.cem-stack-dashboard-shell > .stk-column-wrapper { padding: 28px !important; border-radius: 24px; background: linear-gradient(145deg,#f7fafc,#edf4fa) !important; }
.cem-stack-dashboard-grid > .stk-row { display: grid !important; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr); gap: 24px !important; align-items: center; }
.cem-stack-dashboard-copytext { margin-top: 11px !important; }
.cem-stack-dashboard-kpis { margin-top: 17px; }
.cem-stack-dashboard-kpis > .stk-row { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px !important; }
.cem-stack-kpi > .stk-column-wrapper { padding: 14px 16px !important; border: 1px solid var(--cem-line); border-radius: 14px; background: #fff !important; }
.cem-stack-kpi strong { display: block; color: var(--cem-primary); font-size: 24px; line-height: 1; letter-spacing: -.035em; }
.cem-stack-kpi p { margin: 6px 0 0 !important; color: var(--cem-muted); font-size: 14px; }
.cem-stack-dashboard-visual > .stk-column-wrapper { padding: 20px !important; border: 1px solid var(--cem-line); border-radius: 18px; background: #fff !important; }
.cem-stack-dashboard-visual .stk-block-content { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 18px; align-items: center; }
.cem-stack-donut { display: grid; place-items: center; width: 126px; aspect-ratio: 1; margin: 0 !important; border-radius: 50%; color: var(--cem-ink); background: radial-gradient(circle at center,#fff 0 54%,transparent 55%), conic-gradient(var(--cem-primary) 0 68%,#dfe8f0 68% 100%); font-size: 25px; font-weight: 900; letter-spacing: -.04em; }
.cem-stack-dashboard-list p { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 8px; margin: 0 !important; padding: 8px 0; border-top: 1px solid var(--cem-line); color: var(--cem-muted); font-size: 14px; }
.cem-stack-dashboard-list p:first-child { border-top: 0; }
.cem-stack-dashboard-list strong { color: var(--cem-primary); }
.cem-stack-dashboard-list span { min-width: 0; }

@media (max-width: 1020px) {
  .cem-stack-price-grid > .stk-row,
  .cem-stack-transport-grid > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-service-grid > .stk-row,
  .cem-stack-chart-grid > .stk-row,
  .cem-stack-dashboard-grid > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-dashboard-visual .stk-block-content { grid-template-columns: 150px minmax(0,1fr); }
}

@media (max-width: 720px) {
  .cem-stack-pricing,
  .cem-stack-costtable,
  .cem-stack-chart,
  .cem-stack-servicelist,
  .cem-stack-compare,
  .cem-stack-transportprices,
  .cem-stack-dashboard {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 18px 0 !important;
    overflow: hidden;
  }
  .cem-stack-pricing-shell > .stk-column-wrapper,
  .cem-stack-costtable-shell > .stk-column-wrapper,
  .cem-stack-chart-shell > .stk-column-wrapper,
  .cem-stack-servicelist-shell > .stk-column-wrapper,
  .cem-stack-compare-shell > .stk-column-wrapper,
  .cem-stack-transportprices-shell > .stk-column-wrapper,
  .cem-stack-dashboard-shell > .stk-column-wrapper {
    padding: 20px 14px !important;
    border-radius: 0;
  }
  .cem-stack-v15-head { align-items: flex-start !important; flex-direction: column; gap: 9px; }
  .cem-stack-v15-copy { flex-basis: auto; max-width: none; }
  .cem-stack-price-grid,
  .cem-stack-service-grid,
  .cem-stack-transport-grid { margin-top: 14px; }
  .cem-stack-price-card > .stk-column-wrapper { padding: 17px !important; }
  .cem-stack-price-list { margin-top: 12px !important; }
  .cem-stack-table { margin-top: 14px; border-radius: 14px; }
  .cem-stack-table-row--head { display: none !important; }
  .cem-stack-table-row { grid-template-columns: 1fr auto !important; padding: 12px 13px; row-gap: 5px !important; }
  .cem-stack-table-row > * { padding: 0; border: 0 !important; font-size: 14px; }
  .cem-stack-table-row > *:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--cem-muted); }
  .cem-stack-table-row > *:nth-child(3) { grid-column: 1; grid-row: 3; color: var(--cem-muted); font-size: 13.5px; }
  .cem-stack-table-row > *:nth-child(4) { grid-column: 2; grid-row: 1 / span 3; align-self: center; text-align: right; color: var(--cem-primary); white-space: nowrap; }
  .cem-stack-chart-grid > .stk-row { gap: 14px !important; }
  .cem-stack-chart-bars > .stk-column-wrapper { padding: 16px !important; }
  .cem-stack-service-grid > .stk-row { gap: 7px !important; }
  .cem-stack-service-row { grid-template-columns: 32px minmax(0,1fr); min-height: 0; padding: 11px 12px; }
  .cem-stack-service-price { grid-column: 2; margin-top: 3px !important; white-space: normal; }
  .cem-stack-compare-copy { margin-top: 9px !important; }
  .cem-stack-compare-table { margin-top: 14px; border-radius: 14px; }
  .cem-stack-compare-row--head { display: none !important; }
  .cem-stack-compare-row { grid-template-columns: repeat(3,minmax(0,1fr)) !important; padding: 11px 10px; gap: 6px !important; }
  .cem-stack-compare-row > * { padding: 0; border: 0 !important; font-size: 13.5px; }
  .cem-stack-compare-row > *:first-child { grid-column: 1 / -1; margin-bottom: 3px !important; color: #fff; font-size: 14.5px; font-weight: 800; }
  .cem-stack-compare-row > *:nth-child(n+2)::before { display: block; margin-bottom: 2px; color: rgba(255,255,255,.46); font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
  .cem-stack-compare-row > *:nth-child(2)::before { content: "Базовый"; }
  .cem-stack-compare-row > *:nth-child(3)::before { content: "Оптимальный"; }
  .cem-stack-compare-row > *:nth-child(4)::before { content: "Расширенный"; }
  .cem-stack-transport-photo { aspect-ratio: 16 / 9; }
  .cem-stack-transport-body { padding: 15px !important; }
  .cem-stack-dashboard-grid > .stk-row { gap: 14px !important; }
  .cem-stack-dashboard-visual > .stk-column-wrapper { padding: 16px !important; }
}

@media (max-width: 430px) {
  .cem-stack-v15-title,
  .cem-stack-chart-title,
  .cem-stack-compare-title,
  .cem-stack-dashboard-title { font-size: clamp(30px,9vw,39px) !important; }
  .cem-stack-dashboard-kpis > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-dashboard-visual .stk-block-content { grid-template-columns: 1fr; justify-items: center; }
  .cem-stack-dashboard-list { width: 100%; }
  .cem-stack-donut { width: 118px; }
  .cem-stack-bar p { font-size: 14px; }
  .cem-stack-compare-row > * { font-size: 13px; }
  .cem-stack-compare-row > *:first-child { font-size: 14px; }
}

/* v1.5 serialization-safe refinements */
.cem-stack-bar-label { display: flex !important; justify-content: space-between; gap: 16px; }
.cem-stack-bar-label p { margin: 0 !important; color: rgba(255,255,255,.78); font-size: 14.5px; }
.cem-stack-bar-label p strong { color: #fff; }
.cem-stack-bar-track { height: 10px; margin-top: 6px !important; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.12); }
.cem-stack-bar-fill { height: 100%; min-height: 10px; margin: 0 !important; border-radius: inherit; background: linear-gradient(90deg,#9ec7ec,#fff); }
.cem-stack-bar-fill--35 { width: 35%; }
.cem-stack-bar-fill--72 { width: 72%; }
.cem-stack-bar-fill--100 { width: 100%; }
.cem-stack-bar-fill--64 { width: 64%; }
.cem-stack-bar-fill--28 { width: 28%; }
.cem-stack-kpi-value { display: block; margin: 0 !important; color: var(--cem-primary) !important; font-size: 24px !important; line-height: 1 !important; letter-spacing: -.035em; }
.cem-stack-kpi p { margin: 6px 0 0 !important; color: var(--cem-muted); font-size: 14px; }

/* --------------------------------------------------------------------------
   Data-table UX refinement (v1.5.1)
   -------------------------------------------------------------------------- */
.cem-stack-table-summary { margin-top: 18px; }
.cem-stack-table-summary > .stk-row {
  display: grid !important;
  grid-template-columns: .75fr .95fr 1.3fr;
  gap: 9px !important;
}
.cem-stack-table-summary-card > .stk-column-wrapper {
  height: 100%;
  padding: 15px 17px !important;
  border: 1px solid var(--cem-line);
  border-radius: 15px;
  background: rgba(255,255,255,.82) !important;
}
.cem-stack-table-summary-card--accent > .stk-column-wrapper {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg,#1d4a77,#2f6da8) !important;
}
.cem-stack-table-summary-label {
  margin: 0 !important;
  color: var(--cem-muted);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cem-stack-table-summary-card--accent .cem-stack-table-summary-label,
.cem-stack-table-summary-card--accent .cem-stack-table-summary-note { color: rgba(255,255,255,.72); }
.cem-stack-table-summary-value {
  margin: 7px 0 0 !important;
  color: var(--cem-ink) !important;
  font-size: clamp(25px,2.5vw,34px) !important;
  line-height: 1 !important;
  letter-spacing: -.04em;
}
.cem-stack-table-summary-card--accent .cem-stack-table-summary-value { color: #fff !important; }
.cem-stack-table-summary-note { margin: 6px 0 0 !important; color: var(--cem-muted); font-size: 13.5px; line-height: 1.4; }

.cem-stack-costtable-shell > .stk-column-wrapper {
  background:
    radial-gradient(circle at 94% 4%, rgba(45,95,159,.08), transparent 25%),
    linear-gradient(145deg,#f8fafc,#eef4f8) !important;
}
.cem-stack-table {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #d8e2eb;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(18,34,58,.045);
}
.cem-stack-table-row {
  grid-template-columns: 1.22fr 1.92fr .58fr .72fr .78fr !important;
  min-height: 58px;
  border-top-color: #e4ebf1;
  transition: background .16s ease;
}
.cem-stack-table-row:hover { background: #f8fbfd; }
.cem-stack-table-row > * {
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.38;
}
.cem-stack-table-row > * + * { border-left-color: #e7edf2; }
.cem-stack-table-row--head {
  min-height: 44px;
  background: #172c43;
}
.cem-stack-table-row--head > * {
  color: rgba(255,255,255,.76);
  font-size: 11.5px;
  letter-spacing: .09em;
}
.cem-stack-table-name strong { color: var(--cem-ink); font-size: 14.8px; }
.cem-stack-table-description { color: #687788; }
.cem-stack-table-unit { color: #718092; white-space: nowrap; }
.cem-stack-table-status { text-align: center; }
.cem-stack-table-status span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 850;
  white-space: nowrap;
}
.cem-stack-table-status.is-included span { color: #235d4a; background: #e7f4ee; }
.cem-stack-table-status.is-optional span { color: #52667b; background: #edf2f6; }
.cem-stack-table-price { color: var(--cem-primary) !important; text-align: right; white-space: nowrap; }
.cem-stack-table-price strong { color: var(--cem-primary); font-size: 15.5px; }
.cem-stack-table-category {
  min-height: 38px;
  padding: 0 14px;
  border-top: 1px solid #dce6ee;
  border-bottom: 1px solid #e8eef3;
  background: #f0f5f9;
  gap: 12px;
}
.cem-stack-table-category > * { margin: 0 !important; }
.cem-stack-table-category p:first-child { color: var(--cem-ink); font-size: 12.5px; letter-spacing: .055em; text-transform: uppercase; }
.cem-stack-table-category p:last-child { color: #718092; font-size: 12px; }
.cem-stack-table-totalbar {
  gap: 16px;
  align-items: center;
  padding: 17px 18px;
  border-top: 1px solid #d6e0e9;
  background: linear-gradient(90deg,#edf5fb,#f8fbfd);
}
.cem-stack-table-totalbar p { margin: 0 !important; }
.cem-stack-table-total-label { color: var(--cem-ink); font-size: 15px; font-weight: 850; }
.cem-stack-table-total-note { margin-top: 3px !important; color: var(--cem-muted); font-size: 12.5px; }
.cem-stack-table-total-value { color: var(--cem-primary); font-size: 23px; letter-spacing: -.035em; white-space: nowrap; }

.cem-stack-compare-shell > .stk-column-wrapper {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0%, rgba(93,157,219,.22), transparent 30%),
    linear-gradient(125deg,#102238,#173451 58%,#1f476e) !important;
}
.cem-stack-compare-shell > .stk-column-wrapper::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -130px;
  bottom: -160px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  pointer-events: none;
}
.cem-stack-compare-heading { position: relative; z-index: 1; align-items: end !important; gap: 18px; }
.cem-stack-compare-heading > *:first-child { flex: 1 1 55%; }
.cem-stack-compare-copy { flex: 0 1 430px; margin: 0 !important; }
.cem-stack-compare-planheads {
  position: relative;
  z-index: 1;
  display: grid !important;
  grid-template-columns: 1.45fr repeat(3,1fr) !important;
  gap: 8px !important;
  margin-top: 22px;
  align-items: stretch;
}
.cem-stack-compare-corner {
  display: flex;
  align-items: flex-end;
  margin: 0 !important;
  padding: 0 10px 12px;
  color: rgba(255,255,255,.48);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cem-stack-planhead {
  position: relative;
  min-width: 0;
  padding: 16px !important;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
}
.cem-stack-planhead--featured {
  border-color: rgba(166,210,247,.50);
  background: linear-gradient(145deg,rgba(67,132,193,.48),rgba(255,255,255,.10));
  box-shadow: 0 14px 32px rgba(4,15,28,.16);
}
.cem-stack-plan-kicker { margin: 0 !important; color: #d3e5f6; font-size: 12px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.cem-stack-plan-price { margin: 8px 0 0 !important; color: #fff !important; font-size: clamp(22px,2.3vw,31px) !important; line-height: 1 !important; letter-spacing: -.04em; }
.cem-stack-plan-caption { margin: 7px 0 0 !important; color: rgba(255,255,255,.63); font-size: 12.5px; line-height: 1.35; }
.cem-stack-plan-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  margin: 0 !important;
  padding: 5px 8px;
  border-radius: 999px;
  color: #173451;
  background: #d9edff;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.cem-stack-compare-table {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  border-color: rgba(255,255,255,.13);
  border-radius: 17px;
  background: rgba(6,18,31,.16);
}
.cem-stack-compare-row { grid-template-columns: 1.45fr repeat(3,1fr) !important; min-height: 56px; }
.cem-stack-compare-row > * { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 10px 13px; }
.cem-stack-compare-row > *:first-child { justify-content: flex-start; color: #f0f6fb; font-weight: 720; }
.cem-stack-compare-row > *:nth-child(3) { background: rgba(95,156,214,.10); }
.cem-stack-compare-option { flex-direction: column; gap: 2px; color: rgba(255,255,255,.78) !important; }
.cem-stack-compare-option small { display: block; color: rgba(255,255,255,.46); font-size: 10.5px; line-height: 1.2; }
.cem-stack-check {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: #173d33;
  background: #ccecdf;
  font-size: 14px;
  font-weight: 900;
}
.cem-stack-dash { color: rgba(255,255,255,.38); font-size: 22px; line-height: 1; }
.cem-stack-compare-row--footer { background: rgba(255,255,255,.07); }
.cem-stack-compare-row--footer > * { min-height: 64px; color: #fff !important; }
.cem-stack-compare-row--footer strong { color: #fff; font-size: 16px; }
.cem-stack-compare-row--footer small { color: rgba(255,255,255,.50); font-size: 10.5px; }
.cem-stack-demo-disclaimer--dark { position: relative; z-index: 1; color: rgba(255,255,255,.52); }

@media (max-width: 900px) {
  .cem-stack-table-summary > .stk-row { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .cem-stack-compare-planheads,
  .cem-stack-compare-row { grid-template-columns: 1.15fr repeat(3,1fr) !important; }
}

@media (max-width: 720px) {
  .cem-stack-table-summary { margin-top: 14px; }
  .cem-stack-table-summary > .stk-row { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px !important; }
  .cem-stack-table-summary-card > .stk-column-wrapper { padding: 12px 10px !important; border-radius: 12px; }
  .cem-stack-table-summary-label { font-size: 10.5px; }
  .cem-stack-table-summary-value { font-size: clamp(22px,7vw,28px) !important; }
  .cem-stack-table-summary-note { font-size: 11.5px; }
  .cem-stack-table { margin-top: 10px; border-radius: 0; border-left: 0; border-right: 0; }
  .cem-stack-table-row--head { display: none !important; }
  .cem-stack-table-category { margin-inline: -14px; padding-inline: 14px; }
  .cem-stack-table-row {
    grid-template-columns: minmax(0,1fr) auto !important;
    min-height: 0;
    padding: 13px 0;
    row-gap: 5px !important;
    background: #fff;
  }
  .cem-stack-table-row:hover { background: #fff; }
  .cem-stack-table-row > * { padding: 0; border: 0 !important; }
  .cem-stack-table-name { grid-column: 1; grid-row: 1; padding-right: 10px !important; }
  .cem-stack-table-description { grid-column: 1 / -1; grid-row: 2; padding-right: 0 !important; font-size: 13.5px !important; }
  .cem-stack-table-unit { grid-column: 1; grid-row: 3; font-size: 12.5px !important; }
  .cem-stack-table-status { grid-column: 1; grid-row: 4; text-align: left; }
  .cem-stack-table-status span { min-height: 25px; padding-inline: 8px; font-size: 10.5px; }
  .cem-stack-table-price { grid-column: 2; grid-row: 1 / span 4; align-self: center; padding-left: 12px !important; }
  .cem-stack-table-totalbar { margin-inline: -14px; padding: 14px; }
  .cem-stack-table-total-value { font-size: 21px; }

  .cem-stack-compare-heading { align-items: flex-start !important; flex-direction: column; gap: 8px; }
  .cem-stack-compare-copy { flex-basis: auto; }
  .cem-stack-compare-planheads {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 5px !important;
    margin-top: 16px;
  }
  .cem-stack-compare-corner { display: none; }
  .cem-stack-planhead { padding: 11px 8px !important; border-radius: 12px; text-align: center; }
  .cem-stack-plan-badge { position: static; display: inline-flex; margin: 0 auto 6px !important; padding: 4px 6px; font-size: 8.5px; }
  .cem-stack-plan-kicker { font-size: 10.5px; }
  .cem-stack-plan-price { margin-top: 5px !important; font-size: clamp(17px,5vw,22px) !important; }
  .cem-stack-plan-caption { display: none; }
  .cem-stack-compare-table { margin-top: 6px; border-radius: 12px; }
  .cem-stack-compare-row {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    padding: 11px 8px;
    gap: 5px !important;
    min-height: 0;
  }
  .cem-stack-compare-row > * { min-height: 0; padding: 0; border: 0 !important; font-size: 13px; }
  .cem-stack-compare-row > *:first-child {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-bottom: 3px !important;
    padding-bottom: 7px !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    font-size: 14px;
  }
  .cem-stack-compare-row > *:nth-child(3) { border-radius: 8px; background: rgba(95,156,214,.12); }
  .cem-stack-compare-option { gap: 3px; }
  .cem-stack-compare-option small { font-size: 9px; }
  .cem-stack-check { width: 25px; height: 25px; }
  .cem-stack-compare-row--footer > * { min-height: 0; }
  .cem-stack-compare-row--footer strong { font-size: 14px; }
}

@media (max-width: 370px) {
  .cem-stack-table-summary > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-table-summary-card > .stk-column-wrapper { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  .cem-stack-table-summary-value { grid-column: 2; grid-row: 1 / span 2; margin: 0 !important; }
  .cem-stack-table-summary-note { margin-top: 3px !important; }
  .cem-stack-plan-kicker { font-size: 9.5px; }
  .cem-stack-plan-price { font-size: 16px !important; }
  .cem-stack-compare-row { padding-inline: 6px; }
}

/* v1.5.1 mobile table polish after visual audit */
@media (max-width: 720px) {
  .cem-stack-table-summary > .stk-row {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .cem-stack-table-summary-card--accent { grid-column: 1 / -1; }
  .cem-stack-table-summary-card--accent > .stk-column-wrapper {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    column-gap: 14px;
    align-items: center;
  }
  .cem-stack-table-summary-card--accent .cem-stack-table-summary-value {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0 !important;
  }
  .cem-stack-table-summary-card--accent .cem-stack-table-summary-note { margin-top: 3px !important; }

  .cem-stack-table-row {
    grid-template-columns: minmax(0,1fr) auto !important;
  }
  .cem-stack-table-name { grid-column: 1; grid-row: 1; }
  .cem-stack-table-price {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    padding-left: 10px !important;
    font-size: 15px !important;
  }
  .cem-stack-table-description { grid-column: 1 / -1; grid-row: 2; padding-top: 2px !important; }
  .cem-stack-table-unit { grid-column: 1; grid-row: 3; align-self: center; }
  .cem-stack-table-status {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
    justify-self: end;
    width: auto;
    text-align: right;
  }
  .cem-stack-table-status span { white-space: nowrap; }
}

@media (max-width: 370px) {
  .cem-stack-table-summary > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-table-summary-card--accent { grid-column: auto; }
  .cem-stack-table-summary-card > .stk-column-wrapper,
  .cem-stack-table-summary-card--accent > .stk-column-wrapper {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    column-gap: 12px;
    align-items: center;
  }
  .cem-stack-table-summary-card .cem-stack-table-summary-value {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0 !important;
  }
}

/* v1.5.1 comparison mobile readability: do not shrink explanatory type */
@media (max-width: 720px) {
  .cem-stack-compare-option small { display: none; }
  .cem-stack-plan-kicker { font-size: 11px; }
}
@media (max-width: 370px) {
  .cem-stack-plan-badge { display: none; }
  .cem-stack-plan-kicker { font-size: 10.5px; }
  .cem-stack-plan-price { font-size: 16px !important; }
}

/* ========================================================================== 
   Stackable demonstration set v1.6.0 — removable, self-contained sections
   ========================================================================== */
.cem-stack-journal,
.cem-stack-hours,
.cem-stack-docmatrix,
.cem-stack-timeline,
.cem-stack-metrics,
.cem-stack-editorial {
  width: min(calc(100% - 40px), var(--cem-container));
  margin: 28px auto !important;
  min-width: 0;
}
.cem-stack-journal *, .cem-stack-hours *, .cem-stack-docmatrix *,
.cem-stack-timeline *, .cem-stack-metrics *, .cem-stack-editorial * { box-sizing: border-box; min-width: 0; }

/* Photo journal */
.cem-stack-journal-shell > .stk-column-wrapper {
  padding: 30px !important;
  border: 1px solid var(--cem-line);
  border-radius: 26px;
  background: linear-gradient(145deg,#f8fafc,#edf4f8) !important;
}
.cem-stack-journal-head { align-items: end !important; gap: 22px; margin-bottom: 22px; }
.cem-stack-journal-head > *:first-child { flex: 1 1 520px; }
.cem-stack-journal-title { margin: 0 !important; font-size: clamp(34px,3.6vw,52px) !important; line-height: .98 !important; letter-spacing: -.045em; }
.cem-stack-journal-copy { flex: 0 1 410px; margin: 0 !important; color: var(--cem-muted); font-size: 15px; line-height: 1.55; }
.cem-stack-journal-grid > .stk-row { display: grid; grid-template-columns: 1.18fr .82fr; gap: 12px; align-items: stretch; }
.cem-stack-journal-main > .stk-column-wrapper,
.cem-stack-journal-side > .stk-column-wrapper { height: 100%; background: transparent !important; }
.cem-stack-journal-main { position: relative; }
.cem-stack-journal-photo { margin: 0 !important; overflow: hidden; border-radius: 16px; background: #dfe7ee; }
.cem-stack-journal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cem-stack-journal-photo--main { height: 100%; min-height: 470px; }
.cem-stack-journal-caption { position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 14px 16px; border-radius: 14px; color: #fff; background: rgba(12,31,49,.76); backdrop-filter: blur(12px); }
.cem-stack-journal-caption p { margin: 0 !important; color: rgba(255,255,255,.86); font-size: 14px; line-height: 1.45; }
.cem-stack-journal-caption-label { margin-bottom: 4px !important; color: #fff !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 12px !important; }
.cem-stack-journal-sidegrid > .stk-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.cem-stack-journal-tile > .stk-column-wrapper,
.cem-stack-journal-wide > .stk-column-wrapper { padding: 0 !important; overflow: hidden; border-radius: 16px; background: #fff !important; border: 1px solid var(--cem-line); }
.cem-stack-journal-tile .cem-stack-journal-photo { height: 170px; border-radius: 0; }
.cem-stack-journal-wide { grid-column: 1 / -1; }
.cem-stack-journal-wide .cem-stack-journal-photo { height: 198px; border-radius: 0; }
.cem-stack-journal-smallcap { margin: 0 !important; padding: 10px 12px; color: var(--cem-ink); font-size: 13px; font-weight: 780; }

/* Hours / schedule */
.cem-stack-hours-shell > .stk-column-wrapper { padding: 30px !important; border-radius: 26px; color: #fff; background: linear-gradient(128deg,#0f2439,#1d456e 62%,#2c649b) !important; }
.cem-stack-hours-head { align-items: end !important; gap: 22px; margin-bottom: 22px; }
.cem-stack-hours-title { margin: 0 !important; color: #fff !important; font-size: clamp(34px,3.6vw,52px) !important; line-height: .98 !important; letter-spacing: -.045em; }
.cem-stack-hours-note { flex: 0 1 380px; margin: 0 !important; color: rgba(239,246,252,.7); font-size: 14px; line-height: 1.5; }
.cem-stack-hours-grid > .stk-row { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(260px,.6fr); gap: 14px; align-items: stretch; }
.cem-stack-hours-days > .stk-column-wrapper { padding: 0 !important; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; background: rgba(255,255,255,.07) !important; }
.cem-hours-table { width: 100%; }
.cem-hours-row { display: grid; grid-template-columns: 64px 1fr 1fr 128px; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.cem-hours-row:first-child { border-top: 0; }
.cem-hours-row--head { color: #bdd4ea; background: rgba(255,255,255,.07); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cem-status { justify-self: start; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.cem-status--ok { color: #d8f5e7; background: rgba(76,188,133,.18); }
.cem-status--warn { color: #ffedbd; background: rgba(226,171,45,.18); }
.cem-status--soft { color: #dbe7f4; background: rgba(255,255,255,.10); }
.cem-stack-hours-summary > .stk-column-wrapper { height: 100%; padding: 22px !important; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(255,255,255,.09) !important; }
.cem-stack-hours-summary-label { margin: 0 0 7px !important; color: #bdd4ea; font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.cem-stack-hours-summary-title { margin: 0 !important; color: #fff !important; font-size: 34px !important; }
.cem-stack-hours-summary p:not(.cem-stack-hours-summary-label) { color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.5; }
.cem-stack-hours-legend { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.cem-stack-hours-legend p { display: flex; align-items: center; gap: 9px; margin: 8px 0 0 !important; font-size: 13px !important; }
.cem-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.cem-dot--ok { background: #5bd09c; } .cem-dot--warn { background: #e5b74c; } .cem-dot--soft { background: #98abc0; }

/* Document matrix */
.cem-stack-docmatrix-shell > .stk-column-wrapper { padding: 30px !important; border: 1px solid var(--cem-line); border-radius: 24px; background: #fff !important; }
.cem-stack-docmatrix-title { margin: 0 !important; font-size: clamp(34px,3.5vw,50px) !important; line-height: .99 !important; letter-spacing: -.045em; }
.cem-stack-docmatrix-intro { margin: 12px 0 20px !important; max-width: 760px; color: var(--cem-muted); font-size: 15px; line-height: 1.55; }
.cem-docmatrix { border: 1px solid var(--cem-line); border-radius: 18px; overflow: hidden; }
.cem-docmatrix-row { display: grid; grid-template-columns: 1.35fr repeat(3,1fr); gap: 12px; align-items: center; min-height: 54px; padding: 11px 14px; border-top: 1px solid var(--cem-line); }
.cem-docmatrix-row:first-child { border-top: 0; }
.cem-docmatrix-row:nth-child(odd):not(.cem-docmatrix-row--head) { background: #f8fafc; }
.cem-docmatrix-row--head { min-height: 46px; color: var(--cem-muted); background: #edf3f8; font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.cem-docmatrix-row strong { font-size: 14px; }
.cem-mark { justify-self: start; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.cem-mark--yes { color: #176344; background: #e3f4eb; }
.cem-mark--maybe { color: #7c5a12; background: #fff1c9; }
.cem-mark--no { color: #667586; background: #edf1f5; }
.cem-stack-docmatrix-note { margin: 13px 0 0 !important; color: var(--cem-muted); font-size: 13px; }

/* Timeline */
.cem-stack-timeline-shell > .stk-column-wrapper { padding: 30px !important; border-radius: 26px; color: #fff; background: linear-gradient(135deg,#13293f,#1d4166) !important; }
.cem-stack-timeline-head { align-items: end !important; gap: 22px; margin-bottom: 22px; }
.cem-stack-timeline-title { margin: 0 !important; color: #fff !important; font-size: clamp(34px,3.6vw,52px) !important; line-height: .98 !important; letter-spacing: -.045em; }
.cem-stack-timeline-copy { flex: 0 1 410px; margin: 0 !important; color: rgba(237,245,252,.72); font-size: 14px; line-height: 1.5; }
.cem-stack-timeline-grid > .stk-row { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.cem-stack-timeline-step { position: relative; }
.cem-stack-timeline-step > .stk-column-wrapper { height: 100%; padding: 18px !important; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(255,255,255,.07) !important; }
.cem-stack-timeline-step:not(:last-child)::after { content: ""; position: absolute; top: 31px; right: -8px; width: 7px; height: 2px; background: rgba(255,255,255,.28); }
.cem-stack-timeline-no { width: 38px; height: 38px; margin: 0 0 22px !important; display: grid; place-items: center; border-radius: 11px; color: #fff; background: rgba(113,167,235,.24); font-size: 12px; font-weight: 900; }
.cem-stack-timeline-step h3 { margin: 0 !important; color: #fff !important; font-size: 19px !important; }
.cem-stack-timeline-step p:not(.cem-stack-timeline-no) { margin: 8px 0 0 !important; color: rgba(237,245,252,.72); font-size: 13px; line-height: 1.5; }

/* Metrics */
.cem-stack-metrics-shell > .stk-column-wrapper { padding: 30px !important; border: 1px solid var(--cem-line); border-radius: 24px; background: linear-gradient(145deg,#f8fafc,#eef4f8) !important; }
.cem-stack-metrics-title { margin: 0 !important; font-size: clamp(34px,3.5vw,50px) !important; line-height: .99 !important; letter-spacing: -.045em; }
.cem-stack-metrics-copy { margin: 12px 0 20px !important; max-width: 780px; color: var(--cem-muted); font-size: 15px; line-height: 1.55; }
.cem-stack-metrics-grid > .stk-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.cem-stack-metric > .stk-column-wrapper { height: 100%; padding: 18px !important; border: 1px solid var(--cem-line); border-radius: 16px; background: #fff !important; }
.cem-stack-metric-value { margin: 0 !important; color: var(--cem-primary) !important; font-size: 34px !important; line-height: 1 !important; letter-spacing: -.04em; }
.cem-stack-metric-label { min-height: 44px; margin: 9px 0 15px !important; color: var(--cem-muted); font-size: 13px; line-height: 1.4; }
.cem-meter { height: 8px; overflow: hidden; border-radius: 999px; background: #e9eff5; }
.cem-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#2d5f9f,#68a3df); }

/* Editorial split */
.cem-stack-editorial-shell > .stk-column-wrapper { padding: 30px !important; border-radius: 26px; color: #fff; background: linear-gradient(128deg,#10253b,#214c78) !important; }
.cem-stack-editorial-grid > .stk-row { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; }
.cem-stack-editorial-media > .stk-column-wrapper,
.cem-stack-editorial-copy > .stk-column-wrapper { background: transparent !important; }
.cem-stack-editorial-photo { margin: 0 !important; overflow: hidden; border-radius: 16px; background: #20384f; }
.cem-stack-editorial-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cem-stack-editorial-photo--main { aspect-ratio: 16 / 9; }
.cem-stack-editorial-mini { margin-top: 10px; }
.cem-stack-editorial-mini > .stk-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.cem-stack-editorial-minicard > .stk-column-wrapper { padding: 0 !important; background: transparent !important; }
.cem-stack-editorial-minicard .cem-stack-editorial-photo { aspect-ratio: 16 / 8.6; }
.cem-stack-editorial-title { margin: 0 !important; color: #fff !important; font-size: clamp(34px,3.5vw,50px) !important; line-height: .98 !important; letter-spacing: -.045em; }
.cem-stack-editorial-lead { margin: 13px 0 0 !important; color: rgba(238,245,252,.78); font-size: 15px; line-height: 1.55; }
.cem-stack-editorial-list { margin-top: 18px; }
.cem-stack-editorial-list p { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; margin: 0 !important; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.82); font-size: 14px; }
.cem-stack-editorial-list p:last-child { border-bottom: 1px solid rgba(255,255,255,.12); }
.cem-stack-editorial-list strong { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.11); font-size: 11px; }

@media (max-width: 1020px) {
  .cem-stack-timeline-grid > .stk-row { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .cem-stack-timeline-step:not(:last-child)::after { display: none; }
  .cem-stack-metrics-grid > .stk-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cem-stack-hours-grid > .stk-row { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .cem-stack-journal,
  .cem-stack-hours,
  .cem-stack-docmatrix,
  .cem-stack-timeline,
  .cem-stack-metrics,
  .cem-stack-editorial { width: 100%; margin: 18px 0 !important; max-width: 100%; overflow: hidden; }
  .cem-stack-journal-shell > .stk-column-wrapper,
  .cem-stack-hours-shell > .stk-column-wrapper,
  .cem-stack-docmatrix-shell > .stk-column-wrapper,
  .cem-stack-timeline-shell > .stk-column-wrapper,
  .cem-stack-metrics-shell > .stk-column-wrapper,
  .cem-stack-editorial-shell > .stk-column-wrapper { padding: 22px 14px !important; border-radius: 0; }
  .cem-stack-journal-head, .cem-stack-hours-head, .cem-stack-timeline-head { display: block !important; margin-bottom: 18px; }
  .cem-stack-journal-copy, .cem-stack-hours-note, .cem-stack-timeline-copy { margin-top: 10px !important; }
  .cem-stack-journal-grid > .stk-row,
  .cem-stack-editorial-grid > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-journal-photo--main { min-height: 0; aspect-ratio: 16/10; }
  .cem-stack-journal-main { position: relative; }
  .cem-stack-journal-sidegrid > .stk-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cem-stack-journal-wide .cem-stack-journal-photo { height: auto; aspect-ratio: 16/7; }
  .cem-stack-journal-tile .cem-stack-journal-photo { height: auto; aspect-ratio: 4/3; }
  .cem-hours-row { grid-template-columns: 48px 1fr 1fr; gap: 8px; padding: 11px 10px; }
  .cem-hours-row > :nth-child(4) { grid-column: 2 / -1; }
  .cem-hours-row--head > :nth-child(4) { display: none; }
  .cem-docmatrix { border: 0; overflow: visible; }
  .cem-docmatrix-row { grid-template-columns: 1fr; gap: 8px; margin-top: 9px; padding: 13px; border: 1px solid var(--cem-line) !important; border-radius: 14px; background: #fff !important; }
  .cem-docmatrix-row--head { display: none; }
  .cem-docmatrix-row strong { font-size: 15px; }
  .cem-docmatrix-row span { display: flex; align-items: center; justify-content: space-between; }
  .cem-docmatrix-row span::before { color: var(--cem-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
  .cem-docmatrix-row span:nth-child(2)::before { content: "Поиск участка"; }
  .cem-docmatrix-row span:nth-child(3)::before { content: "Захоронение"; }
  .cem-docmatrix-row span:nth-child(4)::before { content: "Благоустройство"; }
  .cem-mark { justify-self: stretch; }
  .cem-stack-timeline-grid > .stk-row { grid-template-columns: 1fr; gap: 8px; }
  .cem-stack-timeline-step > .stk-column-wrapper { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; padding: 15px !important; }
  .cem-stack-timeline-no { grid-row: 1 / span 2; margin: 0 !important; }
  .cem-stack-timeline-step h3 { align-self: end; }
  .cem-stack-timeline-step p:not(.cem-stack-timeline-no) { align-self: start; }
  .cem-stack-editorial-media { order: 2; }
  .cem-stack-editorial-copy { order: 1; }
}

@media (max-width: 430px) {
  .cem-stack-journal-sidegrid > .stk-row,
  .cem-stack-metrics-grid > .stk-row,
  .cem-stack-editorial-mini > .stk-row { grid-template-columns: 1fr; }
  .cem-stack-journal-wide { grid-column: auto; }
  .cem-stack-journal-tile .cem-stack-journal-photo,
  .cem-stack-journal-wide .cem-stack-journal-photo { aspect-ratio: 16/9; }
  .cem-hours-row { font-size: 13px; }
  .cem-stack-metric-label { min-height: 0; }
}

/* v1.6 table blocks remain visually editable as Core Table blocks inside Stackable. */
.cem-hours-table { margin: 0 !important; width: 100%; }
.cem-hours-table table { width: 100%; border-collapse: collapse; color: #fff; }
.cem-hours-table th, .cem-hours-table td { border: 0; border-top: 1px solid rgba(255,255,255,.10); padding: 12px 14px; text-align: left; font-size: 14px; }
.cem-hours-table thead th { border-top: 0; color: #bdd4ea; background: rgba(255,255,255,.07); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cem-hours-table tbody td:last-child { font-weight: 800; }
.cem-docmatrix { margin: 0 !important; border: 1px solid var(--cem-line); border-radius: 18px; overflow: hidden; }
.cem-docmatrix table { width: 100%; border-collapse: collapse; }
.cem-docmatrix th, .cem-docmatrix td { border: 0; border-top: 1px solid var(--cem-line); padding: 13px 14px; text-align: left; font-size: 13px; }
.cem-docmatrix thead th { border-top: 0; color: var(--cem-muted); background: #edf3f8; font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.cem-docmatrix tbody tr:nth-child(even) { background: #f8fafc; }
.cem-docmatrix tbody td:not(:first-child) { font-weight: 750; }
@media (max-width:780px) {
  .cem-hours-table table, .cem-hours-table thead, .cem-hours-table tbody, .cem-hours-table tr, .cem-hours-table th, .cem-hours-table td,
  .cem-docmatrix table, .cem-docmatrix thead, .cem-docmatrix tbody, .cem-docmatrix tr, .cem-docmatrix th, .cem-docmatrix td { display: block; width: 100%; }
  .cem-hours-table thead, .cem-docmatrix thead { display: none; }
  .cem-hours-table tbody tr { display: grid; grid-template-columns: 46px 1fr 1fr; gap: 4px 8px; padding: 11px 10px; border-top: 1px solid rgba(255,255,255,.10); }
  .cem-hours-table tbody tr:first-child { border-top: 0; }
  .cem-hours-table td { padding: 0; border: 0; font-size: 13px; }
  .cem-hours-table td:last-child { grid-column: 2 / -1; margin-top: 3px; color: #dcecff; }
  .cem-docmatrix { border: 0; overflow: visible; }
  .cem-docmatrix tbody tr { margin-top: 9px; padding: 13px; border: 1px solid var(--cem-line); border-radius: 14px; background: #fff !important; }
  .cem-docmatrix td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border: 0; font-size: 13px; }
  .cem-docmatrix td:first-child { display: block; padding: 0 0 9px; font-size: 15px; }
  .cem-docmatrix td:nth-child(2)::before { content: "Поиск участка"; }
  .cem-docmatrix td:nth-child(3)::before { content: "Захоронение"; }
  .cem-docmatrix td:nth-child(4)::before { content: "Благоустройство"; }
  .cem-docmatrix td:not(:first-child)::before { color: var(--cem-muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
}

/* --------------------------------------------------------------------------
   v1.6.1 — table layout stability hotfix
   Isolates the four table/data-grid families from Gutenberg + Stackable layout
   defaults and makes their mobile rendering deterministic.
   -------------------------------------------------------------------------- */

/* Shared containment: no Stackable/core wrapper may widen a table section. */
.cem-stack-costtable,
.cem-stack-compare,
.cem-stack-hours,
.cem-stack-docmatrix,
.cem-stack-costtable *,
.cem-stack-compare *,
.cem-stack-hours *,
.cem-stack-docmatrix * {
  box-sizing: border-box;
}
.cem-stack-costtable,
.cem-stack-compare,
.cem-stack-hours,
.cem-stack-docmatrix,
.cem-stack-costtable > .stk-row,
.cem-stack-compare > .stk-row,
.cem-stack-hours > .stk-row,
.cem-stack-docmatrix > .stk-row,
.cem-stack-costtable-shell,
.cem-stack-compare-shell,
.cem-stack-hours-shell,
.cem-stack-docmatrix-shell,
.cem-stack-costtable-shell > .stk-column-wrapper,
.cem-stack-compare-shell > .stk-column-wrapper,
.cem-stack-hours-shell > .stk-column-wrapper,
.cem-stack-docmatrix-shell > .stk-column-wrapper,
.cem-stack-costtable .stk-block-content,
.cem-stack-compare .stk-block-content,
.cem-stack-hours .stk-block-content,
.cem-stack-docmatrix .stk-block-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Cost calculation — fixed five-column desktop grid. */
.cem-stack-costtable .cem-stack-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.cem-stack-costtable .cem-stack-table-row {
  display: grid !important;
  grid-template-columns:
    minmax(190px, 1.15fr)
    minmax(260px, 1.8fr)
    minmax(90px, .52fr)
    minmax(100px, .62fr)
    minmax(105px, .68fr) !important;
  gap: 0 !important;
  width: 100%;
  min-width: 0;
}
.cem-stack-costtable .cem-stack-table-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
.cem-stack-costtable .cem-stack-table-description {
  white-space: normal;
}
.cem-stack-costtable .cem-stack-table-price,
.cem-stack-costtable .cem-stack-table-unit,
.cem-stack-costtable .cem-stack-table-status {
  white-space: nowrap;
}

/* Comparison — one stable grid definition, independent of Gutenberg grid. */
.cem-stack-compare .cem-stack-compare-planheads,
.cem-stack-compare .cem-stack-compare-row {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(145px, 1fr)) !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 0 !important;
}
.cem-stack-compare .cem-stack-compare-planheads > *,
.cem-stack-compare .cem-stack-compare-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Real Gutenberg tables — neutralize default figure/table sizing. */
.cem-stack-hours .wp-block-table,
.cem-stack-docmatrix .wp-block-table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
}
.cem-stack-hours .wp-block-table table,
.cem-stack-docmatrix .wp-block-table table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}
.cem-stack-hours .wp-block-table th,
.cem-stack-hours .wp-block-table td,
.cem-stack-docmatrix .wp-block-table th,
.cem-stack-docmatrix .wp-block-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  vertical-align: middle;
}
.cem-stack-hours .wp-block-table th:nth-child(1),
.cem-stack-hours .wp-block-table td:nth-child(1) { width: 9%; }
.cem-stack-hours .wp-block-table th:nth-child(2),
.cem-stack-hours .wp-block-table td:nth-child(2) { width: 34%; }
.cem-stack-hours .wp-block-table th:nth-child(3),
.cem-stack-hours .wp-block-table td:nth-child(3) { width: 34%; }
.cem-stack-hours .wp-block-table th:nth-child(4),
.cem-stack-hours .wp-block-table td:nth-child(4) { width: 23%; }
.cem-stack-docmatrix .wp-block-table th:nth-child(1),
.cem-stack-docmatrix .wp-block-table td:nth-child(1) { width: 34%; }
.cem-stack-docmatrix .wp-block-table th:nth-child(n+2),
.cem-stack-docmatrix .wp-block-table td:nth-child(n+2) { width: 22%; }

@media (max-width: 900px) {
  .cem-stack-costtable .cem-stack-table-row {
    grid-template-columns:
      minmax(160px, 1.05fr)
      minmax(210px, 1.55fr)
      minmax(78px, .52fr)
      minmax(90px, .62fr)
      minmax(95px, .68fr) !important;
  }
  .cem-stack-compare .cem-stack-compare-planheads,
  .cem-stack-compare .cem-stack-compare-row {
    grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(120px, 1fr)) !important;
  }
}

@media (max-width: 780px) {
  /* All four sections become edge-safe before individual mobile layouts. */
  .cem-stack-costtable,
  .cem-stack-compare,
  .cem-stack-hours,
  .cem-stack-docmatrix {
    max-width: 100vw;
    overflow-x: clip;
  }

  /* Cost rows: title+price, description, then unit+status. No spanning price. */
  .cem-stack-costtable .cem-stack-table-row--head {
    display: none !important;
  }
  .cem-stack-costtable .cem-stack-table-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto auto !important;
    gap: 5px 12px !important;
    width: 100%;
    padding: 13px 14px !important;
  }
  .cem-stack-costtable .cem-stack-table-row > * {
    padding: 0 !important;
    border: 0 !important;
    min-width: 0;
  }
  .cem-stack-costtable .cem-stack-table-name {
    grid-column: 1;
    grid-row: 1;
    padding-right: 6px !important;
  }
  .cem-stack-costtable .cem-stack-table-price {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    text-align: right;
    padding-left: 6px !important;
  }
  .cem-stack-costtable .cem-stack-table-description {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-right: 0 !important;
    color: var(--cem-muted);
    font-size: 13.5px !important;
    line-height: 1.45;
  }
  .cem-stack-costtable .cem-stack-table-unit {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
    font-size: 12.5px !important;
  }
  .cem-stack-costtable .cem-stack-table-status {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
    justify-self: end;
    text-align: right;
  }
  .cem-stack-costtable .cem-stack-table-status span {
    white-space: nowrap;
  }

  /* Comparison cards: feature label on top, three equal choices below. */
  .cem-stack-compare .cem-stack-compare-planheads {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    gap: 6px !important;
  }
  .cem-stack-compare .cem-stack-compare-corner {
    display: none !important;
  }
  .cem-stack-compare .cem-stack-compare-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    gap: 6px !important;
    width: 100%;
    padding: 11px 8px !important;
  }
  .cem-stack-compare .cem-stack-compare-row > * {
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
  }
  .cem-stack-compare .cem-stack-compare-feature {
    grid-column: 1 / -1 !important;
    width: 100%;
    margin: 0 0 5px !important;
  }
  .cem-stack-compare .cem-stack-compare-option {
    width: 100%;
    min-width: 0;
  }

  /* Core tables: deterministic card conversion. */
  .cem-stack-hours .wp-block-table,
  .cem-stack-docmatrix .wp-block-table {
    overflow: visible;
  }
  .cem-stack-hours .wp-block-table table,
  .cem-stack-hours .wp-block-table thead,
  .cem-stack-hours .wp-block-table tbody,
  .cem-stack-hours .wp-block-table tr,
  .cem-stack-hours .wp-block-table th,
  .cem-stack-hours .wp-block-table td,
  .cem-stack-docmatrix .wp-block-table table,
  .cem-stack-docmatrix .wp-block-table thead,
  .cem-stack-docmatrix .wp-block-table tbody,
  .cem-stack-docmatrix .wp-block-table tr,
  .cem-stack-docmatrix .wp-block-table th,
  .cem-stack-docmatrix .wp-block-table td {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .cem-stack-hours .wp-block-table table,
  .cem-stack-hours .wp-block-table tbody,
  .cem-stack-docmatrix .wp-block-table table,
  .cem-stack-docmatrix .wp-block-table tbody {
    display: block !important;
    width: 100% !important;
  }
  .cem-stack-hours .wp-block-table thead,
  .cem-stack-docmatrix .wp-block-table thead {
    display: none !important;
  }

  .cem-stack-hours .wp-block-table tbody tr {
    display: grid !important;
    grid-template-columns: 48px minmax(0,1fr) minmax(0,1fr) !important;
    gap: 5px 9px !important;
    width: 100% !important;
    padding: 12px 11px !important;
  }
  .cem-stack-hours .wp-block-table td {
    display: block !important;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    min-width: 0;
    font-size: 13px;
    white-space: normal;
  }
  .cem-stack-hours .wp-block-table td:last-child {
    grid-column: 2 / -1;
    margin-top: 2px;
  }

  .cem-stack-docmatrix .wp-block-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    margin: 0 0 9px !important;
    padding: 13px !important;
  }
  .cem-stack-docmatrix .wp-block-table td {
    display: flex !important;
    width: 100% !important;
    min-width: 0;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0 !important;
    border: 0 !important;
    white-space: normal;
  }
  .cem-stack-docmatrix .wp-block-table td:first-child {
    display: block !important;
    padding: 0 0 9px !important;
  }
}

@media (max-width: 420px) {
  .cem-stack-costtable .cem-stack-table-row {
    gap: 5px 8px !important;
    padding: 12px !important;
  }
  .cem-stack-costtable .cem-stack-table-name strong {
    font-size: 14px;
  }
  .cem-stack-costtable .cem-stack-table-price strong {
    font-size: 14.5px;
  }
  .cem-stack-compare .cem-stack-compare-planheads {
    gap: 5px !important;
  }
  .cem-stack-compare .cem-stack-planhead {
    min-width: 0;
  }
  .cem-stack-compare .cem-stack-plan-price {
    font-size: 17px !important;
  }
  .cem-stack-hours .wp-block-table tbody tr {
    grid-template-columns: 40px minmax(0,1fr) minmax(0,1fr) !important;
    gap: 5px 7px !important;
  }
  .cem-stack-docmatrix .wp-block-table td {
    gap: 8px;
  }
}

/* v1.6.1 final mobile table ordering + schedule card labels */
@media (max-width: 780px) {
  /* Keep the header rule after the generic row rule so !important cannot revive it. */
  .cem-stack-costtable .cem-stack-table-row--head {
    display: none !important;
  }

  .cem-stack-hours .wp-block-table thead,
  .cem-stack-docmatrix .wp-block-table thead {
    display: none !important;
  }

  .cem-stack-hours .wp-block-table tbody tr {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 8px 12px !important;
    padding: 13px 12px !important;
  }
  .cem-stack-hours .wp-block-table td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 7px !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    color: #fff;
    font-size: 15px;
    font-weight: 850;
  }
  .cem-stack-hours .wp-block-table td:nth-child(2),
  .cem-stack-hours .wp-block-table td:nth-child(3) {
    grid-column: auto;
    margin: 0;
    color: #fff;
    font-size: 14px;
  }
  .cem-stack-hours .wp-block-table td:nth-child(2)::before,
  .cem-stack-hours .wp-block-table td:nth-child(3)::before {
    display: block;
    margin-bottom: 3px;
    color: rgba(219,234,248,.58);
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .cem-stack-hours .wp-block-table td:nth-child(2)::before { content: "Территория"; }
  .cem-stack-hours .wp-block-table td:nth-child(3)::before { content: "Справка"; }
  .cem-stack-hours .wp-block-table td:last-child {
    grid-column: 1 / -1;
    margin-top: 1px;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255,255,255,.08) !important;
    color: #dcecff;
    font-size: 13px;
    font-weight: 750;
  }
  .cem-stack-hours .wp-block-table td:last-child::before {
    content: "Приём: ";
    color: rgba(219,234,248,.58);
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
}

/* --------------------------------------------------------------------------
   v1.6.2 — Mobile process timeline stabilization
   Stackable wraps actual inner blocks inside .stk-block-content, so the mobile
   grid must be applied there rather than to .stk-column-wrapper.
   -------------------------------------------------------------------------- */
@media (max-width: 780px) {
  .cem-stack-timeline-grid,
  .cem-stack-timeline-grid > .stk-row,
  .cem-stack-timeline-step,
  .cem-stack-timeline-step > .stk-column-wrapper,
  .cem-stack-timeline-step > .stk-column-wrapper > .stk-block-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .cem-stack-timeline-grid > .stk-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .cem-stack-timeline-step > .stk-column-wrapper {
    display: block !important;
    height: auto !important;
    padding: 15px !important;
  }

  .cem-stack-timeline-step > .stk-column-wrapper > .stk-block-content {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 12px !important;
    row-gap: 4px !important;
    align-items: start !important;
  }

  .cem-stack-timeline-step > .stk-column-wrapper > .stk-block-content > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .cem-stack-timeline-no {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    align-self: start !important;
  }

  .cem-stack-timeline-step h3 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1.18 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .cem-stack-timeline-step p:not(.cem-stack-timeline-no) {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    margin: 0 !important;
    font-size: 14.5px !important;
    line-height: 1.45 !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }
}

@media (max-width: 360px) {
  .cem-stack-timeline-step > .stk-column-wrapper {
    padding: 14px 12px !important;
  }
  .cem-stack-timeline-step > .stk-column-wrapper > .stk-block-content {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    column-gap: 10px !important;
  }
  .cem-stack-timeline-no {
    width: 36px !important;
    height: 36px !important;
  }
  .cem-stack-timeline-step h3 { font-size: 17px !important; }
  .cem-stack-timeline-step p:not(.cem-stack-timeline-no) { font-size: 14px !important; }
}

/* --------------------------------------------------------------------------
   v1.6.3 — Step-by-step blocks mobile hardening
   Live-page audit showed two independent process blocks: .cem-stack-route and
   .cem-stack-timeline. Keep their mobile geometry isolated from Stackable's
   flex-basis rules and place the actual content grid on .stk-block-content.
   -------------------------------------------------------------------------- */
@media (max-width: 780px) {
  .cem-stack-route,
  .cem-stack-route > .stk-row,
  .cem-stack-route-shell,
  .cem-stack-route-shell > .stk-column-wrapper,
  .cem-stack-route-grid,
  .cem-stack-route-grid > .stk-row,
  .cem-stack-route-step,
  .cem-stack-route-step > .stk-column-wrapper,
  .cem-stack-route-step > .stk-column-wrapper > .stk-block-content,
  .cem-stack-timeline,
  .cem-stack-timeline > .stk-row,
  .cem-stack-timeline-shell,
  .cem-stack-timeline-shell > .stk-column-wrapper,
  .cem-stack-timeline-grid,
  .cem-stack-timeline-grid > .stk-row,
  .cem-stack-timeline-step,
  .cem-stack-timeline-step > .stk-column-wrapper,
  .cem-stack-timeline-step > .stk-column-wrapper > .stk-block-content {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-basis: auto !important;
  }

  .cem-stack-route-grid > .stk-row,
  .cem-stack-timeline-grid > .stk-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .cem-stack-route-step > .stk-column-wrapper,
  .cem-stack-timeline-step > .stk-column-wrapper {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 15px !important;
  }

  .cem-stack-route-step > .stk-column-wrapper > .stk-block-content,
  .cem-stack-timeline-step > .stk-column-wrapper > .stk-block-content {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 12px !important;
    row-gap: 4px !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .cem-stack-route-step > .stk-column-wrapper > .stk-block-content > *,
  .cem-stack-timeline-step > .stk-column-wrapper > .stk-block-content > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .cem-stack-route-no,
  .cem-stack-timeline-no {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    align-self: start !important;
  }

  .cem-stack-route-step h3,
  .cem-stack-timeline-step h3 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    align-self: end !important;
    font-size: 18px !important;
    line-height: 1.18 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }

  .cem-stack-route-step p:not(.cem-stack-route-no),
  .cem-stack-timeline-step p:not(.cem-stack-timeline-no) {
    grid-column: 2 !important;
    grid-row: 2 !important;
    margin: 0 !important;
    align-self: start !important;
    font-size: 14.5px !important;
    line-height: 1.45 !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  .cem-stack-timeline-step:not(:last-child)::after {
    display: none !important;
  }
}

@media (max-width: 360px) {
  .cem-stack-route-step > .stk-column-wrapper,
  .cem-stack-timeline-step > .stk-column-wrapper {
    padding: 14px 12px !important;
  }

  .cem-stack-route-step > .stk-column-wrapper > .stk-block-content,
  .cem-stack-timeline-step > .stk-column-wrapper > .stk-block-content {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    column-gap: 10px !important;
  }

  .cem-stack-route-no,
  .cem-stack-timeline-no {
    width: 36px !important;
    height: 36px !important;
  }

  .cem-stack-route-step h3,
  .cem-stack-timeline-step h3 {
    font-size: 17px !important;
  }

  .cem-stack-route-step p:not(.cem-stack-route-no),
  .cem-stack-timeline-step p:not(.cem-stack-timeline-no) {
    font-size: 14px !important;
  }
}

/* --------------------------------------------------------------------------
   v1.6.4 — UX polish pass
   Visual-only refinement: rhythm, shared boundaries, readable small type,
   consistent image radii and calmer data presentation. No content migration.
   -------------------------------------------------------------------------- */
:root {
  --cem-photo-radius: 16px;
  --cem-photo-radius-small: 12px;
  --cem-demo-gap: 24px;
}

/* One visual rail for all demo sections. */
.cemetery-stackable-showcase,
.cem-stack-facts,
.cem-stack-hours,
.cem-stack-pricing,
.cem-stack-journal,
.cem-stack-docs,
.cem-stack-docmatrix,
.cem-stack-costtable,
.cem-stack-orient,
.cem-stack-route,
.cem-stack-timeline,
.cem-stack-chart,
.cem-stack-territory,
.cem-stack-servicelist,
.cem-stack-infra,
.cem-stack-hall,
.cem-stack-transportprices,
.cem-stack-fleet,
.cem-stack-editorial,
.cem-stack-compare,
.cem-stack-dashboard,
.cem-stack-metrics,
.cem-stack-links,
.cem-stack-contact,
.cem-stack-faq {
  width: min(calc(100% - 40px), var(--cem-container)) !important;
  max-width: var(--cem-container) !important;
  margin-top: var(--cem-demo-gap) !important;
  margin-bottom: var(--cem-demo-gap) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Core introduction keeps the same left/right rail as Stackable sections. */
.cemetery-section {
  padding-top: 46px;
  padding-bottom: 46px;
}
.cemetery-section-head {
  margin-bottom: 18px;
}

/* Shared large-card radius. Keep mobile full-bleed rules below intact. */
@media (min-width: 721px) {
  .cem-stack-facts-shell > .stk-column-wrapper,
  .cem-stack-hours-shell > .stk-column-wrapper,
  .cem-stack-pricing-shell > .stk-column-wrapper,
  .cem-stack-journal-shell > .stk-column-wrapper,
  .cem-stack-docs-shell > .stk-column-wrapper,
  .cem-stack-docmatrix-shell > .stk-column-wrapper,
  .cem-stack-costtable-shell > .stk-column-wrapper,
  .cem-stack-orient-shell > .stk-column-wrapper,
  .cem-stack-route-shell > .stk-column-wrapper,
  .cem-stack-timeline-shell > .stk-column-wrapper,
  .cem-stack-chart-shell > .stk-column-wrapper,
  .cem-stack-servicelist-shell > .stk-column-wrapper,
  .cem-stack-infra-shell > .stk-column-wrapper,
  .cem-stack-hall-shell > .stk-column-wrapper,
  .cem-stack-transportprices-shell > .stk-column-wrapper,
  .cem-stack-fleet-shell > .stk-column-wrapper,
  .cem-stack-editorial-shell > .stk-column-wrapper,
  .cem-stack-compare-shell > .stk-column-wrapper,
  .cem-stack-dashboard-shell > .stk-column-wrapper,
  .cem-stack-metrics-shell > .stk-column-wrapper,
  .cem-stack-links-shell > .stk-column-wrapper,
  .cem-stack-contact-shell > .stk-column-wrapper,
  .cem-stack-faq-shell > .stk-column-wrapper {
    border-radius: 22px;
  }
}

/* Consistent photographic language: 16px large media, 12px thumbnails. */
.cem-stack-orient-media,
.cem-stack-hall-photo-media,
.cem-stack-fleet-mainphoto,
.cem-stack-infra-mainphoto,
.cem-stack-journal-photo,
.cem-stack-editorial-photo,
.cem-stack-faq-media > .stk-column-wrapper {
  border-radius: var(--cem-photo-radius) !important;
}
.cem-stack-fleet-miniphoto,
.cem-stack-infra-miniphoto,
.cem-stack-hall-gallery-grid .cem-stack-hall-photo-media,
.cem-stack-editorial-minicard .cem-stack-editorial-photo {
  border-radius: var(--cem-photo-radius-small) !important;
}
@media (min-width: 721px) {
  .cem-stack-territory-imagecol > .stk-column-wrapper {
    border-radius: 18px !important;
  }
}

/* Do not use tiny body copy to create density. */
.cem-stack-fact-card p:not(.cem-stack-fact-label),
.cem-stack-docs-list p,
.cem-stack-route-step p:not(.cem-stack-route-no),
.cem-stack-timeline-step p:not(.cem-stack-timeline-no),
.cem-stack-infra-note p:not(.cem-stack-infra-note-no),
.cem-stack-fleet-stat p:not(.cem-stack-fleet-stat-value),
.cem-stack-hall-fact p:not(.cem-stack-hall-fact-label),
.cem-stack-dashboard-list p,
.cem-stack-hours-note,
.cem-stack-hours-summary p:not(.cem-stack-hours-summary-label),
.cem-stack-editorial-list p,
.cem-stack-service-copy,
.cem-stack-contact-hours {
  font-size: 14.5px !important;
  line-height: 1.5 !important;
}

/* Labels can be smaller, but remain comfortably readable. */
.cem-stack-blue-kicker,
.cem-stack-contact-kicker,
.cem-stack-info-label,
.cem-stack-hall-fact-label,
.cem-stack-fleet-stat-value,
.cem-stack-hours-summary-label,
.cem-stack-plan-kicker,
.cem-stack-table-summary-label,
.cem-stack-journal-caption-label,
.cem-stack-docmatrix th,
.cem-hours-table thead th,
.cem-stack-hours .wp-block-table thead th,
.cem-stack-docmatrix .wp-block-table thead th {
  font-size: 12.5px !important;
}
.cem-stack-plan-badge {
  font-size: 11px !important;
  letter-spacing: .055em;
}
.cem-stack-compare-option small,
.cem-stack-compare-row--footer small,
.cem-stack-table-summary-note,
.cem-stack-table-total-note,
.cem-stack-docmatrix-note,
.cem-stack-demo-disclaimer,
.cem-stack-demo-disclaimer--dark {
  font-size: 12.5px !important;
  line-height: 1.4 !important;
}

/* Hero: slightly stronger foreground contrast and calmer desktop separation. */
.cem-stack-hero-shell > .stk-column-wrapper::after {
  background: linear-gradient(90deg, rgba(8,20,33,.91) 0%, rgba(8,20,33,.72) 43%, rgba(8,20,33,.30) 72%, rgba(8,20,33,.10) 100%);
}
@media (min-width: 1000px) {
  .cem-stack-hero-grid > .stk-row {
    gap: clamp(52px, 7vw, 104px);
  }
  .cem-stack-hero-text {
    color: rgba(248,251,254,.90);
  }
  .cem-stack-hero-infocol > .stk-column-wrapper {
    background: rgba(14,32,50,.64) !important;
  }
}

/* Cost/data tables: stronger grouping, less spreadsheet feel. */
.cem-stack-costtable .cem-stack-table-category {
  position: relative;
  border-left: 3px solid rgba(45,95,159,.55);
  background: linear-gradient(90deg,#eaf2f8,#f5f8fb);
}
.cem-stack-costtable .cem-stack-table-row:not(.cem-stack-table-row--head):nth-child(even) {
  background: #fbfcfd;
}
.cem-stack-docmatrix .wp-block-table tbody tr:nth-child(even) {
  background: #f8fafc;
}
.cem-stack-docmatrix .wp-block-table tbody tr:hover {
  background: #f1f6fa;
}
.cem-stack-hours .wp-block-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,.028);
}

/* Comparison matrix: retain dark identity, but reduce the “solid blue slab” feel. */
.cem-stack-compare-shell > .stk-column-wrapper {
  background:
    radial-gradient(circle at 88% 0%, rgba(111,176,235,.20), transparent 32%),
    linear-gradient(128deg,#132b43 0%,#1a3b5c 56%,#24517c 100%) !important;
}
.cem-stack-compare-table {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.025);
}
.cem-stack-compare-row {
  border-top: 1px solid rgba(255,255,255,.085);
  background: rgba(255,255,255,.012);
}
.cem-stack-compare-row:first-child {
  border-top: 0;
}
.cem-stack-compare-row:nth-child(even) {
  background: rgba(255,255,255,.035);
}
.cem-stack-compare-row > *:nth-child(3) {
  background: rgba(119,178,232,.12);
}
.cem-stack-compare-feature {
  color: rgba(247,251,255,.94) !important;
}
.cem-stack-compare-option {
  color: rgba(255,255,255,.84) !important;
}
.cem-stack-compare-row--footer {
  background: rgba(255,255,255,.085) !important;
}

/* Keep demo blocks dense and consistent on phones. */
@media (max-width: 720px) {
  .cemetery-stackable-showcase,
  .cem-stack-facts,
  .cem-stack-hours,
  .cem-stack-pricing,
  .cem-stack-journal,
  .cem-stack-docs,
  .cem-stack-docmatrix,
  .cem-stack-costtable,
  .cem-stack-orient,
  .cem-stack-route,
  .cem-stack-timeline,
  .cem-stack-chart,
  .cem-stack-territory,
  .cem-stack-servicelist,
  .cem-stack-infra,
  .cem-stack-hall,
  .cem-stack-transportprices,
  .cem-stack-fleet,
  .cem-stack-editorial,
  .cem-stack-compare,
  .cem-stack-dashboard,
  .cem-stack-metrics,
  .cem-stack-links,
  .cem-stack-contact,
  .cem-stack-faq {
    width: 100% !important;
    max-width: none !important;
    margin-top: 16px !important;
    margin-bottom: 16px !important;
  }
  .cemetery-section {
    padding-top: 34px;
    padding-bottom: 34px;
  }
  .cem-stack-compare-option small,
  .cem-stack-compare-row--footer small {
    font-size: 12px !important;
  }
}

/* v1.6.4 safeguard refinements after the full-page polish review. */
.cem-stack-journal-main .cem-stack-journal-photo {
  border-radius: var(--cem-photo-radius) !important;
}
.cem-stack-journal-tile .cem-stack-journal-photo,
.cem-stack-journal-wide .cem-stack-journal-photo {
  border-radius: 0 !important;
}
.cem-stack-hours .wp-block-table th:first-child,
.cem-stack-hours .wp-block-table td:first-child {
  word-break: normal !important;
  overflow-wrap: normal !important;
}
.cem-stack-hours .wp-block-table th:first-child {
  white-space: nowrap;
}

@media (min-width: 781px) {
  .cem-stack-hours .wp-block-table th:nth-child(1),
  .cem-stack-hours .wp-block-table td:nth-child(1) { width: 11%; }
  .cem-stack-hours .wp-block-table th:nth-child(2),
  .cem-stack-hours .wp-block-table td:nth-child(2) { width: 33%; }
  .cem-stack-hours .wp-block-table th:nth-child(3),
  .cem-stack-hours .wp-block-table td:nth-child(3) { width: 33%; }
  .cem-stack-hours .wp-block-table th:nth-child(4),
  .cem-stack-hours .wp-block-table td:nth-child(4) { width: 23%; }
}

@media (max-width: 720px) {
  .cem-stack-plan-kicker {
    font-size: 11.5px !important;
    letter-spacing: .035em !important;
  }
}
@media (max-width: 370px) {
  .cem-stack-plan-kicker { font-size: 11px !important; }
}

/* --------------------------------------------------------------------------
   Stackable vs Kadence A/B laboratory (v1.7.0)
   -------------------------------------------------------------------------- */
.cem-abtest-section {
  width: min(calc(100% - 40px), var(--cem-container));
  margin: 34px auto !important;
  padding: 30px;
  border: 1px solid var(--cem-line);
  border-radius: 26px;
  background: linear-gradient(180deg, #f8fbfd 0%, #f2f6fa 100%);
  box-shadow: 0 14px 38px rgba(18, 34, 58, .055);
}
.cem-abtest-head {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(280px, .68fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}
.cem-abtest-title {
  max-width: 820px;
  margin: 0 !important;
  font-size: clamp(34px, 4vw, 52px) !important;
  line-height: .98 !important;
  letter-spacing: -.045em;
}
.cem-abtest-intro {
  margin: 0 !important;
  color: var(--cem-muted);
  font-size: 15px;
  line-height: 1.6;
}
.cem-abtest-variant {
  min-width: 0;
  padding: 18px;
  border: 1px solid #d8e3ec;
  border-radius: 20px;
  background: #fff;
}
.cem-abtest-variant + .cem-abtest-variant { margin-top: 14px; }
.cem-abtest-variant--stackable { box-shadow: inset 4px 0 0 #2d5f9f; }
.cem-abtest-variant--kadence { box-shadow: inset 4px 0 0 #8769e8; }
.cem-abtest-variant-head {
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5ebf1;
}
.cem-abtest-provider,
.cem-abtest-method { margin: 0 !important; }
.cem-abtest-provider {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: #2d5f9f;
  font-size: 12.5px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cem-abtest-provider--kadence { background: #7057c9; }
.cem-abtest-method {
  color: #728095;
  font-size: 13px;
  font-weight: 650;
}

/* A — Stackable: deliberately hand-built photo mosaic. */
.cem-ab-stack-gallery,
.cem-ab-stack-gallery-shell,
.cem-ab-stack-gallery-grid,
.cem-ab-stack-gallery-grid > .stk-row,
.cem-ab-stack-photo,
.cem-ab-stack-photo > .stk-column-wrapper,
.cem-ab-stack-photo .stk-block-content { min-width: 0 !important; width: 100% !important; max-width: 100% !important; }
.cem-ab-stack-gallery-grid > .stk-row {
  display: grid !important;
  grid-template-columns: 1.3fr .85fr .85fr !important;
  grid-auto-rows: 185px;
  gap: 10px !important;
}
.cem-ab-stack-photo:nth-child(1) { grid-row: span 2; }
.cem-ab-stack-photo:nth-child(6) { grid-column: span 2; }
.cem-ab-stack-photo-media {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  overflow: hidden;
  border-radius: 16px;
  background: #e8eef4;
}
.cem-ab-stack-photo-media img { width: 100%; height: 100%; object-fit: cover; }
.cem-ab-stack-photo-media figcaption {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  margin: 0 !important;
  padding: 7px 9px;
  border-radius: 9px;
  color: #fff;
  background: rgba(12, 30, 48, .72);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

/* B — Kadence: let Advanced Gallery keep its native grid / responsive behavior. */
.cem-abtest-variant--kadence .kb-gallery-wrap-id-k170gallery01,
.cem-abtest-variant--kadence .wp-block-kadence-advancedgallery {
  width: 100%;
  max-width: none;
  margin: 0;
}
.cem-abtest-variant--kadence .kb-gallery-id-k170gallery01 .kadence-blocks-gallery-item__caption {
  font-size: 12.5px;
  line-height: 1.3;
}

/* A — Stackable: generic columns used as a data grid. */
.cem-ab-stack-table,
.cem-ab-stack-table-shell,
.cem-ab-stack-data-row,
.cem-ab-stack-data-row > .stk-row,
.cem-ab-stack-data-cell,
.cem-ab-stack-data-cell > .stk-column-wrapper,
.cem-ab-stack-data-cell .stk-block-content { min-width: 0 !important; width: 100% !important; max-width: 100% !important; }
.cem-ab-stack-data-row > .stk-row {
  display: grid !important;
  grid-template-columns: minmax(180px, 1.15fr) minmax(110px, .65fr) minmax(110px, .65fr) minmax(230px, 1.35fr) !important;
  gap: 0 !important;
  align-items: stretch;
}
.cem-ab-stack-data-cell > .stk-column-wrapper {
  height: 100%;
  padding: 12px 14px !important;
  border-right: 1px solid #dfe7ee;
  border-bottom: 1px solid #dfe7ee;
  background: #fff !important;
}
.cem-ab-stack-data-cell:first-child > .stk-column-wrapper { border-left: 1px solid #dfe7ee; }
.cem-ab-stack-data-row--head .cem-ab-stack-data-cell > .stk-column-wrapper {
  color: #fff;
  border-color: rgba(255,255,255,.13);
  background: #173554 !important;
}
.cem-ab-stack-data-row--head .cem-ab-stack-data-cell:first-child > .stk-column-wrapper { border-radius: 13px 0 0 0; }
.cem-ab-stack-data-row--head .cem-ab-stack-data-cell:last-child > .stk-column-wrapper { border-radius: 0 13px 0 0; }
.cem-ab-stack-data-row:last-child .cem-ab-stack-data-cell:first-child > .stk-column-wrapper { border-radius: 0 0 0 13px; }
.cem-ab-stack-data-row:last-child .cem-ab-stack-data-cell:last-child > .stk-column-wrapper { border-radius: 0 0 13px 0; }
.cem-ab-stack-data-row:nth-of-type(odd):not(.cem-ab-stack-data-row--head) .cem-ab-stack-data-cell > .stk-column-wrapper { background: #f6f9fb !important; }
.cem-ab-stack-data-cell p { margin: 0 !important; font-size: 14px; line-height: 1.45; }

/* B — Kadence Table (Adv): mostly native attributes, only integration shell here. */
.cem-abtest-variant--kadence .kb-table-container.cem-ab-kadence-table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  border: 1px solid #dbe4ec;
  border-radius: 14px;
  background: #fff;
}
.cem-abtest-variant--kadence .cem-ab-kadence-table .kb-table {
  min-width: 760px;
}
.cem-abtest-variant--kadence .cem-ab-kadence-table caption {
  padding: 10px 12px 8px;
  color: #718095;
  font-size: 12px;
  line-height: 1.4;
  caption-side: bottom;
}
.cem-abtest-variant--kadence .cem-ab-kadence-table p { margin: 0 !important; }

@media (max-width: 900px) {
  .cem-abtest-head { grid-template-columns: 1fr; gap: 10px; }
  .cem-ab-stack-gallery-grid > .stk-row { grid-template-columns: 1fr 1fr !important; grid-auto-rows: 190px; }
  .cem-ab-stack-photo:nth-child(1) { grid-row: span 1; }
  .cem-ab-stack-photo:nth-child(6) { grid-column: span 1; }
}

@media (max-width: 620px) {
  .cem-abtest-section {
    width: 100%;
    margin: 20px 0 !important;
    padding: 18px 14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .cem-abtest-title { font-size: clamp(30px, 10vw, 40px) !important; }
  .cem-abtest-variant { padding: 12px; border-radius: 16px; }
  .cem-abtest-variant-head { align-items: flex-start !important; }
  .cem-abtest-method { width: 100%; }
  .cem-ab-stack-gallery-grid > .stk-row { grid-template-columns: 1fr !important; grid-auto-rows: 230px; }
  .cem-ab-stack-photo:nth-child(n) { grid-row: auto; grid-column: auto; }

  .cem-ab-stack-data-row--head { display: none !important; }
  .cem-ab-stack-data-row { margin-bottom: 9px !important; }
  .cem-ab-stack-data-row > .stk-row {
    grid-template-columns: 1fr 1fr !important;
    overflow: hidden;
    border: 1px solid #dce5ed;
    border-radius: 13px;
  }
  .cem-ab-stack-data-cell > .stk-column-wrapper {
    padding: 10px 11px !important;
    border: 0 !important;
    border-bottom: 1px solid #e2e9ef !important;
  }
  .cem-ab-stack-data-cell:nth-child(1),
  .cem-ab-stack-data-cell:nth-child(4) { grid-column: 1 / -1; }
  .cem-ab-stack-data-cell:nth-child(2) > .stk-column-wrapper { border-right: 1px solid #e2e9ef !important; }
  .cem-ab-stack-data-cell:nth-child(4) > .stk-column-wrapper { border-bottom: 0 !important; }
  .cem-ab-stack-data-cell p { font-size: 13.5px; }
  .cem-ab-stack-data-cell:nth-child(2) p::before,
  .cem-ab-stack-data-cell:nth-child(3) p::before,
  .cem-ab-stack-data-cell:nth-child(4) p::before {
    display: block;
    margin-bottom: 3px;
    color: #6a788a;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .cem-ab-stack-data-cell:nth-child(2) p::before { content: "Базовый"; }
  .cem-ab-stack-data-cell:nth-child(3) p::before { content: "Расширенный"; }
  .cem-ab-stack-data-cell:nth-child(4) p::before { content: "Комментарий"; }
}

/* v1.7 gallery grid containment: Stackable's intrinsic inner wrappers must obey
   the CSS grid track height, otherwise wide images can enlarge individual cells. */
.cem-ab-stack-gallery-grid > .stk-row > .cem-ab-stack-photo,
.cem-ab-stack-photo > .stk-column-wrapper,
.cem-ab-stack-photo > .stk-column-wrapper > .stk-block-content {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden;
}
.cem-ab-kadence-scrollhint {
  display: none;
  margin: 0 0 8px !important;
  color: #6f7e91;
  font-size: 12.5px;
  font-weight: 700;
}
@media (max-width: 620px) {
  .cem-ab-kadence-scrollhint { display: block; }
}

/* --------------------------------------------------------------------------
   Official library showcase (v1.8.0)
   Four adapted first-party designs: Stackable x2 + Kadence x2.
   -------------------------------------------------------------------------- */
.cem-library-section {
  width: min(calc(100% - 40px), var(--cem-container));
  margin: 28px auto !important;
  min-width: 0;
}
.cem-library-labelrow {
  gap: 12px;
  margin: 0 0 12px !important;
  padding: 0 4px;
  align-items: center;
}
.cem-library-provider,
.cem-library-source {
  margin: 0 !important;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cem-library-provider {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 7px 11px;
  border-radius: 999px;
}
.cem-library-provider--stackable { color: #234b78; background: #e7f1fb; }
.cem-library-provider--kadence { color: #3d376d; background: #eeeafa; }
.cem-library-source { color: #738195; }
.cem-library-labelrow--dark .cem-library-source { color: rgba(226,238,248,.72); }

/* Stackable official Feature sample: Overlap Background 1. */
.cem-library-feature {
  position: relative;
  overflow: visible;
  border-radius: 26px;
  background: #eaf1f7;
}
.cem-library-feature > .stk-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 0;
  align-items: center;
  min-width: 0;
}
.cem-library-feature-media,
.cem-library-feature-copy,
.cem-library-feature-media > .stk-column-wrapper,
.cem-library-feature-copy > .stk-column-wrapper,
.cem-library-feature-media .stk-block-content,
.cem-library-feature-copy .stk-block-content { min-width: 0; }
.cem-library-feature-media > .stk-column-wrapper { padding: 0 !important; }
.cem-library-feature-media .wp-block-stackable-image,
.cem-library-feature-media figure { margin: 0 !important; }
.cem-library-feature-media .stk-img-wrapper {
  display: block;
  width: 100%;
  height: 520px;
  overflow: hidden;
  border-radius: 26px 0 0 26px;
}
.cem-library-feature-media .stk-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.cem-library-feature-copy {
  position: relative;
  z-index: 2;
  margin-left: -66px;
}
.cem-library-feature-copy > .stk-column-wrapper {
  padding: 34px 34px 30px !important;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 22px;
  background: linear-gradient(140deg, rgba(15,36,57,.97), rgba(42,95,150,.94)) !important;
  box-shadow: 0 24px 56px rgba(18,34,58,.18);
}
.cem-library-feature-copy .stk-block-heading__text {
  margin: 0 !important;
  color: #fff !important;
  font-size: clamp(34px, 3.7vw, 50px) !important;
  line-height: .98 !important;
  letter-spacing: -.04em;
}
.cem-library-feature-copy .stk-block-text__text {
  margin: 14px 0 0 !important;
  color: rgba(239,247,253,.84) !important;
  font-size: 15px;
  line-height: 1.58;
}
.cem-library-feature-list {
  margin: 17px 0 0 !important;
  padding-left: 19px;
  color: rgba(255,255,255,.88);
  font-size: 14px;
  line-height: 1.55;
}
.cem-library-feature-list li + li { margin-top: 5px; }
.cem-library-feature-copy .wp-block-buttons { margin-top: 20px; }
.cem-library-feature-copy .wp-block-button__link {
  min-height: 44px;
  padding: 12px 17px;
  border-radius: 11px;
  color: #15304c;
  background: #fff;
  font-weight: 800;
}

/* Stackable official Image Box sample: Featured Properties. */
.cem-library-stackable-imagebox {
  padding: 30px;
  border: 1px solid var(--cem-line);
  border-radius: 26px;
  background: linear-gradient(145deg, #ffffff, #f4f8fb);
}
.cem-library-stackable-imagebox .cem-library-labelrow { padding: 0; }
.cem-library-section-head {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(300px, .65fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 22px;
}
.cem-library-section-head h2 {
  margin: 0 !important;
  max-width: 760px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: .98;
  letter-spacing: -.04em;
}
.cem-library-section-head > p {
  margin: 0 !important;
  color: var(--cem-muted);
  font-size: 15px;
  line-height: 1.58;
}
.cem-library-imagebox-grid > .stk-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cem-library-imagebox-card,
.cem-library-imagebox-card > .stk-column-wrapper,
.cem-library-imagebox-card .stk-block-content { min-width: 0; }
.cem-library-imagebox-card > .stk-column-wrapper {
  height: 100%;
  overflow: hidden;
  padding: 0 0 19px !important;
  border: 1px solid var(--cem-line);
  border-radius: 19px;
  background: #fff !important;
  box-shadow: 0 10px 26px rgba(18,34,58,.05);
}
.cem-library-imagebox-card .wp-block-stackable-image,
.cem-library-imagebox-card figure { margin: 0 !important; }
.cem-library-imagebox-card .stk-img-wrapper {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.cem-library-imagebox-card .stk-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .32s ease;
}
.cem-library-imagebox-card:hover .stk-img-wrapper img { transform: scale(1.035); }
.cem-library-imagebox-kicker {
  margin: 17px 18px 7px !important;
  color: var(--cem-primary);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.cem-library-imagebox-card .stk-block-heading__text {
  margin: 0 18px !important;
  color: var(--cem-ink) !important;
  font-size: 22px !important;
  line-height: 1.08 !important;
  letter-spacing: -.025em;
}
.cem-library-imagebox-card .stk-block-text__text {
  margin: 9px 18px 0 !important;
  color: var(--cem-muted) !important;
  font-size: 14px;
  line-height: 1.55;
}

/* Kadence official Gallery 1 adaptation. */
.cem-library-kadence-gallery {
  padding: 30px;
  border-radius: 26px;
  background: #edf3f8;
}
.cem-library-kadence-gallery .cem-library-labelrow { padding: 0; }
.cem-library-kadence-gallery-row,
.cem-library-kadence-gallery-row .kt-row-column-wrap,
.cem-library-kadence-gallery-row .wp-block-kadence-column,
.cem-library-kadence-gallery-row .kt-inside-inner-col { min-width: 0; }
.cem-library-kadence-gallery-row .kt-row-column-wrap { padding: 0 !important; }
.cem-library-kadence-gallery-grid { margin-top: 4px; }
.cem-library-kadence-gallery-grid .kadence-blocks-gallery-item,
.cem-library-kadence-gallery-grid figure { overflow: hidden; }

/* Kadence official Hero 21 adaptation. */
.cem-library-kadence-hero {
  overflow: hidden;
  padding: 14px 30px 30px;
  border-radius: 26px;
  background: linear-gradient(125deg, #10243b 0%, #173a5d 58%, #2b639b 100%);
  box-shadow: 0 18px 45px rgba(18,34,58,.10);
}
.cem-library-kadence-hero .cem-library-labelrow { padding: 0; margin-top: 0 !important; }
.cem-library-kadence-hero-row,
.cem-library-kadence-hero-row .kt-row-column-wrap,
.cem-library-kadence-hero-row .wp-block-kadence-column,
.cem-library-kadence-hero-row .kt-inside-inner-col { min-width: 0; }
.cem-library-kadence-hero-row .kt-row-column-wrap {
  display: grid !important;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr) !important;
  gap: 34px !important;
  align-items: center;
  padding: 14px 0 0 !important;
}
.cem-library-kadence-hero-copy .kt-inside-inner-col { padding: 16px 0 !important; }
.cem-library-kadence-hero-button .wp-block-button__link {
  min-height: 45px;
  padding: 12px 18px;
  border-radius: 11px;
  color: #15304c;
  background: #fff;
  font-weight: 800;
}
.cem-library-kadence-hero-media .kt-inside-inner-col {
  position: relative;
  min-height: 420px;
  padding: 0 0 30px 40px !important;
}
.cem-library-kadence-hero-main {
  height: 390px;
  margin: 0 !important;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 20px 48px rgba(3,12,24,.22);
}
.cem-library-kadence-hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.cem-library-kadence-hero-mini {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44%;
  height: 160px;
  margin: 0 !important;
  overflow: hidden;
  border: 7px solid #173a5d;
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(3,12,24,.20);
}
.cem-library-kadence-hero-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 1024px) {
  .cem-library-feature > .stk-row { grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr); }
  .cem-library-feature-copy { margin-left: -42px; }
  .cem-library-feature-copy > .stk-column-wrapper { padding: 28px !important; }
  .cem-library-feature-media .stk-img-wrapper { height: 470px; }
  .cem-library-kadence-hero-row .kt-row-column-wrap { gap: 24px !important; }
  .cem-library-kadence-hero-media .kt-inside-inner-col { min-height: 360px; }
  .cem-library-kadence-hero-main { height: 330px; }
  .cem-library-kadence-hero-mini { height: 135px; }
}

@media (max-width: 780px) {
  .cem-library-section { margin: 22px auto !important; }
  .cem-library-feature > .stk-row,
  .cem-library-kadence-hero-row .kt-row-column-wrap { grid-template-columns: 1fr !important; }
  .cem-library-feature { padding: 0 0 20px; }
  .cem-library-feature-media .stk-img-wrapper { height: auto; aspect-ratio: 16 / 10; border-radius: 24px 24px 0 0; }
  .cem-library-feature-copy { margin: -54px 18px 0; }
  .cem-library-feature-copy > .stk-column-wrapper { padding: 25px 23px !important; }
  .cem-library-section-head { grid-template-columns: 1fr; gap: 11px; }
  .cem-library-imagebox-grid > .stk-row { grid-template-columns: 1fr 1fr; }
  .cem-library-imagebox-card:last-child { grid-column: 1 / -1; }
  .cem-library-imagebox-card:last-child .stk-img-wrapper { aspect-ratio: 16 / 8; }
  .cem-library-kadence-hero-copy .kt-inside-inner-col { padding: 4px 0 0 !important; }
  .cem-library-kadence-hero-media .kt-inside-inner-col { min-height: 340px; padding: 0 0 28px 26px !important; }
  .cem-library-kadence-hero-main { height: 310px; }
  .cem-library-kadence-hero-mini { width: 42%; height: 122px; border-width: 5px; }
}

@media (max-width: 560px) {
  .cem-library-section {
    width: 100%;
    max-width: 100%;
    margin: 18px 0 !important;
    border-radius: 0;
  }
  .cem-library-labelrow { padding: 0 14px; }
  .cem-library-source { font-size: 11px; }
  .cem-library-stackable-imagebox,
  .cem-library-kadence-gallery,
  .cem-library-kadence-hero { padding: 22px 14px; border-radius: 0; }
  .cem-library-stackable-imagebox .cem-library-labelrow,
  .cem-library-kadence-gallery .cem-library-labelrow,
  .cem-library-kadence-hero .cem-library-labelrow { padding: 0; }
  .cem-library-feature { border-radius: 0; }
  .cem-library-feature-media .stk-img-wrapper { border-radius: 0; aspect-ratio: 16 / 11; }
  .cem-library-feature-copy { margin: -42px 14px 0; }
  .cem-library-feature-copy > .stk-column-wrapper { padding: 22px 19px !important; border-radius: 18px; }
  .cem-library-feature-copy .stk-block-heading__text { font-size: 31px !important; }
  .cem-library-section-head h2 { font-size: 32px; }
  .cem-library-imagebox-grid > .stk-row { grid-template-columns: 1fr; gap: 9px; }
  .cem-library-imagebox-card:last-child { grid-column: auto; }
  .cem-library-imagebox-card .stk-img-wrapper,
  .cem-library-imagebox-card:last-child .stk-img-wrapper { aspect-ratio: 16 / 10; }
  .cem-library-kadence-hero { padding-top: 14px; }
  .cem-library-kadence-hero-row .kt-row-column-wrap { padding-top: 6px !important; }
  .cem-library-kadence-hero-media .kt-inside-inner-col { min-height: 300px; padding: 0 0 24px 18px !important; }
  .cem-library-kadence-hero-main { height: 270px; border-radius: 16px; }
  .cem-library-kadence-hero-mini { width: 48%; height: 104px; border-radius: 13px; }
}
/* Defensive theme integration for Kadence Hero 21: these colors are also
   stored in Kadence block attributes, but explicit selectors keep the pattern
   visually correct before/without generated per-block CSS caches. */
.cem-library-kadence-hero .kt-adv-headinglibkh003 { color: #bdd8f2 !important; }
.cem-library-kadence-hero .kt-adv-headinglibkh004 { color: #ffffff !important; }
.cem-library-kadence-hero .kt-adv-headinglibkh005 { color: #dce8f3 !important; }
