/* =========================================================
   concurso-fotografico.css (FINAL)
   Para /actividades/concurso-fotografico.php
   Coherente con el look institucional (brand como acento)
   Requiere tokens existentes: --brand, --brand-dark, --hdr-h, --text-dark
   ========================================================= */

:root{
  --cf-bg: #fff;
  --cf-text: var(--text-dark, #1f1f24);
  --cf-muted: rgba(0,0,0,.72);

  --cf-border: rgba(0,0,0,.10);
  --cf-border-strong: rgba(0,0,0,.14);

  --cf-soft: rgba(75,42,136,.06);
  --cf-soft-2: rgba(0,0,0,.02);

  --cf-radius: 18px;
  --cf-radius-sm: 12px;

  --cf-shadow: 0 18px 55px rgba(0,0,0,.14);
  --cf-shadow-soft: 0 12px 30px rgba(0,0,0,.10);

  --cf-focus: 0 0 0 4px rgba(75,42,136,.12);
}

/* Base */
body.page-concurso{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--cf-text);
  background: #fff;
}

/* Main */
.pagina-interna.concurso-page{
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: calc(var(--hdr-h, 0px) + 18px) 0 56px;
}

/* ====== Título ====== */
.titulo-seccion{
  margin: 0 0 18px;
}
.titulo-seccion h1{
  margin: 0;
  font-size: clamp(1.9rem, 2.8vw, 2.7rem);
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: -0.03em;
  color: rgba(0,0,0,.88);
  position: relative;
  padding-left: 14px;
}
.titulo-seccion h1::before{
  content:"";
  position:absolute;
  left:0;
  top:.12em;
  width: 4px;
  height: .95em;
  background: var(--brand, #4B2A88);
}

/* ====== Flash messages ====== */
.concurso-flash{
  
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.02);
  padding: 12px 14px 12px 16px;
  margin: 0 0 12px;
  font-weight: 850;
  color: rgba(0,0,0,.84);
  position: relative;
  overflow: hidden;
}
.concurso-flash::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width: 4px;
  background: var(--brand, #4B2A88);
}
.concurso-flash.ok::before{ background: #2e8b57; }
.concurso-flash.err::before{ background: #b00020; }

/* ====== Card base ====== */
.concurso-card{
  background: var(--cf-bg);
  border: 1px solid var(--cf-border);
  
  box-shadow: var(--cf-shadow-soft);
  padding: 22px;
  margin: 0 0 18px;
}

.concurso-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.concurso-card h2{
  margin: 0;
  font-size: 1.42rem;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: rgba(0,0,0,.86);
  position: relative;
  padding-left: 14px;
}
.concurso-card h2::before{
  content:"";
  position:absolute;
  left:0;
  top:.18em;
  width: 4px;
  height: .95em;
  background: var(--brand, #4B2A88);
}

/* ====== Estado ACTIVO/CERRADO ====== */
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 950;
  letter-spacing: .10em;
  border: 1px solid rgba(75,42,136,.30);
  background: rgba(75,42,136,.06);
  color: var(--brand, #4B2A88);
  user-select:none;
  white-space: nowrap;
}
.badge.on{
  background: var(--brand, #4B2A88);
  border-color: var(--brand, #4B2A88);
  color: #fff;
  box-shadow: 0 14px 30px rgba(75,42,136,.20);
}
.badge.off{
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.10);
  color: rgba(0,0,0,.70);
}
@keyframes cfPulse{
  0%{ box-shadow: 0 14px 30px rgba(75,42,136,.20), 0 0 0 0 rgba(75,42,136,.18); }
  70%{ box-shadow: 0 14px 30px rgba(75,42,136,.20), 0 0 0 14px rgba(75,42,136,0); }
  100%{ box-shadow: 0 14px 30px rgba(75,42,136,.20), 0 0 0 0 rgba(75,42,136,0); }
}
.badge.on.pulse{ animation: cfPulse 1.8s ease-out infinite; }

/* ===== Header actions: botón Votar + badge ===== */
.concurso-head-actions{
  display:flex;
  align-items:center;
  gap: 12px;
}

/* botón compacto en cabecera */
.btn-head-vote{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 950;
  text-decoration:none;
  border: 1px solid rgba(75,42,136,.20);
  background: rgba(75,42,136,.06);
  color: var(--brand, #4B2A88);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn-head-vote:hover{
  background: var(--brand, #4B2A88);
  color:#fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,0,0,.14);
}
.btn-head-vote:active{ transform: translateY(0); box-shadow:none; }

/* En móvil: que el botón baje debajo del título si falta espacio */
@media (max-width: 520px){
  .concurso-head{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .concurso-head-actions{
    width: 100%;
    justify-content: space-between;
  }
}

/* ====== Botón bases (boton-morado) ====== */
.concurso-actions-top{
  margin: 10px 0 14px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}

a.boton-morado{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 11px 14px;
  
  text-decoration:none;
  font-weight: 950;
  border: 1px solid rgba(0,0,0,.06);
  background: var(--brand, #4B2A88);
  color: #fff;
  box-shadow: 0 12px 26px rgba(75,42,136,.18);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
a.boton-morado:hover{
  background: var(--brand-dark, #351d63);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(75,42,136,.22);
}
a.boton-morado:active{
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(75,42,136,.16);
}

/* =========================================================
   TOP: PARTICIPAR / FORMULARIO (limpio, pro, sin bordes duros)
   ========================================================= */

/* Adiós grid a 2 columnas (ya no existe “Votar” como caja) */
.concurso-current{
  display: block;
  margin-top: 10px;
}

/* Panel principal “Participar” */
.concurso-box{
  border: 0;  
  background: rgba(0,0,0,.015);
  box-shadow: none;
  padding: 18px;
}

.concurso-box h3{
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 950;
  color: rgba(0,0,0,.86);
}

.hint{
  margin: 0 0 12px;
  color: rgba(0,0,0,.72);
  line-height: 1.6;
  max-width: 70ch;
}

.notice{
  margin: 10px 0 12px;
  padding: 12px 14px 12px 16px;
  
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.86);
  color: rgba(0,0,0,.84);
  position: relative;
  overflow: hidden;
}
.notice::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width: 4px;
  background: var(--brand, #4B2A88);
}
.notice strong{ color: var(--brand, #4B2A88); }

/* Accordion pill */
.concurso-accordion{
  border: 0;
  background: transparent;
  
  overflow: visible;
  margin-top: 12px;
}
.concurso-accordion__sum{
  list-style: none;
  cursor: pointer;
  background: rgba(0,0,0,.03);
  border: 1px solid rgba(0,0,0,.06);
  
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  font-weight: 950;
  color: rgba(0,0,0,.82);
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.concurso-accordion__sum::-webkit-details-marker{ display:none; }
.concurso-accordion__sum:hover{
  background: rgba(75,42,136,.05);
  border-color: rgba(75,42,136,.16);
}
.concurso-accordion__sum:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(75,42,136,.12);
}
.concurso-accordion__sum::after{
  content:"▾";
  font-weight: 950;
  opacity: .70;
}
.concurso-accordion[open] .concurso-accordion__sum::after{
  content:"▴";
}

.concurso-accordion__hint{
  color: rgba(0,0,0,.58);
  font-weight: 850;
  font-size: .92rem;
}

.concurso-accordion__body{
  margin-top: 10px;
  background: #fff;
  
  padding: 16px;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
}

/* Form */
.concurso-form{
  display:grid;
  gap: 14px;
}

.concurso-field label{
  display:block;
  margin: 0 0 6px;
  font-weight: 950;
  color: rgba(0,0,0,.82);
}

.concurso-field input[type="text"],
.concurso-field input[type="file"]{
  width: 100%;
  padding: 12px 12px;
  
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.01);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.concurso-field input[type="text"]:focus,
.concurso-field input[type="file"]:focus{
  outline: none;
  border-color: rgba(75,42,136,.45);
  box-shadow: 0 0 0 4px rgba(75,42,136,.12);
  background: #fff;
}

.concurso-help{
  display:block;
  margin-top: 6px;
  color: rgba(0,0,0,.60);
  font-weight: 800;
  font-size: .9rem;
}

/* Fieldset suave */
.concurso-photo-block{
  border: 0;
  background: rgba(0,0,0,.02);
  
  padding: 14px;
  margin: 0;
}
.concurso-photo-block legend{
  padding: 0 8px;
  font-weight: 950;
  color: rgba(0,0,0,.82);
}

/* Aceptación bases + submit */
.concurso-actions{
  display:flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.concurso-checkbox{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  font-weight: 850;
  color: rgba(0,0,0,.80);
  line-height: 1.35;
  padding: 10px 12px;
  
  background: rgba(0,0,0,.02);
  border: 1px solid rgba(0,0,0,.06);
}
.concurso-checkbox input{
  margin-top: 3px;
  accent-color: var(--brand, #4B2A88);
}
.concurso-checkbox a{
  color: var(--brand, #4B2A88);
  font-weight: 950;
  text-decoration: none;
}
.concurso-checkbox a:hover{ text-decoration: underline; }

/* Botones */
.btn-primary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 11px 14px;
  
  font-weight: 950;
  border: 1px solid rgba(0,0,0,.06);
  background: var(--brand, #4B2A88);
  color:#fff;
  box-shadow: 0 12px 26px rgba(75,42,136,.18);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  cursor:pointer;
}
.btn-primary:hover{
  background: var(--brand-dark, #351d63);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(75,42,136,.22);
}
.btn-primary:active{
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(75,42,136,.16);
}

/* Enviar a ancho completo */
.concurso-actions .btn-primary{
  width: 100%;
  padding: 13px 14px;
  
}

/* Desktop: 2 columnas dentro del formulario */
@media (min-width: 980px){
  .concurso-form{
    grid-template-columns: 1fr 1fr;
    align-items:start;
  }
  .concurso-form .concurso-field:first-of-type{
    grid-column: 1 / -1; /* Autor a lo ancho */
  }
  .concurso-actions{
    grid-column: 1 / -1; /* checkbox + submit a lo ancho */
  }
}

/* =========================================================
   GANADORES
   ========================================================= */

.winners-toolbar{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.btn-sec{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 12px;
  
  font-weight: 950;
  border: 1px solid rgba(75,42,136,.20);
  background: rgba(75,42,136,.06);
  color: var(--brand, #4B2A88);
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}
.btn-sec:hover{
  background: var(--brand, #4B2A88);
  color:#fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,0,0,.14);
}
.btn-sec:active{ transform: translateY(0); box-shadow:none; }
.btn-sec.is-active{
  background: var(--brand, #4B2A88);
  color:#fff;
  border-color: var(--brand, #4B2A88);
}

.concurso-year{
  margin: 16px 0 8px;
  font-size: 1.08rem;
  font-weight: 950;
  color: rgba(0,0,0,.84);
}

.concurso-winners{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

/* figure */
.winner{
  margin: 0;
  
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}

.winner-btn{
  display:block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.winner-btn:focus{
  outline:none;
  box-shadow: var(--cf-focus);
}

.winner img{
  width: 100%;
  height: 240px;
  object-fit: cover;
  display:block;
  transform: scale(1.01);
  transition: transform .18s ease, filter .18s ease;
}
.winner:hover img{
  transform: scale(1.04);
  filter: saturate(1.03) contrast(1.02);
}

.winner figcaption{
  padding: 12px 14px 14px;
}
.winner .p{
  font-size: .85rem;
  font-weight: 900;
  color: var(--brand, #4B2A88);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.winner .t{
  font-weight: 950;
  color: rgba(0,0,0,.86);
  letter-spacing: -0.01em;
}
.winner .m{
  margin-top: 6px;
  font-weight: 900;
  color: var(--brand, #4B2A88);
}

/* View mode */
body[data-winners-view="list"] .concurso-year{ display:block; }
/* En galería NO ocultes los años */


/* =========================================================
   LIGHTBOX / MODAL + OVERLAY
   ========================================================= */

.lightbox{ display:none; }
.lightbox.is-open{ display:block; }

.lightbox__backdrop{
  position: fixed;
  inset: 0;
  background: rgba(10,10,14,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
}

.lightbox__panel{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(1200px, 94vw);
  max-height: 92vh;
  z-index: 9999;

  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.25);
  
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
  overflow:hidden;

  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.lightbox.is-open .lightbox__panel{
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Close button (integrado) */
.lightbox__close{
  position:absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.20);
  background: rgba(0,0,0,.40);
  color: #fff;
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
  font-size: 18px;
  font-weight: 950;
  cursor:pointer;
}
.lightbox__close:hover{ background: rgba(0,0,0,.58); }

.lightbox__body{
  position: relative;
  padding: 12px 14px 14px;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* frame contenedor */
.lightbox__frame{
  width: 100%;
  max-width: 1040px;
  max-height: 74vh;
  background: #0e0e12;
  
  overflow:hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
}

/* imagen */
.lightbox__img{
  width: 100%;
  height: 74vh;
  max-height: 74vh;
  object-fit: contain;
  display:block;
}

/* Flechas */
.lightbox__nav{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 0;
  cursor:pointer;

  color:#fff;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 32px;
  font-weight: 950;

  box-shadow: 0 14px 30px rgba(0,0,0,.25);
  transition: transform .12s ease, background .12s ease;
  z-index: 7;
}
.lightbox__nav:hover{ background: rgba(0,0,0,.55); }
.lightbox__nav:active{ transform: translateY(-50%) scale(.98); }
.lightbox__nav.prev{ left: 18px; }
.lightbox__nav.next{ right: 18px; }

/* Overlay (título + autor + contador) encima de la imagen */
.lightbox__top{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;

  padding: 18px 18px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;

  background: linear-gradient(
    0deg,
    rgba(0,0,0,.80),
    rgba(95,37,149,.78) 65%,
    rgba(0,0,0,0)
  );
  color: #fff;
  pointer-events: none;
}

.lightbox__top-left{ pointer-events: auto; }

.lightbox__title{
  color: #fff;
  font-weight: 950;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.lightbox__meta{
  color: rgba(255,255,255,.90);
  font-weight: 850;
  font-size: .98rem;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.lightbox__count{
  justify-self: end;
  align-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.38);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.92);
  font-weight: 900;
  font-size: .92rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 720px){
  .concurso-card{ padding: 16px; }

  .winner img{ height: 210px; }
  body[data-winners-view="gallery"] .winner img{ height: 260px; }

  .lightbox__panel{ width: 96vw; }
  .lightbox__nav.prev{ left: 10px; }
  .lightbox__nav.next{ right: 10px; }

  .lightbox__top{ padding: 14px 14px 12px; }
  .lightbox__title{ font-size: 1.02rem; }
  .lightbox__meta{ font-size: .92rem; }
}

/* Focus general */
.page-concurso a:focus,
.page-concurso button:focus,
.page-concurso summary:focus{
  outline: none;
  box-shadow: var(--cf-focus);
  
}
/* ===== Ajuste de espaciados (menos “acolchado”) ===== */

/* Card principal un pelín menos y mejor ritmo */
.concurso-card{
  padding: 18px;
}

/* El panel Participar no necesita tanto padding */
.concurso-box{
  padding: 14px;
  border-radius: 14px;
}

/* El acordeón: quita el mega margen y reduce el cuerpo */
.concurso-accordion{
  margin-top: 10px;
}

.concurso-accordion__body{
  margin-top: 8px;
  padding: 14px;
}

/* El form: reduce gaps para que no parezca “muy separado” */
.concurso-form{
  gap: 12px;
}

/* Fieldsets de foto: algo menos de padding */
.concurso-photo-block{
  padding: 12px;
}

/* Checkbox: menos alto */
.concurso-checkbox{
  padding: 9px 10px;
}

/* Botón enviar: menos “tocho” y sin parecer footer gigante */
.concurso-actions .btn-primary{
  padding: 12px 14px;
}

/* En pantallas grandes: limita el ancho útil para que no se vea “desierto” */
@media (min-width: 1100px){
  .concurso-current{
    
  }
}
/* =========================================================
   FIX paddings/márgenes raros en el FORM (fieldset/legend)
   Pegar al FINAL del CSS
   ========================================================= */

/* Modelo de caja consistente (evita sumas raras de padding/border) */
.page-concurso, .page-concurso *{
  box-sizing: border-box;
}

/* El form no debe traer márgenes por defecto */
.page-concurso .concurso-form{
  margin: 0;
}

/* Fieldset: quita los estilos “legacy” del navegador */
.page-concurso .concurso-photo-block{
  margin: 0;                /* MUY importante: algunos navegadores meten margen */
  min-inline-size: 0;       /* evita que el contenido “empuje” el grid */
  border: 0;                /* ya lo tenías, lo reafirmo */
  padding: 12px;            /* padding real controlado */

  background: rgba(0,0,0,.02);
}

/* Legend: también suele traer padding raro y empuja el layout */
.page-concurso .concurso-photo-block legend{
  margin: 0;
  padding: 0 6px;           /* pequeñito, sin “marco” */
  line-height: 1.1;
  font-weight: 950;
  color: rgba(0,0,0,.82);
}

/* Para que dentro del fieldset no se “infle” el spacing */
.page-concurso .concurso-photo-block .concurso-field{
  margin: 0;
}
.page-concurso .concurso-photo-block .concurso-field + .concurso-field{
  margin-top: 10px;
}

/* Inputs: redondeo + altura visual consistente */
.page-concurso .concurso-field input[type="text"],
.page-concurso .concurso-field input[type="file"]{
 
}

/* Pequeño ajuste: el bloque de acciones no meta aire extra */
.page-concurso .concurso-actions{
  margin-top: 0;
  padding-top: 4px;
}


body[data-winners-view="gallery"] .concurso-year::after{
  content:"";
  height: 1px;
  flex: 1;
  background: rgba(0,0,0,.12);
}
