/* Álbum Capricho. Las fotos conservan su encuadre completo. */
body.album-page {
  --album-black: #11100e;
  --album-cream: #fdf1e0;
  --album-red: #d00001;
  --album-line: rgba(253, 241, 224, .24);
  background: var(--album-black);
  color: var(--album-cream);
  font-family: Articulat, Arial, sans-serif;
}
.album-page [hidden] { display: none !important; }
.album-page .wrap { max-width: 1600px; }
.album-page button, .album-page input { font-family: inherit; }
.album-page button { border-radius: 0; }
.album-page :focus-visible { outline: 2px solid var(--album-cream); outline-offset: 5px; }
.album-page .skip-link { background: var(--album-cream); color: var(--album-black); }

.album-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--album-line);
}
.album-header .brand { display: block; flex: 0 0 auto; }
.album-header .brand img { display: block; width: 182px; height: auto; }
.album-header nav { flex: 0 0 auto; }
.back-home { display: flex; align-items: center; gap: 17px; min-height: 48px; font-size: 13px; }
.back-home > span { font-size: 24px; line-height: 1; }
.back-home:hover { text-decoration: underline; text-underline-offset: 5px; }

.album-intro { padding-top: 43px; padding-bottom: 37px; }
.album-kicker { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.album-kicker p { font-size: 10px; font-weight: 700; line-height: 1.5; letter-spacing: .08em; }
.album-kicker time { color: var(--album-cream); }
.album-kicker p:first-child > span { padding-inline: 8px; color: #9c9287; }
.album-kicker p:last-child { color: #bcb1a4; }
.album-intro h1 { margin: 0; font-size: clamp(48px, 6.3vw, 100px); font-weight: 700; line-height: .99; letter-spacing: -.055em; }
.album-description { margin: 19px 0 0; font-size: 15px; font-weight: 400; line-height: 1.5; color: #c9bdaf; }
#album-title, #photo-grid { scroll-margin-top: 112px; }

.gallery-tools { position: sticky; top: 0; z-index: 10; border-top: 1px solid var(--album-line); border-bottom: 1px solid var(--album-line); background: var(--album-black); }
.gallery-tools-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 25px; }
#gallery-count { margin: 0; flex: 0 0 auto; font-size: 12px; font-variant-numeric: tabular-nums; color: #c9bdaf; }
.gallery-filters { display: flex; align-items: center; gap: 29px; min-width: 0; }
#favorites-toggle { padding: 12px 0; min-height: 46px; display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; background: none; border: 0; color: var(--album-cream); font-size: 13px; line-height: 1.2; }
#favorites-toggle svg, .viewer-secondary svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#favorites-toggle[aria-pressed="true"] svg { fill: currentColor; }
#favorites-toggle[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 5px; }
[data-favorites-count] { min-width: 18px; font-size: 11px; color: #c9bdaf; font-variant-numeric: tabular-nums; }
.search-label { display: flex; align-items: center; gap: 9px; padding-left: 27px; border-left: 1px solid var(--album-line); color: #bcb1a4; }
.search-label > span[aria-hidden] { font-size: 17px; }
.search-label input { width: 133px; min-width: 0; min-height: 44px; border: 0; border-bottom: 1px solid #8d8378; border-radius: 0; padding: 8px 1px; color: var(--album-cream); background: transparent; font-size: 14px; -webkit-appearance: none; appearance: none; }
.search-label input::placeholder { opacity: 1; color: #bcb1a4; }
.search-label input::-webkit-search-cancel-button { cursor: pointer; }

.gallery-section { padding-top: 24px; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 12px; }
.photo-tile { display: block; position: relative; min-width: 0; padding: 0 0 24px; border: 0; color: var(--album-cream); background: transparent; text-align: left; scroll-margin-top: 100px; }
.photo-tile > img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: contain; background: #201b18; }
.photo-tile:hover > img { filter: brightness(1.08); }
.photo-number { position: absolute; left: 0; bottom: 1px; font-size: 10px; line-height: 1.4; letter-spacing: .07em; font-variant-numeric: tabular-nums; color: #c9bdaf; }
.photo-favorite-marker { position: absolute; right: 1px; bottom: 0; font-size: 14px; line-height: 1.2; color: #ff6257; }
.load-more-wrap { display: flex; justify-content: center; padding: 41px 0 60px; }
.album-page .album-more-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 50px; min-width: 234px; min-height: 53px; border: 1px solid var(--album-cream); padding: 15px 20px; background: transparent; color: var(--album-cream); font-size: 13px; font-weight: 700; }
.album-more-button > span { font-size: 22px; line-height: 1; }
.album-page .album-more-button:hover { background: var(--album-cream); color: var(--album-black); }
.gallery-empty { padding: 65px 20px 15px; text-align: center; font-size: 16px; line-height: 1.5; color: #c9bdaf; }
.gallery-section noscript { display: block; padding: 20px 0 40px; font-size: 15px; }
.gallery-section noscript a { display: inline-block; margin-top: 16px; text-decoration: underline; text-underline-offset: 4px; }
.album-footer { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding-block: 30px; border-top: 1px solid var(--album-line); font-size: 11px; }
.album-footer .brand img { width: 150px; height: auto; }
.album-footer > span { font-size: 10px; letter-spacing: .06em; }
.album-footer > a:last-child { display: flex; align-items: center; gap: 20px; min-height: 44px; }
.album-footer > a:last-child span { font-size: 20px; }
.album-footer > a:last-child:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Visor: la imagen y la descarga tienen prioridad, también en horizontal. */
body.album-page.viewer-open { overflow: hidden; }
#photo-viewer { padding: 0; border: 0; max-width: none; max-height: none; width: 100%; height: 100vh; height: 100dvh; inset: 0; margin: 0; color: var(--album-cream); background: var(--album-black); overflow: hidden; }
#photo-viewer[open] { display: grid; grid-template-rows: 65px minmax(0, 1fr) auto; }
#photo-viewer::backdrop { background: var(--album-black); }
.viewer-top { display: flex; align-items: center; gap: 20px; padding: 0 26px; min-width: 0; font-size: 12px; }
#viewer-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#viewer-counter { flex: 0 0 auto; margin-left: auto; color: #c9bdaf; font-variant-numeric: tabular-nums; }
.icon-button { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 8px; flex: 0 0 auto; border: 1px solid transparent; color: inherit; background: transparent; }
.icon-button:hover { border-color: #b2a699; }
.icon-button:disabled { opacity: .35; }
.icon-button svg, #viewer-download svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.viewer-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.viewer-stage > img { display: block; width: 100%; height: 100%; max-width: calc(100% - 174px); object-fit: contain; user-select: none; touch-action: pan-y pinch-zoom; transition: opacity .12s; }
.is-loading #viewer-image { opacity: .4; }
.viewer-prev, .viewer-next { position: absolute; top: calc(50% - 23px); z-index: 1; background: #11100ecc; border-color: #fdf1e05c; }
.viewer-prev { left: 23px; }
.viewer-next { right: 23px; }
.viewer-bottom { padding: 15px 26px max(10px, env(safe-area-inset-bottom)); }
.viewer-actions { display: flex; align-items: center; justify-content: center; gap: 27px; }
.viewer-secondary { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 6px; min-height: 46px; border: 0; background: none; color: var(--album-cream); font-size: 13px; }
.viewer-secondary.is-favorite { color: #ff756b; }
.viewer-secondary.is-favorite svg { fill: currentColor; }
.viewer-secondary:hover { text-decoration: underline; text-underline-offset: 5px; }
#viewer-download { display: inline-flex; align-items: center; justify-content: space-between; gap: 38px; min-height: 51px; border: 1px solid transparent; padding: 14px 20px; background: var(--album-cream); color: var(--album-black); font-size: 13px; font-weight: 700; }
#viewer-download:hover { background: #fff; }
#viewer-download svg { flex: 0 0 auto; }
#viewer-status { min-height: 16px; margin: 8px 0 0; font-size: 11px; line-height: 1.4; text-align: center; color: #c9bdaf; }

@media (max-width: 900px) {
  .album-intro h1 { font-size: clamp(48px, 8vw, 72px); }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px 11px; }
}

@media (max-width: 600px) {
  .album-page { --pad: 20px; --page-pad: var(--pad); }
  .album-header { min-height: 72px; gap: 16px; }
  .album-header .brand img { width: 143px; }
  .back-home { min-height: 44px; gap: 9px; font-size: 11px; }
  .back-home > span { font-size: 19px; }
  .album-intro { padding-top: 31px; padding-bottom: 28px; }
  .album-kicker { margin-bottom: 21px; gap: 12px; }
  .album-kicker p { font-size: 9px; letter-spacing: .045em; }
  .album-kicker p:first-child > span { padding-inline: 4px; }
  .album-intro h1 { max-width: 390px; font-size: clamp(48px, 11.4vw, 65px); line-height: .98; letter-spacing: -.05em; }
  .album-description { max-width: 265px; margin-top: 17px; font-size: 13px; }
  .gallery-tools-inner { min-height: 93px; padding-block: 10px 6px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  #gallery-count { font-size: 10px; }
  .gallery-filters { justify-content: space-between; gap: 15px; }
  #favorites-toggle { min-height: 45px; font-size: 12px; gap: 7px; padding: 10px 0; }
  #favorites-toggle svg { width: 16px; height: 16px; }
  [data-favorites-count] { min-width: 15px; font-size: 10px; }
  .search-label { min-width: 0; padding-left: 15px; gap: 5px; }
  .search-label input { min-height: 44px; width: 94px; font-size: 16px; }
  .search-label input::placeholder { font-size: 12px; }
  .search-label > span[aria-hidden] { font-size: 15px; }
  .gallery-section { padding-top: 19px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 9px; }
  .photo-tile { padding-bottom: 22px; scroll-margin-top: 112px; }
  .photo-number { font-size: 9px; }
  .photo-favorite-marker { font-size: 13px; }
  .load-more-wrap { padding: 28px 0 41px; }
  .album-page .album-more-button { min-height: 51px; min-width: 222px; font-size: 12px; }
  .gallery-empty { padding: 46px 0 10px; font-size: 14px; }
  .album-footer { padding-block: 24px; gap: 15px; font-size: 10px; }
  .album-footer .brand img { width: 133px; }
  .album-footer > span { display: none; }
  .album-footer > a:last-child { gap: 11px; }
  #photo-viewer[open] { grid-template-rows: 56px minmax(0, 1fr) auto; }
  .viewer-top { padding: 0 13px; gap: 9px; font-size: 10px; }
  .viewer-top .icon-button { width: 43px; height: 43px; }
  .viewer-stage > img { max-width: 100%; }
  .viewer-prev, .viewer-next { top: calc(50% - 22px); width: 38px; height: 44px; padding: 4px; background: #11100eae; }
  .viewer-prev { left: 6px; }
  .viewer-next { right: 6px; }
  .viewer-bottom { padding: 11px 12px max(10px, env(safe-area-inset-bottom)); }
  .viewer-actions { justify-content: space-between; gap: 9px; }
  .viewer-secondary { flex-direction: column; gap: 5px; padding: 5px 4px; min-height: 49px; min-width: 51px; font-size: 10px; }
  .viewer-secondary svg { width: 19px; height: 19px; }
  #viewer-download { flex: 1 1 auto; max-width: 275px; min-width: 0; min-height: 51px; margin-left: 3px; gap: 10px; padding: 13px 12px; font-size: 12px; }
  #viewer-status { min-height: 15px; margin-top: 8px; font-size: 10px; }
}

@media (max-width: 350px) {
  .album-page { --pad: 17px; --page-pad: var(--pad); }
  .album-header .brand img { width: 134px; }
  .back-home { font-size: 10px; gap: 7px; }
  .album-kicker p { font-size: 8px; }
  .gallery-filters { gap: 9px; }
  #favorites-toggle { font-size: 11px; gap: 6px; }
  .search-label { padding-left: 10px; }
  .search-label input { width: 85px; }
  #viewer-download { padding-inline: 10px; font-size: 11px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  #photo-viewer[open] { grid-template-rows: 44px minmax(0, 1fr) 69px; }
  .viewer-top { padding-inline: 15px; }
  .viewer-bottom { padding: 5px 15px 3px; }
  .viewer-actions { gap: 22px; }
  .viewer-secondary { flex-direction: row; min-height: 37px; padding-block: 3px; }
  #viewer-download { min-height: 38px; padding-block: 8px; }
  #viewer-status { margin-top: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .album-page *, .album-page *::before, .album-page *::after { transition: none !important; animation: none !important; }
}
