/* =========================================================
   GALLERY
   Blocksy-aware gallery styles for page-gallery.php
   ========================================================= */

   
:root {
  --yrk-gallery-toolbar-size: 0.96rem;
  --yrk-gallery-gap: 18px;
  --yrk-gallery-gap-lg: 22px;
  --yrk-gallery-gap-sm: 6px;

}


.yrk-gallery-wrap {
  max-width: 2400px;
  margin: 0 auto;
  padding: 0px 16px 16px;
  color: var(--yrk-clr-text);
}

.yrk-gallery-header {
  margin-bottom: 18px;
}

.yrk-gallery-header-main .entry-title {
  margin-bottom: 8px;
}

.yrk-gallery-header-main .entry-content {
  color: var(--yrk-clr-text);
}

/* Filter panel with soft beige layers */
.yrk-gallery-filters-shell {
  margin: 0 0 10px;
  padding: 6px 12px;
  border: 1px solid var(--yrk-clr-border);
  border-radius: var(--yrk-border-radius);
  background: var(--yrk-clr-surface-1);
  box-shadow: var(--yrk-shadow-soft);
}

.yrk-gallery-filters-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.yrk-gallery-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--yrk-clr-text-strong);
  font-size: var(--yrk-gallery-toolbar-size);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.yrk-gallery-filters-toggle-arrow {
  display: inline-block;
  font-size: 0.9em;
  line-height: 1;
  transform: rotate(-180deg);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.yrk-gallery-filters-toggle.is-open .yrk-gallery-filters-toggle-arrow {
  transform: rotate(0deg);
}

.yrk-gallery-filters-toolbar-meta {
  display: inline-flex;
  align-items: center;
}

.yrk-gallery-toolbar-count {
  font-size: var(--yrk-gallery-toolbar-size);
  line-height: 1.2;
  color: var(--yrk-clr-text);
  opacity: 0.95;
}

.yrk-gallery-filters-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.yrk-gallery-filter-apply,
.yrk-gallery-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.yrk-gallery-filter-apply {
  color: var(--yrk-clr-text-good);
  font-size: var(--yrk-gallery-toolbar-size);
  font-weight: 700;
}

.yrk-gallery-filter-reset {
  color: var(--yrk-clr-text-warn);
  font-size: var(--yrk-gallery-toolbar-size);
  font-weight: 400;
}

.yrk-gallery-filters-help {
  margin: 2px 4px 4px 2px;
  font-size: 0.96rem;
  line-height: 1.4;
  color: var(--yrk-clr-text);
  opacity: 0.8;
}

.yrk-gallery-filters-panel {
  margin-top: 10px;
}

.yrk-gallery-filters-panel[hidden] {
  display: none;
}

.yrk-gallery-filters {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.yrk-gallery-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 12px;
  align-items: start;
}

.yrk-gallery-filter-box {
  border: 1px solid var(--yrk-clr-border);
  border-radius: var(--yrk-border-radius);
  padding: 8px 9px 9px;
  background: var(--yrk-clr-surface-2);
  min-width: 0;
  box-shadow: none;
}

.yrk-gallery-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.yrk-gallery-filter label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--yrk-clr-text-strong);
  margin: 0;
}

.yrk-gallery-filter select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 88px;
  padding: 5px 7px;
  border: 1px solid var(--yrk-clr-border);
  border-radius: var(--yrk-border-radius);
  background: var(--yrk-clr-surface-3);
  color: var(--yrk-clr-text);
  font-size: 0.82rem;
  line-height: 1.25;
}

.yrk-gallery-filter select option {
  padding: 2px 4px;
}

#filter-availability,
#filter-price-band {
  min-height: 74px;
}


/* Gallery legend */

.yrk-gallery-legend-shell {
  margin: 2px 0 7px;
  padding: 3px 10px;
  width: fit-content;
  max-width: 100%;
  background: var(--yrk-clr-background);
}

.yrk-gallery-legend {
  line-height: 1.1;
  opacity: 0.92;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  color: var(--yrk-clr-text);
}

.yrk-gallery-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.yrk-gallery-legend-item {
  white-space: nowrap;
}



/* Gallery grid */
.yrk-gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--yrk-gallery-gap-lg);
  align-items: start;
}

/* Individual media card */
.yrk-gallery-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yrk-gallery-card-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--yrk-clr-surface-1);
  overflow: hidden;
}

/* Top text area inside the card */
.yrk-gallery-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin: 0;
  padding: 6px 9px 3px;
}

.yrk-gallery-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  line-height: 1.2;
  margin: 0;
  overflow-wrap: break-word;
  flex: 1 1 auto;
  min-width: 0;
}

.yrk-gallery-title a {
  text-decoration: none;
  color: inherit;
}

.yrk-gallery-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  font-size: 0.9rem;
  line-height: 1;
  flex: 0 0 auto;
  min-width: 28px;
  padding-top: 1px;
}

.yrk-gallery-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.96;
}

.yrk-gallery-icon.is-available,
.yrk-gallery-legend-symbol.is-available {
  color: var(--yrk-clr-text-good);
  font-weight: 900;
}

.yrk-gallery-icon.is-sold,
.yrk-gallery-legend-symbol.is-sold {
  color: var(--yrk-clr-text-warn);
  font-weight: 900;
}

/* Collection text above image, keep user's punctuation style */
.yrk-gallery-collection {
  line-height: 1.2;
  opacity: 0.88;
  text-align: left;
  color: var(--yrk-clr-text);
  background: var(--yrk-clr-surface-1);
}

.yrk-gallery-collection-above {
  margin: 0;
  padding: 0 9px 7px;
  border-bottom: 0;
  font-size: 0.84rem;
}

/* Image should sit directly in the card, without inner frame */
.yrk-gallery-thumb-link {
  display: block;
  margin: 0;
  line-height: 0;
  }

.yrk-gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.yrk-gallery-video-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  line-height: 1;
}

/****************************************************
		Other device size
****************************************************/


/* Tablet landscape (and less) */
@media (max-width: 1100px) {

  .yrk-gallery-grid {
    gap: var(--yrk-gallery-gap);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Tablet portrait and mobile landscape (and less) */
@media (max-width: 768px) {
  .yrk-gallery-grid {
    gap: var(--yrk-gallery-gap);
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* Smartphones portrait (and less) */
@media (max-width: 640px) {
  
  .yrk-gallery-grid {
    gap: var(--yrk-gallery-gap-sm);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yrk-gallery-collection,
  .yrk-gallery-legend {
    font-size: 0.7rem;
  }

}
