.polsky-airtable-widget {
  max-width: unset;
}

.polsky-airtable-search-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: bold;
}

.polsky-airtable-search-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
}

.polsky-airtable-search {
  width: 100%;
  min-width: 0;
  border: 1px solid #6d7074;
  border-radius: 999px;
  padding: 12px 64px 13px 18px;
  font-size: 1rem;
  line-height: 1.2;
  box-sizing: border-box;
  /* suppress the native "x" clear button so our layout stays consistent */
  -webkit-appearance: none;
  appearance: none;
}

.polsky-airtable-search::-webkit-search-cancel-button {
  display: none;
}

.polsky-airtable-search:focus {
  outline: 2px solid #6d7074;
  outline-offset: 2px;
}

/* ========================================================= */

.polsky-airtable-filter-container {
  margin-bottom: 1rem;
}

.polsky-filter-toggle {
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 9px 0 6px;
  border-bottom: 1px solid currentColor;
  position: relative;
  border-radius: 0;
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.polsky-filter-toggle:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.polsky-filter-toggle::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-image: url(/wp-content/themes/ucpolsky/assets/images/menu-chevron.svg);
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  top: 12px;
  right: 0px;
  transform-origin: center 30%;
  transition: transform .5s ease-out;
}

.polsky-filter-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.polsky-filter-panel[hidden] {
  display: none;
}

.polsky-airtable-filters ul.polsky-airtable-filter {
  list-style: none;
  margin: 0 -7px 8px;
  padding: 0;
  overflow: hidden; /* clearfix for floated li */
}

.polsky-airtable-filters ul.polsky-airtable-filter li {
  display: inline-block;
  float: left;
  padding: 4px 6px 8px 0;
}

/* Base button */
.polsky-airtable-filters ul.polsky-airtable-filter li button {
  border: none;
  /*display: inline-block;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;*/
  font-size: .875rem;
  font-weight: 600;
  color: #007396;
  text-decoration: underline;
  line-height: 1;
  padding: 6px 0;
  margin-left: 8px;
  margin-right: 9px;
  cursor: pointer;
}

/* Hover — dark background, white text: contrast 14.7:1 ✓ */
/*.polsky-airtable-filters ul.polsky-airtable-filter li button:hover {
  background-color: #333333;
  color: #ffffff;
  border-color: #333333;
}*/

/* Focus (keyboard) — visible ring, never hidden */
/*.polsky-airtable-filters ul.polsky-airtable-filter li button:focus {
  outline: 3px solid #005a9c;
  outline-offset: 2px;
}*/

/* Suppress ring on pointer click for browsers that support :focus-visible */
/*.polsky-airtable-filters ul.polsky-airtable-filter li button:focus:not(:focus-visible) {
  outline: none;
}*/

/* Active / selected state — blue bg, white text: contrast 7.2:1 ✓ */
.polsky-airtable-filters ul.polsky-airtable-filter li button.active {
  /*background-color: #005a9c;
  color: #ffffff;
  border-color: #005a9c;*/
  font-weight: 600;
  background: #007396;
  color: #fff;
  border-radius: 999px;
  padding: 6px 17px 8px 8px;
  margin-left: 0px;
  margin-right: -8px;
  margin-bottom: -2px;
  position: relative;
}

.polsky-airtable-filters ul.polsky-airtable-filter li button.active::after {
  content: "×";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  text-decoration: none;
}

/*.polsky-airtable-filters ul.polsky-airtable-filter li button.active:hover {
  background-color: #003f70;
  border-color: #003f70;
}*/

/* =========================================================
   Images
   ========================================================= */

.polsky-airtable-image,
.polsky-airtable-field.picture {
  display: block;
  /*max-width: 300px;
  max-height: 300px;*/
  width: auto;
  height: 240px;
}

.polsky-airtable-field img {
  height: 100%;
  width: auto;
  margin: 0 auto;
  object-fit: contain; /* for images that exceed aspect ratio */
}

.polsky-airtable-image--placeholder {
  opacity: 0.5;
}

.image-wrapper {
    width: 100%;
    height: 100%;
    /*background: #cccccc33;*/
    position: relative;
    overflow: hidden;
}

.image-wrapper::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: var(--card-bg);
    background-size: cover;
    background-position: 50% 20%;
    filter: blur(10px);
    transform: scale(150%)
}

/* =========================================================
   Results wrapper — 1 column mobile, 3 columns desktop
   ========================================================= */

.polsky-airtable-records {
  clear: both;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: stretch; /* equal height within each row */
}

@media (min-width: 700px) {
  .polsky-airtable-records {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-md-1 .polsky-airtable-records {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .polsky-airtable-records {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-lg-1 .polsky-airtable-records {
    grid-template-columns: 1fr;
  }
  .grid-lg-2 .polsky-airtable-records {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .grid-xl-4 .polsky-airtable-records {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .grid-xl-2 .polsky-airtable-records {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-xl-1 .polsky-airtable-records {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Individual record card
   ========================================================= */

.polsky-airtable-record {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  /*border: 1px solid #efefef;*/
}

/* =========================================================
   Per-record accordion
   Relies on the theme's accordion-grid.js for open/close.
   ========================================================= */

.polsky-airtable-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  margin: 0;
  border: 1px solid #efefef;
  gap: 1.4rem;
}

.polsky-airtable-field ul {
  font-size: var(--wp--preset--font-size--sm);
  margin: 0;
  display: flex;
  flex-flow: row wrap;
  list-style-type: none;
  padding: 0;
  gap: 6px;
}

.polsky-airtable-field ul li {
    margin: 0;
    padding: 0;
    background: #00000011;
    padding: 0 0.2rem;
}

.polsky-airtable-accordion-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  background: none;
  text-transform: uppercase;
  border: 2px solid #dc2416;  /* non-text contrast ≥ 3:1 ✓ */
  border-radius: 999px;
  color: #dc2416;              /* contrast vs white 16.5:1 ✓ */
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.polsky-airtable-accordion-trigger:hover {
  background-color: #dc2416 ;
  color: #ffffff;
}

.polsky-airtable-accordion-trigger:focus {
  outline: 3px solid #005a9c;
  outline-offset: 2px;
}

.polsky-airtable-accordion-trigger:focus:not(:focus-visible) {
  outline: none;
}

/* Swap label to "Show less" when open */
.polsky-airtable-accordion-trigger[aria-expanded="true"] {
  background-color: #005a9c;
  color: #ffffff;
  border-color: #005a9c;
}

.polsky-airtable-accordion-trigger[aria-expanded="true"]:hover {
  background-color: #003f70;
  border-color: #003f70;
}

.polsky-airtable-accordion-panel {
  overflow: hidden;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  background: #efefef;
  padding: 0 16px;
  margin: 0;
  font-size: var(--wp--preset--font-size--sm);
}

.polsky-airtable-accordion-panel .polsky-airtable-field:first-child {
  margin-top: 24px;
}
.polsky-airtable-accordion-panel .polsky-airtable-field:last-child {
  margin-bottom: 24px;
}

.polsky-airtable-label {
  font-size: var(--wp--preset--font-size--xs);;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--wp--preset--color--dark-gray);
}

.polsky-airtable-label.hide { display: none; }

.polsky-airtable-accordion-panel[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .polsky-airtable-accordion-trigger {
    transition: none;
  }
}



/* venture gallery #polsky-airtable-venture-gallery */

#polsky-airtable-venture-gallery .polsky-airtable-field.logo img,
#polsky-airtable-venture-gallery .polsky-airtable-field.organization-name,
#polsky-airtable-venture-gallery .polsky-airtable-field.logo:has(img) {
    aspect-ratio: 4 / 2;
}

#polsky-airtable-venture-gallery .image-wrapper::before {display: none;}

#polsky-airtable-venture-gallery .polsky-airtable-field.logo img {
    object-fit: contain;
    object-position: center;
    max-width: unset;
    max-height: unset;
    width: 100%;
    height: auto;
    padding: 20px;
    box-sizing: border-box;
}

#polsky-airtable-venture-gallery .polsky-airtable-field.organization-name {
    display: flex;
    text-align: center;
    justify-content: center;
    align-items: center;
    font-size: var(--wp--preset--font-size--2-xl);
    color: var(--wp--preset--color--polsky-blue-text);
    line-height: 1.2;
    box-sizing: border-box;
    padding: 0 11%;
    text-shadow: 2px 2px var(--wp--preset--color--light-gray);
}

#polsky-airtable-venture-gallery .polsky-airtable-field.logo:not(:has(img)) {
  display: none;
}

#polsky-airtable-venture-gallery .polsky-airtable-field.logo:has(img) + .polsky-airtable-field.organization-name {
  display: none;
}