/**
 * PAS4 Theme - Bootstrap / Barrio component overrides.
 * Maps Bootstrap variables to the NOUN brand palette.
 * (Header colours are handled in style.css via #navbar-top / #navbar-main.)
 */

:root {
  --bs-primary: #029443;
  --bs-primary-rgb: 2, 148, 67;
  --bs-link-color: #075435;
  --bs-link-color-rgb: 7, 84, 53;
  --bs-link-hover-color: #029443;
  --bs-body-font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Buttons ---------- */
.btn-primary {
  --bs-btn-bg: #029443;
  --bs-btn-border-color: #029443;
  --bs-btn-hover-bg: #016e32;
  --bs-btn-hover-border-color: #016e32;
  --bs-btn-active-bg: #015a29;
  --bs-btn-active-border-color: #015a29;
  --bs-btn-disabled-bg: #029443;
  --bs-btn-disabled-border-color: #029443;
  color: #ffffff;
}

.btn-outline-primary {
  --bs-btn-color: #029443;
  --bs-btn-border-color: #029443;
  --bs-btn-hover-bg: #029443;
  --bs-btn-hover-border-color: #029443;
  --bs-btn-active-bg: #029443;
}

.btn-danger,
.btn-tertiary {
  --bs-btn-bg: #E02928;
  --bs-btn-border-color: #E02928;
  --bs-btn-hover-bg: #c21f1e;
  --bs-btn-hover-border-color: #c21f1e;
  color: #ffffff;
}

/* ---------- Dropdowns under the brand navbar ----------
 * (Primary rules live in style.css scoped to #navbar-main.) */
.navbar .dropdown-menu .dropdown-item {
  color: #0d6efd;
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
  background-color: #e6f5ec;
  color: #029443;
}

/* ---------- Forms / focus ---------- */
.form-control:focus,
.form-select:focus {
  border-color: #029443;
  box-shadow: 0 0 0 0.2rem rgba(2, 148, 67, 0.25);
}

/* ---------- Tables ---------- */
.table thead th {
  background-color: #029443;
  color: #ffffff;
  border-color: #016e32;
}

/* ---------- Alerts / badges ---------- */
.alert-primary {
  background-color: #e6f5ec;
  border-color: #029443;
  color: #075435;
}

.badge.bg-primary {
  background-color: #029443 !important;
}

.badge.bg-danger {
  background-color: #E02928 !important;
}

/* ---------- Pagination ---------- */
.page-link {
  color: #075435;
}

.page-item.active .page-link {
  background-color: #029443;
  border-color: #029443;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-item a {
  color: #075435;
}

/* =====================================================================
   FIELD DISPLAY (node view)
   Bold labels, each followed by a colon.
   ===================================================================== */
.pas4-theme .field__label,
.pas4-theme h3.field__label,
.pas4-theme .field--label-inline .field__label {
  font-family: var(--pas4-font-body);
  font-weight: 700;
  font-size: inherit;
  line-height: inherit;
  color: #075435;
  margin: 0;
}

.pas4-theme .field__label::after,
.pas4-theme h3.field__label::after {
  content: ':';
}

.pas4-theme .field--label-inline .field__label {
  margin-right: 0.4rem;
}

.pas4-theme .field {
  margin-bottom: 0.65rem;
}

/* =====================================================================
   NODE EDIT FORM LAYOUT
   Main region ~2/3, secondary (revision / meta) ~1/3 on md+ screens.
   ===================================================================== */
@media (min-width: 768px) {
  .pas4-theme .layout-region-node-main,
  .pas4-theme [class*="layout-region-node-main"] {
    flex: 0 0 auto;
    width: 66.6667%;
    max-width: 66.6667%;
  }
  .pas4-theme .layout-region-node-secondary,
  .pas4-theme [class*="layout-region-node-secondary"] {
    flex: 0 0 auto;
    width: 33.3333%;
    max-width: 33.3333%;
  }
}

/* =====================================================================
   PARAGRAPH / MULTI-VALUE FIELD HEADERS
   These render as green table headers; force readable white text
   (was dark and failing contrast).
   ===================================================================== */
.pas4-theme .table thead th,
.pas4-theme .field-multiple-table thead th,
.pas4-theme table thead th {
  color: #ffffff;
}

.pas4-theme .table thead th h1,
.pas4-theme .table thead th h2,
.pas4-theme .table thead th h3,
.pas4-theme .table thead th h4,
.pas4-theme .table thead th label,
.pas4-theme .field-multiple-table thead th h4,
.pas4-theme .field-multiple-table thead th label,
.pas4-theme .field-multiple-table thead th .field-multiple-label,
.pas4-theme table thead th h4 {
  color: #ffffff !important;
  font-family: var(--pas4-font-heading);
  font-size: 1rem;
  margin: 0;
}

/* Required marker stays visible on green. */
.pas4-theme .table thead th .form-required::after,
.pas4-theme .field-multiple-table thead th .form-required::after {
  color: #ffe08a;
}

/* =====================================================================
   SIDEBAR BLOCKS — soft brand cards instead of a hard square border.
   ===================================================================== */
.pas4-theme [class*="region-sidebar"] .block,
.pas4-theme .sidebar .block {
  background: #ffffff;
  border: 1px solid var(--pas4-border);
  border-top: 3px solid var(--pas4-green);
  border-radius: 0.5rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.pas4-theme [class*="region-sidebar"] .block > h2,
.pas4-theme [class*="region-sidebar"] .block .block-title,
.pas4-theme .sidebar .block > h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  color: #075435;
}

/* =====================================================================
   NODE EDIT/ADD FORM LABELS — bold, with a trailing colon.
   Excludes checkbox/radio (option) labels so they read naturally.
   ===================================================================== */
.pas4-theme .node-form .js-form-item > label,
.pas4-theme .node-form .form-item > label,
.pas4-theme form[id*="-edit-form"] .form-item > label,
.pas4-theme form[id*="-add-form"] .form-item > label {
  font-weight: 700;
  color: #075435;
}

.pas4-theme .node-form .js-form-item > label:not(.form-check-label):not(.option):not(.visually-hidden)::after,
.pas4-theme .node-form .form-item > label:not(.form-check-label):not(.option):not(.visually-hidden)::after,
.pas4-theme form[id*="-edit-form"] .form-item > label:not(.form-check-label):not(.option):not(.visually-hidden)::after,
.pas4-theme form[id*="-add-form"] .form-item > label:not(.form-check-label):not(.option):not(.visually-hidden)::after {
  content: ':';
}

/* =====================================================================
   FRONT-PAGE SLIDESHOW (Views Slideshow + "slideshow" content type)
   Slide image full-width; title/subtitle/text/link overlaid on the left.
   ===================================================================== */
.pas4-theme .pas4-slideshow,
.pas4-theme .pas4-slideshow .views-slideshow-cycle-main-frame,
.pas4-theme .pas4-slideshow .views-slideshow-cycle-main-frame-row {
  width: 100% !important;
  max-width: 100%;
}

.pas4-theme .pas4-slideshow ul,
.pas4-theme .pas4-slideshow li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pas4-theme .pas4-slide {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
}

.pas4-theme .pas4-slide__image img {
  display: block;
  width: 100%;
  height: auto;
}

.pas4-theme .pas4-slide__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  max-width: 48%;
  padding: 0 4%;
  color: #ffffff;
}

.pas4-theme .pas4-slide__title {
  margin: 0;
  color: #ffffff;
  font-family: var(--pas4-font-heading);
  font-weight: 700;
  line-height: 1.05;
  font-size: clamp(1.5rem, 3.4vw, 3.25rem);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.pas4-theme .pas4-slide__subtitle {
  color: #eafff2;
  font-weight: 600;
  font-size: clamp(0.95rem, 1.7vw, 1.5rem);
}

.pas4-theme .pas4-slide__text {
  color: #eef7f2;
  font-size: clamp(0.85rem, 1.2vw, 1.1rem);
}
.pas4-theme .pas4-slide__text p { margin: 0; }

.pas4-theme .pas4-slide__cta a {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.55rem 1.5rem;
  border-radius: 2rem;
  background: var(--pas4-red);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}
.pas4-theme .pas4-slide__cta a:hover {
  background: #c21f1e;
  color: #ffffff;
}

/* Pager dots + prev/next controls */
.pas4-theme .pas4-slideshow .views-slideshow-controls-bottom {
  text-align: center;
  margin-top: 0.6rem;
}
.pas4-theme .pas4-slideshow .views_slideshow_pager_field_item {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 5px;
  border-radius: 50%;
  background: #c7d2cc;
  text-indent: -9999px;
  overflow: hidden;
  cursor: pointer;
}
.pas4-theme .pas4-slideshow .views_slideshow_pager_field_item.active {
  background: var(--pas4-green);
}

/* Phones: let the caption use the full width over the baked scrim. */
@media (max-width: 575.98px) {
  .pas4-theme .pas4-slide__caption {
    max-width: 100%;
    padding: 0 6%;
  }
}

/* =====================================================================
   BOOTSTRAP CAROUSEL (preferred slideshow — no jQuery / Views Slideshow)
   ===================================================================== */
.pas4-theme .pas4-carousel {
  border-radius: 0.5rem;
  overflow: hidden;
}
.pas4-theme .pas4-carousel .carousel-item img {
  width: 100%;
  height: auto;
  display: block;
}
/* Brand the indicator dots. */
.pas4-theme .pas4-carousel .carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background-color: rgba(255, 255, 255, 0.6);
  opacity: 1;
}
.pas4-theme .pas4-carousel .carousel-indicators .active {
  background-color: var(--pas4-green);
}
/* Round, tinted prev/next controls. */
.pas4-theme .pas4-carousel .carousel-control-prev,
.pas4-theme .pas4-carousel .carousel-control-next {
  width: 6%;
}
.pas4-theme .pas4-carousel .carousel-control-prev-icon,
.pas4-theme .pas4-carousel .carousel-control-next-icon {
  background-color: rgba(7, 84, 53, 0.55);
  border-radius: 50%;
  padding: 1.1rem;
  background-size: 45%;
}

/* =====================================================================
   VIEWS BOOTSTRAP CAROUSEL — caption left-aligned over the baked scrim,
   brand the indicators/controls. (Targets any .carousel in content.)
   ===================================================================== */
.pas4-theme .view .carousel .carousel-caption {
  right: auto;
  left: 6%;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  text-align: left;
  max-width: 48%;
  padding: 0;
}
.pas4-theme .view .carousel .carousel-caption h1,
.pas4-theme .view .carousel .carousel-caption h2,
.pas4-theme .view .carousel .carousel-caption h3 {
  margin: 0 0 0.4rem;
  color: #ffffff;
  font-family: var(--pas4-font-heading);
  font-weight: 700;
  line-height: 1.05;
  font-size: clamp(1.5rem, 3.4vw, 3.25rem);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.pas4-theme .view .carousel .carousel-caption h1 a,
.pas4-theme .view .carousel .carousel-caption h2 a,
.pas4-theme .view .carousel .carousel-caption h3 a {
  color: #ffffff;
  text-decoration: none;
}
.pas4-theme .view .carousel .carousel-caption p {
  margin: 0;
  color: #eef7f2;
  font-size: clamp(0.85rem, 1.3vw, 1.15rem);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Show the caption on phones too (module hides it with d-none). */
@media (max-width: 767.98px) {
  .pas4-theme .view .carousel .carousel-caption.d-none {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    max-width: 92%;
  }
}

/* Brand indicators + controls for the module's carousel markup. */
.pas4-theme .view .carousel .carousel-indicators [data-slide-to],
.pas4-theme .view .carousel .carousel-indicators [data-bs-slide-to] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background-color: rgba(255, 255, 255, 0.6);
  opacity: 1;
}
.pas4-theme .view .carousel .carousel-indicators .active {
  background-color: var(--pas4-green);
}
.pas4-theme .view .carousel .carousel-control-prev-icon,
.pas4-theme .view .carousel .carousel-control-next-icon {
  background-color: rgba(7, 84, 53, 0.55);
  border-radius: 50%;
  padding: 1.1rem;
  background-size: 45%;
}

/* =====================================================================
   CAROUSEL CROSSFADE (driven by the theme's vanilla slideshow JS).
   Active slide is in flow (defines height); others fade out on top.
   Independent of Bootstrap's own slide/fade classes.
   ===================================================================== */
.pas4-theme .view .carousel .carousel-inner {
  position: relative;
}
.pas4-theme .view .carousel .carousel-item {
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  transform: none !important;
  pointer-events: none;
}
.pas4-theme .view .carousel .carousel-item.active {
  position: relative;
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

/* =====================================================================
   VIEWS BOOTSTRAP CAROUSEL — image fit + visible controls.
   ===================================================================== */
/* Image was overflowing (shown at natural 1920px and clipped on the right). */
.pas4-theme .view .carousel .carousel-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Make the prev/next controls clearly visible and clickable. */
.pas4-theme .view .carousel .carousel-control-prev,
.pas4-theme .view .carousel .carousel-control-next {
  opacity: 1;
  width: 7%;
  z-index: 5;
}
.pas4-theme .view .carousel .carousel-control-prev { justify-content: flex-start; padding-left: 1rem; }
.pas4-theme .view .carousel .carousel-control-next { justify-content: flex-end; padding-right: 1rem; }
.pas4-theme .view .carousel .carousel-control-prev-icon,
.pas4-theme .view .carousel .carousel-control-next-icon {
  width: 2.75rem;
  height: 2.75rem;
  background-color: rgba(7, 84, 53, 0.7);
  border-radius: 50%;
  background-size: 45%;
  background-repeat: no-repeat;
  background-position: center;
}
.pas4-theme .view .carousel .carousel-control-prev:hover .carousel-control-prev-icon,
.pas4-theme .view .carousel .carousel-control-next:hover .carousel-control-next-icon {
  background-color: var(--pas4-green);
}

/* =====================================================================
   CTA BUTTON CONTRAST — white text on the red button (was inheriting the
   green link colour, which failed contrast). White on #E02928 ~ 4.6:1 (AA).
   ===================================================================== */
.pas4-theme a.btn-tertiary,
.pas4-theme a.btn-danger,
.pas4-theme .carousel-caption a.btn-tertiary,
.pas4-theme .carousel-caption a.btn-danger,
.pas4-theme .pas4-slide__cta a {
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none;
}
.pas4-theme a.btn-tertiary:hover,
.pas4-theme a.btn-tertiary:focus,
.pas4-theme .carousel-caption a.btn-tertiary:hover,
.pas4-theme .carousel-caption a.btn-tertiary:focus,
.pas4-theme .pas4-slide__cta a:hover,
.pas4-theme .pas4-slide__cta a:focus {
  color: #ffffff !important;
  background-color: #b81f1e; /* darker red on hover → ~6:1 with white */
  text-decoration: none;
}

/* =====================================================================
   DASHBOARD MENUS — turn the in-page guide menus into card panels with
   rounded square button tiles. Scoped to dashboard nodes only.
   ===================================================================== */
.pas4-theme .node--type-dashboard .block-menu {
  background: #ffffff;
  border: 1px solid var(--pas4-border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.25rem 1.35rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.pas4-theme .node--type-dashboard .block-menu > h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.55rem;
  font-family: var(--pas4-font-heading);
  font-size: 1.25rem;
  color: #075435;
  border-bottom: 2px solid var(--pas4-green);
}

.pas4-theme .node--type-dashboard .block-menu ul.nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pas4-theme .node--type-dashboard .block-menu .nav-item {
  margin: 0;
}

.pas4-theme .node--type-dashboard .block-menu .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 86px;
  padding: 0.9rem 1rem;
  background: #f4f8f5;
  border: 1px solid #d7e6dd;
  border-radius: 0.65rem;
  color: #075435;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pas4-theme .node--type-dashboard .block-menu .nav-link:hover,
.pas4-theme .node--type-dashboard .block-menu .nav-link:focus,
.pas4-theme .node--type-dashboard .block-menu .nav-link.active,
.pas4-theme .node--type-dashboard .block-menu .nav-link.is-active {
  background: var(--pas4-green);
  border-color: var(--pas4-green);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(2, 148, 67, 0.25);
  transform: translateY(-2px);
}

/* Keyboard focus ring for accessibility. */
.pas4-theme .node--type-dashboard .block-menu .nav-link:focus-visible {
  outline: 3px solid #075435;
  outline-offset: 2px;
}

/* =====================================================================
   MESSAGE / NOTIFICATIONS BLOCK — card with a brand header + empty state.
   ===================================================================== */
.pas4-theme .block-views-blockmessage-message-block-1 {
  background: #ffffff;
  border: 1px solid var(--pas4-border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-top: 1.5rem;
  overflow: hidden;
}

.pas4-theme .block-views-blockmessage-message-block-1 > h2 {
  margin: 0;
  padding: 0.85rem 1.25rem;
  background: var(--pas4-green-dark);
  color: #ffffff;
  font-family: var(--pas4-font-heading);
  font-size: 1.1rem;
}

.pas4-theme .block-views-blockmessage-message-block-1 > .content {
  padding: 1.25rem;
}

.pas4-theme .block-views-blockmessage-message-block-1 .view-empty {
  margin: 0;
  padding: 1.4rem;
  text-align: center;
  color: var(--pas4-muted);
  background: #f7faf8;
  border: 1px dashed #cfe0d6;
  border-radius: 0.5rem;
}

/* Rows, when notifications exist. */
.pas4-theme .block-views-blockmessage-message-block-1 .views-row {
  padding: 0.85rem 0.25rem;
  border-bottom: 1px solid var(--pas4-border);
}
.pas4-theme .block-views-blockmessage-message-block-1 .views-row:last-child {
  border-bottom: 0;
}

/* =====================================================================
   RECORD NODES (UG/PG submissions, academic support, person nodes …)
   Tagged `.pas4-record` via pas4_theme_preprocess_node(). Turns the flat
   field stream into a readable card with label/value rows, section
   sub-cards for paragraphs, and file "download" chips.
   ===================================================================== */
.pas4-theme .pas4-record {
  background: #ffffff;
  border: 1px solid var(--pas4-border);
  border-radius: 0.9rem;
  padding: clamp(1rem, 2vw, 1.75rem);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  max-width: 1000px;
}

/* Header / "Submitted by" meta */
.pas4-theme .pas4-record > header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--pas4-green);
}
.pas4-theme .pas4-record .node__meta,
.pas4-theme .pas4-record .node__meta em {
  color: var(--pas4-muted);
  font-size: 0.9rem;
  font-style: normal;
}
.pas4-theme .pas4-record .node__meta .username {
  color: #075435;
  font-weight: 600;
}

/* ---- Quick-fact rows (inline label fields at the top level) ---- */
.pas4-theme .pas4-record .node__content > .field--label-inline {
  display: grid;
  grid-template-columns: minmax(170px, 250px) 1fr;
  gap: 0.15rem 1.25rem;
  align-items: baseline;
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eef2f0;
}
.pas4-theme .pas4-record .field--label-inline .field__label {
  color: #075435;
  font-weight: 700;
}
.pas4-theme .pas4-record .field--label-inline .field__label::after {
  content: ':';
}
.pas4-theme .pas4-record .field__item a {
  color: #075435;
  font-weight: 600;
}

/* ---- Section groups (label-above fields at the top level) ---- */
.pas4-theme .pas4-record .node__content > .field--label-above {
  margin: 1.5rem 0 0.5rem;
}
.pas4-theme .pas4-record .node__content > .field--label-above > .field__label {
  font-family: var(--pas4-font-heading);
  color: #075435;                     /* dark green text (AA on light green) */
  background: #dcefe4;                 /* light green fill */
  border-left: 4px solid var(--pas4-green);
  font-size: 1.02rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 0.4rem;
  margin-bottom: 0.75rem;
}

/* Abstract / long-text readability */
.pas4-theme .pas4-record .field--type-string-long .field__item {
  line-height: 1.7;
}

/* ---- Paragraph sub-cards (supervision record, chapters, scores) ---- */
.pas4-theme .pas4-record .paragraph {
  background: #f7faf8;
  border: 1px solid #e2ece7;
  border-left: 4px solid var(--pas4-green);
  border-radius: 0.6rem;
  padding: 1rem 1.15rem;
  margin: 0.6rem 0;
}
.pas4-theme .pas4-record .paragraph .field {
  margin-bottom: 0.6rem;
}
.pas4-theme .pas4-record .paragraph .field:last-child {
  margin-bottom: 0;
}
/* Nested paragraph field labels: compact, uppercase, muted */
.pas4-theme .pas4-record .paragraph .field--label-above > .field__label,
.pas4-theme .pas4-record .paragraph .field--label-inline .field__label {
  font-family: var(--pas4-font-body);
  color: #4a6c5b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: none;
  padding: 0;
  margin: 0 0 0.15rem;
}
.pas4-theme .pas4-record .paragraph .field__item {
  color: var(--pas4-text);
}

/* Score/decimal values as a subtle badge */
.pas4-theme .pas4-record .paragraph .field--type-decimal .field__item {
  display: inline-block;
  background: #e6f5ec;
  color: #075435;
  font-weight: 700;
  padding: 0.1rem 0.6rem;
  border-radius: 0.35rem;
}

/* ---- File links → download chips ---- */
.pas4-theme .pas4-record .file {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: #eef6f1;
  border: 1px solid #cfe3d8;
  border-radius: 0.5rem;
}
.pas4-theme .pas4-record .file::before {
  content: "";
  width: 14px;
  height: 16px;
  background: #075435;
  clip-path: polygon(0 0, 66% 0, 100% 30%, 100% 100%, 0 100%);
  flex: 0 0 auto;
}
.pas4-theme .pas4-record .file a {
  color: #075435;
  font-weight: 600;
  text-decoration: none;
}
.pas4-theme .pas4-record .file a:hover {
  text-decoration: underline;
}

/* Stack the label/value rows on small screens. */
@media (max-width: 575.98px) {
  .pas4-theme .pas4-record .node__content > .field--label-inline {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   COLLAPSIBLE RECORD SECTIONS (supervision records, chapters, scores).
   The green section header becomes a toggle; items hide when collapsed.
   Behaviour added by Drupal.behaviors.pas4Collapsibles.
   ===================================================================== */
.pas4-theme .pas4-record .field--label-above.pas4-collapsible > .field__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

/* Chevron (replaces the default colon on these headers). */
.pas4-theme .pas4-record .field--label-above.pas4-collapsible > .field__label::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  margin-left: auto;
  border-right: 2px solid #075435;
  border-bottom: 2px solid #075435;
  transform: rotate(45deg);          /* points down = expanded */
  transition: transform 0.2s ease;
}
.pas4-theme .pas4-record .field--label-above.pas4-collapsed > .field__label::after {
  transform: rotate(-45deg);         /* points right = collapsed */
}

/* Item-count badge. */
.pas4-theme .pas4-record .field--label-above .pas4-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  background: #bfe0cd;
  color: #075435;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

/* Hidden items when collapsed (multi-item uses .field__items, single-item
   renders .field__item directly under the field). */
.pas4-theme .pas4-record .field--label-above.pas4-collapsed > .field__items,
.pas4-theme .pas4-record .field--label-above.pas4-collapsed > .field__item {
  display: none;
}

/* Keyboard focus ri
/* =====================================================================
   USER PROFILE (article.profile) — avatar card with clean field rows.
   :has() scopes this to real profiles, skipping the empty .profile stub
   that appears inside record-node meta.
   ===================================================================== */
.pas4-theme .profile:has(.field__label) {
  max-width: 640px;
  background: #ffffff;
  border: 1px solid var(--pas4-border);
  border-radius: 0.9rem;
  padding: clamp(1rem, 2vw, 1.75rem);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

/* Avatar */
.pas4-theme .profile .field--name-user-picture {
  margin: 0 0 0.75rem;
}
.pas4-theme .profile .field--name-user-picture img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--pas4-green);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* "Member for …" meta line */
.pas4-theme .profile .form-type-item {
  margin: 0 0 1rem;
  color: var(--pas4-muted);
}
.pas4-theme .profile .form-type-item h4.label {
  display: inline;
  margin: 0 0.35rem 0 0;
  font-family: var(--pas4-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a6c5b;
}

/* Field rows: label / value */
.pas4-theme .profile .field--label-inline {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr;
  gap: 0.15rem 1rem;
  align-items: baseline;
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eef2f0;
}
.pas4-theme .profile .field--label-inline .field__label {
  color: #075435;
  font-weight: 700;
}
.pas4-theme .profile .field--label-inline .field__label::after {
  content: ':';
}
/* Remove Barrio's grey pill from single values */
.pas4-theme .profile .field--label-inline .field__item {
  background: none;
  padding: 0;
}
.pas4-theme .profile .field__item a {
  color: #075435;
  font-weight: 600;
  text-decoration: none;
}
.pas4-theme .profile .field__item a:hover {
  text-decoration: underline;
}

/* Group (multi-value) → brand chips */
.pas4-theme .profile .field--name-field-group .field__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pas4-theme .profile .field--name-field-group .field__item {
  background: #eef6f1;
  border: 1px solid #cfe3d8;
  border-radius: 1rem;
  padding: 0.3rem 0.85rem;
}

/* =====================================================================
   PARAGRAPH FIELD LABELS — always visible, readable captions.
   Some paragraph fields are label-inline, whose labels get suppressed by
   the base theme. Force them visible as a small caption above each value
   so records (progress reports, chapters, meetings) stay readable.
   ===================================================================== */
.pas4-theme .paragraph .field--label-inline,
.pas4-theme .paragraph .field--label-above {
  display: block;
}

.pas4-theme .paragraph .field {
  margin-bottom: 0.6rem;
}

.pas4-theme .paragraph .field__label {
  display: block !important;
  visibility: visible !important;
  float: none !important;
  width: auto !important;
  margin: 0 0 0.1rem !important;
  padding: 0;
  background: none;
  font-family: var(--pas4-font-body);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4a6c5b;
}

/* Captions don't need the trailing colon used elsewhere. */
.pas4-theme .paragraph .field__label::after {
  content: none;
}

.pas4-theme .paragraph .field__item,
.pas4-theme .paragraph .field__items {
  display: block;
  color: var(--pas4-text);
}
.pas4-theme .paragraph .text-formatted .field__item p:last-child {
  margin-bottom: 0;
}

/* =====================================================================
   FIELD GROUP — "details" formatter (e.g. Topics, Abstract & Proposals;
   Progress Reports). Framed light-green section with a green summary bar
   and a custom chevron. Paragraph cards inside sit on white for depth.
   ===================================================================== */
.pas4-theme .pas4-record details.form-wrapper {
  margin: 1.25rem 0;
  border: 1px solid #cfe3d8;
  border-radius: 0.6rem;
  background: #f1f8f4;
  overflow: hidden;
}

.pas4-theme .pas4-record details.form-wrapper > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: #dcefe4;                 /* light green fill */
  color: #075435;                     /* dark green text */
  border-left: 4px solid var(--pas4-green);
  font-family: var(--pas4-font-heading);
  font-weight: 700;
}
.pas4-theme .pas4-record details.form-wrapper > summary::-webkit-details-marker {
  display: none;
}
.pas4-theme .pas4-record details.form-wrapper > summary::marker {
  content: "";
}
.pas4-theme .pas4-record details.form-wrapper > summary::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid #075435;
  border-bottom: 2px solid #075435;
  transform: rotate(-45deg);        /* collapsed → points right */
  transition: transform 0.2s ease;
}
.pas4-theme .pas4-record details.form-wrapper[open] > summary::before {
  transform: rotate(45deg);         /* open → points down */
}
.pas4-theme .pas4-record details.form-wrapper > summary:focus-visible {
  outline: 3px solid #075435;
  outline-offset: -3px;
}

.pas4-theme .pas4-record details.form-wrapper > .details-wrapper {
  padding: 1rem 1.15rem;
}

/* The group's own field label (duplicates the summary) → small caption. */
.pas4-theme .pas4-record details.form-wrapper > .details-wrapper > .field > .field__label {
  font-family: var(--pas4-font-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4a6c5b;
  background: none;
  padding: 0;
  margin: 0 0 0.6rem;
}
.pas4-theme .pas4-record details.form-wrapper > .details-wrapper > .field > .field__label::after {
  content: none;
}

/* Paragraph cards inside the green group keep a faint green tint,
   set slightly lighter than the group so they still read as cards. */
.pas4-theme .pas4-record details.form-wrapper {
  background: #e9f4ee;
}
.pas4-theme .pas4-record details.form-wrapper .paragraph {
  background: #f5faf7;
}
