/*
Theme Name: CAEL Institucional
Description: Tema de bloques para el sitio del Colegio de Abogados del Estado Lara. Azul marino, detalles en dorado y títulos con serifa.
Version: 1.2.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: cael
License: GPLv2 or later
*/

/* Sin hueco entre cabecera, contenido y pie */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Banda superior */
.cael-topbar { font-size: 13px; }
.cael-topbar p { margin: 0; opacity: .85; }

/* Cabecera */
.cael-header { border-bottom: 3px solid var(--wp--preset--color--brass); position: sticky; top: 0; z-index: 50; }
.admin-bar .cael-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .cael-header { top: 46px; } }
.cael-header .wp-block-site-title a { text-decoration: none; }
.cael-header .cael-tagline { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--wp--preset--color--brass); margin: 2px 0 0; }
.cael-header .wp-block-navigation a { padding: 6px 2px; border-bottom: 2px solid transparent; }
.cael-header .wp-block-navigation a:hover,
.cael-header .wp-block-navigation .current-menu-item > a { border-bottom-color: var(--wp--preset--color--brass); color: var(--wp--preset--color--brass); }
.cael-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--navy) !important; color: var(--wp--preset--color--on-navy) !important; }

/* Etiqueta pequeña sobre títulos */
.cael-eyebrow { font-size: 12px !important; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--wp--preset--color--brass); margin-bottom: 8px !important; }

/* Portada */
.cael-hero { position: relative; overflow: hidden; padding-block: 96px 88px !important; }
.cael-hero .wp-block-cover__image-background { animation: cael-kenburns 18s ease-out both; }
.cael-hero .wp-block-cover__background { background: linear-gradient(100deg, var(--wp--preset--color--navy) 0%, rgba(10,20,36,.88) 45%, rgba(10,20,36,.55) 100%) !important; opacity: 1 !important; }
.cael-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, transparent, var(--wp--preset--color--brass), transparent); z-index: 2; }
.cael-hero-inner > * + * { margin-top: 22px; }
.cael-hero-inner .cael-since { font-family: var(--wp--preset--font-family--display); font-style: italic; color: var(--wp--preset--color--brass); font-size: 18px; display: flex; align-items: center; gap: 14px; }
.cael-hero-inner .cael-since::before { content: ""; width: 48px; height: 1px; background: var(--wp--preset--color--brass); }
.cael-hero-inner p:not(.cael-since) { max-width: 56ch; font-size: 18px; color: rgba(238,241,246,.88); }
.cael-hero-inner h1 { max-width: 18ch; margin-bottom: 0; letter-spacing: -.01em; }
@keyframes cael-kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }

.cael-quick { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); margin-top: -32px !important; position: relative; z-index: 2; gap: 0 !important; }
.cael-quick > .wp-block-column { padding: 24px; border-right: 1px solid var(--wp--preset--color--line); }
.cael-quick > .wp-block-column:last-child { border-right: 0; }
.cael-quick h3 a { text-decoration: none; }
.cael-quick p { color: var(--wp--preset--color--ink-soft); font-size: 14px; }
@media (max-width: 781px) { .cael-quick > .wp-block-column { border-right: 0; border-bottom: 1px solid var(--wp--preset--color--line); } }

/* Tarjetas */
.cael-card, .cael-news .wp-block-post { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); }
.cael-card { padding: 24px; }
.cael-card ul { color: var(--wp--preset--color--ink-soft); font-size: 15px; padding-left: 18px; }
.cael-card .cael-meta { font-size: 12px; font-weight: 600; color: var(--wp--preset--color--ink-soft); }
.cael-news .wp-block-post { display: flex; flex-direction: column; }
.cael-news .wp-block-post > *:not(.wp-block-post-featured-image) { padding-inline: 20px; }
.cael-news .wp-block-post > *:last-child { padding-bottom: 20px; }
.cael-news .wp-block-post-featured-image { margin: 0; aspect-ratio: 16/10; background: repeating-linear-gradient(135deg, var(--wp--preset--color--brass-soft) 0 12px, transparent 12px 24px), var(--wp--preset--color--line); }
.cael-news .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; }
.cael-news .wp-block-post-date { font-size: 13px; color: var(--wp--preset--color--brass); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-top: 16px; }
.cael-news .wp-block-post-title a { text-decoration: none; }
.cael-news .wp-block-post-excerpt { color: var(--wp--preset--color--ink-soft); font-size: 15px; }

/* Cita */
.cael-quote { border-left: 3px solid var(--wp--preset--color--brass) !important; padding-left: 20px !important; }
.cael-quote p { font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: 22px; line-height: 1.45; }

/* Encabezado de páginas internas */
.cael-page-head { border-bottom: 1px solid var(--wp--preset--color--line); }
.cael-lead { font-size: 19px !important; color: var(--wp--preset--color--ink-soft); }

/* Junta directiva */
.cael-person { text-align: center; }
.cael-person .cael-role { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--wp--preset--color--brass); font-weight: 600; margin: 0; }
.cael-person .cael-name { font-family: var(--wp--preset--font-family--display); font-size: 17px; margin: 4px 0 0; }

/* Pasos de inscripción */
.wp-block-details { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); padding: 18px 22px; }
.wp-block-details + .wp-block-details { margin-top: -1px !important; }
.wp-block-details summary { font-family: var(--wp--preset--font-family--display); font-size: 20px; cursor: pointer; }
.wp-block-details ol { margin-top: 14px; }
.wp-block-details li { margin-bottom: 6px; }

/* Dato por confirmar */
.cael-pending { display: inline; background: #3a2f12; color: #f3d27a; font-size: 12px !important; font-weight: 600; padding: 1px 8px; border-radius: 2px; }

/* Categorías como filtros */
.cael-filters, .cael-filters ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.cael-filters li a { display: block; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); padding: 6px 14px; text-decoration: none; font-size: 14px; border-radius: 2px; }
.cael-filters li.current-cat a, .cael-filters li a:hover { background: var(--wp--preset--color--navy); color: var(--wp--preset--color--on-navy); border-color: var(--wp--preset--color--navy); }

/* Pie */
.cael-footer h4 { font-family: var(--wp--preset--font-family--body); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--wp--preset--color--brass); }
.cael-footer a { color: inherit; }
.cael-footer .cael-legal { border-top: 1px solid rgba(255,255,255,.12); opacity: .65; font-size: 13px; }

/* Formulario Contact Form 7 */
.wpcf7 form { display: grid; gap: 18px; }
.wpcf7 form p { margin: 0; }
.wpcf7 label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.wpcf7 label br { display: none; }
.wpcf7 .wpcf7-form-control-wrap { display: block; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"],
.wpcf7 select, .wpcf7 textarea {
	box-sizing: border-box; width: 100%; max-width: 100%;
	font: 15px var(--wp--preset--font-family--body);
	padding: 10px 12px; border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); border-radius: 2px;
}
.wpcf7 textarea { height: 140px; resize: vertical; }
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus { outline: 2px solid var(--wp--preset--color--brass); outline-offset: 1px; border-color: var(--wp--preset--color--brass); }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-list-item label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.wpcf7 .wpcf7-list-item input[type="checkbox"] { margin-top: 4px; accent-color: var(--wp--preset--color--brass); }
.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--brass); color: var(--wp--preset--color--navy-deep);
	border: 0; padding: 12px 22px; font: 600 15px var(--wp--preset--font-family--body); border-radius: 2px; cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: #d6b678; }
.wpcf7 .wpcf7-spinner { vertical-align: middle; }
.wpcf7-not-valid-tip { font-size: 13px; font-weight: 400; margin-top: 4px; }
.wpcf7 form .wpcf7-response-output { margin: 0; padding: 10px 14px; font-size: 14px; }

/* Separación entre columnas de las páginas internas */
.entry-content .wp-block-columns { gap: 32px; }

/* El sitio es siempre oscuro */
body { color-scheme: dark; }


/* ---------- Versión 1.2: fotos, animaciones y acabados ---------- */

/* Cabecera con efecto vidrio que se compacta al bajar */
.cael-header { transition: background-color .3s ease, box-shadow .3s ease; }
.cael-header > .wp-block-group { transition: padding .3s ease; }
.cael-header.is-scrolled { background-color: rgba(10,20,36,.82) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.cael-header.is-scrolled > .wp-block-group { padding-top: 8px !important; padding-bottom: 8px !important; }
.cael-header .wp-block-navigation a { position: relative; border-bottom: 0 !important; }
.cael-header .wp-block-navigation a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--wp--preset--color--brass); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.cael-header .wp-block-navigation a:hover::after, .cael-header .wp-block-navigation .current-menu-item > a::after { transform: scaleX(1); }

/* Botones */
.wp-element-button, .wp-block-button__link { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(201,167,100,.25); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: rgba(201,167,100,.12); }

/* Títulos de sección con línea dorada */
main h2.wp-block-heading { position: relative; padding-bottom: 14px; }
main h2.wp-block-heading::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 2px; background: var(--wp--preset--color--brass); transform-origin: left; }
.cael-hero h2::after, .cael-footer h2::after { display: none; }

/* Tarjetas: elevación y borde dorado al pasar el ratón */
.cael-card, .cael-news .wp-block-post, .cael-quick > .wp-block-column { transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .35s ease, box-shadow .35s ease; }
.cael-card:hover, .cael-news .wp-block-post:hover { transform: translateY(-6px); border-color: rgba(201,167,100,.55); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.cael-quick > .wp-block-column:hover { background: rgba(201,167,100,.06); }

/* Fotos en tarjetas */
.cael-card { overflow: hidden; }
.cael-card > .cael-card-photo:first-child { margin: -24px -24px 18px !important; aspect-ratio: 16/10; overflow: hidden; }
.cael-card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.cael-card:hover .cael-card-photo img { transform: scale(1.06); }

/* Noticias: foto con zoom y sello cuando no hay imagen */
.cael-news .wp-block-post { overflow: hidden; }
.cael-news .wp-block-post-featured-image { overflow: hidden; }
.cael-news .wp-block-post-featured-image img { transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.cael-news .wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.06); }
.cael-news .wp-block-post:not(:has(.wp-block-post-featured-image))::before {
	content: "CAEL · 1895"; display: grid; place-items: center; aspect-ratio: 16/10;
	font-family: var(--wp--preset--font-family--display); font-style: italic; font-size: 22px; letter-spacing: .08em; color: var(--wp--preset--color--brass);
	background: radial-gradient(circle at 70% 30%, rgba(201,167,100,.18), transparent 60%), linear-gradient(135deg, var(--wp--preset--color--navy), var(--wp--preset--color--navy-deep));
}

/* Galerías tipo mosaico */
.cael-mosaic.wp-block-gallery { gap: 12px !important; }
.cael-mosaic.wp-block-gallery .wp-block-image { overflow: hidden; border: 1px solid var(--wp--preset--color--line); }
.cael-mosaic.wp-block-gallery .wp-block-image img { aspect-ratio: 4/3; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .4s ease; filter: saturate(.9); }
.cael-mosaic.wp-block-gallery .wp-block-image:hover img { transform: scale(1.07); filter: saturate(1.05); }
@media (min-width: 782px) {
	.cael-mosaic.wp-block-gallery.columns-3 { display: grid !important; grid-template-columns: repeat(3, 1fr); }
	.cael-mosaic.wp-block-gallery.columns-3 > .wp-block-image { width: auto !important; margin: 0 !important; }
	.cael-mosaic.wp-block-gallery.columns-3 > .wp-block-image:first-child { grid-column: span 2; grid-row: span 2; }
	.cael-mosaic.wp-block-gallery.columns-3 > .wp-block-image:first-child img { aspect-ratio: auto; height: 100%; }
}

/* Galería de la portada */
.cael-home-content { padding-top: 72px; }

/* Cifras */
.cael-stats .wp-block-column { border-left: 1px solid var(--wp--preset--color--line); padding-left: 22px; }
.cael-stat-num { font-family: var(--wp--preset--font-family--display); font-size: clamp(36px, 4.5vw, 54px); line-height: 1; color: var(--wp--preset--color--brass); margin: 0; font-variant-numeric: tabular-nums; }
.cael-stat-label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--wp--preset--color--ink-soft); margin-top: 10px !important; }

/* Imagen destacada de una noticia */
.single .wp-block-post-featured-image { overflow: hidden; border: 1px solid var(--wp--preset--color--line); }

/* ---------- Efectos de entrada ---------- */
/* Solo se activan si el navegador ejecuta el script del tema y el visitante no pidió reducir el movimiento. */
@media (prefers-reduced-motion: no-preference) {
	.cael-anim .cael-hero-inner > * { animation: cael-rise .9s cubic-bezier(.2,.7,.2,1) both; }
	.cael-anim .cael-hero-inner > *:nth-child(1) { animation-delay: .15s; }
	.cael-anim .cael-hero-inner > *:nth-child(2) { animation-delay: .3s; }
	.cael-anim .cael-hero-inner > *:nth-child(3) { animation-delay: .45s; }
	.cael-anim .cael-hero-inner > *:nth-child(4) { animation-delay: .6s; }
	.cael-anim .cael-page-head .wp-block-post-title, .cael-anim .cael-page-head h1 { animation: cael-rise .8s cubic-bezier(.2,.7,.2,1) both; }

	.cael-anim .cael-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--cael-delay, 0s); }
	.cael-anim .cael-reveal.is-visible { opacity: 1; transform: none; }
	.cael-anim main h2.wp-block-heading.cael-reveal::after { transform: scaleX(0); transition: transform .9s cubic-bezier(.2,.7,.2,1) .25s; }
	.cael-anim main h2.wp-block-heading.cael-reveal.is-visible::after { transform: scaleX(1); }
}
@keyframes cael-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.cael-hero .wp-block-cover__image-background { animation: none; }
	.cael-card, .cael-news .wp-block-post, .cael-card-photo img, .cael-mosaic img { transition: none !important; }
}
