@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* ================================================================
   Persodia tokens
   Edit these first. Humans do enjoy moving the furniture.
   ================================================================ */
:root {
  --p-bg: #EDEAE1;
  --p-text: #233142;
  --p-midnight: #0C223F;
  --p-teal: #1A7A8A;
  --p-title: #1A7A8A;
  --p-border: rgba(12,34,63,0.12);
  --p-muted: #4b5b68;
  --p-max: 760px;
  --p-wide: 980px;
  --p-pad: 40px;
  --p-header-height: 52px;
  --p-thumb-width: 86px;
  --p-single-image-width: 500px;
}

/* Reset enough of TT5 to keep the layout sane */
html, body { margin: 0 !important; padding: 0 !important; }
body {
  font-family: 'Source Sans 3', system-ui, sans-serif !important;
  background: var(--p-bg) !important;
  color: var(--p-text) !important;
  -webkit-font-smoothing: antialiased;
  --wp--style--root--padding-left: 0 !important;
  --wp--style--root--padding-right: 0 !important;
}
body .wp-site-blocks, body .wp-site-blocks > *, body .is-layout-constrained > * { max-width: none !important; }
.site-content, .wp-block-post-content, .entry-content { margin: 0; }

/* Header and footer */
.p-shell-header,
.p-shell-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: var(--p-header-height);
  padding: 0 var(--p-pad);
  background: var(--p-bg);
  color: var(--p-text);
}
.p-shell-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--p-border);
}
.p-shell-footer { border-top: 1px solid var(--p-border); }
.p-shell-brand,
.p-shell-header a,
.p-shell-footer a,
.p-shell-claim {
  color: var(--p-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}
.p-shell-claim { text-align: right; }
.p-shell-header a:hover,
.p-shell-footer a:hover { color: var(--p-midnight); }

/* Layout */
.p-wrap,
.p-wrap-wide {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.p-wrap { max-width: calc(var(--p-max) + (var(--p-pad) * 2)); padding: 48px var(--p-pad) 72px; }
.p-wrap-wide { max-width: calc(var(--p-wide) + (var(--p-pad) * 2)); padding: 48px var(--p-pad) 72px; }
.p-page-header { margin-bottom: 34px; }
.p-page-title,
.p-item-page-title {
  margin: 0 0 10px;
  color: var(--p-title);
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.p-page-title { font-size: 1.05rem; font-weight: 700; }
.p-item-page-title { font-size: 1.3rem; font-weight: 900; }
.p-page-intro,
.p-item-page-intro {
  margin: 0;
  color: var(--p-text);
  font-size: 1.04rem;
  line-height: 1.72;
  font-weight: 600;
}
.p-item-page-intro { margin: 0 0 16px; max-width: 42ch; }
.p-page-body { margin-top: 28px; }
.p-page-body p, .p-page-body li { font-size: 1rem; line-height: 1.75; }

/* Filters */
.p-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--p-border);
  margin-bottom: 12px;
}
.p-filter-btn {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--p-muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px 11px;
  margin-bottom: -1px;
  cursor: pointer;
}
.p-filter-btn:first-child { padding-left: 0; }
.p-filter-btn.active { color: var(--p-midnight); border-bottom-color: var(--p-teal); }
.p-repository-count {
  margin: 0 0 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Repository cards */
.p-repository-list { display: flex; flex-direction: column; gap: 0; }
.p-item-card {
  display: grid;
  grid-template-columns: var(--p-thumb-width) 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid var(--p-border);
}
.p-item-card:last-child { border-bottom: 1px solid var(--p-border); }
.p-item-thumb {
  display: block;
  width: var(--p-thumb-width);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 3px;
  background: var(--p-placeholder, transparent);
}
.p-item-thumb img,
.p-item-thumb-placeholder { width: 100%; height: 100%; display: block; }
.p-item-thumb img {
  object-fit: contain;
  object-position: center top;
}
.p-item-main { min-width: 0; }
.p-item-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.p-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.p-pill-type { background: var(--p-midnight); color: #fff; }
.p-pill-status { background: rgba(12,34,63,0.08); color: var(--p-midnight); }
.p-pill-new { background: var(--p-teal); color: #fff; }
.p-item-title,
.p-item-title a {
  margin: 0 0 10px;
  color: var(--p-title);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.42;
  font-size: 1rem;
  font-weight: 900;
}
.p-item-title a:hover { color: var(--p-teal); }
.p-item-card.is-unpublished .p-item-title,
.p-item-card.is-unpublished .p-item-title-text {
  color: var(--p-title);
}
.p-item-card.is-unpublished .p-item-thumb,
.p-item-card.is-unpublished .p-item-title-text {
  cursor: default;
}

.p-item-intro { margin: 0 0 12px; font-size: 1.02rem; line-height: 1.7; font-weight: 600; }
.p-item-meta-end,
.p-item-page-meta-end { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.88rem; align-items: baseline; }
.p-meta-sep { opacity: 0.72; }
.p-empty { padding: 18px 0; margin: 0; }
.p-repository-invite {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--p-border);
}
.p-repository-invite p { margin: 0; line-height: 1.72; }
.p-repository-invite a,
.p-page-body a,
.p-item-page-content a { color: var(--p-teal); }

/* Single item pages */
.p-article { max-width: var(--p-wide); margin: 0 auto; }
.p-item-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 18px;
}
.p-item-hero.has-image { grid-template-columns: minmax(220px, 420px) minmax(0, 1fr); }
.p-item-hero-copy { min-width: 0; }
.p-item-figure {
  margin: 0;
  width: 100%;
  align-self: start;
}
.p-item-figure img {
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  object-position: left top;
  display: block;
  border-radius: 3px;
}
.p-item-page-content {
  margin-top: 22px;
  max-width: 100%;
}
.p-item-page-content p,
.p-item-page-content li { font-size: 1rem; line-height: 1.8; }
.p-item-page-content h2 {
  margin: 1.8em 0 0.7em;
  color: var(--p-midnight);
  font-size: 0.94rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.p-item-page-content h3 {
  margin: 1.6em 0 0.6em;
  color: var(--p-teal);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
/* Hide featured image in essay template by design */
.p-article-essay .p-item-figure { display: none; }

/* Responsive */
@media (max-width: 1024px) {
  :root { --p-pad: 28px; }
  .p-item-hero.has-image { grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); }
  .p-item-figure img { max-height: 52vh; }
}
@media (max-width: 640px) {
  :root {
    --p-pad: 18px;
    --p-header-height: 48px;
    --p-thumb-width: 72px;
  }
  .p-shell-claim { max-width: 44vw; }
  .p-item-card { gap: 16px; }
  .p-item-hero.has-image { grid-template-columns: 1fr; }
  .p-item-figure { width: 100%; }
  .p-item-figure img { max-height: none; }
  .p-page-title, .p-item-page-title { font-size: 1.02rem; }
  .p-page-intro, .p-item-page-intro, .p-item-intro, .p-item-page-content p, .p-item-page-content li, .p-page-body p, .p-page-body li { font-size: 0.97rem; }
}

/* Standard pages like About */
.p-page-standard { max-width: var(--p-max); margin: 0 auto; }
.p-page-title-large { font-size: 1.2rem; font-weight: 900; }
.p-page-body-standard h2 {
  margin: 1.8em 0 0.7em;
  color: var(--p-midnight);
  font-size: 0.94rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.p-page-body-standard h3 {
  margin: 1.5em 0 0.6em;
  color: var(--p-teal);
  font-size: 0.92rem;
  font-weight: 700;
}
.p-page-body-standard p,
.p-page-body-standard li { font-size: 1rem; line-height: 1.8; }
