/* TripleJota Certamen Fotografía — estilos de frontend */

.tjcf-panel,
.tjcf-jurado,
.tjcf-galeria-publica,
.tjcf-auth-wrap {
	--tjcf-accent: #1e5aa8;
	--tjcf-accent-dark: #17457f;
	--tjcf-green: #1a7f37;
	--tjcf-border: #e3e5e8;
	--tjcf-muted: #646970;
	max-width: 920px;
	margin: 0 auto;
}
.tjcf-auth-wrap { max-width: 480px; }

/* ---------- Avisos ---------- */
.tjcf-alert { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; border: 1px solid transparent; }
.tjcf-alert p { margin: 0 0 4px; }
.tjcf-alert p:last-child { margin: 0; }
.tjcf-alert ul { margin: 6px 0 0 18px; }
.tjcf-alert-ok { background: #edf7ed; border-color: #cde8cd; color: #1a5928; }
.tjcf-alert-error { background: #fcf0f1; border-color: #f2d2d4; color: #8a1f26; }
.tjcf-alert-warn { background: #fcf6e5; border-color: #f0e0b0; color: #7a5b00; }

/* Bloque estructurado de conflictos del jurado */
.tjcf-conflictos { border: 1px solid #f0d9a8; background: #fdf7e8; border-radius: 10px; padding: 16px 18px; margin: 0 0 22px; }
.tjcf-conflictos-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: #7a5b00; }
.tjcf-conflictos-ico { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #e0a83b; color: #fff; font-weight: 700; flex: 0 0 auto; }
.tjcf-conflictos-cab strong { font-size: 1.05rem; }
.tjcf-conf-item { border-top: 1px solid #f0e4c4; padding-top: 14px; margin-top: 14px; }
.tjcf-conf-item:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.tjcf-conf-tit { font-weight: 700; margin-bottom: 10px; }
.tjcf-conf-obras { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.tjcf-conf-obras li { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tjcf-chip { display: inline-block; background: var(--tjcf-accent, #1e5aa8); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 12px; }
.tjcf-conf-obra { font-weight: 600; }
.tjcf-conf-obras code { background: #efe6cf; padding: 1px 7px; border-radius: 4px; font-size: 12px; }
.tjcf-conf-accion { color: #7a5b00; font-weight: 600; }
.tjcf-conf-accion::before { content: "→ "; }

/* ---------- Formularios ---------- */
.tjcf-form p { margin: 0 0 14px; }
.tjcf-form label { font-weight: 600; display: block; margin: 0 0 5px; }
.tjcf-form input[type="text"],
.tjcf-form input[type="email"],
.tjcf-form input[type="password"],
.tjcf-form input[type="url"],
.tjcf-form select,
.tjcf-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #c3c4c7;
	border-radius: 7px;
	font-size: 16px;
	box-sizing: border-box;
	background: #fff;
}
.tjcf-form input:focus,
.tjcf-form select:focus,
.tjcf-form textarea:focus {
	border-color: var(--tjcf-accent);
	outline: 2px solid rgba(30, 90, 168, .15);
}
.tjcf-form-row { display: flex; gap: 14px; }
.tjcf-form-row > p { flex: 1; }
.tjcf-check-inline label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }

.tjcf-fieldset { border: 1px solid var(--tjcf-border); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; }
.tjcf-fieldset > label { font-weight: 400; display: block; margin: 0 0 8px; }
.tjcf-consent legend { font-weight: 700; padding: 0 6px; }

.tjcf-btn {
	display: inline-block;
	background: var(--tjcf-accent);
	color: #fff;
	border: 0;
	border-radius: 7px;
	padding: 11px 22px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}
.tjcf-btn:hover { background: var(--tjcf-accent-dark); color: #fff; }
.tjcf-btn-link { background: none; border: 0; color: #b32d2e; cursor: pointer; padding: 0; font-size: 14px; text-decoration: underline; }
.tjcf-btn-sec {
	display: inline-block;
	background: #fff;
	color: var(--tjcf-accent);
	border: 1px solid var(--tjcf-accent);
	border-radius: 7px;
	padding: 9px 16px;
	font-weight: 600;
	text-decoration: none;
}
.tjcf-btn-sec:hover { background: #eef3fb; color: var(--tjcf-accent-dark); }
.tjcf-jurado-tools { margin: 0 0 18px; }

/* ---------- Tarjeta de acceso con pestañas ---------- */
.tjcf-auth-intro { text-align: center; margin: 0 0 18px; }
.tjcf-auth-intro h2 { margin: 0 0 6px; font-size: 1.5rem; }
.tjcf-auth-intro p { color: var(--tjcf-muted); margin: 0; }

.tjcf-auth {
	border: 1px solid var(--tjcf-border);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
	background: #fff;
}
.tjcf-authtab-radio { position: absolute; opacity: 0; width: 0; height: 0; }
.tjcf-tabs { display: flex; border-bottom: 1px solid var(--tjcf-border); }
.tjcf-tab {
	flex: 1;
	text-align: center;
	padding: 14px 10px;
	cursor: pointer;
	font-weight: 600;
	color: var(--tjcf-muted);
	background: #f6f7f8;
	user-select: none;
}
.tjcf-tab:hover { color: var(--tjcf-accent); }
.tjcf-tabpanel { display: none; padding: 22px; }
#tjcf-authtab-login:checked ~ .tjcf-tp-login,
#tjcf-authtab-reg:checked ~ .tjcf-tp-reg { display: block; }
#tjcf-authtab-login:checked ~ .tjcf-tabs .tjcf-tab[for="tjcf-authtab-login"],
#tjcf-authtab-reg:checked ~ .tjcf-tabs .tjcf-tab[for="tjcf-authtab-reg"] {
	background: #fff;
	color: var(--tjcf-accent);
	box-shadow: inset 0 -3px 0 var(--tjcf-accent);
}
.tjcf-auth-form .tjcf-btn { width: 100%; }

/* ---------- Cabecera del panel ---------- */
.tjcf-panel-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--tjcf-border);
	margin-bottom: 20px;
}
.tjcf-panel-head h2 { margin: 0 0 4px; }
.tjcf-datos { color: var(--tjcf-muted); font-size: 14px; margin: 0; }
.tjcf-logout { flex: 0 0 auto; font-size: 14px; white-space: nowrap; }

/* ---------- Banner de convocatoria + progreso ---------- */
.tjcf-conv-banner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	padding: 16px 20px;
	border: 1px solid var(--tjcf-border);
	border-left: 5px solid var(--tjcf-muted);
	border-radius: 10px;
	background: #fbfbfc;
	margin-bottom: 24px;
}
.tjcf-conv-banner.is-open { border-left-color: var(--tjcf-green); }
.tjcf-conv-banner.is-closed { border-left-color: #b32d2e; }
.tjcf-conv-info h3 { margin: 0 0 4px; font-size: 1.15rem; }
.tjcf-plazo { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tjcf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tjcf-green); box-shadow: 0 0 0 3px rgba(26, 127, 55, .18); }
.tjcf-progress { text-align: right; min-width: 140px; }
.tjcf-progress-num { font-size: 1.4rem; font-weight: 700; color: var(--tjcf-accent); }
.tjcf-progress-lbl { color: var(--tjcf-muted); font-size: 13px; }
.tjcf-progress-bar { height: 7px; background: #e6e8eb; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.tjcf-progress-bar i { display: block; height: 100%; background: var(--tjcf-accent); border-radius: 4px; }

/* ---------- Rejilla de obras ---------- */
.tjcf-sec-tit { margin: 0 0 14px; }
.tjcf-vacio { color: var(--tjcf-muted); }
.tjcf-obras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-bottom: 28px; }
.tjcf-obra-card {
	border: 1px solid var(--tjcf-border);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
}
.tjcf-obra-thumb { aspect-ratio: 4 / 3; background: #f0f0f0; }
.tjcf-obra-thumb .tjcf-lb { height: 100%; }
.tjcf-obra-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tjcf-obra-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.tjcf-obra-body h4 { margin: 0; font-size: 1.02rem; }
.tjcf-cod { color: var(--tjcf-muted); font-size: 12px; font-family: monospace; }
.tjcf-opta-tag {
	display: inline-block;
	width: fit-content;
	background: #fff5e0;
	color: #8a6100;
	font-size: 12px;
	font-weight: 600;
	padding: 2px 9px;
	border-radius: 10px;
}
.tjcf-obra-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.tjcf-editar summary { cursor: pointer; color: var(--tjcf-accent); font-weight: 600; font-size: 14px; }
.tjcf-editar .tjcf-obra-form { margin-top: 12px; }

/* ---------- Tarjeta de añadir obra ---------- */
.tjcf-add-card {
	border: 1px solid var(--tjcf-border);
	border-radius: 12px;
	background: #f8fafc;
	padding: 20px 22px;
}
.tjcf-add-card h3 { margin-top: 0; }
.tjcf-add-full { text-align: center; color: var(--tjcf-muted); background: #f6f7f8; }
.tjcf-add-full p { margin: 0; }

/* ---------- Disparador de lightbox ---------- */
.tjcf-lb {
	display: block;
	position: relative;
	overflow: hidden;
	cursor: zoom-in;
	background: #eceef0;
	line-height: 0;
}
.tjcf-lb img { transition: transform .35s ease; }
.tjcf-lb:hover img { transform: scale(1.05); }
.tjcf-lb::after {
	content: "⤢";
	position: absolute;
	top: 8px;
	right: 8px;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .5);
	color: #fff;
	border-radius: 50%;
	font-size: 15px;
	opacity: 0;
	transition: opacity .2s;
	line-height: 1;
}
.tjcf-lb:hover::after { opacity: 1; }

/* ---------- Lightbox (overlay) ---------- */
.tjcf-lightbox { position: fixed; inset: 0; background: rgba(14, 16, 18, .93); display: none; align-items: center; justify-content: center; z-index: 100000; }
.tjcf-lightbox.is-open { display: flex; }
.tjcf-lb-fig { margin: 0; max-width: 94vw; max-height: 94vh; display: flex; flex-direction: column; align-items: center; }
.tjcf-lb-fig img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 6px; box-shadow: 0 12px 44px rgba(0, 0, 0, .6); background: #1a1a1a; }
.tjcf-lb-fig figcaption { color: #f2f2f2; margin-top: 14px; font-size: 15px; text-align: center; }
.tjcf-lb-close, .tjcf-lb-prev, .tjcf-lb-next {
	position: absolute; background: rgba(255, 255, 255, .13); color: #fff; border: 0; cursor: pointer;
	border-radius: 50%; width: 50px; height: 50px; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
	transition: background .15s;
}
.tjcf-lb-close:hover, .tjcf-lb-prev:hover, .tjcf-lb-next:hover { background: rgba(255, 255, 255, .28); }
.tjcf-lb-close { top: 18px; right: 18px; }
.tjcf-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.tjcf-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Galería del jurado ---------- */
.tjcf-galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin: 20px 0; }
.tjcf-card { margin: 0; border: 1px solid var(--tjcf-border, #e5e5e5); border-radius: 12px; overflow: hidden; background: #fff; position: relative; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.tjcf-card .tjcf-lb { aspect-ratio: 4 / 3; }
.tjcf-card .tjcf-lb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tjcf-card figcaption { padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.tjcf-card figcaption strong { font-size: 1rem; }
.tjcf-card figcaption select { margin-top: 4px; width: 100%; padding: 8px; border-radius: 7px; border: 1px solid #c3c4c7; }
.tjcf-badge { display: inline-block; background: #fff5e0; color: #8a6100; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 10px; width: fit-content; }
.tjcf-card .tjcf-cod { color: var(--tjcf-muted, #646970); font-size: 12px; font-family: monospace; }

.tjcf-jurado-bar {
	position: sticky; bottom: 0; z-index: 5;
	display: flex; justify-content: space-between; align-items: center; gap: 16px;
	background: #fff; border-top: 1px solid var(--tjcf-border); padding: 12px 4px;
	margin-top: 8px;
}
.tjcf-jurado-bar .tjcf-btn { margin: 0; }

/* ---------- Galería pública ---------- */
.tjcf-gal-header { text-align: center; margin: 0 0 28px; }
.tjcf-gal-header h2 { margin: 0 0 6px; font-size: 1.8rem; }
.tjcf-gal-header p { color: var(--tjcf-muted); margin: 0; }
.tjcf-gal-sec-tit { display: flex; align-items: center; gap: 12px; margin: 30px 0 18px; font-size: 1.15rem; }
.tjcf-gal-sec-tit::after { content: ""; flex: 1; height: 1px; background: var(--tjcf-border); }

.tjcf-ganadoras { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; margin-bottom: 12px; }
.tjcf-win { margin: 0; border-radius: 14px; overflow: hidden; background: #fff; position: relative; box-shadow: 0 8px 26px rgba(0, 0, 0, .13); }
.tjcf-win .tjcf-lb { aspect-ratio: 3 / 2; }
.tjcf-win .tjcf-lb img { width: 100%; height: 100%; object-fit: cover; }
.tjcf-ribbon {
	position: absolute; top: 16px; left: 0; z-index: 3;
	background: linear-gradient(135deg, #e6c14b, #b8901f); color: #3a2f00;
	font-weight: 700; font-size: 13px; padding: 6px 16px 6px 14px;
	box-shadow: 0 3px 8px rgba(0, 0, 0, .25); border-radius: 0 20px 20px 0;
}
.tjcf-win figcaption { padding: 16px 18px; }
.tjcf-win figcaption strong { display: block; font-size: 1.15rem; }

.tjcf-masonry { column-count: 3; column-gap: 18px; }
.tjcf-mitem { break-inside: avoid; margin: 0 0 18px; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .09); }
.tjcf-mitem .tjcf-lb img { width: 100%; display: block; }
.tjcf-mitem figcaption { padding: 11px 13px; font-size: 14px; }

.tjcf-autor { color: #555; display: block; }
.tjcf-mail { font-size: 13px; }

@media (max-width: 900px) { .tjcf-masonry { column-count: 2; } }
@media (max-width: 560px) { .tjcf-masonry { column-count: 1; } }

@media (max-width: 600px) {
	.tjcf-panel-head { flex-direction: column; }
	.tjcf-conv-banner { flex-direction: column; align-items: flex-start; }
	.tjcf-progress { text-align: left; width: 100%; }
	.tjcf-form-row { flex-direction: column; gap: 0; }
}
