/* =========================================================
   CalcioCatania.com — Fotogallery detail 2026
   ========================================================= */


/* ACCESSIBILITY */

.photo-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 99999;
  transform: translateY(-160%);
  padding: 10px 14px;
  background: var(--cc-ink);
  color: var(--cc-white);
  font-family: var(--cc-font-sans);
  font-size: .75rem;
  font-weight: 900;
  text-decoration: none;
}

.photo-skip-link:focus {
  transform: translateY(0);
}


/* PAGE */

.photo-page {
  min-width: 0;
  background: var(--cc-white);
}


/* HERO */

.photo-hero {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 0 34px;
  border-top: 3px solid var(--cc-ink);
  border-bottom: 1px solid var(--cc-rule);
}

.photo-hero__copy {
  min-width: 0;
  max-width: 940px;
  padding-top: 22px;
}

.photo-hero__title {
  max-width: 900px;
  margin: 0;
  color: var(--cc-ink);
  font-family: var(--cc-font-sans);
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  line-height: 1.04;
  font-weight: 850;
  letter-spacing: -.035em;
}

.photo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  color: var(--cc-subtle);
  font-size: .69rem;
  line-height: 1.4;
  font-weight: 800;
}

.photo-meta > * {
  position: relative;
}

.photo-meta > * + *::before {
  content: "·";
  position: absolute;
  left: -11px;
  color: var(--cc-rule-strong);
}

.photo-hero__media {
  order: -1;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--cc-soft);
}

.photo-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.photo-hero__fallback {
  min-height: 320px;
  background:
    linear-gradient(
      135deg,
      var(--cc-blue-deep),
      var(--cc-dark) 52%,
      var(--cc-red)
    );
}


/* CONTEXT LINKS */

.photo-context-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
}

.photo-context-link {
  min-width: 0;
  display: block;
  padding: 12px 13px;
  border: 1px solid var(--cc-rule);
  color: var(--cc-ink);
  text-decoration: none;
}

.photo-context-link:hover {
  border-color: var(--cc-blue-deep);
}

.photo-context-link--match {
  border-top: 3px solid var(--cc-red);
}

.photo-context-link > span {
  display: block;
  margin-bottom: 4px;
  color: var(--cc-subtle);
  font-size: .53rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.photo-context-link > strong {
  display: block;
  overflow: hidden;
  color: var(--cc-blue-deep);
  font-size: .72rem;
  line-height: 1.3;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}


/* SECTIONS */

.photo-section {
  margin-top: 48px;
}


/* PHOTO GRID */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.photo-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: var(--cc-soft);
}

.photo-card__link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #ededeb;
  text-decoration: none;
}

.photo-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0 solid rgba(255,255,255,.72);
  pointer-events: none;
  transition:
    border-width var(--cc-duration-fast) var(--cc-ease),
    background-color var(--cc-duration-fast) var(--cc-ease);
}

.photo-card__link:hover::after,
.photo-card__link:focus-visible::after {
  border-width: 5px;
  background: rgba(0,0,0,.03);
}

.photo-card__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition:
    transform var(--cc-duration) var(--cc-ease);
}

.photo-card__link:hover .photo-card__image {
  transform: scale(1.015);
}

.photo-card__caption {
  padding: 9px 10px 10px;
  border-top: 1px solid var(--cc-rule-soft);
  background: var(--cc-white);
  color: var(--cc-text);
  font-size: .68rem;
  line-height: 1.35;
  font-weight: 800;
}

.photo-empty {
  padding: 28px 0;
  border-bottom: 1px solid var(--cc-rule);
  color: var(--cc-subtle);
  font-size: .82rem;
  font-weight: 700;
}


/* MORE GALLERIES */

.photo-more {
  padding-top: 2px;
}

.photo-more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.photo-more-card {
  min-width: 0;
  display: block;
  color: inherit;
  text-decoration: none;
}

.photo-more-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--cc-soft);
}

.photo-more-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform var(--cc-duration) var(--cc-ease);
}

.photo-more-card:hover .photo-more-card__media img {
  transform: scale(1.02);
}

.photo-more-card__fallback {
  width: 100%;
  height: 100%;
  display: block;
  background:
    linear-gradient(
      135deg,
      var(--cc-blue-deep),
      var(--cc-red)
    );
}

.photo-more-card__body {
  display: block;
  padding-top: 10px;
}

.photo-more-card__body time,
.photo-more-card__body > span:last-child {
  display: block;
  color: var(--cc-subtle);
  font-size: .56rem;
  line-height: 1.3;
  font-weight: 800;
}

.photo-more-card__body strong {
  display: block;
  margin: 5px 0 7px;
  color: var(--cc-ink);
  font-size: .9rem;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: -.015em;
}

.photo-more-card:hover .photo-more-card__body strong {
  color: var(--cc-blue-deep);
}

.photo-archive-link {
  display: inline-flex;
  margin-top: 22px;
  color: var(--cc-blue-deep);
  font-size: .64rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}


/* LIGHTBOX */

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  padding: 14px;
  background: rgba(0,0,0,.95);
  color: var(--cc-white);
  font-family: var(--cc-font-sans);
}

.photo-lightbox[hidden] {
  display: none !important;
}

.photo-lightbox__inner {
  width: min(1240px, 100%);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.photo-lightbox__top,
.photo-lightbox__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
}

.photo-lightbox__count {
  color: rgba(255,255,255,.78);
  font-size: .7rem;
  font-weight: 900;
}

.photo-lightbox__button,
.photo-lightbox__nav button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: rgba(255,255,255,.1);
  color: var(--cc-white);
  cursor: pointer;
}

.photo-lightbox__button {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.photo-lightbox__button:hover,
.photo-lightbox__nav button:hover {
  background: rgba(255,255,255,.18);
}

.photo-lightbox__stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.photo-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.photo-lightbox__nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.photo-lightbox__nav button {
  width: 48px;
  height: 64px;
  margin: 0 8px;
  pointer-events: auto;
  font-size: 2rem;
}

.photo-lightbox__caption {
  color: var(--cc-white);
  font-size: .78rem;
  font-weight: 850;
}

.photo-lightbox__credit {
  color: rgba(255,255,255,.64);
  font-size: .68rem;
  font-weight: 700;
}


/* RESPONSIVE */

@media (max-width: 980px) {

  .photo-grid,
  .photo-more-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


@media (max-width: 680px) {

  .photo-hero {
    padding-top: 14px;
  }

  .photo-hero__media {
    width: calc(100% + 40px);
    margin-left: -20px;
  }

  .photo-hero__copy {
    padding-top: 18px;
  }

  .photo-hero__title {
    font-size: clamp(1.65rem, 7.5vw, 2.35rem);
    line-height: 1.06;
  }

  .photo-meta {
    gap: 7px 14px;
  }

  .photo-meta > * + *::before {
    left: -9px;
  }

  .photo-context-links {
    grid-template-columns: 1fr;
  }

  .photo-section {
    margin-top: 38px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .photo-card__caption {
    padding: 8px;
    font-size: .62rem;
  }

  .photo-more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .photo-lightbox {
    padding: 8px;
  }

  .photo-lightbox__nav button {
    width: 44px;
    height: 58px;
    margin: 0 2px;
  }

  .photo-lightbox__bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}


@media (max-width: 420px) {

  .photo-grid {
    gap: 4px;
  }

  .photo-more-grid {
    grid-template-columns: 1fr;
  }
}


@media (prefers-reduced-motion: reduce) {

  .photo-card__image,
  .photo-more-card__media img,
  .photo-card__link::after {
    transition: none;
  }

  .photo-card__link:hover .photo-card__image,
  .photo-more-card:hover .photo-more-card__media img {
    transform: none;
  }
}

/* =========================================================
   IMMERSIVE PHOTO MODE — v3
   Hero da mostra fotografica + contact sheet
   ========================================================= */

.photo-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 0 26px;
  border: 0;
  background: #09090a;
  color: #fff;
}

.photo-hero__media {
  order: -1;
  width: 100%;
  min-height: min(76svh, 820px);
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050506;
}

.photo-hero__media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(76svh, 820px);
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

.photo-hero__fallback {
  width: 100%;
  min-height: min(70svh, 720px);
}

.photo-hero__copy {
  width: min(1160px, calc(100% - 40px));
  max-width: none;
  margin: 0 auto;
  padding-top: 20px;
}

.photo-hero .cc-kicker {
  margin-bottom: 7px;
  color: rgba(255,255,255,.54);
  font-size: .53rem;
  letter-spacing: .13em;
}

.photo-hero__title {
  max-width: 820px;
  color: #fff;
  font-size: clamp(1.35rem, 2.35vw, 2.05rem);
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: -.025em;
}

.photo-meta {
  margin-top: 12px;
  color: rgba(255,255,255,.58);
  font-size: .62rem;
  font-weight: 750;
}

.photo-meta > * + *::before {
  color: rgba(255,255,255,.25);
}

.photo-context-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.photo-context-link,
.photo-context-link--match {
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-top-width: 1px;
  background: rgba(255,255,255,.025);
  color: #fff;
}

.photo-context-link:hover {
  border-color: rgba(255,255,255,.38);
  background: rgba(255,255,255,.06);
}

.photo-context-link > span {
  display: inline;
  margin: 0;
  color: rgba(255,255,255,.42);
  font-size: .48rem;
}

.photo-context-link > strong {
  display: inline;
  max-width: 300px;
  color: rgba(255,255,255,.9);
  font-size: .62rem;
  white-space: nowrap;
}

.photo-section--gallery {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 0;
  padding:
    34px
    max(20px, calc((100vw - 1160px) / 2))
    58px;
  background: #09090a;
  color: #fff;
}

.photo-section--gallery .cc-section-heading {
  border-bottom-color: rgba(255,255,255,.2);
}

.photo-section--gallery .cc-section-heading__title {
  color: #fff;
}

.photo-section--gallery .cc-section-heading__meta {
  color: rgba(255,255,255,.48);
}

.photo-section--gallery .photo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.photo-section--gallery .photo-card {
  background: #111;
}

.photo-section--gallery .photo-card__link {
  background: #111;
}

.photo-section--gallery .photo-card__link::after {
  border-color: rgba(255,255,255,.7);
}

.photo-section--gallery .photo-card__image {
  aspect-ratio: 3 / 2;
}

.photo-section--gallery .photo-card__caption {
  padding: 8px 2px 5px;
  border: 0;
  background: #09090a;
  color: rgba(255,255,255,.68);
  font-size: .6rem;
  font-weight: 700;
}

.photo-more {
  margin-top: 54px;
}

@media (max-width: 980px) {
  .photo-section--gallery .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .photo-hero {
    padding-top: 0;
  }

  .photo-hero__media {
    width: 100%;
    min-height: 58svh;
    margin-left: 0;
  }

  .photo-hero__media img {
    max-height: 68svh;
  }

  .photo-hero__copy {
    width: calc(100% - 28px);
    padding-top: 16px;
  }

  .photo-hero__title {
    font-size: clamp(1.22rem, 5.6vw, 1.7rem);
    line-height: 1.1;
  }

  .photo-context-links {
    display: flex;
    flex-direction: row;
  }

  .photo-context-link {
    max-width: 100%;
  }

  .photo-section--gallery {
    padding:
      25px
      6px
      44px;
  }

  .photo-section--gallery .cc-section-heading {
    margin-left: 8px;
    margin-right: 8px;
  }

  .photo-section--gallery .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .photo-section--gallery .photo-card__caption {
    display: none;
  }
}
