/*
Theme Name: Aviación Simulada
Theme URI: https://aviacionsimulada.com
Description: Tema de bloques ligero para el portal Aviación Simulada: aviación real, simuladores, academia y descargas.
Author: Aviación Simulada
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
License: GPLv2 or later
Text Domain: aviacion
*/

/* ---------- Base ---------- */
:root { --av-radius: 14px; --av-shadow: 0 14px 30px rgba(22, 50, 79, .10); }
html { scroll-padding-top: 90px; }
body { -webkit-font-smoothing: antialiased; }
:where(a, button, input, summary):focus-visible { outline: 3px solid #FF8A34; outline-offset: 3px; border-radius: 4px; }
img { height: auto; }
.screen-reader-text:focus { clip: auto !important; }

/* ---------- Barra superior ---------- */
.av-topbar { background: #16324F; color: #D5E3F0; font-size: .8rem; }
.av-topbar a { color: #D5E3F0; }
.av-topbar a:hover { color: #fff; }
.av-topbar .av-metar { display: inline-flex; align-items: center; gap: 6px; color: #9FD8FF; }
@media (max-width: 640px) { .av-topbar .av-topbar__extra { display: none; } }

/* ---------- Cabecera fija ---------- */
.av-header-wrap { position: sticky; top: 0; z-index: 60; }
.admin-bar .av-header-wrap { top: 32px; }
@media (max-width: 782px) { .admin-bar .av-header-wrap { top: 0; } }
.av-header { background: #fff; border-bottom: 1px solid #E2EBF3; }
.av-header__inner { min-height: 66px; }
.av-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; flex-shrink: 0; }
.av-logo__mark { width: 40px; height: 40px; border-radius: 11px; background: #0875D1; display: grid; place-items: center; position: relative; }
.av-logo__mark svg { transform: rotate(45deg); }
.av-logo__dot { position: absolute; right: -3px; bottom: 6px; width: 9px; height: 9px; border-radius: 50%; background: #FF8A34; border: 2px solid #fff; }
.av-logo__text { display: flex; flex-direction: column; line-height: 1; }
.av-logo__name { font: 800 19px/1 Barlow, sans-serif; color: #16324F; letter-spacing: .01em; }
.av-logo__name span { color: #0875D1; }
.av-logo__tag { font: 500 10px/1 Inter, sans-serif; color: #5A6F84; letter-spacing: .14em; margin-top: 5px; }
@media (max-width: 420px) { .av-logo__tag { display: none; } .av-logo__name { font-size: 17px; } }

.av-nav .wp-block-navigation-item__content { padding: .6rem .7rem; border-radius: 8px; }
.av-nav > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover { color: #0875D1; background: #EEF6FD; text-decoration: none; }
.av-nav .wp-block-navigation__submenu-container { border: 1px solid #E2EBF3 !important; border-radius: 12px; box-shadow: 0 16px 40px rgba(22, 50, 79, .12); padding: 8px !important; min-width: 240px !important; }
.av-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-weight: 500; }
.av-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { background: #EEF6FD; color: #0875D1; text-decoration: none; }
.av-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 1.25rem; background: #fff !important; color: #16324F !important; overflow-y: auto; }
.av-nav .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 3rem; gap: .25rem; }
.av-nav .is-menu-open .wp-block-navigation-item__content { font-size: 1.05rem; font-weight: 700; }
.av-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-size: .95rem; font-weight: 500; color: #3E5670; }
.av-nav .wp-block-navigation__responsive-container-open, .av-nav .wp-block-navigation__responsive-container-close { width: 44px; height: 44px; place-items: center; border: 1px solid #CFDDEA; border-radius: 10px; }
.av-nav .wp-block-navigation__responsive-container-open { display: grid; }
/* Menú de móvil también en tableta (hasta 1080 px) */
@media (min-width: 600px) and (max-width: 1080px) {
	.av-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: grid; }
	.av-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.av-nav .wp-block-navigation__responsive-container-close:not(.always-shown) { display: grid; }
}
@media (min-width: 1081px) { .av-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none; } }
.av-header__inner > .av-nav { flex: 1 1 auto; min-width: 0; }
.av-header__inner > :last-child { flex-shrink: 0; }
.av-account .wp-block-button__link { white-space: nowrap; }
@media (max-width: 1080px) { .av-header__inner > .av-nav { flex: 0 0 auto; order: 3; } .av-header__inner { gap: .5rem; } }
@media (max-width: 480px) {
	.av-account .wp-block-button__link { padding: .5rem .75rem; font-size: .85rem; }
	.av-logo { gap: 8px; }
	.av-logo__mark { width: 34px; height: 34px; border-radius: 9px; }
	.av-logo__mark svg { width: 18px; height: 18px; }
	.av-logo__name { font-size: 16px; }
	.av-header__inner { gap: .4rem; }
}

.av-search .wp-block-search__inside-wrapper { background: #F0F6FB; border: 1px solid #DCE6EF !important; border-radius: 10px; padding: 2px 4px; }
.av-search .wp-block-search__input { border: 0; background: transparent; font-size: .9rem; min-width: 210px; color: #16324F; }
.av-search .wp-block-search__button { background: transparent; color: #5A6F84; padding: 6px; margin: 0; }
.av-search .wp-block-search__button:hover { color: #0875D1; background: transparent; }
@media (max-width: 1080px) { .av-search { display: none; } }
.av-search .wp-block-search__input { min-width: 0; width: 170px; }
@media (min-width: 1081px) { .av-nav .wp-block-navigation__container { flex-wrap: nowrap; gap: 0; } }
@media (min-width: 1081px) and (max-width: 1240px) { .av-search { display: none; } .av-nav .wp-block-navigation-item__content { padding: .6rem .55rem; } }
.av-account .wp-block-button__link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }

/* ---------- Encabezados de sección ---------- */
.av-sec-head { border-bottom: 2px solid #E2EBF3; padding-bottom: .75rem; margin-bottom: 1.25rem !important; }
.av-sec-title { position: relative; padding-left: 14px; margin: 0; }
.av-sec-title::before { content: ""; position: absolute; left: 0; top: .3em; bottom: .3em; width: 4px; border-radius: 2px; background: #00A6FF; }
.av-sec-more { font-weight: 600; font-size: .9rem; margin: 0; white-space: nowrap; }

/* ---------- Etiquetas (chips) ---------- */
.av-chip, .av-chip a { font: 600 11px/1 Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.av-chip a { display: inline-flex; color: #0875D1; background: #E6F2FC; padding: 5px 9px; border-radius: 999px; text-decoration: none !important; }
.av-chip a:hover { background: #D3E8FA; }
.av-chip .wp-block-post-terms__separator, .av-chip a ~ a { display: none; }
.av-chip--orange { display: inline-block; background: #FF8A34; color: #16324F; padding: 5px 9px; border-radius: 999px; font: 600 11px/1 Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Tarjetas ---------- */
.av-card { background: #fff; border: 1px solid #E2EBF3; border-radius: var(--av-radius); overflow: hidden; height: 100%; gap: 0 !important; transition: transform .2s ease, box-shadow .2s ease; }
.av-card:hover { transform: translateY(-3px); box-shadow: var(--av-shadow); }
@media (prefers-reduced-motion: reduce) { .av-card, .av-card:hover { transition: none; transform: none; } }
.av-card .wp-block-post-featured-image { margin: 0; width: 100%; }
.av-card .wp-block-post-featured-image img { width: 100%; object-fit: cover; }
.av-card__body { padding: 1rem; gap: .6rem !important; flex: 1; width: 100%; box-sizing: border-box; }
.av-card__title { font-size: 1.15rem !important; line-height: 1.22; margin: 0; }
.av-card__title a { color: #16324F; }
.av-card__title a:hover { color: #0875D1; text-decoration: none; }
.av-card__excerpt { color: #3E5670; font-size: .9rem; margin: 0; }
.av-card__excerpt p { margin: 0; }
.av-card .wp-block-post-date { margin-top: auto; }

/* Hueco de foto cuando el artículo aún no tiene imagen destacada */
.av-ph { background: #DCEBF7; display: grid; place-items: center; aspect-ratio: 16 / 10; width: 100%; margin: 0; }
.av-ph svg { opacity: .5; width: 34%; max-width: 90px; height: auto; transform: rotate(45deg); }

/* Rejillas automáticas */
.av-grid .wp-block-post-template { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; }
.av-grid--3 .wp-block-post-template { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.av-list .wp-block-post-template { display: grid; gap: .85rem; }
.av-list .av-card { flex-direction: row !important; }
.av-list .av-card .wp-block-post-featured-image, .av-list .av-card .av-ph { width: 112px; flex-shrink: 0; aspect-ratio: auto; min-height: 92px; }
.av-list .av-card .wp-block-post-featured-image img { height: 100% !important; aspect-ratio: auto !important; }
.av-list .av-card__body { padding: .75rem .9rem; gap: .35rem !important; }
.av-list .av-card__title { font-size: 1rem !important; }

/* ---------- Portada magazine ---------- */
.av-hero .wp-block-post-template { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: repeat(3, minmax(150px, 1fr)); gap: 1.25rem; }
.av-hero .wp-block-post-template > li:first-child { grid-row: 1 / 4; }
.av-hero .wp-block-post-template > li:first-child .av-card { position: relative; min-height: 520px; border: 0; }
.av-hero .wp-block-post-template > li:first-child .wp-block-post-featured-image,
.av-hero .wp-block-post-template > li:first-child .av-ph { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.av-hero .wp-block-post-template > li:first-child .wp-block-post-featured-image img { height: 100% !important; aspect-ratio: auto !important; }
.av-hero .wp-block-post-template > li:first-child .av-card__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem; background: linear-gradient(180deg, rgba(10, 30, 50, 0) 0%, rgba(10, 30, 50, .85) 55%); }
.av-hero .wp-block-post-template > li:first-child .av-card__title { font-size: clamp(1.75rem, 3.2vw, 2.75rem) !important; font-weight: 800; line-height: 1.05; }
.av-hero .wp-block-post-template > li:first-child .av-card__title a,
.av-hero .wp-block-post-template > li:first-child .av-card__excerpt,
.av-hero .wp-block-post-template > li:first-child .wp-block-post-date { color: #fff; }
.av-hero .wp-block-post-template > li:not(:first-child) .av-card { flex-direction: row !important; }
.av-hero .wp-block-post-template > li:not(:first-child) .wp-block-post-featured-image,
.av-hero .wp-block-post-template > li:not(:first-child) .av-ph { width: 42%; flex-shrink: 0; aspect-ratio: auto; }
.av-hero .wp-block-post-template > li:not(:first-child) .wp-block-post-featured-image img { height: 100% !important; aspect-ratio: auto !important; }
.av-hero .wp-block-post-template > li:not(:first-child) .av-card__excerpt { display: none; }
@media (max-width: 900px) {
	.av-hero .wp-block-post-template { grid-template-columns: 1fr; grid-template-rows: none; }
	.av-hero .wp-block-post-template > li:first-child { grid-row: auto; }
	.av-hero .wp-block-post-template > li:first-child .av-card { min-height: 420px; }
}

/* Bienvenida mientras no hay artículos */
.av-welcome { background: #0875D1; border-radius: 20px; color: #fff; overflow: hidden; position: relative; }
.av-welcome h1, .av-welcome h2, .av-welcome p { color: #fff; }
.av-welcome__art { position: absolute; right: -40px; top: 50%; transform: translateY(-50%) rotate(45deg); opacity: .14; width: 420px; height: 420px; pointer-events: none; }
@media (max-width: 760px) { .av-welcome__art { display: none; } }

/* ---------- Bloques de portada ---------- */
.av-quick a { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #E2EBF3; border-radius: var(--av-radius); padding: 16px 18px; text-decoration: none !important; height: 100%; box-sizing: border-box; transition: transform .2s ease, box-shadow .2s ease; }
.av-quick a:hover { transform: translateY(-3px); box-shadow: var(--av-shadow); }
.av-quick__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.av-quick strong { display: block; font: 700 17px/1.2 Barlow, sans-serif; color: #16324F; }
.av-quick small { color: #5A6F84; font-size: 13px; }
.av-quick-grid, .av-tools-grid, .av-sims-grid, .av-dl-types { display: grid; gap: 14px; }
.av-quick-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.av-band { background: #fff; border-top: 1px solid #E2EBF3; border-bottom: 1px solid #E2EBF3; }
.av-sims-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.av-sim { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid #E2EBF3; border-top: 4px solid var(--c, #0875D1); border-radius: var(--av-radius); padding: 18px; text-decoration: none !important; transition: transform .2s ease, box-shadow .2s ease; }
.av-sim:hover { transform: translateY(-3px); box-shadow: var(--av-shadow); }
.av-sim b { font: 800 22px/1 Barlow, sans-serif; color: #16324F; letter-spacing: .02em; }
.av-sim strong { font-size: 14px; color: #16324F; }
.av-sim small { font-size: 12.5px; color: #5A6F84; }
@media (max-width: 480px) { .av-sims-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.av-rows .wp-block-post-template { display: grid; gap: .75rem; }
.av-row { background: #F9FBFD; border: 1px solid #E2EBF3; border-radius: 12px; padding: .85rem 1rem; gap: .3rem !important; }
.av-row .wp-block-post-title { font-family: Inter, sans-serif; font-size: .95rem !important; font-weight: 600; line-height: 1.35; margin: 0; letter-spacing: 0; }
.av-row .wp-block-post-title a { color: #16324F; }

.av-dl-types { display: flex; flex-wrap: wrap; gap: 8px; }
.av-dl-types span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid #DCE6EF; font-size: 13.5px; }
.av-soon { background: #fff; border: 1px dashed #A9C6E0; border-radius: var(--av-radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.av-soon h3 { margin: 0; font-size: 1.15rem; }
.av-soon p { margin: 0; color: #5A6F84; font-size: .875rem; line-height: 1.55; }
.av-soon__icon { width: 44px; height: 44px; border-radius: 12px; background: #E6F7FF; display: grid; place-items: center; }
.av-soon__state { font-weight: 600; font-size: .8rem; color: #3E5670; margin-top: auto !important; }
.av-tools-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.av-academy { background: #E6F2FC; border-radius: 20px; }
.av-schools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.av-schools a { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #D3E6F7; border-radius: 12px; padding: 12px 14px; min-height: 60px; text-decoration: none !important; color: #16324F; font-weight: 600; font-size: 14.5px; }
.av-schools a:hover { border-color: #0875D1; }
.av-schools b { width: 36px; height: 36px; border-radius: 9px; background: #0875D1; color: #fff; display: grid; place-items: center; font: 800 12.5px Barlow, sans-serif; flex-shrink: 0; }
@media (max-width: 480px) { .av-schools { grid-template-columns: 1fr; } }
.av-levels { display: flex; gap: 8px; flex-wrap: wrap; }
.av-levels span, .av-levels a { font: 600 12px Inter, sans-serif; padding: 6px 12px; border-radius: 999px; color: #16324F; text-decoration: none !important; }
.av-levels a:hover { box-shadow: 0 0 0 2px #0875D1; }

/* ---------- Fase B: subsecciones y espacios de simulador ---------- */
.av-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.25rem; }
.av-subnav a { font: 600 13px/1 Inter, sans-serif; padding: 9px 14px; border-radius: 999px; background: #F0F6FB; border: 1px solid #DCE6EF; color: #16324F; text-decoration: none !important; }
.av-subnav a:hover, .av-subnav a[aria-current] { background: #0875D1; border-color: #0875D1; color: #fff; }
.av-sim-head { display: flex; align-items: center; gap: 18px; }
.av-sim-head__badge { width: 64px; height: 64px; border-radius: 16px; background: var(--c, #0875D1); color: #fff; display: grid; place-items: center; font: 800 18px Barlow, sans-serif; flex-shrink: 0; }
.av-sim-head .av-chip--orange { margin-bottom: .4rem; }
.av-sim-head h1 { margin: 0; }
.av-sim-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

.av-cta { background: #0875D1; border-radius: 20px; color: #fff; }
.av-cta h2, .av-cta p { color: #fff; }
.is-style-naranja .wp-block-button__link { background: #FF8A34; color: #16324F; }
.is-style-naranja .wp-block-button__link:hover { background: #F07A22; color: #16324F; }
:where(.av-cta, .av-welcome) .is-style-outline .wp-block-button__link { color: #fff; border: 1px solid rgba(255, 255, 255, .75); background: transparent; }
:where(.av-cta, .av-welcome) .is-style-outline .wp-block-button__link:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Artículo ---------- */
.av-single .wp-block-post-featured-image img { border-radius: var(--av-radius); }
.av-single .wp-block-post-content { font-size: 1.0625rem; line-height: 1.75; }
.av-single .wp-block-post-content :where(h2, h3) { margin-top: 2rem; }
.av-single .wp-block-post-content :where(figure img) { border-radius: 10px; }
.av-tags a { display: inline-block; background: #fff; border: 1px solid #DCE6EF; border-radius: 999px; padding: 4px 12px; font-size: 13px; margin: 0 6px 6px 0; }
.av-tags .wp-block-post-terms__separator { display: none; }
.av-related__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.av-related .av-card { display: flex; flex-direction: column; text-decoration: none; }
.av-related .av-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.av-related .av-card__title { color: #16324F; }

/* ---------- Páginas de archivo ---------- */
.av-archive-head { background: #fff; border-bottom: 1px solid #E2EBF3; }
.av-archive-head .wp-block-term-description { color: #3E5670; max-width: 760px; }
.wp-block-query-pagination { gap: .5rem; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; border: 1px solid #DCE6EF; border-radius: 8px; background: #fff; padding: 0 10px; }
.wp-block-query-pagination .page-numbers.current { background: #0875D1; color: #fff; border-color: #0875D1; }
.av-empty { background: #fff; border: 1px dashed #A9C6E0; border-radius: var(--av-radius); padding: 1.5rem; color: #3E5670; }

/* ---------- Pie ---------- */
.av-footer { background: #16324F; color: #C8D8E8; }
.av-footer a { color: #C8D8E8; }
.av-footer a:hover { color: #fff; }
.av-footer h2, .av-footer h3, .av-footer h4 { color: #fff; }
.av-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.av-footer__bottom { border-top: 1px solid #2C4A68; font-size: 13px; }

/* ---------- Pantallas de plugins (get_header/get_footer): Área restringida ---------- */
.av-legacy main.wrap { max-width: 780px; margin: 0 auto; padding: 2.5rem 1rem 4rem; box-sizing: border-box; }
.av-legacy .page-head { margin-bottom: 1.5rem; }
.av-legacy .page-head h1 { margin: .5rem 0; }
.av-legacy .eyebrow { display: inline-block; background: #FF8A34; color: #16324F; padding: 5px 10px; border-radius: 999px; font: 600 11px/1 Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.av-legacy .reading { background: #fff; border: 1px solid #E2EBF3; border-radius: 14px; padding: 1.5rem; }
.av-legacy .reading h2 { margin-top: 0; }
.av-legacy .reading input[type=text], .av-legacy .reading input[type=password], .av-legacy .reading input[type=email], .av-legacy .reading input[type=number] { width: 100%; box-sizing: border-box; padding: .7rem .8rem; border: 1px solid #CFDDEA; border-radius: 10px; font: inherit; }
.av-legacy .reading .button, .av-legacy .reading input[type=submit] { display: inline-block; background: #0875D1; color: #fff; border: 0; border-radius: 10px; padding: .7rem 1.2rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.av-legacy .reading .button:hover, .av-legacy .reading input[type=submit]:hover { background: #065BA3; }
