/* WordPress-only styles: maps core block markup onto the shared design system
   (tokens, base, header, sections, pages, footer are shared with the mockup). */

/* ---------- Plumbing ---------- */

/* Template-part wrappers must not trap the sticky header or add boxes. */
.wp-block-template-part:has(> .site-header),
.wp-block-template-part:has(> .skip-link),
.wp-block-template-part:has(> .site-footer) { display: contents; }

.site-main .wp-block-post-content > * { margin-block: 0; }
.wp-site-blocks { padding: 0; }

/* Lists that are layout, not bullets. */
.path-links, .route-links, .ring-list, .tag-grid { list-style: none; padding: 0; margin: 0; }

/* Text link on its own line (pattern helper `so_more`). */
.more a {
  display: inline-flex;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}
.more a:hover { color: var(--orange-deep); }
.band--panel .more a { color: var(--white); }

/* ---------- Buttons block → .btn ---------- */

.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6em 1.15em;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--orange);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.wp-block-button__link:hover { background: #FF8F2B; color: var(--ink); }
.wp-block-button.is-style-outline-ink .wp-block-button__link { background: transparent; border-color: var(--ink); color: var(--ink); }
.wp-block-button.is-style-outline-ink .wp-block-button__link:hover { background: var(--ink); color: var(--white); }
.wp-block-button.is-style-on-image .wp-block-button__link { background: rgba(16, 24, 21, .18); border-color: rgba(255, 255, 255, .85); color: var(--white); }
.wp-block-button.is-style-on-image .wp-block-button__link:hover { background: var(--white); color: var(--ink); }
.page-head-actions.wp-block-buttons { margin-top: 32px; }
.page-head-actions .wp-block-button__link { min-height: 52px; padding: 0.8em 1.5em; font-size: var(--text-md); }

/* ---------- Tables ---------- */

.wp-block-table:is(.compare, .sol-table) { margin: 0; overflow-x: auto; }
.wp-block-table:is(.compare, .sol-table) table { width: 100%; border-collapse: collapse; }
.wp-block-table:is(.compare, .sol-table) thead { border: 0; }
.wp-block-table:is(.compare, .sol-table) :is(td, th) { border: 0; }
.wp-block-table.compare :is(td, th) { padding: 16px 20px 16px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.wp-block-table.compare thead th { border-bottom: 2px solid var(--ink); }
.wp-block-table.compare tbody td:first-child { width: 24%; font-weight: 550; color: var(--ink); }
.wp-block-table.compare--wide { min-width: 0; }
.wp-block-table.compare--wide table { min-width: 760px; }

/* Homepage matrix: solution × audience. */
.sol-table th { padding: 0 24px 14px 0; font-size: var(--text-xs); font-weight: 500; color: var(--ink-soft); text-align: left; }
.sol-table td { padding: 24px 24px 24px 0; vertical-align: baseline; border-top: 1px solid var(--line) !important; }
.sol-table tbody tr:last-child td { border-bottom: 1px solid var(--line) !important; }
.sol-table td:first-child { width: 23%; font-family: var(--font-display); font-size: 1.125rem; font-weight: 400; line-height: 1.3; }
.sol-table td:nth-child(2) { width: 38%; font-size: var(--text-sm); color: var(--ink-soft); }
.sol-table td:nth-child(n+3) { font-size: var(--text-sm); color: var(--ink-soft); }
.sol-table td a { font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
@media (max-width: 860px) {
  .sol-table thead { display: none; }
  .sol-table table, .sol-table tbody, .sol-table td { display: block; width: auto !important; }
  .sol-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; padding: 22px 0; border-top: 1px solid var(--line); }
  .sol-table tr:last-child { border-bottom: 1px solid var(--line); }
  .sol-table td { padding: 0; border: 0 !important; }
  .sol-table td:first-child, .sol-table td:nth-child(2) { grid-column: 1 / -1; }
  .sol-table td:nth-child(n+3)::before { display: block; font-size: var(--text-xs); color: var(--ink-soft); margin-bottom: 2px; }
  .sol-table td[data-label]::before { content: attr(data-label); }
}

/* ---------- Section details that differ from the mockup markup ---------- */

.path-media { overflow: hidden; aspect-ratio: 3 / 2; background: var(--line); }
.path-body > .more { margin-top: 2px; }

.link-rows { border-top: 1px solid var(--line); }
.link-rows > .link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 32px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.link-rows--dark > .link-row { border-color: rgba(233, 238, 241, .16); }
.lr-title a { text-decoration: inherit; }
@media (max-width: 640px) { .link-rows > .link-row { grid-template-columns: 1fr; } }

.flow-arrow:empty {
  width: 48px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 16'%3E%3Cpath d='M0 8h36m-6-6 6 6-6 6' fill='none' stroke='%23101815' stroke-width='1.5'/%3E%3C/svg%3E") center / 48px 20px no-repeat;
}
@media (max-width: 860px) { .flow-arrow:empty { justify-self: center; transform: rotate(90deg); } }
.flow-caption { grid-column: 1 / -1; margin-top: 12px; font-size: var(--text-sm); color: var(--ink-soft); }

.notice + .section-head { margin-top: clamp(40px, 5vw, 64px); }
.band > .wrap > .notice:first-child { margin-top: 0; }

.project-body { display: grid; gap: 8px; padding-top: 18px; }
.project-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 4px 24px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Visible label above a block of sample content. */
.ph-label { margin-bottom: 14px; font-size: 12px; font-weight: 500; color: var(--orange-deep); }
.ph-label + .ph-block, .ph-wrap .ph-block { outline-offset: 10px; }
.ph-off .ph-label { display: none; }
.ph-block::before { content: none; } /* the mockup's attribute label; WordPress uses .ph-label */

.mini-facts { margin-top: 8px; }

/* ---------- Forms ---------- */

.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status--error { background: #FDECEA; border-left-color: #B3261E; }
.quote-form button[disabled] { opacity: .6; cursor: progress; }

/* ---------- Plain pages (index template) ---------- */

.prose-wide { max-width: calc(68ch + var(--gutter) * 2); }
.prose-wide p + p { margin-top: 1em; }

/* Logged-in editors: keep the sticky header and mobile menu below the admin bar. */
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
.admin-bar .mobile-nav { top: calc(var(--header-h) + var(--wp-admin--admin-bar--height, 32px)); }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

/* Kiswahili and Somali labels are longer: use the menu button up to 1360px instead of 1180px. */
@media (min-width: 1181px) and (max-width: 1360px) {
  html:not([lang^="en"]) .primary-nav,
  html:not([lang^="en"]) .header-wa,
  html:not([lang^="en"]) .lang { display: none; }
  html:not([lang^="en"]) .menu-toggle { display: inline-flex; }
  html:not([lang^="en"]) .mobile-nav:not([hidden]) { display: block !important; }
  html:not([lang^="en"]) { --header-h: 64px; }
}
