.portfolio-search {
  /* Red-bar clearance: gap between the breadcrumb hero and the
     search row, per the mockup. One knob to tune. */
  --redbar-clearance: 46px;
  padding: var(--redbar-clearance) 0 100px;
  position: relative;
  background-color: #fff;
  font-family: var(--font_regular);
}

/* section-rhythm.css loads after this file and may normalize
   section paddings — this override keeps the clearance in charge. */
section.portfolio-search#portfolioSearch {
  padding-top: var(--redbar-clearance) !important;
  padding-bottom: 100px !important;
}

.portfolio-search .container {
  position: relative;
  z-index: 2;
}

.portfolio-search__intro {
  margin-bottom: 44px;
}

.portfolio-search .filter-label {
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 20px;
  color: var(--rr-heading-primary, #000000);
  text-transform: uppercase;
}

/* =========================================================
   Filter bar
   Desktop / tablet : horizontal trigger row, one full-width
                      panel opens below the whole bar.
   Mobile (<=767px) : stacked accordion, panels open in-flow.
========================================================= */

.portfolio-search .filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 34px;
  padding-bottom: 16px;
  border-bottom: 0;
  position: relative; /* anchor for the full-width dropdown panel */
  z-index: 30;
}

.portfolio-search .filter-group {
  position: static; /* panel anchors to .filter-bar, not the trigger */
  z-index: 5;
}

.portfolio-search .filter-group.is-open {
  z-index: 50;
}

.portfolio-search .filter-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 22px 0 0;
  color: var(--rr-heading-primary, #000000);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  position: relative;
  cursor: pointer;
  transition: color 0.2s ease;
}

.portfolio-search .filter-trigger:hover {
  color: rgba(17, 17, 17, 0.55);
}

.portfolio-search .filter-group.is-open .filter-trigger {
  color: var(--rr-heading-primary, #000000);
}

.portfolio-search .filter-trigger:focus-visible {
  outline: 2px solid var(--rr-heading-primary, #000000);
  outline-offset: 4px;
}

.portfolio-search .filter-trigger::after {
  content: "\f078";
  font-family: "Font Awesome 6 Pro";
  font-weight: 300;
  font-size: 14px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.3s ease;
}

.portfolio-search .filter-group.is-open .filter-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Full-width panel below the trigger row */
.portfolio-search .filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  width: 100%;
  min-width: 0;
  padding: 20px 24px 28px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: block;
}

.portfolio-search .filter-group.is-open .filter-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.portfolio-search .filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

/* Options spread across the full panel width */
.portfolio-search .filter-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px 26px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.portfolio-search .filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 15px;
  line-height: 1.4;
  font-weight: normal;
  color: var(--secondary, #555555);
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease;
}

.portfolio-search .filter-option:hover {
  color: var(--rr-heading-primary, #000000);
  background: transparent;
}

.portfolio-search .filter-option:has(input[type="checkbox"]:checked) {
  color: var(--rr-heading-primary, #000000);
}

.portfolio-search .filter-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1.5px solid #000;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.portfolio-search .filter-option input[type="checkbox"]:checked {
  background: #000;
  border-color: #000;
}

.portfolio-search .filter-option input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--rr-heading-primary, #000000);
  outline-offset: 2px;
}

.portfolio-search .filter-option input[type="checkbox"]::before {
  display: none;
}

/* Selected chips / results meta */
.portfolio-search .selected-row {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 18px 0 0;
}

.portfolio-search .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 0px;
  background: #000000;
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
}

.portfolio-search .chip-clear {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.portfolio-search .results-meta {
  margin-top: 14px;
  color: rgba(17, 17, 17, 0.65);
  font-size: 16px;
  line-height: 1.4;
}

.portfolio-search #portfolioGrid {
  position: relative;
  z-index: 1;
}

.portfolio-search .works-section-12__item[hidden] {
  display: none !important;
}

.portfolio-search .empty {
  display: none;
  padding-top: 20px;
  color: rgba(17, 17, 17, 0.65);
  font-size: 18px;
}

.portfolio-search .empty.is-visible {
  display: block;
}

.portfolio-search .load-trigger {
  width: 100%;
  height: 1px;
  margin-top: 20px;
}

.portfolio-search .load-trigger[hidden] {
  display: none !important;
}

.portfolio-search .filter-action,
.portfolio-search .filter-action[data-action="close"],
.portfolio-search .filter-action[data-action="clear"] {
  appearance: none;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.portfolio-search .filter-action:hover,
.portfolio-search .filter-action[data-action="close"]:hover,
.portfolio-search .filter-action[data-action="clear"]:hover {
  background: #fff;
  color: #000;
  border: 1px solid #000;
}

/* =========================================================
   Keyword search — collapsed icon that expands into the
   full field (input + Search + Clear) on click.
========================================================= */
.portfolio-search .filter-searchbar {
  margin-bottom: 38px;
}

.portfolio-search .filter-search-wrap {
  display: flex;
  align-items: center;
  max-width: 780px;
}

/* --- Toggle (the collapsed state): borderless icon + "Search"
   label, grey by default, darkening to black on hover. --- */
.portfolio-search .search-toggle {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(17, 17, 17, 0.4);
  cursor: pointer;
  transition: color 0.25s ease;
}

.portfolio-search .search-toggle:hover,
.portfolio-search .filter-search-wrap.is-expanded .search-toggle {
  color: var(--rr-heading-primary, #000000);
}

.portfolio-search .search-toggle:focus-visible {
  outline: 2px solid var(--rr-heading-primary, #000000);
  outline-offset: 4px;
}

/* Anchor box for the cross-fading glyphs */
.portfolio-search .search-toggle__icons {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portfolio-search .search-toggle__text {
  display: inline-block;
  margin-left: 10px;
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.2;
  user-select: none;
  opacity: 1;
  transition:
    opacity 0.3s ease,
    max-width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    margin-left 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The label tucks away once the field is open — the x alone closes it */
.portfolio-search .filter-search-wrap.is-expanded .search-toggle__text {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
}

/* Cross-fading magnifier / close glyphs */
.portfolio-search .search-toggle__icon {
  position: absolute;
  font-size: 18px;
  line-height: 1;
  transition:
    opacity 0.3s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-search .search-toggle__icon--close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.portfolio-search .filter-search-wrap.is-expanded .search-toggle__icon--open {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.portfolio-search .filter-search-wrap.is-expanded .search-toggle__icon--close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* --- Collapsible field ---
   grid-template-columns 0fr -> 1fr gives a buttery width
   animation without hardcoded max-widths. */
.portfolio-search .search-field {
  display: grid;
  grid-template-columns: 0fr;
  flex: 1 1 auto;
  min-width: 0;
  transition: grid-template-columns 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-search .search-field__inner {
  overflow: hidden;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 0;
  opacity: 0;
  transform: translateX(-12px);
  visibility: hidden;
  transition:
    opacity 0.35s ease 0s,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.55s,
    padding-left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-search .filter-search-wrap.is-expanded .search-field {
  grid-template-columns: 1fr;
}

.portfolio-search .filter-search-wrap.is-expanded .search-field__inner {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  padding-left: 16px;
  transition:
    opacity 0.4s ease 0.12s,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s,
    padding-left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-search .filter-search-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #999;
  background: #fff;
  color: #000;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portfolio-search .filter-search-input:focus {
  border: 1px solid #000;
  border-radius: 0px;	
}

.portfolio-search .filter-search-input::placeholder {
  color: rgba(17, 17, 17, 0.5);
}

.portfolio-search .search-btn {
  height: 48px;
  min-width: 120px;
  padding: 0 18px;
  border-radius: 0px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.portfolio-search .search-btn:hover {
  background: #000;
}

.portfolio-search .search-clear-btn {
  height: 48px;
  min-width: 120px;
  padding: 0 18px;
  border-radius: 0px;
  background: transparent;
  color: #000;
  border: 1px solid #000;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.portfolio-search .search-clear-btn:hover {
  background: #000;
  color: #fff;
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 1199px) {
  .portfolio-search .filter-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .portfolio-search {
    --redbar-clearance: 38px;
    padding: var(--redbar-clearance) 0 80px;
  }

  section.portfolio-search#portfolioSearch {
    padding-bottom: 80px !important;
  }

  .portfolio-search__intro {
    margin-bottom: 32px;
  }

  .portfolio-search .filter-trigger {
    font-size: 24px;
  }

  .portfolio-search .filter-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 20px;
  }
}

/* Mobile: stacked accordion. Each group is a full-width row with
   dividers; the panel opens in-flow and pushes content down. */
@media (max-width: 767px) {
  .portfolio-search {
    --redbar-clearance: 30px;
    padding: var(--redbar-clearance) 0 64px;
  }

  section.portfolio-search#portfolioSearch {
    padding-bottom: 64px !important;
  }

  .portfolio-search .filter-bar {
    display: block;
    gap: 0;
    padding-bottom: 0;
    border-top: 1px solid rgba(17, 17, 17, 0.12);
  }

  .portfolio-search .filter-group {
    border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  }

  .portfolio-search .filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 20px 0;
    font-size: 26px;
    text-align: left;
  }

  .portfolio-search .filter-trigger:hover {
    color: var(--rr-heading-primary, #000000);
  }

  .portfolio-search .filter-trigger::after {
    position: static;
    transform: rotate(0deg);
    font-size: 15px;
  }

  .portfolio-search .filter-group.is-open .filter-trigger::after {
    transform: rotate(180deg);
  }

  .portfolio-search .filter-dropdown {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    min-width: 0;
    margin: 2px 0 24px;
    padding: 24px 20px 28px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  }

  .portfolio-search .filter-options {
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 320px;
  }

  .portfolio-search .filter-option {
    gap: 14px;
    padding: 10px 0;
    font-size: 17px;
  }

  .portfolio-search .filter-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 575px) {
  .portfolio-search .filter-options {
    max-height: 280px;
  }

  /* Keyword input takes the expanding row next to the icon;
     Search and Clear share the row below, side by side. */
  .portfolio-search .search-field__inner {
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .portfolio-search .filter-search-input {
    flex: 1 1 100%;
    width: 100%;
  }

  .portfolio-search .search-btn,
  .portfolio-search .search-clear-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  .portfolio-search .filter-search-wrap.is-expanded .search-field__inner {
    padding-left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-search .filter-trigger,
  .portfolio-search .filter-trigger::after,
  .portfolio-search .filter-option,
  .portfolio-search .filter-option input[type="checkbox"],
  .portfolio-search .filter-action,
  .portfolio-search .search-btn,
  .portfolio-search .search-clear-btn,
  .portfolio-search .search-toggle,
  .portfolio-search .search-toggle__icon,
  .portfolio-search .search-field,
  .portfolio-search .search-field__inner {
    transition: none;
  }
}


/* Override ONLY on this page */
/* =========================================================
   Project Card Hover - Video Matched
   Desktop: original translate-up hover
   Mobile: title sits higher by default, panel still reveals on hover
========================================================= */

.project-6__top .section-title-6__wrapper .title {
  max-width: 1010px;
}

.project-6__top-content {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 121px;
  margin-bottom: 80px;
}

@media only screen and (max-width: 1399px) {
  .project-6__top-content {
    margin-top: 60px;
  }
}

@media only screen and (max-width: 991px) {
  .project-6__top-content {
    margin: 50px 0;
  }
}

@media only screen and (max-width: 767px) {
  .project-6__top-content {
    gap: 15px;
    margin: 40px 0;
    flex-wrap: wrap;
  }
}

.project-6__thumb,
.project-card-hover {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #5a5a5a;
}

.project-6__thumb img,
.project-card-hover img {
  width: 100%;
  display: block;
  transition: transform 0.45s ease-in-out;
  will-change: transform;
}

.project-6__thumb:hover img,
.project-card-hover:hover img {
  transform: scale(1.08);
}

.project-6__thumb::before,
.project-card-hover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.25) 22%,
      rgba(0, 0, 0, 0) 45%
    ),
    rgba(17, 17, 17, 0.14);
  transition: opacity 0.32s ease-in-out;
}

.project-6__thumb .content-top,
.project-card-hover .content-top {
  position: absolute;
  top: 30px;
  left: 30px;
  right: 30px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.content-top {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    transform 0.45s cubic-bezier(.19,1,.22,1),
    opacity 0.35s ease;
}

.content-top .sub-title {
  transition:
    transform 0.45s cubic-bezier(.19,1,.22,1),
    border-color 0.35s ease,
    background-color 0.35s ease,
    opacity 0.35s ease;
}

.project-6__arrow i {
  transition:
    transform 0.45s cubic-bezier(.19,1,.22,1),
    opacity 0.35s ease;
}

/* Hover */
.project-6__thumb:hover .content-top,
.project-card-hover:hover .content-top {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Touch devices have no hover — keep the label visible there */
@media (hover: none) {
  .content-top {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

.project-6__thumb:hover .sub-title,
.project-card-hover:hover .sub-title {
  border-color: rgba(255,255,255,.55);
}

.project-6__thumb:hover .project-6__arrow i,
.project-card-hover:hover .project-6__arrow i {
  transform: translateY(-4px);
}
.project-6__thumb .content-top .sub-title,
.project-card-hover .content-top .sub-title {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  color: var(--white);
  font-size: 12px;
  font-weight: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: uppercase;
  font-family: var(--font_light);
}

.project-6__arrow i {
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
  color: var(--white);

  transition:
    transform 0.35s cubic-bezier(.19,1,.22,1),
    opacity 0.35s ease;
}

.project-6__thumb:hover .project-6__arrow i,
.project-card-hover:hover .project-6__arrow i {
  transform: translateY(-4px);
}

/* Desktop/tablet hover: translated panel, matching original recording */
.project-6__content {
  position: absolute;
  left: 0px;
  right: 0px;
  bottom: 0px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background-color: transparent;
  transform: translateY(24px);
  transition:
    transform 0.32s ease-in-out,
    background-color 0.32s ease-in-out,
    bottom 0.32s ease-in-out;
}

.project-6__thumb:hover .project-6__content,
.project-card-hover:hover .project-6__content {
  transform: translateY(0);
  background-color: transparent;
}

.project-6__content .price-plan {
  width: 100%;
  padding: 26px 30px 30px;
}

.project-6__content .title {
  margin: 0 0 4px;
  color: var(--white);
  font-size: 26px;
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: normal;
  font-family: var(--font_regular);
  transition: color 0.3s ease-in-out;
}

.project-6__content .title a {
  color: inherit;
}

.project-6__content .price-plan span {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  color: var(--white);
  font-size: 17px;
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  font-family: var(--font_light);
  transition:
    opacity 0.28s ease-in-out,
    visibility 0.28s ease-in-out,
    transform 0.28s ease-in-out;
}

.project-6__thumb:hover .project-6__content .price-plan span,
.project-card-hover:hover .project-6__content .price-plan span {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.project-6__content .price-plan h2,
.project-6__content .details-list {
  display: none;
}

.works-section-12__thumb {
  overflow: hidden;
}

.works-section-12 .meta .tag {
  display: inline-block;
  color: var(--primary);
  font-size: 22px;
  font-weight: normal;
  line-height: 24px;
}

.works-section-12 .meta .date {
  display: block;
  color: var(--primary);
  font-size: 22px;
  font-weight: normal;
  line-height: 24px;
}

@media only screen and (max-width: 1199px) {
  .project-6__content {
    transform: translateY(24px);
  }

  .project-6__content .title {
    font-size: 25px;
  }
}

@media only screen and (max-width: 991px) {
  .project-6__content {
    transform: translateY(24px);
  }

  .project-6__content .price-plan {
    padding: 22px 20px 20px;
  }

  .project-6__content .title {
    font-size: 23px;
  }
}

@media only screen and (max-width: 767px) {
  .project-6__thumb .content-top,
  .project-card-hover .content-top {
    top: 22px;
    left: 22px;
    right: 22px;
  }

  .project-6__content .title {
    font-size: 22px;
    line-height: 1.2;
  }
}

/* Mobile correction from second recording:
   Default title must sit higher, not on the card edge.
   Hover/tap still brings the black panel flush to the bottom. */
@media (max-width: 575px) {
  .project-6__thumb .content-top,
  .project-card-hover .content-top {
    top: 28px;
    left: 18px;
    right: 18px;
  }

  .project-6__thumb .content-top .sub-title,
  .project-card-hover .content-top .sub-title {
    font-size: 12px;
    padding: 5px 8px;
  }

  .project-6__content {
    left: 0;
    right: 0;
    bottom: 24px;
    transform: translateY(0);
    background-color: transparent;
  }

  .project-6__thumb:hover .project-6__content,
  .project-card-hover:hover .project-6__content {
    bottom: 0;
    transform: translateY(0);
    background-color: transparent;
  }

  .project-6__content .price-plan {
    padding: 18px;
  }

  .project-6__content .title {
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: normal;
    margin-bottom: 4px;
  }

  .project-6__content .price-plan span {
    font-size: 15px;
    line-height: 1.2;
  }
}

/* =========================================================
   Grid / List view toggle  (mockup: list-view-toggle.jpg)
   Sits at the right end of the filter-trigger row.
========================================================= */

.portfolio-search .view-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.portfolio-search .view-toggle__label {
  font-size: 18px;
  line-height: 1.2;
  color: rgba(17, 17, 17, 0.4);
  transition: color 0.25s ease;
  user-select: none;
}

.portfolio-search .view-toggle__label.is-active {
  color: var(--rr-heading-primary, #000000);
}

.portfolio-search .view-toggle__switch {
  appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  width: 46px;
  height: 22px;
  border-radius: 999px;
  background: #000;
  flex: 0 0 auto;
}

.portfolio-search .view-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  will-change: transform;
  /* Fallback transition when GSAP is absent; GSAP overrides inline. */
  transition: transform 0.3s ease;
}

.portfolio-search .view-toggle__switch[aria-checked="true"] .view-toggle__knob {
  transform: translateX(24px);
}

/* Results row: holds #resultsMeta; on mobile the JS moves the
   view toggle in here, so meta sits left and toggle sits right
   on the same line. */
.portfolio-search .results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
}

.portfolio-search .results-row .results-meta {
  margin-top: 0;
}

@media only screen and (max-width: 767px) {
  /* No keyword search on mobile */
  .portfolio-search .filter-searchbar {
    display: none;
  }

  /* Mockup shows "Grid" / "List" only on mobile */
  .portfolio-search .view-toggle__label-suffix {
    display: none;
  }

  .portfolio-search .view-toggle {
    margin-left: 0;
    gap: 10px;
    flex: 0 0 auto;
  }

  .portfolio-search .view-toggle__label {
    font-size: 17px;
  }

  .portfolio-search .search-toggle__text {
    font-size: 17px;
  }

  .portfolio-search .view-toggle__label.is-active {
    font-weight: 500;
  }
}

/* =========================================================
   List view
   The grid wrapper gets .is-list; card thumbs hide and the
   JS-built .list-row (name / location / type) shows instead.
========================================================= */

.portfolio-search #portfolioGrid .list-row {
  display: none;
}

.portfolio-search #portfolioGrid.is-list {
  display: block;
}

.portfolio-search #portfolioGrid.is-list .works-section-12__item {
  border-bottom: 1px solid rgba(17, 17, 17, 0.14);
}

.portfolio-search #portfolioGrid.is-list .works-section-12__item:first-child {
  border-top: 1px solid rgba(17, 17, 17, 0.14);
}

.portfolio-search #portfolioGrid.is-list .works-section-12__thumb {
  display: none;
}

.portfolio-search #portfolioGrid.is-list .list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px) minmax(0, 200px);
  gap: 12px 30px;
  align-items: baseline;
  padding: 24px 0;
  text-decoration: none;
  color: var(--rr-heading-primary, #000000);
}

.portfolio-search #portfolioGrid.is-list .list-row__name {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  transition: transform 0.3s ease;
}

.portfolio-search #portfolioGrid.is-list .list-row:hover .list-row__name {
  transform: translateX(10px);
}

.portfolio-search #portfolioGrid.is-list .list-row__location,
.portfolio-search #portfolioGrid.is-list .list-row__type {
  font-size: 16px;
  line-height: 1.4;
  color: rgba(17, 17, 17, 0.65);
}

@media only screen and (max-width: 991px) {
  .portfolio-search #portfolioGrid.is-list .list-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 200px);
  }

  .portfolio-search #portfolioGrid.is-list .list-row__type {
    grid-column: 2;
  }
}

@media only screen and (max-width: 767px) {
  .portfolio-search #portfolioGrid.is-list .list-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 18px 0;
  }

  .portfolio-search #portfolioGrid.is-list .list-row__name {
    font-size: 20px;
  }

  .portfolio-search #portfolioGrid.is-list .list-row__type {
    grid-column: auto;
  }
}

/* Floating thumbnail preview shown while hovering a list row */
.list-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 300px;
  height: 200px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0);
}

.list-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (hover: none), (max-width: 991px) {
  .list-preview {
    display: none;
  }
}
/* =========================================================
   Thumbnail loading skeleton + fade-in
   While a thumb image downloads, its container shows a soft
   shimmer and the image/overlays are hidden; everything fades
   in once loaded. Cached images never get the skeleton.
   Paired with the aspect-ratio memory in filter_projects.js,
   the grid keeps its full height while images load, so the
   Back-button scroll restore lands on a laid-out page instead
   of a blank one.
========================================================= */

.portfolio-search .works-section-12__thumb.thumb-loading {
  background: #ececec;
}

/* First-ever visit (no stored ratio yet): reserve some height
   so the skeleton is visible at all. */
.portfolio-search .works-section-12__thumb.thumb-loading.thumb-noratio {
  min-height: 240px;
}

.portfolio-search .works-section-12__thumb.thumb-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4; /* above .project-6__content (z-index 3) while loading */
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: translateX(-100%);
  animation: thumbShimmer 1.3s ease-in-out infinite;
}

@keyframes thumbShimmer {
  to {
    transform: translateX(100%);
  }
}

/* Hide the image and its text overlays while loading. The image
   fades back in via the template's own `transition: all .4s` on
   the img; overlays re-appear instantly (their transition property
   is left alone because it drives the hover reveal). */
.portfolio-search .works-section-12__thumb.thumb-loading img,
.portfolio-search .works-section-12__thumb.thumb-loading .content-top,
.portfolio-search .works-section-12__thumb.thumb-loading .project-6__content {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-search .works-section-12__thumb.thumb-loading::after {
    animation: none;
  }
}
