/* AragónGym – Carteles v1.1: poster visible and readable without disrupting existing filters. */
.table-competitions .agc-row-with-poster {
  display: grid !important;
  grid-template-columns: minmax(325px, 2.55fr) minmax(185px, 1.5fr) repeat(3, minmax(88px, .83fr)) minmax(85px, .75fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 16px 12px;
  box-sizing: border-box;
}
.table-competitions .agc-row-with-poster > div {
  display: block !important;
  box-sizing: border-box;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  padding: 0 !important;
  margin: 0 !important;
}
.table-competitions .agc-row-with-poster > div:nth-child(6) { display: none !important; }
.table-competitions .agc-row-with-poster p { margin: 0; }
.table-competitions .agc-row-with-poster > div:nth-child(3) a,
.table-competitions .agc-row-with-poster > div:nth-child(4) a,
.table-competitions .agc-row-with-poster > div:nth-child(5) a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.agc-poster-name {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  width: 100%;
  text-align: left;
}
.agc-poster-name .agc-poster-title {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 700;
  font-size: clamp(15px, 1.12vw, 18px);
  line-height: 1.35;
  color: #162f43;
}
.agc-poster-trigger {
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block;
  flex: 0 0 108px;
  width: 108px;
  height: 135px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cad6df;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(5,40,70,.17);
  line-height: 0;
  cursor: zoom-in;
  transition: box-shadow .16s ease, transform .16s ease;
}
.agc-poster-trigger:hover,
.agc-poster-trigger:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(5,40,70,.26);
  outline: 2px solid #087ca5;
  outline-offset: 3px;
}
.agc-poster-trigger .agc-poster-thumb {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
/* Mouse hover: a floating, undimmed poster above the page, placed by JS near its thumbnail. */
.agc-preview {
  display: none;
  position: fixed;
  z-index: 2147483600;
  box-sizing: border-box;
}
.agc-preview.agc-open { display: block; }
.agc-preview.agc-hover {
  width: min(410px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 5px;
  background: #fff;
  border-radius: 13px;
  pointer-events: none;
  box-shadow: 0 16px 50px rgba(0,24,47,.35), 0 0 0 1px rgba(12,56,87,.12);
}
.agc-preview__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(80vh, 760px);
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
  -webkit-user-drag: none;
  user-select: none;
}
.agc-preview__close { display: none; }
/* Touch/keyboard/click: accessible centered lightbox with no download action. */
.agc-preview.agc-modal {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 54px 15px 22px;
  background: rgba(3,19,34,.86);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
.agc-preview.agc-modal .agc-preview__image {
  width: auto;
  max-width: min(510px, 92vw);
  max-height: calc(100vh - 95px);
  height: auto;
  box-shadow: 0 15px 40px rgba(0,0,0,.3);
}
.agc-preview.agc-modal .agc-preview__close {
  display: grid;
  place-items: center;
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  background: #fff;
  color: #133550;
  border: 0;
  border-radius: 50%;
  font: 30px/1 Arial, sans-serif;
  cursor: pointer;
}
.agc-preview.agc-modal .agc-preview__close:focus-visible { outline: 3px solid #ffd36b; }
@media (min-width: 768px) and (max-width: 1199px) {
  .table-competitions .agc-row-with-poster {
    grid-template-columns: minmax(0, 2fr) minmax(170px, 1fr) minmax(0, 1fr);
    column-gap: 20px;
    row-gap: 10px;
  }
  .table-competitions .agc-row-with-poster > div:nth-child(1) { grid-column: 1 / 3; }
  .table-competitions .agc-row-with-poster > div:nth-child(2) { grid-column: 3; }
  .table-competitions .agc-row-with-poster > div:nth-child(3),
  .table-competitions .agc-row-with-poster > div:nth-child(4),
  .table-competitions .agc-row-with-poster > div:nth-child(5) { grid-row: 2; }
  .table-competitions .agc-row-with-poster > div:nth-child(7) { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .table-competitions .agc-row-with-poster {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 11px;
    padding: 15px 8px;
  }
  .table-competitions .agc-row-with-poster > div:nth-child(3),
  .table-competitions .agc-row-with-poster > div:nth-child(4),
  .table-competitions .agc-row-with-poster > div:nth-child(5) { display: none !important; }
  .table-competitions .agc-row-with-poster > div:nth-child(6) {
    display: flex !important;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }
  .table-competitions .agc-row-with-poster > div:nth-child(1) p,
  .table-competitions .agc-row-with-poster > div:nth-child(2) p { text-align: left !important; }
  .agc-poster-name { gap: 14px; }
  .agc-poster-trigger { flex-basis: 96px; width: 96px; height: 120px; }
  .agc-poster-name .agc-poster-title { font-size: 17px; }
  .table-competitions .agc-row-with-poster > div:nth-child(2) { padding-left: 110px !important; }
  .table-competitions .agc-row-with-poster > div:nth-child(6) { padding-left: 0 !important; }
}
@media (max-width: 380px) {
  .agc-poster-trigger { flex-basis: 80px; width: 80px; height: 100px; }
  .table-competitions .agc-row-with-poster > div:nth-child(2) { padding-left: 94px !important; }
  .agc-poster-name .agc-poster-title { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .agc-poster-trigger { transition: none; }
}
