/**
 * WordPress wrappers for HTML imported from the static site (Tailwind sections).
 */

/* Let full-width section backgrounds span the viewport */
.po-static-import {
  width: 100%;
  max-width: none;
}

.po-static-import .po-content,
.po-static-import .po-content-wide {
  max-width: var(--po-content-max, 720px);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.po-static-import .po-content-wide {
  max-width: var(--po-shell-max, 1280px);
}

/* Undo Picostrap/Bootstrap prose constraints on imported pages */
.po-has-static-import .po-static-import.entry-content {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Bootstrap utility classes collide with Tailwind tokens — restore brand palette */
.po-has-static-import .po-static-import .text-primary {
  color: #1a202c !important;
}

.po-has-static-import .po-static-import .bg-primary {
  background-color: #1a202c !important;
}

.po-has-static-import .po-static-import .border-primary {
  border-color: #1a202c !important;
}

.po-has-static-import .po-static-import .text-secondary {
  color: #3182ce !important;
}

.po-has-static-import .po-static-import .text-tertiary {
  color: #319795 !important;
}

.po-has-static-import .po-static-import .text-on-primary {
  color: #ffffff !important;
}

.po-has-static-import .po-static-import .text-on-primary-container {
  color: #a0aec0 !important;
}

.po-has-static-import .po-static-import .text-secondary-container {
  color: #90cdf4 !important;
}

.po-has-static-import .po-static-import .text-on-surface-variant {
  color: #4a5568 !important;
}

/* Imported tables and callouts */
.po-static-import .po-data-table {
  width: 100%;
  border-collapse: collapse;
}

.po-static-import .po-data-table th,
.po-static-import .po-data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.po-static-import .po-data-table thead th {
  font-family: "Public Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a202c;
  background: #f7fafc;
}

/* Publication body: match static site top spacing under header */
.single-po_publication .po-static-import {
  padding-top: 0;
}

/**
 * Bootstrap 5 .grid is a 12-column CSS grid; Tailwind .grid uses grid-cols-*.
 * Without this override, three cards land in three 1/12 columns (broken layout).
 */
.po-has-static-import .po-static-import .grid[class*="grid-cols"] {
  display: grid;
  grid-template-rows: unset;
  --bs-columns: unset;
  --bs-rows: unset;
  --bs-gap: unset;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.po-has-static-import .po-static-import .grid[class*="grid-cols"] > * {
  min-width: 0;
}

/* wpautop sometimes wraps grid children in <p> — keep them in the grid */
.po-has-static-import .po-static-import .grid[class*="grid-cols"] > p {
  display: contents;
  margin: 0;
}

.po-has-static-import .po-static-import .grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.po-has-static-import .po-static-import .grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.po-has-static-import .po-static-import .grid-cols-8 {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
}

@media (min-width: 640px) {
  .po-has-static-import .po-static-import .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 768px) {
  .po-has-static-import .po-static-import .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .po-has-static-import .po-static-import .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .po-has-static-import .po-static-import .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .po-has-static-import .po-static-import .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Homepage audience cards — "Start here" */
.po-has-static-import .po-static-import .grid.md\:grid-cols-3 > a,
.po-has-static-import .po-static-import .grid.md\:grid-cols-3 > p > a {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Fixed WP navbar — match static site main.pt-20 */
body.po-has-static-import #theme-main > .po-static-import.entry-content {
  padding-top: 5rem;
}

.single-po_publication .po-static-import {
  padding-top: 0;
}

/* Surface / background tokens vs Bootstrap .bg-light, .bg-white */
.po-has-static-import .po-static-import .bg-surface {
  background-color: #edf2f7 !important;
}

.po-has-static-import .po-static-import .bg-surface-container-lowest {
  background-color: #ffffff !important;
}

.po-has-static-import .po-static-import .bg-surface-container-low {
  background-color: #f7fafc !important;
}

.po-has-static-import .po-static-import .bg-surface-container-high {
  background-color: #edf2f7 !important;
}

.po-has-static-import .po-static-import .bg-primary-container {
  background-color: #1a202c !important;
}

.po-has-static-import .po-static-import .bg-status-report {
  background-color: #553c9a !important;
}

.po-has-static-import .po-static-import .bg-status-brief {
  background-color: #319795 !important;
}

.po-has-static-import .po-static-import .border-outline-variant {
  border-color: #e2e8f0 !important;
}

.po-has-static-import .po-static-import .text-outline {
  color: #a0aec0 !important;
}

.po-has-static-import .po-static-import .text-data-highlight {
  color: #319795 !important;
}

/* Bootstrap .border sets color; keep Tailwind border width */
.po-has-static-import .po-static-import .border {
  border-style: solid;
  border-width: 1px;
}

.po-has-static-import .po-static-import .border-y {
  border-top-width: 1px;
  border-bottom-width: 1px;
  border-style: solid;
}

.po-has-static-import .po-static-import .border-b {
  border-bottom-width: 1px;
  border-style: solid;
}

/* Flex layout — Bootstrap uses .d-flex; Tailwind .flex must stay flex */
.po-has-static-import .po-static-import .flex {
  display: flex !important;
}

.po-has-static-import .po-static-import .inline-flex {
  display: inline-flex !important;
}

.po-has-static-import .po-static-import .flex-wrap {
  flex-wrap: wrap !important;
}

.po-has-static-import .po-static-import .flex-col {
  flex-direction: column !important;
}

.po-has-static-import .po-static-import .items-center {
  align-items: center !important;
}

.po-has-static-import .po-static-import .items-end {
  align-items: flex-end !important;
}

.po-has-static-import .po-static-import .justify-between {
  justify-content: space-between !important;
}

.po-has-static-import .po-static-import .justify-center {
  justify-content: center !important;
}

.po-has-static-import .po-static-import .gap-2 {
  gap: 0.5rem !important;
}

.po-has-static-import .po-static-import .gap-6 {
  gap: 1.5rem !important;
}

.po-has-static-import .po-static-import .gap-8 {
  gap: 2rem !important;
}

/* Hero thumbnails */
.po-has-static-import .po-static-import .po-thumb,
.po-has-static-import .po-static-import img.po-research-hero__img {
  object-fit: cover;
}

.po-has-static-import .po-static-import .relative {
  position: relative !important;
}

.po-has-static-import .po-static-import .absolute {
  position: absolute !important;
}

.po-has-static-import .po-static-import .overflow-hidden {
  overflow: hidden !important;
}

.po-has-static-import .po-static-import .overflow-x-auto {
  overflow-x: auto !important;
}

.po-has-static-import .po-static-import .w-full {
  width: 100% !important;
}

.po-has-static-import .po-static-import .h-full {
  height: 100% !important;
}

.po-has-static-import .po-static-import .h-40 {
  height: 10rem !important;
}

.po-has-static-import .po-static-import .hidden {
  display: none !important;
}

@media (min-width: 768px) {
  .po-has-static-import .po-static-import .md\:flex {
    display: flex !important;
  }

  .po-has-static-import .po-static-import .md\:hidden {
    display: none !important;
  }
}

/* Research hub filter script */
.po-has-static-import .po-static-import .publication-card[hidden] {
  display: none !important;
}

.po-has-static-import .po-static-import .tab-active {
  color: #1a202c !important;
  border-bottom: 2px solid #319795 !important;
  font-weight: 700 !important;
}
