.cv-public-photos {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: clamp(28px, 5vw, 64px) 0;
}
.cv-public-photos > header { margin-bottom: 22px; }
.cv-public-photos > header h2 { margin: .25rem 0 0; }
.cv-public-photos__galleries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 18px;
  align-items: start;
}
.cv-public-photos__gallery {
  min-width: 0;
  padding: clamp(14px, 2vw, 22px);
  overflow: hidden;
  border: 1px solid #e1e8e5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(22, 48, 40, .06);
}
.cv-public-photos__gallery:has(> .cv-public-photos__album[aria-expanded="true"]) { grid-column: 1 / -1; }
.cv-public-photos__gallery h3 { margin: 0 0 6px; font-size: clamp(1.12rem, 2vw, 1.4rem); line-height: 1.25; }
.cv-public-photos__gallery > .cv-media-card__meta { margin: 0 0 14px; }
.cv-public-photos__album {
  display: grid;
  box-sizing: border-box;
  width: calc(100% + clamp(28px, 4vw, 44px));
  grid-template-columns: clamp(92px, 28%, 140px) minmax(0, 1fr) 22px;
  gap: 14px;
  align-items: center;
  margin: calc(-1 * clamp(14px, 2vw, 22px));
  padding: 0 16px 0 0;
  border: 0;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.cv-public-photos__album:focus-visible,
.cv-public-photos__item:focus-visible,
.cv-photo-gallery__item:focus-visible,
.cv-photo-gallery__viewer button:focus-visible,
.cv-photo-gallery__grid-toggle:focus-visible,
.cv-photo-gallery__download:focus-visible,
.cv-public-photos__carousel-controls button:focus-visible {
  outline: 3px solid #e0a82e;
  outline-offset: 3px;
}
.cv-public-photos__album .cv-public-photos__cover {
  display: block;
  width: 100%;
  height: 116px;
  margin: 0;
  object-fit: cover;
  background: linear-gradient(135deg, #e7efec, #f5f7f6);
}
.cv-public-photos__cover--empty { min-height: 116px; }
.cv-public-photos__album-copy { display: grid; min-width: 0; gap: 5px; }
.cv-public-photos__album-title { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.cv-public-photos__album .cv-media-card__meta { margin: 0; font-size: .86rem; }
.cv-public-photos__album-chevron { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .18s ease; }
.cv-public-photos__album[aria-expanded="true"] .cv-public-photos__album-chevron { transform: rotate(180deg); }
.cv-photo-gallery__toolbar {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
}
.cv-photo-gallery__status { flex: 1; min-width: 0; min-height: 1.4em; margin: 0; color: var(--cv-muted, #5d6965); font-size: 13px; }
.cv-photo-gallery__status:empty { display: none; }
.cv-photo-gallery__grid-toggle,
.cv-photo-gallery__download {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid #dbe5e1;
  border-radius: 50%;
  background: #fff;
  color: #155f50;
  cursor: pointer;
  text-decoration: none;
}
.cv-photo-gallery__grid-toggle:hover,
.cv-photo-gallery__download:hover { background: #eff7f4; }
.cv-photo-gallery__download { flex-basis: 32px; width: 32px; height: 32px; color: #687873; }
.cv-public-photos__dialog .cv-photo-gallery__download {
  margin: 12px auto 0;
  border-color: rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.cv-public-photos__dialog .cv-photo-gallery__download:hover { background: rgba(255, 255, 255, .18); }
.cv-public-photos__dialog .cv-photo-gallery__download svg { stroke: currentColor !important; }
.cv-photo-gallery__grid-toggle svg,
.cv-photo-gallery__download svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cv-photo-gallery__grid-toggle svg[data-view-icon-grid] { fill: currentColor; stroke: none; }
.cv-photo-gallery__grid-toggle svg[hidden] { display: none !important; }
.cv-photo-gallery__download[hidden],
.cv-photo-gallery__toolbar[hidden],
.cv-public-photos__gallery [data-gallery-body][hidden],
.cv-photo-gallery__viewer[hidden],
.cv-public-photos__gallery [data-gallery-grid][hidden],
.cv-photo-gallery__retry[hidden],
.cv-public-photos__featured[hidden] { display: none !important; }
.cv-photo-gallery__viewer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
.cv-photo-gallery__viewer > button,
.cv-public-photos__dialog > button:not(.cv-public-photos__close) {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid #dbe5e1;
  border-radius: 50%;
  background: #fff;
  color: #155f50;
  cursor: pointer;
}
.cv-photo-gallery__viewer > button svg,
.cv-public-photos__dialog > button:not(.cv-public-photos__close) svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cv-photo-gallery__viewer > button:disabled { opacity: .4; cursor: default; }
.cv-photo-gallery__viewer figure { min-width: 0; margin: 0; text-align: center; }
.cv-photo-gallery__viewer img { display: block; width: 100%; max-height: min(58vw, 520px); aspect-ratio: 16 / 10; object-fit: contain; border-radius: 10px; background: #10201b; }
.cv-photo-gallery__viewer figcaption { padding: 8px 4px 0; color: #34423d; font-size: .9rem; line-height: 1.4; }
.cv-photo-gallery__main-open { display: block; width: 100%; padding: 0; border: 0; border-radius: 10px; background: #10201b; cursor: zoom-in; }
.cv-public-photos__gallery [data-gallery-grid],
.cv-indexed-drive-gallery [data-gallery-grid] { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 9px; margin: 14px 0 0; }
.cv-public-photos__item,
.cv-photo-gallery__item { position: relative; display: block; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; padding: 0; border: 0; border-radius: 9px; background: #edf2f0; cursor: pointer; }
.cv-public-photos__item img,
.cv-photo-gallery__item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.cv-public-photos__item:hover img,
.cv-photo-gallery__item:hover img { transform: scale(1.035); }
.cv-public-photos__featured { margin: 24px 0; padding: 18px 0; border-block: 1px solid #e4e9e7; }
.cv-public-photos__featured h3,
.cv-public-photos__featured h4 { margin: 0 0 12px; }
.cv-public-photos__featured [data-featured-grid] { display: flex; gap: 12px; overflow-x: auto; padding: 5px 4px 12px; scroll-snap-type: x mandatory; scroll-padding: 4px; overscroll-behavior-inline: contain; }
.cv-public-photos__featured .cv-public-photos__item { flex: 0 0 clamp(210px, 25vw, 290px); max-height: 400px; aspect-ratio: 3 / 4; scroll-snap-align: start; }
.cv-public-photos__item.is-featured { background: #111; }
.cv-public-photos__item.is-featured img { object-fit: contain; }
.cv-public-photos__castle-label { position: absolute; right: 0; bottom: 0; left: 0; padding: 28px 11px 10px; background: linear-gradient(transparent, rgba(0,0,0,.88)); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.3; text-align: left; }
.cv-public-photos__carousel-controls { display: flex; justify-content: flex-end; gap: 8px; margin: -4px 0 8px; }
.cv-public-photos__carousel-controls button { display: inline-grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 1px solid #dbe5e1; border-radius: 50%; background: #fff; color: #155f50; cursor: pointer; }
.cv-public-photos__carousel-controls svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cv-public-photos__dialog { width: min(96vw, 1100px); max-width: none; max-height: 94vh; padding: 24px; border: 0; border-radius: 16px; background: #101713; color: #fff; }
.cv-public-photos__dialog::backdrop { background: rgba(4, 13, 10, .86); }
.cv-public-photos__dialog[open] { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 14px; align-items: center; }
.cv-public-photos__dialog figure { min-width: 0; margin: 0; text-align: center; }
.cv-public-photos__dialog figure img { display: block; max-width: 100%; max-height: 76vh; margin: auto; object-fit: contain; }
.cv-public-photos__dialog figcaption { padding-top: 10px; }
.cv-public-photos__close { position: absolute; top: 8px; right: 10px; display: inline-grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; background: #fff; color: #111; font-size: 25px; cursor: pointer; }
.cv-indexed-drive-gallery { min-width: 0; }
.cv-indexed-drive-gallery > .cv-media-card__body { padding: 18px; }
.cv-indexed-drive-gallery .cv-photo-gallery__grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }

/* Album index: let the cover carry the visual weight; album details live on
   the dedicated page and stay compact here. */
.cv-photo-albums {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: clamp(28px, 5vw, 64px) 0;
}
.cv-photo-album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}
.cv-photo-album-card { min-width: 0; scroll-margin-top: 110px; }
.cv-photo-album-card__link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.cv-photo-album-card__cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #edf2f0;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cv-photo-album-card__cover--empty {
  background: #e9efec;
}
.cv-photo-album-card__title {
  display: block;
  margin: 11px 0 0;
  color: #183d33;
  font-size: clamp(1rem, 1.25vw, 1.14rem);
  font-weight: 700;
  line-height: 1.3;
}
.cv-photo-album-card h3.cv-photo-album-card__title { margin: 11px 0 0; }
.cv-photo-album-card__meta {
  margin: 4px 0 0;
  color: var(--cv-muted, #5d6965);
  font-size: .86rem;
  line-height: 1.4;
}
.cv-photo-album-card__link:hover .cv-photo-album-card__cover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(22, 48, 40, .13);
}
.cv-photo-album-card__link:focus-visible {
  outline: 3px solid #e0a82e;
  outline-offset: 5px;
  border-radius: 12px;
}
.cv-photo-album-card__link:focus-visible .cv-photo-album-card__cover {
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px #e0a82e;
}
.cv-photo-album-page__header { margin: 0 0 24px; }
.cv-photo-album-page__back {
  display: inline-block;
  margin: 0 0 12px;
  color: #155f50;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(21, 95, 80, .35);
  text-underline-offset: 3px;
}
.cv-photo-album-page__back:hover { text-decoration-color: currentColor; }
.cv-photo-album-page__back:focus-visible {
  outline: 3px solid #e0a82e;
  outline-offset: 3px;
  border-radius: 2px;
}
.cv-photo-album-page__header h1 { margin: 0 0 6px; }
.cv-photo-album-page__header .cv-media-card__meta { margin: 0; }
@media (max-width: 900px) {
  .cv-photo-album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .cv-photo-album-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .cv-photo-album-card__cover { border-radius: 10px; }
}
@media (max-width: 620px) {
  .cv-public-photos__galleries { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cv-public-photos__album { width: calc(100% + 28px); grid-template-columns: clamp(84px, 27%, 120px) minmax(0, 1fr) 20px; gap: 11px; }
  .cv-public-photos__album .cv-public-photos__cover { height: 94px; }
  .cv-photo-gallery__viewer { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 6px; }
  .cv-photo-gallery__viewer > button { width: 34px; height: 34px; }
  .cv-photo-gallery__viewer img { max-height: 56vh; aspect-ratio: 4 / 3; }
  .cv-public-photos__gallery [data-gallery-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .cv-public-photos__dialog { padding: 42px 10px 14px; }
  .cv-public-photos__dialog[open] { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 5px; }
  .cv-public-photos__dialog > button:not(.cv-public-photos__close) { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .cv-public-photos__item img,
  .cv-photo-gallery__item img,
  .cv-photo-album-card__cover,
  .cv-public-photos__album-chevron { transition: none; }
}
