/* Shared photographic cards for the workshop's public catalogues. */
.photo-loading-note { display: none; }
:is(#gallery-modal, #media-dialog) :is(.photo-retry, .photo-retry-success) { display: none; }
#portfolio-photo-error { color: #dce8dd; font-size: .875rem; }
#portfolio-stage { position: relative; }
#portfolio-stage > .photo-original-revealed { opacity: 1; }
#portfolio-stage > .photo-preview-leaving {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 730px), (max-width: 1024px) and (hover: none) and (pointer: coarse) {
  #portfolio-stage > .photo-preview-leaving {
    animation: photo-preview-fade 240ms ease-in-out both;
  }
  :is(#gallery-modal, #media-dialog) .photo-retry-success:empty:not(.is-recovered) {
    display: block;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }
  :is(#gallery-modal, #media-dialog) :is(.photo-retry:not([hidden]), .photo-retry-success.is-recovered) {
    display: inline-flex;
    vertical-align: middle;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-inline-size: 10rem;
    padding: 0 .9rem;
    border: 1px solid #d59570;
    border-radius: 6px;
    background: #1d3029;
    color: #ffbd96;
    font: 600 .875rem/1.2 var(--lectura, Manrope, Arial, sans-serif);
    cursor: pointer;
  }
  :is(#gallery-modal, #media-dialog) .photo-retry-success:not(:empty) {
    color: #b9e4c9;
    border-color: transparent;
    background: transparent;
    cursor: default;
    /* The viewer clears the notice after two seconds. Both fades fit inside that window. */
    animation: photo-ready-fade 2s ease-in-out both;
  }
  /* Keep the same line box until the viewer leaves this photo. */
  .photo-retry-success.is-recovered:empty {
    visibility: hidden;
  }
  .photo-retry-success:not(:empty)::before {
    content: "✓";
    content: "✓" / "";
    margin-inline-end: .45rem;
    font-size: 1.2em;
    font-weight: 700;
  }
  :is(#gallery-modal, #media-dialog) .photo-retry:not([hidden]):disabled {
    border-color: #83948b;
    background: #25392f;
    color: #e3ece6;
    opacity: 1;
    cursor: progress;
  }
  :is(#gallery-modal, #media-dialog) .photo-retry:not([hidden]):disabled::before {
    content: "";
    flex: none;
    box-sizing: border-box;
    width: 1em;
    height: 1em;
    margin-inline-end: .45rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: photo-retry-spin .85s linear infinite;
  }
  :is(#gallery-modal, #media-dialog) .photo-retry:focus-visible {
    outline: 2px solid #ffbd96;
    outline-offset: 2px;
  }
  .portfolio-photo-recovery:has(.photo-retry:not([hidden]), .photo-retry-success.is-recovered) {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .25rem .75rem;
  }
  #gallery-modal:has(.photo-retry:not([hidden])) .photo-loading-note,
  :is(#gallery-modal, #media-dialog):has(.photo-retry-success.is-recovered) .photo-loading-note { display: none; }
  :is(#gallery-modal, #media-dialog) .photo-loading-note {
    display: block;
    min-height: 1.45em;
    margin: 0;
    color: #c5d1c9;
    font: 400 .8125rem/1.45 var(--lectura, Manrope, Arial, sans-serif);
  }
  .photo-loading-note:not(:empty)::before {
    content: "";
    display: inline-block;
    width: .42em;
    height: .42em;
    margin-inline-end: .55em;
    vertical-align: .1em;
    border-radius: 50%;
    background: #ffac79;
  }
  #gallery-modal:has(#portfolio-stage video) .photo-loading-note { display: none; }
}
@keyframes photo-retry-spin {
  to { transform: rotate(1turn); }
}
@keyframes photo-ready-fade {
  0%, 100% { opacity: 0; }
  12%, 85% { opacity: 1; }
}
@keyframes photo-preview-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #portfolio-stage > .photo-preview-leaving,
  :is(#gallery-modal, #media-dialog) .photo-retry:not([hidden]):disabled::before,
  :is(#gallery-modal, #media-dialog) .photo-retry-success:not(:empty) {
    animation: none;
  }
}
.taller-card {
  --card-pad: clamp(16px, 1.65vw, 24px);
  --card-ink: #172c25;
  --card-copy: #485a50;
  --card-rule: #c7d0c7;
  --card-paper: #fffefa;
  --card-type: var(--lectura, Manrope, Arial, sans-serif);
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--card-paper);
  color: var(--card-ink);
  border: 1px solid var(--card-rule);
  border-radius: 8px;
  box-shadow: none;
}
.taller-card[hidden] { display: none; }
.taller-card .taller-card-media, .home-work-card .thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--card-rule);
  border-radius: 0;
  background: #e4e9e3;
}
.taller-card .taller-card-media img,
.home-work-card .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--card-position, center);
  border-radius: 0;
}
.taller-card .taller-card-body, .home-work-card .card-caption {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: var(--card-pad);
}
.taller-card .taller-card-body h3, .home-work-card .card-caption strong {
  margin: 0;
  color: var(--card-ink);
  font: 500 clamp(1.65rem, 2.2vw, 2.15rem)/1.07 var(--display, "Arial Narrow", sans-serif);
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.taller-card .taller-card-body p {
  margin: 0;
  color: var(--card-copy);
  font: 400 1rem/1.5 var(--card-type);
}
.taller-card .taller-card-body .taller-card-family, .home-work-card .card-caption small {
  color: #3e6050;
  font: 600 .79rem/1.4 var(--card-type);
}
.taller-card .taller-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 16px;
  margin: auto var(--card-pad) 0;
  padding: 9px 0 12px;
  border-top: 1px solid var(--card-rule);
}
.taller-card-actions :is(.taller-card-detail, .taller-card-quote) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-sizing: border-box;
  margin: 0;
  font: 600 .875rem/1.35 var(--card-type);
  cursor: pointer;
}
.taller-card-actions .taller-card-detail {
  padding: 0 2px;
  color: #254d40;
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.taller-card-actions .taller-card-quote {
  padding: 8px 12px;
  border: 1px solid #274d41;
  border-radius: 4px;
  background: #23483b;
  color: white;
  text-decoration: none;
  text-align: center;
}
.taller-card-actions .taller-card-detail:hover { color: #8b421d; }
.taller-card-actions .taller-card-quote:hover { background: #335d4d; color: white; }
.taller-card :is(a, button, summary):focus-visible,
.shop-front .taller-card.home-card-link:focus-visible {
  outline: 3px solid #bc540d;
  outline-offset: -3px;
}
.shop-front .home-card-link, .shop-front .home-work-card > .catalog-card {
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  height: 100%;
  margin: 0;
  color: #172c25;
  text-decoration: none;
}
.shop-front .home-card-link:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.shop-front .equipment-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shop-front .equipment-grid .taller-card-media img { aspect-ratio: auto; filter: none; }
.home-work-card .catalog-card { flex: 1; }
.shop-front #trabajos .catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 335px), 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.home-video-list-title { grid-column: 1 / -1; margin: 22px 0 0; color: #f5f3ee; }
.shop-front #trabajos .world-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 16px;
}
.shop-front #trabajos .world-card-actions .button { margin-top: 0; }
.world-quote {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #fff;
  font: 600 .9rem/1.4 Manrope, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
}
@media (max-width: 990px) {
  .shop-front .equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 621px) and (max-width: 730px) {
  .shop-front #empresa .shop-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .shop-front .equipment-grid, .shop-front #empresa .shop-services { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
