.cd-gallery-hub {
  --cd-gallery-blue: #0b3c74;
  --cd-gallery-blue-deep: #062b55;
  --cd-gallery-pink: #e64980;
  --cd-gallery-gold: #f7c948;
  --cd-gallery-ink: #172033;
  --cd-gallery-muted: #637083;
  --cd-gallery-line: #dfe5ec;
  --cd-gallery-paper: #f8f6f1;
  box-sizing: border-box;
  margin-left: calc(50% - 50vw) !important;
  max-width: none !important;
  width: 100vw !important;
  background: var(--cd-gallery-paper);
  color: var(--cd-gallery-ink);
}

.cd-gallery-hub *,
.cd-gallery-hub *::before,
.cd-gallery-hub *::after {
  box-sizing: border-box;
}

.cd-gallery-hub__inner {
  width: min(calc(100% - 40px), 1320px);
  margin: 0 auto;
  padding: clamp(54px, 6vw, 88px) 0 72px;
}

.cd-gallery-hub__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 48px;
  align-items: end;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--cd-gallery-line);
}

.cd-gallery-hub__eyebrow,
.cd-gallery-explorer__kicker,
.cd-gallery-archive__heading > div > p,
.cd-gallery-year__heading p,
.cd-gallery-contribute > div > p {
  margin: 0;
  color: #237a38;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cd-gallery-hub__hero h1 {
  grid-column: 1;
  max-width: 830px;
  margin: 0;
  color: var(--cd-gallery-blue);
  font-family: var(--wp--preset--font-family--heading, sans-serif);
  font-size: clamp(2.55rem, 5vw, 5.3rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.cd-gallery-hub__intro {
  grid-column: 1;
  max-width: 770px;
  margin: 8px 0 0;
  color: var(--cd-gallery-muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.65;
}

.cd-gallery-hub__stats {
  grid-column: 2;
  grid-row: 1 / 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  overflow: hidden;
  border: 1px solid var(--cd-gallery-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 45px rgb(11 60 116 / 8%);
}

.cd-gallery-hub__stats span {
  display: flex;
  min-height: 112px;
  padding: 18px 16px;
  flex-direction: column;
  justify-content: center;
  color: var(--cd-gallery-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.cd-gallery-hub__stats span + span {
  border-left: 1px solid var(--cd-gallery-line);
}

.cd-gallery-hub__stats strong {
  display: block;
  margin-bottom: 4px;
  color: var(--cd-gallery-blue);
  font-size: 1.75rem;
  letter-spacing: -0.04em;
}

.cd-gallery-hub__stats span:nth-child(2) strong {
  color: var(--cd-gallery-pink);
}

.cd-gallery-hub__layout {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: clamp(34px, 4.5vw, 68px);
  align-items: start;
  padding-top: 48px;
}

.cd-gallery-explorer {
  min-width: 0;
  align-self: stretch;
}

.cd-gallery-archive,
.cd-gallery-year,
.cd-gallery-year__grid {
  min-width: 0;
}

.cd-gallery-explorer__sticky {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 104px);
  padding: 26px;
  overflow-y: auto;
  border: 1px solid var(--cd-gallery-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 15px 40px rgb(23 32 51 / 6%);
}

.cd-gallery-explorer h2 {
  margin: 5px 0 20px;
  color: var(--cd-gallery-blue);
  font-size: 1.45rem;
  line-height: 1.15;
}

.cd-gallery-search label {
  display: block;
  margin-bottom: 8px;
  color: var(--cd-gallery-ink);
  font-size: 0.78rem;
  font-weight: 750;
}

.cd-gallery-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--cd-gallery-ink);
  font: inherit;
}

.cd-gallery-search input:focus {
  border-color: var(--cd-gallery-blue);
  outline: 3px solid rgb(11 60 116 / 16%);
  outline-offset: 1px;
}

.cd-gallery-search button {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cd-gallery-blue);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cd-gallery-years {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--cd-gallery-line);
}

.cd-gallery-years > p,
.cd-gallery-explorer__paths > p {
  margin: 0 0 10px;
  color: var(--cd-gallery-muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.cd-gallery-years ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cd-gallery-years li {
  margin: 0;
  padding: 0;
}

.cd-gallery-years a {
  display: flex;
  min-height: 38px;
  padding: 7px 8px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  color: var(--cd-gallery-blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.cd-gallery-years a:hover,
.cd-gallery-years a:focus-visible {
  border-color: var(--cd-gallery-blue);
  background: #edf4fb;
}

.cd-gallery-years small {
  color: var(--cd-gallery-muted);
  font-size: 0.65rem;
}

.cd-gallery-explorer__paths {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--cd-gallery-line);
}

.cd-gallery-explorer__paths a {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--cd-gallery-blue);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
}

.cd-gallery-explorer__paths a:hover {
  color: var(--cd-gallery-pink);
}

.cd-gallery-archive__heading {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 30px;
}

.cd-gallery-archive__heading h2 {
  margin: 4px 0 0;
  color: var(--cd-gallery-blue);
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.cd-gallery-results {
  margin: 0;
  color: var(--cd-gallery-muted);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.cd-gallery-year {
  scroll-margin-top: 96px;
  padding: 30px 0 42px;
  border-top: 1px solid var(--cd-gallery-line);
}

.cd-gallery-year:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.cd-gallery-year__heading {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cd-gallery-year__heading h2 {
  margin: 0;
  color: var(--cd-gallery-blue);
  font-size: 2rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.cd-gallery-year__heading > a {
  color: var(--cd-gallery-blue);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.cd-gallery-year__heading > a:hover {
  color: var(--cd-gallery-pink);
}

.cd-gallery-year__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cd-gallery-card {
  display: flex !important;
  min-width: 0;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--cd-gallery-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgb(23 32 51 / 5%);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.cd-gallery-card:hover {
  border-color: #bdcad8;
  box-shadow: 0 16px 36px rgb(11 60 116 / 10%);
  transform: translateY(-2px);
}

.cd-gallery-card__media {
  position: relative;
  display: block !important;
  width: 100% !important;
  height: 218px !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  background: var(--cd-gallery-blue-deep);
  text-decoration: none;
}

.cd-gallery-card__collage {
  display: grid !important;
  width: 100% !important;
  height: 100% !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2px;
}

.cd-gallery-card__collage > span {
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.cd-gallery-card__media img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  transition: transform 300ms ease;
}

.cd-gallery-card:hover .cd-gallery-card__media img {
  transform: scale(1.025);
}

.cd-gallery-card__placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  color: #fff;
  font-size: 3rem;
}

.cd-gallery-card__badges {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
}

.cd-gallery-card__badges span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgb(6 43 85 / 90%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 850;
  backdrop-filter: blur(7px);
}

.cd-gallery-card__body {
  display: flex;
  min-height: 265px;
  padding: 20px;
  flex: 1;
  flex-direction: column;
}

.cd-gallery-card__source {
  margin: 0 0 9px;
  color: var(--cd-gallery-pink);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}

.cd-gallery-card h3 {
  margin: 0;
  color: var(--cd-gallery-ink);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cd-gallery-card h3 a {
  color: inherit;
  text-decoration: none;
}

.cd-gallery-card h3 a:hover {
  color: var(--cd-gallery-blue);
}

.cd-gallery-card__description {
  display: -webkit-box;
  margin: 12px 0 18px;
  overflow: hidden;
  color: var(--cd-gallery-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.cd-gallery-card__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #e9edf2;
}

.cd-gallery-card__actions a {
  color: var(--cd-gallery-blue);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.cd-gallery-card__actions .cd-gallery-card__open {
  display: inline-flex;
  padding: 8px 11px;
  align-items: center;
  border-radius: 8px;
  background: var(--cd-gallery-blue);
  color: #fff;
}

.cd-gallery-empty {
  padding: 28px;
  border: 1px dashed #b7c2cf;
  border-radius: 14px;
  color: var(--cd-gallery-muted);
  text-align: center;
}

.cd-gallery-contribute {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  margin-top: 34px;
  padding: clamp(26px, 4vw, 42px);
  border-radius: 20px;
  background: var(--cd-gallery-blue-deep);
  color: #fff;
}

.cd-gallery-contribute > div:first-child {
  max-width: 720px;
}

.cd-gallery-contribute > div > p:first-child {
  color: var(--cd-gallery-gold);
}

.cd-gallery-contribute h2 {
  margin: 6px 0 10px;
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.cd-gallery-contribute h2 + p {
  margin: 0;
  color: #dbe7f4;
  line-height: 1.55;
}

.cd-gallery-contribute__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cd-gallery-contribute__actions a {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 15px;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 9px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.cd-gallery-contribute__actions .cd-gallery-contribute__primary {
  border-color: var(--cd-gallery-gold);
  background: var(--cd-gallery-gold);
  color: #172033;
}

.cd-gallery-hub [hidden] {
  display: none !important;
}

@media (max-width: 1060px) {
  .cd-gallery-hub__hero {
    grid-template-columns: 1fr;
  }

  .cd-gallery-hub__stats {
    grid-column: 1;
    grid-row: auto;
    width: min(100%, 480px);
    margin-top: 14px;
  }

  .cd-gallery-hub__layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 30px;
  }

  .cd-gallery-year__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .cd-gallery-hub__inner {
    width: min(calc(100% - 28px), 680px);
    padding-top: 42px;
  }

  .cd-gallery-hub__layout {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 32px;
  }

  .cd-gallery-explorer__sticky {
    position: static;
    max-height: none;
    padding: 20px;
    overflow: visible;
  }

  .cd-gallery-years ul {
    display: flex;
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .cd-gallery-years li {
    flex: 0 0 76px;
    scroll-snap-align: start;
  }

  .cd-gallery-explorer__paths {
    grid-template-columns: 1fr;
  }

  .cd-gallery-contribute {
    align-items: flex-start;
    flex-direction: column;
  }

  .cd-gallery-contribute__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .cd-gallery-hub__hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.5rem);
  }

  .cd-gallery-hub__stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .cd-gallery-hub__stats span {
    min-height: 88px;
    padding: 12px 6px;
    font-size: 0.6rem;
  }

  .cd-gallery-hub__stats strong {
    font-size: 1.3rem;
  }

  .cd-gallery-archive__heading,
  .cd-gallery-year__heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .cd-gallery-results {
    white-space: normal;
  }

  .cd-gallery-card__media {
    height: 190px !important;
  }

  .cd-gallery-card__body {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cd-gallery-card,
  .cd-gallery-card__media img {
    transition: none;
  }
}
