.gallery-page__shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.gallery-page__main {
  display: grid;
  gap: 24px;
}

.gallery-intro-card {
  padding: clamp(24px, 3vw, 38px) 0;
  display: grid;
  gap: 20px;
}

.gallery-intro-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px;
}

.gallery-toolbar__eyebrow {
  margin: 0 0 6px;
  color: var(--ndc-muted);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.gallery-toolbar h2 {
  margin: 0;
  font-family: var(--ndc-font-head);
  color: var(--ndc-blue-deep);
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.gallery-toolbar__summary {
  margin: 0;
  color: var(--ndc-muted);
  white-space: nowrap;
}

.gallery-sidebar {
  position: sticky;
  top: 120px;
  padding: 24px;
}

.gallery-sidebar__panel {
  display: grid;
  gap: 14px;
}

.gallery-sidebar__panel--note {
  margin-top: 22px;
}

.gallery-sidebar__copy {
  margin: 0;
  color: var(--ndc-muted);
  line-height: 1.7;
}

.gallery-filter-list {
  display: grid;
  gap: 10px;
}

.gallery-filter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ndc-border);
  border-radius: 16px;
  background: #fff;
  color: var(--ndc-ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.gallery-filter-link:hover,
.gallery-filter-link:focus {
  transform: translateX(4px);
  box-shadow: 0 12px 26px rgba(15, 76, 129, 0.12);
  border-color: rgba(15, 76, 129, 0.26);
}

.gallery-filter-link.is-active {
  background: var(--ndc-gradient);
  border-color: transparent;
  color: #fff;
}

.gallery-grid {
  column-count: 2;
  column-gap: 24px;
}

.gallery-page__shell .gallery-grid{
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.gallery-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 24px;
  border: 1px solid var(--ndc-border);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--ndc-shadow);
  break-inside: avoid;
  transform: translateY(18px);
  opacity: 0;
  transition: transform 420ms ease, opacity 420ms ease, box-shadow 220ms ease;
  word-break: break-word; /* ADD THIS */
  overflow-wrap: break-word; /* ADD THIS */
}

body.gallery-motion-enabled .gallery-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card h2,
.gallery-card p {
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}

.gallery-card__body {
  width: 100%; /* ADD THIS */
  box-sizing: border-box; /* ADD THIS */
  min-width: 0; /* ADD THIS — fixes grid blowout */
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 42px rgba(15, 76, 129, 0.16);
}

.gallery-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #edf3f8;
}

.gallery-grid img{
  border-radius: 0 !important;
}

.gallery-card__media img,
.gallery-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card__placeholder {
  background:
    linear-gradient(135deg, rgba(15, 76, 129, 0.1), rgba(71, 153, 98, 0.12)),
    #edf3f8;
}

.gallery-card__glow {
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(6, 19, 33, 0) 0%, rgba(6, 19, 33, 0.18) 100%);
  pointer-events: none;
}

.gallery-card__body {
  display: grid;
  gap: 12px;
  padding: 18px 18px 20px;
}

.gallery-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  align-items: center;
}

.gallery-card__date {
  color: var(--ndc-muted);
  font-size: 0.88rem;
}

.gallery-card h2 {
  margin: 0;
  font-family: var(--ndc-font-head);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  line-height: 1.25;
}

.gallery-card h2 a {
  color: var(--ndc-blue-deep);
}

.gallery-card p {
  margin: 0;
  color: var(--ndc-ink);
  line-height: 1.75;
}

.gallery-card__actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}

.gallery-card__button {
  min-width: 148px;
  background: #0f5282 !important;
}

.gallery-card__button:hover {
  min-width: 148px;
  background: #856f00 !important;
}

.gallery-actions {
  display: grid;
  justify-items: start;
  gap: 18px;
  margin-top: 10px;
}

.gallery-load-more {
  min-width: 180px;
  display: inline-flex;
  align-self: start;
}

.gallery-empty {
  max-width: 100%;
}

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

body.gallery-motion-enabled .gallery-card {
  opacity: 0;
  transform: translateY(18px);
}

body.gallery-motion-enabled .gallery-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.gallery-motion-enabled .gallery-card:hover {
  transform: translateY(-6px);
}

.gallery-filter-link span:last-child,
.gallery-toolbar__summary {
  font-variant-numeric: tabular-nums;
}

.gallery-load-more[disabled] {
  opacity: 0.62;
  cursor: wait;
}

.gallery-load-more[disabled]:hover {
  transform: none;
  color: #fff;
}

@media (max-width: 1100px) {
  .gallery-page__shell {
    grid-template-columns: 1fr;
  }

  .gallery-sidebar {
    position: static;
  }
}

@media (max-width: 960px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 700px) {
  .gallery-grid {
    column-count: 1;
  }

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