/* ============================================================
   SISTEMA DE DISEÑO — PREMIO NACIONAL DE ARQUITECTURA ITESAL
   ============================================================ */
:root {
  --itesal-blue: #009BDB;
  --itesal-blue-bright: #38B6E6;
  --itesal-blue-deep: #002A3D;
  --itesal-ink: #0A1620;
  --bone: #F5F1EA;
  --grey-light: #E8E8E8;
  --grey-mid: #6B7280;
  --aluminium: #C9B68A;
}
html, body { background: var(--bone); color: var(--itesal-ink); }
body { font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.font-display { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; letter-spacing: -0.02em; }
.font-mono   { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.label-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }

/* layout helpers */
.wrap { max-width: 1440px; margin: 0 auto; padding-left: clamp(24px, 6vw, 128px); padding-right: clamp(24px, 6vw, 128px); }
.hairline { border-top: 1px solid currentColor; opacity: .25; }
.hairline-strong { border-top: 1px solid currentColor; opacity: .55; }

/* color tokens */
.bg-blue { background: var(--itesal-blue); }
.bg-blue-deep { background: var(--itesal-blue-deep); }
.bg-blue-bright { background: var(--itesal-blue-bright); }
.bg-bone { background: var(--bone); }
.bg-ink { background: var(--itesal-ink); }
.text-blue { color: var(--itesal-blue); }
.text-blue-deep { color: var(--itesal-blue-deep); }
.text-blue-bright { color: var(--itesal-blue-bright); }
.text-bone { color: var(--bone); }
.text-ink { color: var(--itesal-ink); }
.text-grey-mid { color: var(--grey-mid); }
.text-aluminium { color: var(--aluminium); }
.border-blue-deep { border-color: var(--itesal-blue-deep); }
.border-bone { border-color: var(--bone); }
.border-blue { border-color: var(--itesal-blue); }
.border-ink { border-color: var(--itesal-ink); }

/* tratamiento fotográfico */
.photo { position: relative; background-size: cover; background-position: center; }
.duotone { position: relative; background-size: cover; background-position: center; }
.duotone::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,42,61,.45) 0%, rgba(0,42,61,.10) 30%, rgba(0,42,61,.55) 100%); }
.duotone-soft { position: relative; background-size: cover; background-position: center; }
.duotone-soft::after { content:''; position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,42,61,0) 60%, rgba(0,42,61,.25) 100%); pointer-events: none; }
.duotone-clean { position: relative; background-size: cover; background-position: center; }

/* page transition */
.view { opacity: 0; transform: translateY(14px); transition: opacity .42s cubic-bezier(.22,.61,.36,1), transform .42s cubic-bezier(.22,.61,.36,1); }
.view.in { opacity: 1; transform: translateY(0); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* nav active */
.nav-link { position: relative; }
.nav-link[aria-current="page"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: currentColor; }

/* dropdowns */
.has-menu:hover > .menu, .has-menu:focus-within > .menu { opacity: 1; visibility: visible; transform: translateY(0); }
.menu { opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all .18s ease; background-color: rgb(240,240,240); }

/* form fields */
.field { position: relative; padding-top: 22px; }
.field input, .field select, .field textarea { width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(0,30,61,.35); padding: 8px 0; font-size: 16px; color: var(--itesal-blue-deep); outline: none; transition: border-color .2s ease; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--itesal-blue-bright); }
.field label { position: absolute; left: 0; top: 22px; pointer-events: none; color: var(--grey-mid); font-size: 14px; transition: all .18s ease; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field select:focus + label, .field select.has-value + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--itesal-blue); font-family: 'JetBrains Mono', monospace; }

/* checkbox */
.check { width: 18px; height: 18px; border: 1px solid var(--itesal-blue); display: inline-block; position: relative; flex: none; }
input[type="checkbox"]:checked + .check::after { content: ''; position: absolute; inset: 3px; background: var(--itesal-blue); }

/* button */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; transition: all .2s ease; border: 1px solid currentColor; }
.btn-primary { background: var(--bone); color: var(--itesal-blue-deep); border-color: var(--bone); }
.btn-primary:hover { background: var(--itesal-blue-bright); color: var(--bone); border-color: var(--itesal-blue-bright); }
.btn-outline { background: transparent; color: var(--bone); }
.btn-outline:hover { background: var(--bone); color: var(--itesal-blue-deep); }
.btn-dark { background: var(--itesal-blue); color: var(--bone); border-color: var(--itesal-blue); }
.btn-dark:hover { background: var(--itesal-blue-deep); border-color: var(--itesal-blue-deep); }

/* arrows */
.arrow::after { content: '→'; transition: transform .25s ease; display: inline-block; }
.arrow:hover::after { transform: translateX(4px); }

/* card hover */
.card-edition { transition: background .25s ease, color .25s ease, border-color .25s ease; }
.card-edition:hover { background: var(--itesal-blue-deep); color: var(--bone); border-color: var(--itesal-blue-deep); }
.card-edition:hover .text-grey-mid { color: rgba(245,241,234,.6); }
.card-edition:hover .text-aluminium { color: var(--aluminium); }
/* Las imágenes de ediciones son carteles verticales (~5:7): el marco 5/4 + cover los recortaba.
   Marco a proporción de cartel y contain para que se vean enteros aunque llegue otra proporción. */
.card-edition > div:first-child { aspect-ratio: 5 / 7; background: var(--bone); }
.card-edition .duotone-soft { background-size: contain; background-repeat: no-repeat; }
.card-edition .duotone-soft::after { display: none; }

/* timeline node */
.tl-node { width: 12px; height: 12px; background: var(--itesal-blue); border-radius: 1px; }

/* accordion */
details.faq { border-bottom: 1px solid rgba(0,30,61,.18); }
details.faq summary { list-style: none; cursor: pointer; padding: 28px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq .plus { transition: transform .25s ease; font-family: 'JetBrains Mono', monospace; font-size: 24px; color: var(--itesal-blue); }
details.faq[open] .plus { transform: rotate(45deg); }
details.faq .answer { padding-bottom: 28px; max-width: 760px; color: var(--itesal-blue-deep); opacity: .8; line-height: 1.65; }

/* FAQ paneles renderizados por el CMS (faq_items) */
.faq-panel { border-bottom: 1px solid rgba(0,30,61,.18); }
.faq-panel__label { width: 100%; background: transparent; border: 0; cursor: pointer; padding: 28px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; font-size: 20px; font-family: 'Fraunces', serif; text-align: left; color: var(--itesal-blue-deep); }
.faq-panel__icon { font-family: 'JetBrains Mono', monospace; font-size: 24px; color: var(--itesal-blue); transition: transform .25s ease; }
.faq-panel__label[aria-expanded="true"] .faq-panel__icon { transform: rotate(45deg); }
.faq-panel__inner { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.faq-panel__label[aria-expanded="true"] + .faq-panel__inner { grid-template-rows: 1fr; }
.faq-panel__content { overflow: hidden; padding-bottom: 0; max-width: 760px; color: var(--itesal-blue-deep); opacity: .8; line-height: 1.65; }
.faq-panel__label[aria-expanded="true"] + .faq-panel__inner .faq-panel__content { padding-bottom: 28px; }

/* mobile menu */
.mobile-overlay { transform: translateY(-100%); transition: transform .42s cubic-bezier(.7,0,.3,1); }
.mobile-overlay.open { transform: translateY(0); }

/* placeholder stripe */
.ph-stripe { background: repeating-linear-gradient(45deg, rgba(245,241,234,.06), rgba(245,241,234,.06) 12px, transparent 12px, transparent 24px), var(--itesal-blue-deep); }
::selection { background: var(--itesal-blue-bright); color: var(--bone); }

/* typography sizing */
.display-xl { font-family: 'Fraunces', serif; font-weight: 350; line-height: .95; letter-spacing: -0.035em; font-size: clamp(48px, 9vw, 144px); }
.display-lg { font-family: 'Fraunces', serif; font-weight: 350; line-height: .98; letter-spacing: -0.03em; font-size: clamp(40px, 6.5vw, 96px); }
.display-md { font-family: 'Fraunces', serif; font-weight: 350; line-height: 1.02; letter-spacing: -0.025em; font-size: clamp(32px, 4.5vw, 64px); }
.display-sm { font-family: 'Fraunces', serif; font-weight: 350; line-height: 1.1; letter-spacing: -0.015em; font-size: clamp(24px, 2.6vw, 36px); }
.display-2xl { font-family: 'Fraunces', serif; font-weight: 350; line-height: 1.05; letter-spacing: -0.02em; font-size: clamp(20px, 2vw, 28px); }
.italic-key { font-style: italic; }

/* logo mask */
.logo-mark { display: inline-block; width: 44px; height: 36px; background: currentColor; -webkit-mask: url('/assets/images/itesal-logo.png') center/contain no-repeat; mask: url('/assets/images/itesal-logo.png') center/contain no-repeat; flex: none; }
.logo-mark.lg { width: 64px; height: 52px; }

/* tabla editorial */
table.editorial { width: 100%; border-collapse: collapse; }
table.editorial th, table.editorial td { text-align: left; padding: 18px 16px; border-bottom: 1px solid rgba(0,30,61,.14); vertical-align: top; }
table.editorial th { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--grey-mid); font-weight: 500; }
table.editorial tr:hover td { background: rgba(0,61,122,.03); }

/* tabla genérica del CMS (table_data) */
.ctd-table-wrap { overflow-x: auto; }
.ctd-table { width: 100%; border-collapse: collapse; }
.ctd-table th, .ctd-table td { text-align: left; padding: 16px; border-bottom: 1px solid rgba(0,30,61,.14); }
.ctd-table th { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--grey-mid); }

/* tarjetas image_cards (grid_tarjetas) — overlay editorial */
.cards-grid { display: grid; grid-template-columns: repeat(1, minmax(0,1fr)); gap: 16px; }
@media (min-width: 768px) { .cards-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .cards-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.cards-grid .cg-card { position: relative; display: block; background: var(--itesal-ink); overflow: hidden; aspect-ratio: 4/5; }
.cards-grid .cg-card__img { position: absolute; inset: 0; }
.cards-grid .cg-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.cards-grid .cg-card:hover .cg-card__img img { transform: scale(1.05); }
.cards-grid .cg-card__text { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; font-family: 'Fraunces', serif; font-size: clamp(1.25rem, 1.6vw, 1.75rem); line-height: 1.1; color: var(--bone); background: linear-gradient(180deg, transparent, rgba(0,42,61,.85)); z-index: 1; }

/* galería (image_array → .gallery-embed__item) */
.cms-gallery .gallery-embed__item { overflow: hidden; }
.cms-gallery .gallery-embed__item img { width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform .7s ease; }
.cms-gallery .gallery-embed__item:hover img { transform: scale(1.04); }

/* countdown */
.countdown { display: flex; flex-wrap: wrap; }

/* Las colecciones (jurado, ediciones) las envuelve collection_list.php en
   .rts-blog-list-area > .container. ".container" es una utilidad de Tailwind que
   limita el ancho y alinea a la izquierda → descentra la cuadrícula. Lo neutralizamos:
   el centrado lo aporta el .wrap interno de nuestra wrapper_html. */
.rts-blog-list-area { width: 100%; }
.rts-blog-list-area > .container { max-width: none; width: 100%; margin: 0; padding: 0; }

a { color: inherit; }
