/* Shared public photo filters: visual language of the site's dark MME pages. */
.tp-photo-filters {
  box-sizing: border-box;
  width: 100%;
  margin: 1.35rem 0 1.8rem;
  padding: 1rem 1.1rem;
  border: 1px solid #424242;
  border-radius: 0.6rem;
  background: #222;
  color: #eee;
}
.tp-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-bottom: 0.8rem;
}
.tp-filter-header h2 {
  margin: 0;
  color: #f2f2f2;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
}
.tp-filter-count {
  font-size: 0.82rem;
  color: #c4c4c4;
  font-variant-numeric: tabular-nums;
}
.tp-filter-controls {
  display: grid;
  grid-template-columns: minmax(175px, 1.5fr) repeat(3, minmax(115px, 1fr)) minmax(120px, 1fr) auto;
  align-items: end;
  gap: 0.7rem;
}
.tp-filter-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.tp-filter-label {
  font-size: 0.75rem;
  font-weight: 550;
  color: #c7c7c7;
}
.tp-filter-field input[type="search"],
.tp-filter-field select,
.tp-filter-years > summary,
.tp-filter-reset {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  height: 2.55rem;
  border: 1px solid #585858;
  border-radius: 0.38rem;
  background: #292929;
  color: #f4f4f4;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.3;
}
.tp-filter-field input[type="search"],
.tp-filter-field select { padding: 0.55rem 0.7rem; }
.tp-filter-field input[type="search"]::placeholder { color: #a2a2a2; opacity: 1; }
.tp-filter-field select { cursor: pointer; text-overflow: ellipsis; padding-right: 1.6rem; }
.tp-filter-field select option { background: #292929; color: #f4f4f4; }
.tp-filter-field input[type="search"]:focus-visible,
.tp-filter-field select:focus-visible,
.tp-filter-years > summary:focus-visible,
.tp-filter-reset:focus-visible,
.tp-filter-years__all:focus-visible,
.tp-filter-year-option input:focus-visible {
  outline: 2px solid #e5484d;
  outline-offset: 2px;
}
.tp-filter-years { position: relative; min-width: 0; }
.tp-filter-years > summary {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 2rem 0.5rem 0.7rem;
  user-select: none;
}
.tp-filter-years > summary::-webkit-details-marker { display: none; }
.tp-filter-years > summary::after {
  content: '';
  position: absolute;
  right: 0.85rem;
  top: calc(50% - 0.25rem);
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid #ddd;
  border-bottom: 1.5px solid #ddd;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.tp-filter-years[open] > summary::after { transform: rotate(225deg) translate(-0.12rem, -0.12rem); }
.tp-filter-years.has-selection > summary { border-color: #c1272d; color: #fff; }
.tp-filter-years__summary-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tp-filter-years__menu {
  box-sizing: border-box;
  position: absolute;
  z-index: 100;
  top: calc(100% + 0.35rem);
  left: 0;
  width: max(100%, 190px);
  max-width: min(90vw, 290px);
  border: 1px solid #666;
  border-radius: 0.5rem;
  box-shadow: 0 0.7rem 1.6rem rgba(0,0,0,0.52);
  padding: 0.65rem;
  background: #242424;
  color: #fff;
}
.tp-filter-years__intro { font-size: 0.78rem; color: #ccc; margin-bottom: 0.45rem; }
.tp-filter-years__all {
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.55rem;
  border: 1px solid #575757;
  border-radius: 0.3rem;
  background: #333;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
}
.tp-filter-years__all:hover { border-color: #c1272d; }
.tp-filter-years__options {
  display: grid;
  gap: 0.1rem;
  max-height: min(260px, 36vh);
  overflow-y: auto;
}
.tp-filter-year-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 0.25rem;
  padding: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.tp-filter-year-option:hover { background: #353535; }
.tp-filter-year-option input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #c1272d;
  cursor: pointer;
}
.tp-filter-reset {
  width: auto;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border-color: #a5393f;
  color: #f1c6c8;
  cursor: pointer;
}
.tp-filter-reset:hover:not(:disabled) { border-color: #ef6268; background: #42262a; }
.tp-filter-reset:disabled { opacity: 0.5; cursor: default; }
.tp-filter-empty { margin: 1rem 0 0; font-size: 0.88rem; color: #d9d9d9; }
.tp-filter-empty[hidden] { display: none !important; }
.tp-gallery__item[hidden], .tp-gallery__section[hidden] { display: none !important; }

/* The pre-existing lightbox remains unchanged except for its metadata section. */
.tp-lightbox__metadata {
  display: grid;
  grid-template-columns: minmax(95px, max-content) minmax(0, 1fr);
  gap: 4px 14px;
  max-height: 32vh;
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 7px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: .91rem;
  text-align: left;
}
.tp-lightbox__metadata[hidden] { display: none !important; }
.tp-lightbox__metadata dt { font-weight: 700; color: #d4e8ed; }
.tp-lightbox__metadata dd { margin: 0; overflow-wrap: anywhere; }
.tp-lightbox__metadata a { color: #9de4f1; text-decoration: underline; text-underline-offset: 2px; }
.tp-lightbox__metadata a:hover { color: #c6f5ff; }
.tp-lightbox__metadata a:focus-visible { outline: 2px solid #9de4f1; outline-offset: 3px; }

@media (max-width: 1100px) {
  .tp-filter-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp-filter-field--search { grid-column: span 2; }
  .tp-filter-reset { min-width: 0; }
}
@media (max-width: 650px) {
  .tp-photo-filters { padding: 0.85rem; margin: 1rem 0 1.25rem; }
  .tp-filter-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .tp-filter-field--search { grid-column: 1 / -1; }
  .tp-filter-reset { align-self: end; }
  .tp-filter-years__menu { max-width: min(85vw, 290px); }
  .tp-lightbox__metadata { grid-template-columns: 1fr; gap: 2px; max-height: 27vh; }
  .tp-lightbox__metadata dd { margin-bottom: 6px; }
}
@media (max-width: 420px) {
  .tp-filter-controls { grid-template-columns: 1fr; }
  .tp-filter-field--search { grid-column: 1; }
  .tp-filter-reset { width: 100%; }
}
