:root {
  --ink: #263238;
  --muted: #5f6f73;
  --paper: #fffdf8;
  --mist: #f1f7f3;
  --sage: #b9d8c2;
  --sage-dark: #477263;
  --blue: #c8ddeb;
  --lavender: #d9cee9;
  --rose: #f3d7d7;
  --sand: #f6eddf;
  --line: #dfe8e3;
  --white: #ffffff;
  --shadow: 0 18px 42px rgba(53, 77, 74, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 64px);
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #173f38;
  background: var(--sage);
  border-radius: 50%;
  font-weight: 700;
}

.brand-logo-frame {
  display: inline-flex;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
}

.brand-logo-image {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.top-nav a,
.text-link {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 82px);
  padding: clamp(42px, 7vw, 96px) clamp(18px, 4vw, 64px);
  background-color: var(--paper);
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(110deg, rgba(241, 247, 243, 0.98), rgba(255, 253, 248, 0.95) 55%, rgba(200, 221, 235, 0.52));
  background-repeat: repeat, no-repeat;
  background-size: var(--theme-pattern-size, auto), auto;
}

.has-partners > .hero-section {
  align-items: start;
  min-height: auto;
  padding-top: clamp(18px, 3vw, 36px);
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sage-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.24rem;
}

.hero-copy {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  color: #ffffff;
  background: #315f55;
}

.button-secondary {
  color: #214b43;
  background: var(--sage);
}

.button-ghost {
  color: #315f55;
  background: transparent;
  border-color: #9fc7b0;
}

.button:focus-visible,
.icon-button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #83b6d6;
  outline-offset: 3px;
}

.hero-visual {
  display: grid;
  min-height: 440px;
  place-items: center;
}

.campaign-card {
  position: relative;
  width: min(100%, 460px);
  min-height: 520px;
  overflow: hidden;
  padding: 34px;
  background: linear-gradient(160deg, #ffffff, #f4faf7 58%, #edf1fb);
  border: 1px solid rgba(71, 114, 99, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.campaign-tag {
  display: inline-block;
  margin-bottom: 78px;
  color: #315f55;
  font-weight: 700;
}

.campaign-card h2 {
  max-width: 350px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.campaign-card p {
  max-width: 340px;
  color: var(--muted);
}

.soft-rings {
  position: absolute;
  right: 28px;
  bottom: 26px;
  display: flex;
  gap: 12px;
}

.soft-rings span {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  opacity: 0.9;
}

.soft-rings span:nth-child(1) {
  background: var(--rose);
}

.soft-rings span:nth-child(2) {
  background: var(--blue);
}

.soft-rings span:nth-child(3) {
  background: var(--lavender);
}

.section {
  padding: clamp(58px, 8vw, 104px) clamp(18px, 4vw, 64px);
  background-image: var(--theme-pattern-image, none);
  background-repeat: repeat;
  background-size: var(--theme-pattern-size, auto);
}

.section-heading {
  max-width: 920px;
  margin-bottom: 30px;
}

.partners-strip {
  padding: 8px clamp(18px, 4vw, 64px);
  background: color-mix(in srgb, var(--white) 86%, var(--theme-secondary, #b9d8c2));
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.partners-strip-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.partners-strip .eyebrow {
  margin: 0;
  white-space: nowrap;
}

.partner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.partner-pill {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(53, 77, 74, 0.08);
}

.partner-pill::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
}

.partner-main-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  color: inherit;
  text-decoration: none;
}

.partner-pill:hover,
.partner-pill:focus-within {
  z-index: 6;
  border-color: color-mix(in srgb, var(--theme-primary, #315f55) 58%, var(--line));
  box-shadow: 0 14px 34px rgba(34, 54, 51, 0.18);
}

.partner-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  z-index: 10;
  width: min(320px, calc(100vw - 36px));
  padding: 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 28%, var(--line));
  border-radius: 8px;
  box-shadow: 0 20px 46px rgba(20, 33, 31, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.partner-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 12px;
  height: 12px;
  background: var(--white);
  border-left: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 28%, var(--line));
  border-top: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 28%, var(--line));
  transform: translateX(-50%) rotate(45deg);
}

.partner-pill:hover .partner-tooltip,
.partner-pill:focus-within .partner-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.partner-tooltip > strong,
.partner-tooltip span,
.partner-tooltip small {
  display: block;
}

.partner-tooltip > strong {
  margin-bottom: 8px;
  color: var(--theme-primary, #315f55);
}

.partner-tooltip p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.45;
}

.partner-tooltip span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.partner-tooltip span strong {
  display: block;
  color: var(--ink);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.partner-tooltip-link {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 12px;
  color: var(--theme-primary, #315f55);
  font-weight: 900;
  overflow-wrap: anywhere;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.partner-tooltip-link:hover,
.partner-tooltip-link:focus-visible {
  color: var(--theme-accent, #8e3f45);
}

.partner-logo {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background-color: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 42%, #ffffff);
  background-position: var(--image-x, 50%) var(--image-y, 50%);
  background-repeat: no-repeat;
  background-size: var(--image-fit, contain);
  border-radius: 50%;
  color: var(--theme-primary, #315f55);
  font-size: 0.8rem;
  font-weight: 900;
}

.partner-main-link > strong {
  font-size: 0.94rem;
}

@media (max-width: 760px) {
  .partners-strip-inner {
    grid-template-columns: 1fr;
  }

  .partner-pill {
    width: 100%;
  }
}

.split-heading {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.intro-section,
.listening-section {
  background-color: var(--mist);
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  max-width: 1060px;
  color: var(--muted);
  font-size: 1.08rem;
}

.notion-grid,
.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.info-card,
.document-card,
.contact-card,
.admin-panel,
.admin-mock aside {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(53, 77, 74, 0.08);
}

.info-card {
  padding: 24px;
}

.card-icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 24px;
  color: #294f48;
  background: var(--blue);
  border-radius: 50%;
  font-weight: 700;
}

.info-card:nth-child(2) .card-icon {
  background: var(--rose);
}

.info-card:nth-child(3) .card-icon {
  background: var(--lavender);
}

.info-card p,
.contact-card p,
.document-card p {
  color: var(--muted);
}

.info-card ul {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.document-section {
  background-color: #fbf7f1;
}

.document-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
}

.document-preview {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border-radius: 8px;
  color: #253b37;
}

.document-preview span,
.document-preview small {
  font-weight: 700;
}

.document-preview strong {
  font-size: 1.42rem;
  line-height: 1.1;
}

.flyer-preview {
  background: linear-gradient(180deg, #dceee3, #ffffff 42%, #c8ddeb);
}

.poster-preview {
  background: linear-gradient(180deg, #f3d7d7, #ffffff 48%, #d9cee9);
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.meta-list dt {
  color: var(--muted);
}

.meta-list dd {
  margin: 0;
  font-weight: 700;
}

.carousel-controls {
  display: flex;
  gap: 10px;
}

.icon-button {
  width: 46px;
  height: 46px;
  color: #315f55;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.55rem;
  cursor: pointer;
}

.contact-carousel {
  display: grid;
  grid-auto-columns: minmax(290px, 380px);
  grid-auto-flow: column;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x mandatory;
}

.contact-card {
  min-height: 330px;
  padding: 24px;
  scroll-snap-align: start;
}

.contact-card.featured {
  border-color: #aacdb8;
  background: #f6fbf8;
}

.region {
  margin-top: 0;
  color: var(--sage-dark);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

address {
  display: grid;
  gap: 8px;
  margin: 22px 0;
  font-style: normal;
}

.listening-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 4vw, 42px);
  background: #ffffff;
  border: 1px solid #cbded4;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.listening-panel p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.1rem;
}

.call-box {
  display: grid;
  gap: 10px;
  padding: 24px;
  background: #eef7f2;
  border-radius: 8px;
}

.call-box span,
.call-box small {
  color: var(--muted);
}

.call-box > a:not(.button) {
  color: #214b43;
  font-size: 1.75rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-page {
  background: #f7f8f5;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 42px);
  background: rgba(255, 253, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 24px clamp(18px, 4vw, 42px) 64px;
}

.admin-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(53, 77, 74, 0.08);
}

.admin-sidebar a {
  color: var(--muted);
  text-decoration: none;
}

.admin-content {
  display: grid;
  gap: 22px;
}

.admin-hero,
.admin-card {
  padding: clamp(22px, 3vw, 34px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(53, 77, 74, 0.08);
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
  background: linear-gradient(120deg, #ffffff, #f1f7f3);
}

.admin-hero h1 {
  font-size: clamp(2rem, 4vw, 4.1rem);
}

.admin-hero p {
  max-width: 820px;
  color: var(--muted);
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-card h2 {
  font-size: 1.5rem;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  color: #315f55;
  background: var(--sage);
  border-radius: 999px;
  font-weight: 700;
}

.stats-grid,
.admin-repeat-grid,
.admin-two-cols {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid div,
.admin-repeat-grid article {
  padding: 18px;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-grid span,
.stats-grid strong {
  display: block;
}

.stats-grid span {
  color: var(--muted);
}

.stats-grid strong {
  margin-top: 6px;
  font-size: 1.22rem;
}

.admin-form,
.login-card,
.admin-repeat-grid article {
  display: grid;
  gap: 14px;
}

.admin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form h3,
.document-admin-form h3,
.organization-form h3 {
  grid-column: 1 / -1;
}

.admin-form label,
.login-card label,
.admin-repeat-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.login-card input,
.admin-repeat-grid input,
.admin-repeat-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.admin-form textarea,
.admin-repeat-grid textarea {
  min-height: 104px;
  resize: vertical;
}

.admin-repeat-grid,
.admin-two-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-admin-form {
  padding: 18px;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-bottom: 22px;
}

.admin-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #315f55;
  background: #eef7f2;
}

.organization-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.fake-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.fake-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.fake-form input {
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fake-form button {
  align-self: end;
}

.site-footer {
  padding: 34px clamp(18px, 4vw, 64px);
  color: #ffffff;
  background: #315f55;
}

.site-footer p {
  max-width: 980px;
  margin: 6px 0;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .hero-section,
  .intro-grid,
  .document-grid,
  .listening-panel,
  .admin-layout,
  .admin-hero,
  .admin-form,
  .admin-repeat-grid,
  .admin-two-cols,
  .organization-form,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .hero-section {
    min-height: auto;
  }

  .notion-grid {
    grid-template-columns: 1fr;
  }

  .document-card {
    grid-template-columns: 170px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
  }

  .hero-section {
    padding-top: 34px;
  }

  .hero-visual {
    min-height: 340px;
  }

  .campaign-card {
    min-height: 370px;
  }

  .campaign-tag {
    margin-bottom: 42px;
  }

  .soft-rings span {
    width: 48px;
    height: 48px;
  }

  .split-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-card {
    grid-template-columns: 1fr;
  }

  .document-preview {
    min-height: 210px;
  }

  .fake-form {
    grid-template-columns: 1fr;
  }

  .admin-topbar,
  .admin-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.admin-editor {
  display: grid;
  gap: 22px;
}

.admin-actions,
.admin-inline-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-actions {
  justify-content: flex-start;
}

.admin-save-status {
  margin: 0;
  color: var(--muted);
}

.check-row {
  align-content: center;
  grid-template-columns: auto 1fr;
  min-height: 44px;
  padding: 10px 12px;
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.organization-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .organization-editor-grid {
    grid-template-columns: 1fr;
  }
}

.document-admin-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

.document-admin-form input,
.document-admin-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.document-admin-form textarea {
  min-height: 104px;
  resize: vertical;
}

body {
  font-family: var(--body-font, Arial, Helvetica, sans-serif);
}

h1,
h2,
h3,
.brand strong {
  color: var(--ink);
  font-family: var(--heading-font, Arial, Helvetica, sans-serif);
}

.button-primary {
  color: var(--theme-button-text, #ffffff);
  background: var(--theme-primary, #315f55);
}

.button-secondary {
  color: var(--theme-primary, #315f55);
  background: var(--theme-secondary, #b9d8c2);
}

.button-ghost {
  color: var(--theme-primary, #315f55);
  border-color: var(--theme-primary, #315f55);
}

body[data-button-style="pill"] .button {
  border-radius: 999px;
}

body[data-button-style="square"] .button {
  border-radius: 2px;
}

body[data-button-style="outline"] .button-primary,
body[data-button-style="outline"] .button-secondary {
  color: var(--theme-primary, #315f55);
  background: transparent;
  border-color: var(--theme-primary, #315f55);
}

body[data-card-style="flat"] .info-card,
body[data-card-style="flat"] .document-card,
body[data-card-style="flat"] .contact-card,
body[data-card-style="flat"] .resource-card,
body[data-card-style="flat"] .page-directory-card,
body[data-card-style="flat"] .news-card {
  box-shadow: none;
}

body[data-card-style="bordered"] .info-card,
body[data-card-style="bordered"] .document-card,
body[data-card-style="bordered"] .contact-card,
body[data-card-style="bordered"] .resource-card,
body[data-card-style="bordered"] .page-directory-card,
body[data-card-style="bordered"] .news-card {
  border-width: 2px;
  box-shadow: none;
}

body[data-hero-style="centered"] .hero-section {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
  text-align: center;
}

body[data-hero-style="centered"] .hero-content,
body[data-hero-style="centered"] .hero-copy {
  margin-right: auto;
  margin-left: auto;
}

body[data-hero-style="centered"] .hero-visual {
  display: none;
}

body[data-hero-style="banner"] .hero-section {
  min-height: 68vh;
  background-color: var(--theme-primary, #315f55);
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(135deg, var(--theme-primary, #315f55), var(--theme-accent, #c8ddeb));
  background-repeat: repeat, no-repeat;
  background-size: var(--theme-pattern-size, auto), auto;
}

body[data-hero-style="banner"] .hero-section h1,
body[data-hero-style="banner"] .hero-copy,
body[data-hero-style="banner"] .eyebrow {
  color: #ffffff;
}

.loading-state {
  min-height: 50vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.page-directory-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.page-directory-card,
.news-card,
.resource-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(53, 77, 74, 0.08);
}

.page-directory-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
}

.page-directory-media,
.news-image {
  min-height: 180px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--theme-secondary, #b9d8c2), var(--theme-accent, #c8ddeb));
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  color: #173f38;
  font-size: 1.4rem;
  font-weight: 800;
}

.news-carousel {
  display: grid;
  grid-auto-columns: minmax(300px, 430px);
  grid-auto-flow: column;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x mandatory;
}

.news-card {
  overflow: hidden;
  scroll-snap-align: start;
}

.news-card > div:not(.news-image) {
  padding: 20px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.directory-list {
  display: grid;
  gap: 14px;
}

.compact-contact {
  min-height: auto;
  cursor: pointer;
}

.world-panel {
  display: grid;
  gap: 16px;
}

.world-map {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 42%, rgba(255,255,255,0.9) 0 8%, transparent 9%),
    radial-gradient(circle at 48% 36%, rgba(255,255,255,0.85) 0 13%, transparent 14%),
    radial-gradient(circle at 70% 51%, rgba(255,255,255,0.82) 0 11%, transparent 12%),
    linear-gradient(135deg, var(--theme-accent, #c8ddeb), #e8f2ed);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-pin {
  position: absolute;
  width: 18px;
  height: 18px;
  padding: 0;
  transform: translate(-50%, -50%);
  background: var(--theme-primary, #315f55);
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  cursor: pointer;
}

.story-pin {
  background: #a24d66;
}

.map-detail,
.resource-card {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.world-heading {
  margin-top: 36px;
}

.pdf-modal[hidden] {
  display: none;
}

.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: clamp(16px, 3vw, 36px);
  background: rgba(20, 31, 34, 0.72);
}

.pdf-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 80vh;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
}

.pdf-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.compact-actions {
  margin-top: 0;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  min-height: 68vh;
  border: 0;
}

.wide-repeat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-form input[type="color"] {
  min-height: 52px;
  padding: 4px;
}

.admin-form select,
.admin-repeat-grid select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

@media (max-width: 980px) {
  .page-directory-grid,
  .resource-grid,
  .map-layout,
  .wide-repeat-grid {
    grid-template-columns: 1fr;
  }

  .page-directory-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pdf-modal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .world-map {
    min-height: 320px;
  }
}

/* Real world map + compact directory accordion */
.map-layout {
  grid-template-columns: 1fr;
}

.world-panel {
  gap: 18px;
}

.world-map {
  min-height: clamp(360px, 54vw, 620px);
  background: linear-gradient(180deg, #cfe4ec, #eaf3ef);
  border-color: rgba(49, 95, 85, 0.18);
  box-shadow: 0 14px 34px rgba(53, 77, 74, 0.1);
}

.world-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-land {
  fill: rgba(255, 255, 255, 0.86);
  stroke: rgba(49, 95, 85, 0.18);
  stroke-width: 2;
  filter: drop-shadow(0 8px 10px rgba(53, 77, 74, 0.12));
}

.map-island {
  opacity: 0.82;
}

.map-line {
  fill: none;
  stroke: rgba(49, 95, 85, 0.1);
  stroke-width: 1;
}

.map-pin {
  z-index: 2;
}

.map-pin::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.22;
}

.map-detail {
  max-width: none;
}

.directory-list {
  margin-top: 6px;
}

.directory-list-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.directory-list-header h3,
.directory-list-header p {
  margin: 0;
}

.directory-list-header p {
  color: var(--muted);
  font-weight: 700;
}

.accordion-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.contact-accordion {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(53, 77, 74, 0.06);
}

.contact-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.contact-accordion summary::-webkit-details-marker {
  display: none;
}

.contact-accordion summary::after {
  content: "+";
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--theme-primary, #315f55);
  background: var(--theme-secondary, #b9d8c2);
  border-radius: 50%;
  font-weight: 800;
}

.contact-accordion[open] summary::after {
  content: "-";
}

.contact-accordion summary span {
  display: grid;
  gap: 4px;
}

.contact-accordion summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-accordion-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
  color: var(--muted);
}

.contact-accordion-body p,
.contact-accordion-body address {
  margin: 0;
}

@media (max-width: 640px) {
  .world-map {
    min-height: 340px;
  }

  .contact-accordion summary {
    align-items: flex-start;
  }
}

.map-pin.active-pin {
  width: 24px;
  height: 24px;
  background: #8f2f4f;
  box-shadow: 0 0 0 8px rgba(143, 47, 79, 0.16), 0 12px 22px rgba(0,0,0,0.24);
}

.world-map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.world-map .world-svg {
  display: none;
}

/* Silhouette map image display */
.world-map {
  min-height: clamp(360px, 46vw, 560px);
  background: #ffffff;
  border-color: rgba(49, 95, 85, 0.16);
}

.world-map-image {
  object-fit: contain;
  padding: clamp(18px, 4vw, 48px);
  background: #ffffff;
}

.page-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.page-admin-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page-admin-row strong {
  color: var(--theme-primary, #315f55);
}

.active-page-row {
  background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 34%, #ffffff);
  border-color: var(--theme-primary, #315f55);
}

@media (max-width: 640px) {
  .page-admin-row {
    grid-template-columns: 1fr;
  }
}

.create-page-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--white) 88%, var(--theme-secondary, #b9d8c2));
  overflow: hidden;
}

.create-page-panel summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
  color: var(--theme-heading, var(--ink));
}

.admin-help-text {
  margin: 0 18px 14px;
  color: var(--muted);
  line-height: 1.6;
}

.create-page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.create-page-grid label:has(textarea),
.create-page-actions {
  grid-column: span 3;
}

.create-page-actions {
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 920px) {
  .create-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .create-page-grid label:has(textarea),
  .create-page-actions {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .create-page-grid {
    grid-template-columns: 1fr;
  }

  .create-page-grid label:has(textarea),
  .create-page-actions {
    grid-column: span 1;
  }
}

.upload-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: -6px;
}

.upload-status {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-media-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--white) 92%, var(--theme-secondary, #b9d8c2));
}

.admin-media-preview img,
.file-preview-icon {
  width: 96px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--paper);
  border: 1px solid var(--line);
}

.file-preview-icon {
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--theme-primary, var(--sage-dark));
}

.admin-media-preview strong,
.admin-media-preview small,
.admin-media-preview a {
  display: block;
  overflow-wrap: anywhere;
}

.admin-media-preview small {
  margin-top: 4px;
  color: var(--muted);
}

.empty-preview {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-weight: 700;
}

.pdf-frame.image-frame {
  background: #ffffff;
}

/* Leaflet real interactive map */
.leaflet-world-map.world-map {
  min-height: clamp(420px, 56vw, 660px);
  padding: 0;
  background: #e8f2ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(53, 77, 74, 0.1);
  isolation: isolate;
}

.leaflet-world-map .leaflet-container,
.leaflet-world-map.leaflet-container {
  width: 100%;
  height: 100%;
  min-height: inherit;
  border-radius: inherit;
  font-family: var(--body-font, Arial, Helvetica, sans-serif);
}

.map-loading {
  min-height: inherit;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.map-loading span {
  display: block;
  max-width: 520px;
  font-weight: 600;
}

.leaflet-poi-marker {
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--theme-primary, #315f55);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.leaflet-poi-marker.story-pin {
  background: #a24d66;
}

.leaflet-poi-marker::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.2;
}

.leaflet-poi-marker.active-pin {
  transform: scale(1.22);
  background: #8f2f4f;
  box-shadow: 0 0 0 8px rgba(143, 47, 79, 0.16), 0 12px 22px rgba(0, 0, 0, 0.28);
}

.leaflet-popup-content {
  margin: 12px 14px;
  color: var(--ink);
  line-height: 1.4;
}

.leaflet-popup-content small {
  color: var(--muted);
}

.leaflet-control-attribution {
  font-size: 0.7rem;
}

@media (max-width: 640px) {
  .leaflet-world-map.world-map {
    min-height: 380px;
  }
}

/* Local Leaflet safety rules: keeps the map usable if CDN CSS is delayed or blocked. */
.leaflet-container {
  overflow: hidden;
  touch-action: pan-x pan-y;
  font-family: var(--body-font, Arial, Helvetica, sans-serif);
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  filter: inherit;
  visibility: hidden;
}

.leaflet-tile-loaded {
  visibility: inherit;
}

.leaflet-map-pane {
  z-index: 1;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  pointer-events: none;
}

.leaflet-control-container .leaflet-control {
  pointer-events: auto;
}

.leaflet-world-map.world-map.leaflet-container {
  height: clamp(420px, 56vw, 660px);
  min-height: 420px;
  max-height: 660px;
}

@media (max-width: 640px) {
  .leaflet-world-map.world-map.leaflet-container {
    height: 380px;
    min-height: 380px;
  }
}

.map-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin: 0 0 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-tab {
  min-height: 42px;
  padding: 10px 14px;
  color: var(--theme-primary, var(--sage-dark));
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.map-tab.active-tab {
  color: var(--theme-button-text, #ffffff);
  background: var(--theme-primary, var(--sage-dark));
}

.calendar-panel {
  display: grid;
  gap: 18px;
}

.compact-section-heading {
  margin-bottom: 0;
}

.calendar-list {
  display: grid;
  gap: 14px;
}

.calendar-event {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(53, 77, 74, 0.06);
  cursor: pointer;
}

.calendar-date {
  display: grid;
  place-items: center;
  min-height: 82px;
  color: var(--theme-button-text, #ffffff);
  background: var(--theme-primary, var(--sage-dark));
  border-radius: 8px;
  text-align: center;
}

.calendar-date strong {
  font-size: 1.8rem;
  line-height: 1;
}

.calendar-date span {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-event h3,
.calendar-event p {
  margin-top: 0;
}

.calendar-time {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 640px) {
  .map-tabs {
    display: grid;
  }

  .calendar-event {
    grid-template-columns: 1fr;
  }

  .calendar-date {
    width: 82px;
  }
}

/* Admin configuration tabs */
.compact-admin-hero {
  min-height: auto;
  padding-bottom: 22px;
}

.admin-config-shell {
  display: grid;
  gap: 18px;
}

.admin-config-nav {
  position: sticky;
  top: 84px;
  z-index: 12;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  background: color-mix(in srgb, var(--white) 94%, var(--theme-secondary, #b9d8c2));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(53, 77, 74, 0.08);
}

.admin-config-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-config-tab.active-admin-tab {
  color: var(--theme-button-text, #ffffff);
  background: var(--theme-primary, var(--sage-dark));
  border-color: var(--theme-primary, var(--sage-dark));
}

.admin-tab-panels {
  display: grid;
  gap: 18px;
}

.admin-tab-panel[hidden] {
  display: none;
}

.admin-save-card {
  position: sticky;
  bottom: 0;
  z-index: 11;
  box-shadow: 0 -10px 24px rgba(53, 77, 74, 0.08);
}

.sidebar-note {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .admin-config-nav {
    top: 72px;
  }
}

/* Demo login, roles and dark mode */
.login-page {
  min-height: 100vh;
  background: var(--paper);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.72fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 6vw, 72px);
}

.login-hero h1 {
  margin-bottom: 18px;
}

.login-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.18rem;
}

.login-panel {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 3vw, 34px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.login-panel input,
.login-panel select {
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--white) 92%, var(--paper));
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}



.status-pill.draft-status {
  color: #6d3f00;
  background: #fff1d6;
  border-color: #f0bf70;
}

.admin-coordinate-map {
  min-height: 260px;
  overflow: hidden;
  margin-top: 12px;
  background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 22%, var(--white));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-coordinate-map .leaflet-container,
.admin-coordinate-map.leaflet-container {
  min-height: 260px;
}

.admin-coordinate-map .map-loading {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.geocode-control,
.advanced-coordinate-panel {
  grid-column: 1 / -1;
  padding: 14px;
  background: color-mix(in srgb, var(--white) 88%, var(--theme-secondary, #b9d8c2));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.geocode-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
}

.geocode-control strong,
.geocode-control small,
.geocode-status {
  display: block;
}

.geocode-control small,
.geocode-status,
.advanced-coordinate-panel .admin-help-text {
  color: var(--muted);
}

.geocode-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.geocode-results button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.geocode-results button:hover,
.geocode-results button:focus-visible {
  border-color: var(--theme-primary, #315f55);
  box-shadow: 0 10px 22px rgba(31, 63, 57, 0.12);
}

.geocode-results small {
  color: var(--muted);
}

.advanced-coordinate-panel summary {
  color: var(--theme-primary, #315f55);
  cursor: pointer;
  font-weight: 900;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .geocode-control,
  .coordinate-grid {
    grid-template-columns: 1fr;
  }
}

.login-role-grid,
.permission-grid {
  display: grid;
  gap: 10px;
}

.login-role-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.login-role-grid article,
.permission-grid .check-row,
.theme-live-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--white) 86%, var(--theme-secondary, #b9d8c2));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-top h3,
.preview-top p {
  margin: 0;
}

.preview-kicker {
  color: var(--theme-primary, #315f55);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-top span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  color: var(--preview-button-text, #ffffff);
  background: var(--preview-primary, #315f55);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.preview-shell {
  overflow: hidden;
  color: var(--preview-text, #5f6f73);
  background-color: var(--preview-bg, #fffdf8);
  background-image: var(--preview-pattern-image, none);
  background-repeat: repeat;
  background-size: var(--preview-pattern-size, auto);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--preview-body-font, Arial, Helvetica, sans-serif);
}

.preview-shell header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: var(--preview-heading, #263238);
  background: color-mix(in srgb, var(--preview-surface, #ffffff) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--preview-primary, #315f55) 16%, transparent);
}

.preview-shell nav {
  display: flex;
  gap: 10px;
  color: var(--preview-text, #5f6f73);
  font-size: 0.76rem;
}

.preview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.72fr);
  gap: 16px;
  align-items: center;
  padding: 22px;
}

.preview-hero p {
  margin: 0 0 6px;
  color: var(--preview-primary, #315f55);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-hero h4 {
  max-width: 520px;
  margin: 0 0 10px;
  color: var(--preview-heading, #263238);
  font-family: var(--preview-heading-font, Arial, Helvetica, sans-serif);
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 0.98;
}

.preview-hero span,
.preview-card-row p {
  color: var(--preview-text, #5f6f73);
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.preview-actions button,
.preview-card-row a {
  min-height: 34px;
  padding: 8px 12px;
  color: var(--preview-button-text, #ffffff);
  background: var(--preview-primary, #315f55);
  border: 1px solid var(--preview-primary, #315f55);
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
}

.preview-actions button + button {
  color: var(--preview-primary, #315f55);
  background: var(--preview-secondary, #b9d8c2);
  border-color: var(--preview-secondary, #b9d8c2);
}

.preview-hero article,
.preview-card-row article {
  color: var(--preview-text, #5f6f73);
  background: var(--preview-surface, #ffffff);
  border: 1px solid color-mix(in srgb, var(--preview-primary, #315f55) 18%, transparent);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.preview-hero article {
  min-height: 180px;
  display: grid;
  align-content: space-between;
  padding: 16px;
}

.preview-hero article small {
  color: var(--preview-primary, #315f55);
  font-weight: 900;
}

.preview-hero article strong,
.preview-card-row strong {
  color: var(--preview-heading, #263238);
  font-family: var(--preview-heading-font, Arial, Helvetica, sans-serif);
}

.preview-card-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 22px 22px;
}

.preview-card-row article {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.theme-live-preview[data-preview-button-style="square"] .preview-actions button,
.theme-live-preview[data-preview-button-style="square"] .preview-card-row a {
  border-radius: 2px;
}

.theme-live-preview[data-preview-button-style="outline"] .preview-actions button,
.theme-live-preview[data-preview-button-style="outline"] .preview-card-row a {
  color: var(--preview-primary, #315f55);
  background: transparent;
}

.theme-live-preview[data-preview-card-style="flat"] .preview-hero article,
.theme-live-preview[data-preview-card-style="flat"] .preview-card-row article {
  box-shadow: none;
}

.theme-live-preview[data-preview-card-style="bordered"] .preview-hero article,
.theme-live-preview[data-preview-card-style="bordered"] .preview-card-row article {
  border-width: 2px;
  box-shadow: none;
}

.theme-live-preview[data-preview-hero-style="centered"] .preview-hero {
  grid-template-columns: 1fr;
  text-align: center;
}

.theme-live-preview[data-preview-hero-style="centered"] .preview-hero h4 {
  margin-right: auto;
  margin-left: auto;
}

.theme-live-preview[data-preview-hero-style="centered"] .preview-hero article {
  display: none;
}

.theme-live-preview[data-preview-hero-style="banner"] .preview-hero {
  color: #ffffff;
  background: linear-gradient(135deg, var(--preview-primary, #315f55), var(--preview-accent, #c8ddeb));
}

.theme-live-preview[data-preview-hero-style="banner"] .preview-hero h4,
.theme-live-preview[data-preview-hero-style="banner"] .preview-hero p,
.theme-live-preview[data-preview-hero-style="banner"] .preview-hero span {
  color: #ffffff;
}

.pattern-admin {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--white) 88%, var(--theme-secondary, #b9d8c2));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pattern-admin > div:first-child,
.pattern-preview {
  grid-column: 1 / -1;
}

.pattern-admin strong,
.pattern-admin small {
  display: block;
}

.pattern-admin small {
  margin-top: 4px;
  color: var(--muted);
}

.pattern-admin label {
  display: grid;
  grid-template-rows: auto 46px auto;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.pattern-admin select,
.pattern-admin input[type="color"] {
  width: 100%;
  min-height: 46px;
}

.pattern-admin input[type="range"] {
  align-self: center;
  width: 100%;
  margin: 0;
}

.pattern-admin label small {
  min-height: 20px;
  margin-top: 0;
}

.pattern-preview {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-repeat: repeat;
  background-position: 0 0;
  color: #ffffff;
  font-weight: 900;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
}

.dark-theme-preview {
  padding: 14px;
  background: color-mix(in srgb, var(--white) 88%, var(--theme-secondary, #b9d8c2));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-role-grid strong,
.login-role-grid span {
  display: block;
}

.login-role-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.permission-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-role-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 18px;
}

.admin-role-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  color: var(--theme-button-text, #ffffff);
  background: var(--theme-primary, #315f55);
  border-radius: 999px;
  font-weight: 800;
}

.admin-role-strip small {
  color: var(--muted);
}

.dark-theme-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr repeat(3, 44px);
  gap: 10px;
  align-items: center;
}

.dark-theme-preview span {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dark-theme-preview small {
  grid-column: 1 / -1;
  color: var(--muted);
}

body[data-color-mode="dark"] {
  --line: color-mix(in srgb, var(--white) 18%, transparent);
  --mist: color-mix(in srgb, var(--white) 8%, var(--paper));
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
}

body[data-color-mode="dark"] .site-header,
body[data-color-mode="dark"] .admin-topbar {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}

body[data-color-mode="dark"] .hero-section,
body[data-color-mode="dark"] .admin-hero {
  background-color: var(--paper);
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(120deg, var(--white), var(--paper));
  background-repeat: repeat, no-repeat;
  background-size: var(--theme-pattern-size, auto), auto;
}

body[data-color-mode="dark"] .button-secondary,
body[data-color-mode="dark"] .status-pill,
body[data-color-mode="dark"] .brand-mark {
  color: var(--ink);
}

@media (max-width: 900px) {
  .login-shell,
  .login-role-grid,
  .permission-grid,
  .pattern-admin {
    grid-template-columns: 1fr;
  }
}

/* Stable image framing and manual crop support */
.page-directory-media,
.news-image,
.document-preview.has-image {
  background-position: var(--image-x, 50%) var(--image-y, 50%);
  background-size: var(--image-fit, cover);
  background-repeat: no-repeat;
}

.page-directory-media:not(.empty-media),
.news-image:not(.empty-media),
.document-preview.has-image {
  background-color: color-mix(in srgb, var(--white) 92%, var(--theme-secondary, #b9d8c2));
}

.page-directory-media:not(.empty-media) span {
  display: none;
}

.document-preview.has-image {
  min-height: auto;
  aspect-ratio: 4 / 3;
  padding: 0;
}

.document-preview.has-image span,
.document-preview.has-image strong,
.document-preview.has-image small {
  display: none;
}

.image-crop-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--white) 90%, var(--theme-secondary, #b9d8c2));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-crop-controls .admin-help-text {
  grid-column: 1 / -1;
  margin: 0;
}

.crop-workbench {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px);
  gap: 14px;
  align-items: stretch;
}

.crop-picker,
.crop-preview-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: color-mix(in srgb, var(--white) 82%, var(--theme-secondary, #b9d8c2));
  background-position: var(--image-x, 50%) var(--image-y, 50%);
  background-repeat: no-repeat;
  background-size: var(--image-fit, cover);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.crop-picker {
  position: relative;
  min-height: 260px;
  cursor: crosshair;
  background-size: contain;
}

.crop-keep-box {
  position: absolute;
  left: var(--crop-x, 50%);
  top: var(--crop-y, 50%);
  width: min(44%, 180px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid #ffffff;
  border-radius: 6px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.42), 0 8px 24px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.crop-result {
  display: grid;
  gap: 8px;
  align-content: start;
}

.crop-preview-frame {
  min-height: 150px;
  aspect-ratio: 16 / 9;
}

.empty-crop-preview {
  background-image: linear-gradient(135deg, rgba(255,255,255,0.72), rgba(0,0,0,0.04));
}

.crop-result small {
  color: var(--muted);
}

.image-crop-controls small {
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 760px) {
  .image-crop-controls,
  .crop-workbench,
  .preview-hero,
  .preview-card-row {
    grid-template-columns: 1fr;
  }

  .crop-picker {
    min-height: 220px;
  }

  .preview-shell nav {
    display: none;
  }
}

/* AQRP powered footer */
.aqrp-footer {
  padding: clamp(28px, 4vw, 46px) clamp(18px, 4vw, 64px);
  color: #ffffff;
  background: #2f357f;
}

.aqrp-footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(260px, 0.8fr) minmax(220px, 0.7fr);
  gap: 28px;
  align-items: start;
}

.aqrp-logo-lockup {
  display: flex;
  gap: 16px;
  align-items: center;
}

.aqrp-logo-image {
  display: block;
  flex: 0 0 auto;
  width: clamp(72px, 8vw, 104px);
  height: auto;
  object-fit: contain;
}

.aqrp-footer strong,
.aqrp-footer small,
.aqrp-footer span,
.aqrp-footer a,
.aqrp-footer p {
  color: #ffffff;
}

.aqrp-footer strong {
  display: block;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.08;
}

.aqrp-footer small {
  display: block;
  max-width: 420px;
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.aqrp-footer-brand p {
  max-width: 680px;
  margin: 22px 0 0;
  opacity: 0.88;
}

.aqrp-footer-contact {
  display: grid;
  gap: 8px;
  margin: 0;
  font-style: normal;
  font-weight: 700;
}

.aqrp-footer a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.aqrp-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aqrp-social-links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 7px 12px;
  color: #2f357f;
  background: #ffffff;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 900px) {
  .aqrp-footer-grid {
    grid-template-columns: 1fr;
  }
}

.public-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(160px, 220px));
  gap: 12px;
  margin: 0 0 22px;
  padding: 14px;
  background: color-mix(in srgb, var(--white) 86%, var(--theme-secondary, #b9d8c2));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.public-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.public-filter-bar input,
.public-filter-bar select {
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.expanded-copy {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.publish-control {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.media-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.media-library-card,
.history-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: color-mix(in srgb, var(--white) 92%, var(--paper));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.media-library-card {
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
}

.media-thumb {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  background-color: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 32%, var(--white));
  background-position: var(--image-x, 50%) var(--image-y, 50%);
  background-repeat: no-repeat;
  background-size: var(--image-fit, contain);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--theme-primary, #315f55);
  font-weight: 900;
}

.media-library-card strong,
.media-library-card small,
.history-row strong,
.history-row small {
  display: block;
}

.media-library-card small,
.history-row small {
  color: var(--muted);
}

.copy-media-path {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.history-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.partner-pill.featured-partner {
  border-color: color-mix(in srgb, var(--theme-accent, #8e3f45) 58%, var(--line));
  box-shadow: 0 16px 32px rgba(31, 63, 57, 0.16);
}

.partner-pill.featured-partner .partner-main-link::after {
  content: "Principal";
  padding: 3px 7px;
  color: var(--theme-button-text, #ffffff);
  background: var(--theme-accent, #8e3f45);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .public-filter-bar,
  .history-row,
  .media-library-card {
    grid-template-columns: 1fr;
  }
}


.inline-link-button {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.user-admin-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 380px) 1fr;
  align-items: start;
}
.user-list {
  display: grid;
  gap: 14px;
}
.user-editor-card {
  border: 1px solid var(--border, #d8e1dc);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface, #fff);
  display: grid;
  gap: 14px;
}
.user-page-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border, #d8e1dc);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface, #fff), var(--background, #f5f5f0) 45%);
}
.compact-permissions {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.login-error {
  border: 1px solid #c54a4a;
  border-radius: 8px;
  color: #8d1f1f;
  background: #fff1f1;
  padding: 10px 12px;
  margin: 0;
}
@media (max-width: 900px) {
  .user-admin-grid { grid-template-columns: 1fr; }
}

.compact-page-switcher {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  font-weight: 700;
}
.compact-page-switcher select {
  min-height: 40px;
}

.activity-list {
  display: grid;
  gap: 10px;
}
.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border, #d8e1dc);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface, #fff);
}
.activity-row div {
  display: grid;
  gap: 3px;
}
.activity-row small,
.activity-row span {
  color: var(--text-muted, #5f6f73);
}
.password-success {
  border: 1px solid #72a97d;
  border-radius: 8px;
  color: #235b31;
  background: #effaf1;
  padding: 10px 12px;
  margin: 0;
}
@media (max-width: 700px) {
  .activity-row { align-items: flex-start; flex-direction: column; }
}


/* Theme variety additions */
body[data-background-style="clean"] .hero-section {
  background-image: var(--theme-pattern-image, none);
  background-color: var(--theme-bg, var(--paper));
}

body[data-background-style="paper"] .hero-section {
  background-color: var(--theme-bg, var(--paper));
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(90deg, rgba(255,255,255,0.46) 1px, transparent 1px),
    linear-gradient(180deg, rgba(38,50,56,0.045) 1px, transparent 1px),
    linear-gradient(115deg, rgba(255,255,255,0.9), rgba(255,255,255,0.38));
  background-size: var(--theme-pattern-size, auto), 34px 34px, 34px 34px, auto;
}

body[data-background-style="bands"] .hero-section {
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(180deg,
      color-mix(in srgb, var(--theme-secondary, #b9d8c2) 34%, transparent) 0 22%,
      transparent 22% 48%,
      color-mix(in srgb, var(--theme-accent, #c8ddeb) 18%, transparent) 48% 70%,
      transparent 70% 100%);
  background-size: var(--theme-pattern-size, auto), auto;
}

body[data-background-style="diagonal"] .hero-section {
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(128deg,
      color-mix(in srgb, var(--theme-secondary, #b9d8c2) 42%, var(--theme-bg, #fffdf8)) 0 38%,
      var(--theme-bg, #fffdf8) 38% 68%,
      color-mix(in srgb, var(--theme-accent, #c8ddeb) 26%, var(--theme-bg, #fffdf8)) 68% 100%);
  background-size: var(--theme-pattern-size, auto), auto;
}

body[data-background-style="depth"] .hero-section {
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(145deg,
      color-mix(in srgb, var(--theme-primary, #315f55) 13%, var(--theme-bg, #fffdf8)),
      var(--theme-bg, #fffdf8) 46%,
      color-mix(in srgb, var(--theme-secondary, #b9d8c2) 42%, var(--theme-bg, #fffdf8)));
  background-size: var(--theme-pattern-size, auto), auto;
}

body[data-background-style="sectioned"] .hero-section {
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(90deg,
      color-mix(in srgb, var(--theme-primary, #315f55) 10%, var(--theme-bg, #fffdf8)) 0 50%,
      color-mix(in srgb, var(--theme-secondary, #b9d8c2) 24%, var(--theme-bg, #fffdf8)) 50% 100%);
  background-size: var(--theme-pattern-size, auto), auto;
}

body[data-button-style="ghost"] .button-primary,
body[data-button-style="ghost"] .button-secondary {
  color: var(--theme-primary, #315f55);
  background: transparent;
  border-color: transparent;
  border-bottom-color: currentColor;
  border-radius: 0;
  padding-inline: 4px;
}

body[data-button-style="lifted"] .button {
  border-radius: 10px;
  box-shadow: 0 9px 0 color-mix(in srgb, var(--theme-primary, #315f55) 42%, #000000);
  transform: translateY(-3px);
}

body[data-button-style="lifted"] .button:active {
  box-shadow: 0 4px 0 color-mix(in srgb, var(--theme-primary, #315f55) 42%, #000000);
  transform: translateY(2px);
}

body[data-button-style="split"] .button {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding-left: 26px;
}

body[data-button-style="split"] .button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--theme-accent, #8e3f45);
}

body[data-button-style="glass"] .button-primary,
body[data-button-style="glass"] .button-secondary {
  color: var(--theme-primary, #315f55);
  background: color-mix(in srgb, var(--theme-surface, #ffffff) 64%, transparent);
  border-color: color-mix(in srgb, var(--theme-primary, #315f55) 28%, transparent);
  box-shadow: 0 12px 26px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

body[data-card-style="glass"] .info-card,
body[data-card-style="glass"] .document-card,
body[data-card-style="glass"] .contact-card,
body[data-card-style="glass"] .resource-card,
body[data-card-style="glass"] .page-directory-card,
body[data-card-style="glass"] .news-card {
  background: color-mix(in srgb, var(--theme-surface, #ffffff) 72%, transparent);
  border-color: color-mix(in srgb, var(--theme-primary, #315f55) 18%, transparent);
  box-shadow: 0 18px 40px rgba(0,0,0,0.11);
  backdrop-filter: blur(12px);
}

body[data-card-style="editorial"] .info-card,
body[data-card-style="editorial"] .document-card,
body[data-card-style="editorial"] .contact-card,
body[data-card-style="editorial"] .resource-card,
body[data-card-style="editorial"] .page-directory-card,
body[data-card-style="editorial"] .news-card {
  border-left: 7px solid var(--theme-accent, #8e3f45);
  box-shadow: none;
}

body[data-card-style="compact"] .info-card,
body[data-card-style="compact"] .document-card,
body[data-card-style="compact"] .contact-card,
body[data-card-style="compact"] .resource-card,
body[data-card-style="compact"] .page-directory-card,
body[data-card-style="compact"] .news-card {
  padding: clamp(14px, 2vw, 20px);
  box-shadow: none;
}

body[data-card-style="compact"] .news-card,
body[data-card-style="compact"] .page-directory-card {
  gap: 10px;
}

body[data-hero-style="editorial"] .hero-section {
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1.18fr);
  align-items: end;
  min-height: 76vh;
}

body[data-hero-style="editorial"] .hero-section h1 {
  max-width: 980px;
  font-size: clamp(2.8rem, 9vw, 7rem);
}

body[data-hero-style="spotlight"] .hero-section {
  grid-template-columns: minmax(0, 760px);
  justify-content: start;
  min-height: 82vh;
  background-color: var(--theme-primary, #315f55);
  background-image:
    var(--theme-pattern-image, none),
    linear-gradient(100deg, color-mix(in srgb, var(--theme-primary, #315f55) 92%, #000) 0 52%, color-mix(in srgb, var(--theme-accent, #c8ddeb) 56%, var(--theme-primary, #315f55)) 52% 100%);
}

body[data-hero-style="spotlight"] .hero-section h1,
body[data-hero-style="spotlight"] .hero-copy,
body[data-hero-style="spotlight"] .eyebrow {
  color: #ffffff;
}

body[data-hero-style="spotlight"] .hero-visual {
  display: none;
}

body[data-hero-style="quiet"] .hero-section {
  min-height: 54vh;
  grid-template-columns: minmax(0, 900px);
  align-items: center;
}

body[data-hero-style="quiet"] .hero-visual {
  display: none;
}

body[data-hero-style="quiet"] .hero-section h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.theme-live-preview[data-preview-button-style="ghost"] .preview-actions button,
.theme-live-preview[data-preview-button-style="ghost"] .preview-card-row a {
  color: var(--preview-primary, #315f55);
  background: transparent;
  border-color: transparent;
  border-bottom-color: currentColor;
  border-radius: 0;
  padding-inline: 2px;
}

.theme-live-preview[data-preview-button-style="lifted"] .preview-actions button,
.theme-live-preview[data-preview-button-style="lifted"] .preview-card-row a {
  box-shadow: 0 5px 0 color-mix(in srgb, var(--preview-primary, #315f55) 42%, #000000);
  transform: translateY(-2px);
}

.theme-live-preview[data-preview-button-style="split"] .preview-actions button,
.theme-live-preview[data-preview-button-style="split"] .preview-card-row a {
  border-left: 7px solid var(--preview-accent, #c8ddeb);
}

.theme-live-preview[data-preview-button-style="glass"] .preview-actions button,
.theme-live-preview[data-preview-button-style="glass"] .preview-card-row a {
  color: var(--preview-primary, #315f55);
  background: color-mix(in srgb, var(--preview-surface, #ffffff) 70%, transparent);
  border-color: color-mix(in srgb, var(--preview-primary, #315f55) 24%, transparent);
}

.theme-live-preview[data-preview-card-style="glass"] .preview-hero article,
.theme-live-preview[data-preview-card-style="glass"] .preview-card-row article {
  background: color-mix(in srgb, var(--preview-surface, #ffffff) 72%, transparent);
  backdrop-filter: blur(10px);
}

.theme-live-preview[data-preview-card-style="editorial"] .preview-hero article,
.theme-live-preview[data-preview-card-style="editorial"] .preview-card-row article {
  border-left: 6px solid var(--preview-accent, #c8ddeb);
  box-shadow: none;
}

.theme-live-preview[data-preview-card-style="compact"] .preview-hero article,
.theme-live-preview[data-preview-card-style="compact"] .preview-card-row article {
  padding: 10px;
  box-shadow: none;
}

.theme-live-preview[data-preview-hero-style="editorial"] .preview-hero {
  grid-template-columns: 0.82fr 1.18fr;
  align-items: end;
}

.theme-live-preview[data-preview-hero-style="spotlight"] .preview-hero {
  grid-template-columns: 1fr;
  color: #ffffff;
  background: linear-gradient(100deg, var(--preview-primary, #315f55) 0 62%, var(--preview-accent, #c8ddeb) 62% 100%);
}

.theme-live-preview[data-preview-hero-style="spotlight"] .preview-hero article {
  display: none;
}

.theme-live-preview[data-preview-hero-style="spotlight"] .preview-hero h4,
.theme-live-preview[data-preview-hero-style="spotlight"] .preview-hero p,
.theme-live-preview[data-preview-hero-style="spotlight"] .preview-hero span {
  color: #ffffff;
}

.theme-live-preview[data-preview-hero-style="quiet"] .preview-hero {
  grid-template-columns: 1fr;
}

.theme-live-preview[data-preview-hero-style="quiet"] .preview-hero article {
  display: none;
}

.theme-live-preview[data-preview-background-style="clean"] .preview-shell {
  background-image: var(--preview-pattern-image, none);
}

.theme-live-preview[data-preview-background-style="paper"] .preview-shell {
  background-image: var(--preview-pattern-image, none), linear-gradient(90deg, rgba(0,0,0,0.055) 1px, transparent 1px), linear-gradient(180deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: var(--preview-pattern-size, auto), 22px 22px, 22px 22px;
}

.theme-live-preview[data-preview-background-style="bands"] .preview-shell {
  background-image: var(--preview-pattern-image, none), linear-gradient(180deg, var(--preview-secondary, #b9d8c2) 0 24%, transparent 24% 52%, color-mix(in srgb, var(--preview-accent, #c8ddeb) 28%, transparent) 52% 76%, transparent 76%);
}

.theme-live-preview[data-preview-background-style="diagonal"] .preview-shell {
  background-image: var(--preview-pattern-image, none), linear-gradient(128deg, color-mix(in srgb, var(--preview-secondary, #b9d8c2) 38%, var(--preview-bg, #fffdf8)) 0 42%, var(--preview-bg, #fffdf8) 42% 70%, color-mix(in srgb, var(--preview-accent, #c8ddeb) 30%, var(--preview-bg, #fffdf8)) 70%);
}

.theme-live-preview[data-preview-background-style="depth"] .preview-shell {
  background-image: var(--preview-pattern-image, none), linear-gradient(145deg, color-mix(in srgb, var(--preview-primary, #315f55) 12%, var(--preview-bg, #fffdf8)), var(--preview-bg, #fffdf8) 48%, color-mix(in srgb, var(--preview-secondary, #b9d8c2) 42%, var(--preview-bg, #fffdf8)));
}

.theme-live-preview[data-preview-background-style="sectioned"] .preview-shell {
  background-image: var(--preview-pattern-image, none), linear-gradient(90deg, color-mix(in srgb, var(--preview-primary, #315f55) 10%, var(--preview-bg, #fffdf8)) 0 50%, color-mix(in srgb, var(--preview-secondary, #b9d8c2) 24%, var(--preview-bg, #fffdf8)) 50% 100%);
}


/* Public page layout templates */
.public-layout-shell {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  align-items: start;
  background: var(--paper);
}

.public-flow {
  min-width: 0;
}

.public-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  min-height: calc(100vh - 72px);
  padding: clamp(18px, 3vw, 34px) 0;
  background: color-mix(in srgb, var(--theme-primary, #315f55) 9%, var(--theme-bg, #fffdf8));
  border-right: 1px solid var(--line);
}

.partners-side-section {
  padding: 0 clamp(16px, 2.4vw, 28px);
  background: transparent;
  border: 0;
}

.partners-side-section .partners-strip-inner,
.partners-side-section .partner-list {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.partners-side-section .partner-pill,
.partners-side-section .partner-main-link {
  width: 100%;
  justify-content: flex-start;
}

body[data-page-layout="visual-left"] .managed-hero .hero-content {
  order: 2;
}

body[data-page-layout="visual-left"] .managed-hero .hero-visual {
  order: 1;
}

body[data-page-layout="visual-left"] .managed-hero {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

body[data-page-layout="visual-left"] .campaign-card {
  transform: rotate(-1deg);
}

body[data-page-layout="editorial-stack"] .managed-hero {
  grid-template-columns: minmax(0, 980px);
  justify-content: center;
  text-align: left;
  min-height: 72vh;
}

body[data-page-layout="editorial-stack"] .managed-hero .hero-content,
body[data-page-layout="editorial-stack"] .managed-hero .hero-copy {
  max-width: 980px;
}

body[data-page-layout="editorial-stack"] .managed-hero .hero-visual {
  min-height: auto;
  place-items: stretch;
}

body[data-page-layout="editorial-stack"] .managed-hero .campaign-card {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

body[data-page-layout="editorial-stack"] .document-grid,
body[data-page-layout="editorial-stack"] .resource-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

body[data-page-layout="map-focus"] .map-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
}

body[data-page-layout="map-focus"] .world-panel {
  order: -1;
}

body[data-page-layout="map-focus"] .world-map {
  min-height: clamp(520px, 72vh, 780px);
}

body[data-page-layout="map-focus"] .directory-list {
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}

.theme-live-preview[data-preview-page-layout="visual-left"] .preview-hero > div {
  order: 2;
}

.theme-live-preview[data-preview-page-layout="visual-left"] .preview-hero > article {
  order: 1;
}

.theme-live-preview[data-preview-page-layout="partners-side"] .preview-shell {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
}

.theme-live-preview[data-preview-page-layout="partners-side"] .preview-shell::before {
  content: "Partenaires";
  grid-row: 1 / span 3;
  padding: 12px 8px;
  color: var(--preview-primary, #315f55);
  background: color-mix(in srgb, var(--preview-primary, #315f55) 10%, var(--preview-bg, #fffdf8));
  border-right: 1px solid color-mix(in srgb, var(--preview-primary, #315f55) 18%, transparent);
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.theme-live-preview[data-preview-page-layout="partners-side"] .preview-shell > * {
  grid-column: 2;
}

.theme-live-preview[data-preview-page-layout="editorial-stack"] .preview-hero {
  grid-template-columns: 1fr;
}

.theme-live-preview[data-preview-page-layout="editorial-stack"] .preview-card-row {
  grid-template-columns: 1fr 1fr;
}

.theme-live-preview[data-preview-page-layout="map-focus"] .preview-card-row article:last-child {
  grid-column: span 2;
  min-height: 96px;
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--preview-accent, #c8ddeb) 22%, transparent), transparent);
}

@media (max-width: 900px) {
  .public-layout-shell {
    grid-template-columns: 1fr;
  }

  .public-sidebar {
    position: static;
    min-height: 0;
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .partners-side-section .partners-strip-inner,
  .partners-side-section .partner-list {
    display: flex;
  }

  body[data-page-layout="visual-left"] .managed-hero .hero-content,
  body[data-page-layout="visual-left"] .managed-hero .hero-visual,
  body[data-page-layout="map-focus"] .world-panel {
    order: initial;
  }

  body[data-page-layout="editorial-stack"] .managed-hero .campaign-card,
  body[data-page-layout="map-focus"] .map-layout {
    grid-template-columns: 1fr;
  }
}


/* Layout template picker */
.layout-template-picker {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--white) 82%, var(--theme-secondary, #b9d8c2));
}

.layout-template-picker legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 800;
}

.layout-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.layout-template-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 230px;
  padding: 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 20px rgba(53, 77, 74, 0.06);
}

.layout-template-card input {
  position: absolute;
  inset: 12px 12px auto auto;
  width: 18px;
  height: 18px;
  accent-color: var(--theme-primary, #315f55);
}

.layout-template-card:has(input:checked) {
  border-color: var(--theme-primary, #315f55);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary, #315f55) 18%, transparent), 0 14px 28px rgba(53, 77, 74, 0.12);
}

.layout-template-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.layout-template-card span:not(.layout-mini):not(.layout-mini span) {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.layout-mini {
  position: relative;
  display: block;
  height: 104px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 18%, transparent);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--theme-bg, #fffdf8), color-mix(in srgb, var(--theme-secondary, #b9d8c2) 38%, var(--theme-bg, #fffdf8)));
}

.layout-mini span {
  position: absolute;
  display: block;
  border-radius: 4px;
  background: color-mix(in srgb, var(--theme-primary, #315f55) 72%, #ffffff);
}

.layout-mini .mini-nav {
  inset: 8px 8px auto 8px;
  height: 10px;
  opacity: 0.9;
}

.layout-mini .mini-hero-text {
  left: 12px;
  top: 30px;
  width: 45%;
  height: 42px;
  background: color-mix(in srgb, var(--theme-primary, #315f55) 34%, #ffffff);
}

.layout-mini .mini-hero-card {
  right: 12px;
  top: 30px;
  width: 32%;
  height: 48px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 18%, transparent);
}

.layout-mini .mini-strip {
  left: 12px;
  right: 12px;
  bottom: 18px;
  height: 8px;
  background: color-mix(in srgb, var(--theme-accent, #c8ddeb) 55%, #ffffff);
}

.layout-mini .mini-row {
  left: 12px;
  bottom: 6px;
  width: 58%;
  height: 7px;
  background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 70%, #ffffff);
}

.layout-mini .mini-row.short {
  left: auto;
  right: 12px;
  width: 24%;
}

.layout-mini .mini-hero-card.left {
  left: 12px;
  right: auto;
  width: 34%;
}

.layout-mini .mini-hero-text.right {
  left: auto;
  right: 12px;
  width: 46%;
}

.layout-mini .mini-sidebar {
  inset: 0 auto 0 0;
  width: 28px;
  border-radius: 0;
  background: color-mix(in srgb, var(--theme-primary, #315f55) 18%, var(--theme-bg, #fffdf8));
}

.layout-mini .mini-nav.side,
.layout-mini .mini-hero-text.side,
.layout-mini .mini-hero-card.side,
.layout-mini .mini-row.side {
  left: 40px;
}

.layout-mini .mini-nav.side {
  right: 8px;
}

.layout-mini .mini-hero-text.side {
  width: 38%;
}

.layout-mini .mini-hero-card.side {
  right: 10px;
  width: 28%;
}

.layout-mini .mini-row.side {
  right: 10px;
  bottom: 10px;
  width: auto;
  height: 13px;
}

.layout-mini .mini-wide-title {
  left: 12px;
  right: 12px;
  top: 30px;
  height: 26px;
  background: color-mix(in srgb, var(--theme-primary, #315f55) 40%, #ffffff);
}

.layout-mini .mini-wide-card {
  left: 12px;
  right: 12px;
  top: 64px;
  height: 16px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 18%, transparent);
}

.layout-mini .mini-grid-a,
.layout-mini .mini-grid-b {
  bottom: 8px;
  height: 10px;
  background: color-mix(in srgb, var(--theme-accent, #c8ddeb) 48%, #ffffff);
}

.layout-mini .mini-grid-a {
  left: 12px;
  width: 42%;
}

.layout-mini .mini-grid-b {
  right: 12px;
  width: 42%;
}

.layout-mini .mini-hero-text.compact {
  width: 58%;
  height: 20px;
}

.layout-mini .mini-map {
  left: 12px;
  right: 58px;
  bottom: 10px;
  height: 46px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme-accent, #c8ddeb) 70%, #ffffff), color-mix(in srgb, var(--theme-primary, #315f55) 28%, #ffffff));
}

.layout-mini .mini-list {
  right: 12px;
  bottom: 10px;
  width: 36px;
  height: 46px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 18%, transparent);
}


/* Full layout preview page */
.layout-preview-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 4px;
  padding: 8px 10px;
  color: var(--theme-primary, #315f55);
  border: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 32%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-surface, #ffffff) 82%, transparent);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.layout-preview-link:hover,
.layout-preview-link:focus-visible {
  background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 42%, var(--theme-surface, #ffffff));
}

.layout-preview-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.2fr) auto;
  gap: 18px;
  align-items: center;
  padding: clamp(18px, 3vw, 30px) clamp(18px, 4vw, 64px);
  color: var(--ink);
  background: color-mix(in srgb, var(--theme-surface, #ffffff) 92%, var(--theme-secondary, #b9d8c2));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 26px rgba(53, 77, 74, 0.08);
}

.layout-preview-toolbar h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.layout-preview-toolbar p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

.layout-preview-toolbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layout-preview-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--theme-primary, #315f55);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.layout-preview-nav-link.active-layout-preview {
  color: var(--theme-button-text, #ffffff);
  background: var(--theme-primary, #315f55);
  border-color: var(--theme-primary, #315f55);
}

@media (max-width: 980px) {
  .layout-preview-toolbar {
    grid-template-columns: 1fr;
  }
}


/* Additional partner placement layouts */
body[data-page-layout="partners-after-news"] .partners-strip,
body[data-page-layout="partners-before-map"] .partners-strip,
body[data-page-layout="partners-bottom"] .partners-strip,
body[data-page-layout="resource-first"] .partners-strip {
  margin: 0;
  padding-block: clamp(28px, 4vw, 54px);
  background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 22%, var(--theme-bg, #fffdf8));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

body[data-page-layout="partners-after-news"] .partners-strip-inner,
body[data-page-layout="partners-before-map"] .partners-strip-inner,
body[data-page-layout="partners-bottom"] .partners-strip-inner,
body[data-page-layout="resource-first"] .partners-strip-inner {
  max-width: 1180px;
  margin: 0 auto;
}

body[data-page-layout="partners-bottom"] .partners-strip {
  background: color-mix(in srgb, var(--theme-primary, #315f55) 10%, var(--theme-bg, #fffdf8));
}

body[data-page-layout="partners-bottom"] .partners-strip-inner {
  grid-template-columns: 1fr;
  text-align: center;
}

body[data-page-layout="partners-bottom"] .partner-list {
  justify-content: center;
}

body[data-page-layout="resource-first"] .resource-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

body[data-page-layout="resource-first"] #ressources {
  background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 18%, var(--paper));
}

.layout-mini .mini-news-band,
.layout-mini .mini-partner-band,
.layout-mini .mini-resource-grid {
  left: 12px;
  right: 12px;
  height: 10px;
}

.layout-mini .mini-news-band {
  top: 52px;
  background: color-mix(in srgb, var(--theme-accent, #c8ddeb) 55%, #ffffff);
}

.layout-mini .mini-news-band.low {
  top: 72px;
  right: 58px;
}

.layout-mini .mini-partner-band {
  top: 68px;
  background: color-mix(in srgb, var(--theme-primary, #315f55) 54%, #ffffff);
}

.layout-mini .mini-partner-band.middle {
  top: 58px;
}

.layout-mini .mini-partner-band.bottom {
  top: auto;
  bottom: 8px;
  height: 12px;
}

.layout-mini .mini-map.small {
  left: 12px;
  right: 12px;
  top: 76px;
  height: 18px;
}

.layout-mini .mini-resource-grid {
  top: 48px;
  height: 18px;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--theme-primary, #315f55) 32%, #ffffff) 0 31%,
      transparent 31% 35%,
      color-mix(in srgb, var(--theme-primary, #315f55) 32%, #ffffff) 35% 66%,
      transparent 66% 70%,
      color-mix(in srgb, var(--theme-primary, #315f55) 32%, #ffffff) 70% 100%);
}

.theme-live-preview[data-preview-page-layout="partners-after-news"] .preview-card-row::before,
.theme-live-preview[data-preview-page-layout="partners-before-map"] .preview-card-row::before,
.theme-live-preview[data-preview-page-layout="partners-bottom"] .preview-card-row::after,
.theme-live-preview[data-preview-page-layout="resource-first"] .preview-card-row::before {
  content: "Partenaires";
  display: grid;
  place-items: center;
  min-height: 44px;
  color: var(--preview-primary, #315f55);
  border: 1px solid color-mix(in srgb, var(--preview-primary, #315f55) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--preview-secondary, #b9d8c2) 34%, var(--preview-surface, #ffffff));
  font-size: 0.72rem;
  font-weight: 800;
}

.theme-live-preview[data-preview-page-layout="partners-after-news"] .preview-card-row::before,
.theme-live-preview[data-preview-page-layout="partners-before-map"] .preview-card-row::before,
.theme-live-preview[data-preview-page-layout="resource-first"] .preview-card-row::before {
  grid-column: 1 / -1;
  order: -1;
}

.theme-live-preview[data-preview-page-layout="partners-bottom"] .preview-card-row::after {
  grid-column: 1 / -1;
}

.theme-live-preview[data-preview-page-layout="resource-first"] .preview-card-row article:nth-child(3) {
  order: -2;
}


/* Controlled block builder variants */
.home-variant-visual-left .hero-content { order: 2; }
.home-variant-visual-left .hero-visual { order: 1; }
.home-variant-visual-left { grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr); }
.home-variant-centered { grid-template-columns: minmax(0, 920px); justify-content: center; text-align: center; }
.home-variant-centered .hero-content,
.home-variant-centered .hero-copy { margin-inline: auto; }
.home-variant-centered .hero-actions { justify-content: center; }
.home-variant-centered .hero-visual { display: none; }
.home-variant-banner { grid-template-columns: minmax(0, 1fr); min-height: 64vh; background-color: var(--theme-primary, #315f55); }
.home-variant-banner .hero-content { max-width: 1080px; }
.home-variant-banner h1,
.home-variant-banner .hero-copy,
.home-variant-banner .eyebrow { color: #ffffff; }
.home-variant-banner .hero-visual { display: none; }
.home-variant-quiet { grid-template-columns: minmax(0, 900px); min-height: 48vh; }
.home-variant-quiet .hero-visual { display: none; }
.home-variant-quiet h1 { font-size: clamp(2.2rem, 5vw, 4.4rem); }

.news-variant-grid .news-carousel,
.news-variant-editorial .news-carousel {
  grid-auto-flow: initial;
  grid-auto-columns: initial;
  overflow: visible;
  scroll-snap-type: none;
}
.news-variant-grid .news-carousel { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.news-variant-editorial .news-carousel { grid-template-columns: 1fr; }
.news-variant-editorial .news-card { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); }
.news-variant-editorial .news-image { min-height: 220px; }
.news-variant-grid .carousel-controls,
.news-variant-editorial .carousel-controls { display: none; }

.documents-variant-list .document-grid,
.documents-variant-compact .document-grid { grid-template-columns: 1fr; }
.documents-variant-list .document-card { grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); }
.documents-variant-compact .document-card { min-height: auto; padding: 16px; }
.documents-variant-compact .document-preview { min-height: 130px; }

.directory-variant-map-left .map-layout { grid-template-columns: minmax(280px, 390px) minmax(0, 1fr); }
.directory-variant-map-left .directory-list { order: -1; }
.directory-variant-map-top .map-layout { grid-template-columns: 1fr; }
.directory-variant-map-top .world-map { min-height: clamp(520px, 70vh, 760px); }
.directory-variant-map-top .directory-list { max-height: none; }
.directory-variant-map-top .accordion-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }

.resources-variant-list .resource-grid { grid-template-columns: 1fr; }
.resources-variant-featured .resource-grid { grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(220px, 0.8fr)); }
.resources-variant-featured .resource-card:first-child { grid-row: span 2; background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 24%, var(--white)); }

.partners-variant-feature .partners-strip-inner,
.partners-variant-footer .partners-strip-inner { grid-template-columns: 1fr; text-align: center; }
.partners-variant-feature .partner-list,
.partners-variant-footer .partner-list { justify-content: center; }
.partners-variant-feature { padding-block: clamp(32px, 5vw, 68px); background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 28%, var(--theme-bg, #fffdf8)); }
.partners-variant-feature .partner-pill { min-height: 64px; padding-right: 12px; border-radius: 8px; }
.partners-variant-feature .partner-logo { width: 48px; height: 48px; }
.partners-variant-footer { padding-block: clamp(28px, 4vw, 54px); background: color-mix(in srgb, var(--theme-primary, #315f55) 10%, var(--theme-bg, #fffdf8)); }
.public-layout-shell.sidebar-right { grid-template-columns: minmax(0, 1fr) minmax(210px, 280px); }
.public-layout-shell.sidebar-right .public-sidebar { order: 2; border-right: 0; border-left: 1px solid var(--line); }
.public-layout-shell.sidebar-right .public-flow { order: 1; }

.block-builder {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--white) 86%, var(--theme-secondary, #b9d8c2));
}
.block-builder legend { padding: 0 8px; color: var(--ink); font-weight: 800; }
.block-preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.block-preset-button { display: grid; gap: 8px; padding: 10px; color: var(--ink); text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.block-preset-button .layout-mini { height: 74px; }
.block-preset-button span { font-weight: 800; }
.block-builder-grid { display: grid; gap: 10px; }
.block-builder-row { display: grid; grid-template-columns: minmax(160px, 0.7fr) minmax(110px, 0.35fr) minmax(220px, 1fr); gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.block-builder-row strong { align-self: center; color: var(--ink); }
.block-builder-row label { margin: 0; }

@media (max-width: 900px) {
  .home-variant-visual-left .hero-content,
  .home-variant-visual-left .hero-visual,
  .directory-variant-map-left .directory-list,
  .public-layout-shell.sidebar-right .public-sidebar,
  .public-layout-shell.sidebar-right .public-flow { order: initial; }
  .news-variant-editorial .news-card,
  .resources-variant-featured .resource-grid,
  .block-builder-row { grid-template-columns: 1fr; }
}


/* Visual page blueprint controls */
.block-blueprint {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.blueprint-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  color: var(--muted);
}

.blueprint-help strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.blueprint-canvas {
  display: grid;
  grid-template-columns: minmax(70px, 0.18fr) minmax(260px, 1fr) minmax(70px, 0.18fr);
  gap: 14px;
  align-items: stretch;
  min-height: 420px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(49,95,85,0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(49,95,85,0.035) 1px, transparent 1px),
    color-mix(in srgb, var(--theme-bg, #fffdf8) 84%, var(--white));
  background-size: 28px 28px, 28px 28px, auto;
}

.blueprint-side,
.blueprint-main {
  display: grid;
  gap: 12px;
}

.blueprint-side {
  align-content: stretch;
  min-height: 100%;
  padding: 10px;
  color: var(--muted);
  border: 2px dashed color-mix(in srgb, var(--theme-primary, #315f55) 22%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-secondary, #b9d8c2) 16%, transparent);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-align: center;
}

.blueprint-side.has-side-block {
  writing-mode: horizontal-tb;
  text-align: left;
  border-style: solid;
  border-color: var(--theme-primary, #315f55);
}

.blueprint-side span,
.blueprint-side small {
  align-self: center;
  justify-self: center;
}

.blueprint-main {
  align-content: start;
}

.blueprint-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 16px;
  border: 2px solid color-mix(in srgb, var(--theme-primary, #315f55) 36%, transparent);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 24px rgba(53, 77, 74, 0.08);
}

.blueprint-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.blueprint-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.blueprint-partners {
  border-color: var(--theme-accent, #f28c28);
  background: color-mix(in srgb, var(--theme-accent, #f28c28) 10%, var(--white));
}

.blueprint-card-controls,
.partner-zone-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.blueprint-card-controls button,
.partner-zone-controls button {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  color: var(--theme-primary, #315f55);
  border: 1px solid color-mix(in srgb, var(--theme-primary, #315f55) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--white) 88%, var(--theme-secondary, #b9d8c2));
  cursor: pointer;
  font-weight: 800;
}

.partner-zone-controls {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.partner-zone-controls button {
  border-radius: 8px;
  font-size: 0.78rem;
}

.block-advanced-controls {
  margin-top: 12px;
}

.block-advanced-controls summary {
  cursor: pointer;
  color: var(--theme-primary, #315f55);
  font-weight: 800;
}

@media (max-width: 820px) {
  .blueprint-canvas {
    grid-template-columns: 1fr;
  }

  .blueprint-side {
    min-height: 72px;
    writing-mode: horizontal-tb;
  }

  .blueprint-card {
    grid-template-columns: 1fr;
  }

  .blueprint-card-controls,
  .partner-zone-controls {
    justify-content: flex-start;
  }
}


/* Blueprint readability fixes */
.blueprint-canvas {
  grid-template-columns: minmax(126px, 0.24fr) minmax(320px, 1fr) minmax(126px, 0.24fr);
}

.blueprint-side {
  min-width: 116px;
  writing-mode: horizontal-tb;
  text-orientation: initial;
  text-align: center;
  overflow: hidden;
}

.blueprint-side .blueprint-card {
  grid-template-columns: 1fr;
  align-content: start;
  min-height: 100%;
  padding: 12px 10px;
}

.blueprint-side .blueprint-card strong,
.blueprint-side .blueprint-card small {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}

.blueprint-side .blueprint-card strong {
  font-size: 0.94rem;
  line-height: 1.16;
}

.blueprint-side .blueprint-card small {
  font-size: 0.78rem;
  line-height: 1.25;
}

.blueprint-side .partner-zone-controls {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}

.blueprint-side .partner-zone-controls button {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
  font-size: 0.74rem;
}

.blueprint-card-controls button {
  min-width: 48px;
}

@media (max-width: 980px) {
  .blueprint-canvas {
    grid-template-columns: minmax(104px, 0.24fr) minmax(260px, 1fr) minmax(104px, 0.24fr);
  }

  .blueprint-side {
    min-width: 96px;
  }
}

@media (max-width: 820px) {
  .blueprint-side {
    min-width: 0;
  }

  .blueprint-side .partner-zone-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* Blueprint drag and drop states */
.blueprint-card[data-draggable-block] {
  cursor: grab;
}

.blueprint-card[data-draggable-block]:active,
.blueprint-card.is-dragging-block {
  cursor: grabbing;
}

.blueprint-card.is-dragging-block {
  opacity: 0.55;
  transform: scale(0.99);
}

.blueprint-main.is-drop-target,
.blueprint-side.is-drop-target {
  outline: 3px solid var(--theme-accent, #f28c28);
  outline-offset: 4px;
  background: color-mix(in srgb, var(--theme-accent, #f28c28) 12%, var(--white));
}

.blueprint-main.is-drop-target::after {
  content: "Deposer ici";
  display: grid;
  min-height: 58px;
  place-items: center;
  color: var(--theme-primary, #315f55);
  border: 2px dashed color-mix(in srgb, var(--theme-primary, #315f55) 38%, transparent);
  border-radius: 8px;
  font-weight: 800;
}


/* Stable click-to-place blueprint fallback */
.blueprint-card.is-selected-block {
  border-color: var(--theme-accent, #f28c28);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-accent, #f28c28) 24%, transparent), 0 16px 30px rgba(53, 77, 74, 0.14);
}

.blueprint-main.is-click-drop-target,
.blueprint-side.is-click-drop-target {
  outline: 3px solid color-mix(in srgb, var(--theme-accent, #f28c28) 72%, transparent);
  outline-offset: 4px;
}

.blueprint-side.is-click-drop-target::after,
.blueprint-main.is-click-drop-target::after {
  content: "Clique ici pour deposer";
  display: grid;
  place-items: center;
  min-height: 42px;
  color: var(--theme-primary, #315f55);
  border: 1px dashed color-mix(in srgb, var(--theme-primary, #315f55) 35%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-accent, #f28c28) 8%, transparent);
  font-size: 0.8rem;
  font-weight: 800;
}

.blueprint-side.is-click-drop-target::after {
  writing-mode: horizontal-tb;
}


.blueprint-card-controls [data-block-select] {
  min-width: 92px;
  color: var(--theme-button-text, #ffffff);
  background: var(--theme-primary, #315f55);
  border-color: var(--theme-primary, #315f55);
}

.blueprint-side .blueprint-card-controls [data-block-select] {
  min-width: 0;
  width: 100%;
  font-size: 0.72rem;
}

/* Precise drag placement preview */
.blueprint-drop-marker {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: var(--theme-primary, #315f55);
  border: 2px dashed var(--theme-accent, #f28c28);
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-accent, #f28c28) 14%, var(--white));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--theme-accent, #f28c28) 18%, transparent);
  font-weight: 900;
}

.blueprint-side.is-side-drop-preview {
  border-style: solid;
  border-color: var(--theme-accent, #f28c28);
  background: color-mix(in srgb, var(--theme-accent, #f28c28) 16%, var(--white));
}

.blueprint-side.is-side-drop-preview::after {
  content: "Les partenaires iront ici";
  display: grid;
  place-items: center;
  min-height: 58px;
  color: var(--theme-primary, #315f55);
  border: 2px dashed color-mix(in srgb, var(--theme-primary, #315f55) 38%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--white) 78%, transparent);
  font-weight: 900;
  writing-mode: horizontal-tb;
}

.blueprint-main.is-drop-target::after {
  content: none;
  display: none;
}

/* Easier top/bottom drag targets in the page blueprint */
.blueprint-main {
  padding-block: 8px;
}

/* Controlled blueprint pointer drag */
.is-blueprint-pointer-dragging,
.is-blueprint-pointer-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

.blueprint-drag-ghost {
  position: fixed;
  z-index: 9999;
  width: min(360px, 46vw);
  max-width: 360px;
  pointer-events: none;
  opacity: 0.9;
  transform: rotate(1deg) scale(0.98);
  box-shadow: 0 18px 36px rgba(16, 35, 32, 0.22);
}

.blueprint-drag-ghost .blueprint-card-controls,
.blueprint-drag-ghost .partner-zone-controls {
  opacity: 0.45;
}

.admin-divider { border: 0; border-top: 1px solid rgba(31, 95, 85, 0.18); margin: 1.5rem 0; }

