/*
Theme Name: Historia de España Child
Template: astra
Version: 1.0
Description: Child theme para Historia de España
Text Domain: atlas-child
*/

/* ── Full width para categorías con templates personalizados ──
   Astra fuerza max-width:950px en .archive .site-content > .ast-container
   Este override lo cancela con mayor especificidad + !important           */
body.ast-page-builder-template.archive .site-content > .ast-container,
body.ast-page-builder-template.archive #content > .ast-container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
}

/* ============================================
   PÁGINA UICN — Estados de conservación
============================================ */
.uicn-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.uicn-card {
    display: flex; align-items: flex-start; gap: 20px;
    background: #fff; border: 1px solid #e8e8e8;
    border-left: 5px solid #888;
    border-radius: 0 12px 12px 0;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.uicn-card[id="EX"] { border-left-color: #111; }
.uicn-card[id="EW"] { border-left-color: #333; }
.uicn-card[id="CR"] { border-left-color: #c0392b; }
.uicn-card[id="EN"] { border-left-color: #e67e22; }
.uicn-card[id="VU"] { border-left-color: #c09000; }
.uicn-card[id="NT"] { border-left-color: #2980b9; }
.uicn-card[id="LC"] { border-left-color: #27ae60; }
.uicn-card[id="DD"] { border-left-color: #7f8c8d; }
.uicn-card[id="NE"] { border-left-color: #aaaaaa; }

.uicn-badge-big {
    flex-shrink: 0; color: #fff;
    font-size: 1.1rem; font-weight: 900; letter-spacing: .04em;
    padding: 6px 12px; border-radius: 6px;
    min-width: 52px; text-align: center; margin-top: 2px;
    background: #888;
}
.uicn-card[id="EX"] .uicn-badge-big { background: #111; }
.uicn-card[id="EW"] .uicn-badge-big { background: #333; }
.uicn-card[id="CR"] .uicn-badge-big { background: #c0392b; }
.uicn-card[id="EN"] .uicn-badge-big { background: #e67e22; }
.uicn-card[id="VU"] .uicn-badge-big { background: #c09000; }
.uicn-card[id="NT"] .uicn-badge-big { background: #2980b9; }
.uicn-card[id="LC"] .uicn-badge-big { background: #27ae60; }
.uicn-card[id="DD"] .uicn-badge-big { background: #7f8c8d; }
.uicn-card[id="NE"] .uicn-badge-big { background: #aaaaaa; }

.uicn-card-body h3 { font-size: 1rem !important; font-weight: 800 !important; color: #1b4332 !important; margin: 0 0 6px !important; border: none !important; padding: 0 !important; }
.uicn-card-body h3 span { font-weight: 400; font-style: italic; color: #666; font-size: .88rem; }
.uicn-card-body p { margin: 0; font-size: .92rem; }
.uicn-cta { background: #e8f5e9; border-left: 4px solid #2d9e6b; border-radius: 0 10px 10px 0; padding: 16px 20px; margin-top: 32px; }
.uicn-cta p { margin: 0; font-size: .95rem; }
.uicn-cta a { color: #1b5e3b; font-weight: 600; }
@media(max-width:500px) {
    .uicn-card { flex-direction: column; gap: 10px; }
    .uicn-badge-big { align-self: flex-start; }
}

/* Imagen infográfico UICN */
.uicn-infographic { margin: 0 0 36px; }
.uicn-infographic img { max-width: 100%; border-radius: 8px; border: 1px solid #e0e0e0; }

/* ============================================
   PÁGINAS DE CONTENIDO (page-atlas-content.php)
============================================ */
.atlas-content-page-wrap {
    max-width: 920px;
    margin: 0 auto;
    padding: 48px clamp(16px, 4vw, 56px) 80px;
}
.atlas-content-page-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem) !important;
    font-weight: 900 !important;
    color: #1b4332 !important;
    margin: 0 0 8px !important;
    line-height: 1.2 !important;
    border-bottom: 3px solid #2d9e6b;
    padding-bottom: 16px;
    margin-bottom: 36px !important;
}
.atlas-content-page-wrap h2 {
    font-size: 1.25rem !important; font-weight: 800 !important;
    color: #1b4332 !important; border-bottom: 2px solid #dff0e8;
    padding-bottom: 7px; margin: 36px 0 14px !important;
}
.atlas-content-page-wrap h3 {
    font-size: 1.05rem !important; font-weight: 700 !important;
    color: #2d5a3d !important; margin: 22px 0 9px !important;
}
.atlas-content-page-wrap p,
.atlas-content-page-wrap li { color: #333; line-height: 1.85; font-size: .97rem; }
.atlas-content-page-wrap ul, .atlas-content-page-wrap ol { padding-left: 22px; margin: 0 0 16px; }
.atlas-content-page-wrap li { margin-bottom: 6px; }
.atlas-content-page-wrap a { color: #2d9e6b; }
.atlas-content-page-wrap strong { color: #1b4332; }
.atlas-content-page-wrap table { width: 100%; border-collapse: collapse; margin: 14px 0 20px; font-size: .88rem; }
.atlas-content-page-wrap table th { background: #e8f5e9; color: #1b4332; padding: 8px 12px; text-align: left; }
.atlas-content-page-wrap table td { padding: 7px 12px; border-bottom: 1px solid #eee; vertical-align: top; }
.atlas-content-page-wrap table tr:last-child td { border-bottom: none; }

/* ============================================
   PÁGINAS DE LISTA UICN (page-uicn-list.php)
============================================ */
.uicn-list-page { min-height: 60vh; }

/* Hero */
.uicn-list-hero {
    /* background set inline in template */
    padding: 40px clamp(16px,5vw,80px) 28px;
    color: #fff;
}
.uicn-list-hero-inner {
    display: flex; align-items: flex-start; gap: 24px;
    max-width: 920px; margin: 0 auto 12px;
}
.uicn-list-badge {
    flex-shrink: 0; background: rgba(255,255,255,.2);
    border: 2px solid rgba(255,255,255,.6);
    font-size: 1.6rem; font-weight: 900; letter-spacing: .05em;
    padding: 8px 16px; border-radius: 8px; margin-top: 4px;
    min-width: 64px; text-align: center;
}
.uicn-list-title {
    font-size: clamp(1.4rem,3vw,2rem) !important;
    font-weight: 900 !important; color: #fff !important;
    margin: 0 0 6px !important; line-height: 1.2 !important;
}
.uicn-list-subtitle {
    font-size: .97rem; color: rgba(255,255,255,.88);
    margin: 0; line-height: 1.6;
}
.uicn-list-breadcrumb {
    max-width: 920px; margin: 0 auto;
    font-size: .82rem; color: rgba(255,255,255,.7);
}
.uicn-list-breadcrumb a { color: rgba(255,255,255,.85); text-decoration: underline; }

/* Contenido */
.uicn-list-wrap {
    max-width: 960px; margin: 0 auto;
    padding: 40px clamp(16px,4vw,56px) 80px;
}
.uicn-list-count {
    font-size: .97rem; color: #555;
    border-left: 4px solid #ddd; padding-left: 14px;
    margin-bottom: 28px;
}

/* Grid de animales */
.uicn-animals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin: 0 0 40px;
}
.uicn-animal-card {
    display: flex; flex-direction: column;
    border: 1px solid #e8e8e8; border-radius: 10px;
    overflow: hidden; text-decoration: none !important;
    transition: box-shadow .2s, transform .2s;
    background: #fff;
}
.uicn-animal-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transform: translateY(-3px);
}
.uicn-animal-img {
    height: 130px;
    background-size: cover; background-position: center;
    background-color: #f0f4f0;
}
.uicn-animal-img--empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
}
.uicn-animal-info {
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 3px;
}
.uicn-animal-info strong {
    font-size: .9rem; font-weight: 700; color: #1b4332; line-height: 1.3;
}
.uicn-animal-info em {
    font-size: .78rem; color: #777; font-style: italic;
}
.uicn-animal-cat {
    font-size: .72rem; color: #2d9e6b; font-weight: 600;
    text-transform: uppercase; letter-spacing: .03em;
    margin-top: 2px;
}

/* Sin animales */
.uicn-list-empty {
    background: #f8f8f8; border-radius: 10px;
    padding: 28px 24px; margin: 0 0 32px;
    color: #555; font-size: .95rem; line-height: 1.7;
}
.uicn-list-empty a { color: #2d9e6b; }

/* Texto SEO adicional */
.uicn-list-seo { margin: 24px 0 32px; }
.uicn-list-seo p { color: #444; line-height: 1.8; font-size: .95rem; margin-bottom: 14px; }

/* Enlace volver */
.uicn-list-back { font-size: .9rem; margin-top: 16px; }
.uicn-list-back a { color: #2d9e6b; font-weight: 600; }

@media(max-width:600px) {
    .uicn-list-hero-inner { flex-direction: column; gap: 14px; }
    .uicn-animals-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Badge UICN en cards de la página principal — hacerlos links */
.uicn-card-link { text-decoration: none !important; color: inherit !important; }
.uicn-card-link:hover .uicn-card { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.uicn-card { transition: box-shadow .2s, transform .2s; }

/* Fix: uicn-list-page como flex-item ocupa ancho completo */
.uicn-list-page { width: 100%; min-width: 0; }
/* Fix: atlas-content-page-wrap también ocupa ancho completo para centrar bien */
.atlas-content-page-wrap { width: 100%; min-width: 0; box-sizing: border-box; }

/* Link "Ver todos los animales en ___" en tarjetas UICN */
.uicn-ver-todos {
    display: inline-block;
    margin-top: 10px;
    font-size: .82rem;
    font-weight: 700;
    color: #1b4332;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
    opacity: .8;
    transition: opacity .15s;
}
.uicn-ver-todos:hover { opacity: 1; }

/* ---- Banner En Peligro en página UICN ---- */
.uicn-peligro-banner {
    margin-top: 40px;
    background: linear-gradient(135deg, #7b1010 0%, #c0392b 100%);
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 4px 16px rgba(192,57,43,.25);
}
.uicn-peligro-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; flex-wrap: wrap;
}
.uicn-peligro-text {
    display: flex; flex-direction: column; gap: 6px;
}
.uicn-peligro-text strong {
    font-size: 1.05rem; font-weight: 800; color: #fff !important;
}
.uicn-peligro-text span {
    font-size: .88rem; color: rgba(255,255,255,.82); line-height: 1.55;
    max-width: 540px;
}
.uicn-peligro-btn {
    flex-shrink: 0;
    display: inline-block;
    background: #fff;
    color: #c0392b !important;
    font-weight: 800; font-size: .88rem;
    padding: 11px 22px; border-radius: 6px;
    text-decoration: none !important;
    transition: background .18s, transform .18s;
    white-space: nowrap;
}
.uicn-peligro-btn:hover { background: #ffe5e5; transform: translateY(-1px); }
@media(max-width:600px) {
    .uicn-peligro-inner { flex-direction: column; align-items: flex-start; }
}

/* Grid de subcategorías en categoría padre */
.pillar-subcats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 40px;
}
.pillar-subcat-card a {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 6px;
    background: #fff; border: 1px solid #d8eee3;
    border-radius: 10px; padding: 20px 14px;
    text-decoration: none !important;
    transition: box-shadow .2s, transform .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.pillar-subcat-card a:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12); transform: translateY(-2px);
}
.subcat-name { font-weight: 700; color: #1b4332; font-size: .95rem; text-align: center; }
.subcat-count { font-size: .78rem; color: #2d9e6b; font-weight: 600; }

/* ============================================
   GRID DE SUBCATEGORÍAS en shortcode atlas_animales
============================================ */
.atlas-subcats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
    margin: 24px 0;
}
@media (max-width: 600px) { .atlas-subcats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 380px) { .atlas-subcats-grid { grid-template-columns: 1fr; } }

.atlas-subcat-card {
    display: flex; flex-direction: column;
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,.09);
    text-decoration: none !important; color: inherit;
    transition: transform .2s, box-shadow .2s;
}
.atlas-subcat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0,0,0,.15);
}
.atlas-subcat-img {
    width: 100%; height: 140px;
    background-size: cover; background-position: center;
    background-color: #e8f5e9;
}
.atlas-subcat-img--empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
}
.atlas-subcat-body {
    padding: 16px 18px 18px;
    display: flex; flex-direction: column; gap: 4px;
}
.atlas-subcat-name {
    font-size: 1.05rem; font-weight: 800;
    color: #1b4332; line-height: 1.3;
}
.atlas-subcat-count {
    font-size: .78rem; font-weight: 600;
    color: #2d9e6b; text-transform: uppercase; letter-spacing: .04em;
}
.atlas-subcat-desc {
    font-size: .83rem; color: #666;
    line-height: 1.55; margin: 4px 0 0;
}

/* ============================================
   BREADCRUMB en categorías y subcategorías
============================================ */





/* ============================================
   PÁGINAS PILAR Y SUBCATEGORÍAS — layout base
   (movido desde category.php inline styles)
============================================ */

.pillar-content {
    padding: 48px 32px 64px;
    max-width: 1200px;
}
.pillar-grid-heading {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1b4332;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dff0e8;
}
@media (max-width: 768px) { .pillar-content { padding: 32px 16px 48px; } }

.pillar-intro {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #333;
    background: #f4fbf7;
    border-radius: 10px;
    padding: 24px 32px;
    margin-bottom: 48px;
}
.pillar-intro strong { color: #1b4332; }
@media (max-width: 640px) { .pillar-intro { padding: 16px 18px; } }

.pillar-seo-footer {
    margin-top: 56px;
    padding: 40px 0 0;
    border-top: 2px solid #e8f5e9;
    font-size: 1rem;
    line-height: 1.85;
    color: #333;
}
.pillar-seo-footer h2 { color: #1b4332; font-size: 1.4rem; margin: 32px 0 10px; }
.pillar-seo-footer h3 { color: #2d6a4f; font-size: 1.1rem; margin: 24px 0 8px; }

/* Grid de animales */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
@media (max-width: 900px) { .pillar-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (max-width: 480px) { .pillar-grid { grid-template-columns: 1fr; } }

/* Cards de animal */
.animal-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,.09);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.animal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0,0,0,.16);
    color: inherit;
    text-decoration: none;
}
.animal-card-img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
    background: #e8f5e9;
}
.animal-card-img-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
}
.animal-card-body { padding: 18px 20px 22px; flex: 1; }
.animal-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1b4332;
    margin: 0 0 8px;
    line-height: 1.3;
}
.animal-card-excerpt {
    font-size: .88rem;
    color: #555;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Shortcode atlas-grid-N */
.atlas-grid-1,.atlas-grid-2,.atlas-grid-3,.atlas-grid-4 {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}
.atlas-grid-1 { grid-template-columns: 1fr; }
.atlas-grid-2 { grid-template-columns: repeat(2,1fr); }
.atlas-grid-3 { grid-template-columns: repeat(3,1fr); }
.atlas-grid-4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px) {
    .atlas-grid-2,.atlas-grid-3,.atlas-grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
    .atlas-grid-1,.atlas-grid-2,.atlas-grid-3,.atlas-grid-4 { grid-template-columns: 1fr; }
}
.atlas-card {
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,.09);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.atlas-card:hover {
    transform: translateY(-5px); box-shadow: 0 10px 28px rgba(0,0,0,.16);
    color: inherit; text-decoration: none;
}
.atlas-card img { width:100%; aspect-ratio:16/10; object-fit:cover; display:block; }
.atlas-card-placeholder {
    width:100%; aspect-ratio:16/10;
    background: linear-gradient(135deg,#e8f5e9,#c8e6c9);
    display:flex; align-items:center; justify-content:center; font-size:3rem;
}
.atlas-card-body { padding:16px 18px 20px; flex:1; }
.atlas-card-title { font-size:1.05rem; font-weight:700; color:#1b4332; margin:0 0 6px; line-height:1.3; }
.atlas-card-excerpt {
    font-size:.85rem; color:#555; line-height:1.6;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

/* ============================================
   ATLAS — SINGLE POST — Layout 2 columnas
============================================ */
/* ============================================
   ATLAS — SINGLE POST — Layout 2 columnas
============================================ */

/* Cabecera limpia del post (sin imagen de fondo) */
.atlas-post-header {
    width: 100%;
    background: linear-gradient(135deg, #1b4332 0%, #2d9e6b 100%);
    padding: 40px 0 36px;
}
.atlas-post-header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 48px);
}
.atlas-breadcrumb {
    font-size: .82rem;
    color: rgba(255,255,255,.7);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    margin-bottom: 10px;
}
.atlas-breadcrumb a {
    color: rgba(255,255,255,.85);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.atlas-breadcrumb a:hover { color: #fff; }
.atlas-bc-sep { color: rgba(255,255,255,.45); }
.atlas-bc-current { color: rgba(255,255,255,.65); font-weight: 600; }

/* Pillar headers: centrar el breadcrumb */
.pillar-header .atlas-breadcrumb {
    justify-content: center;
}
.atlas-post-title {
    font-size: clamp(1.7rem, 4vw, 2.9rem) !important;
    font-weight: 900 !important;
    color: #fff !important;
    margin: 0 0 8px !important;
    line-height: 1.14 !important;
    border: none !important;
    text-shadow: none !important;
}
.atlas-post-sci {
    font-style: italic;
    color: rgba(255,255,255,.65);
    font-size: 1rem;
}
.ast-page-builder-template #content,
.ast-page-builder-template .site-content > .ast-container { padding-top: 0 !important; }

/* Imagen debajo de la intro */
.atlas-post-image {
    margin: 24px 0 32px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    line-height: 0;
    background: #f5f5f5;
}
.atlas-post-image img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    border-radius: 12px 12px 0 0;
}
.atlas-post-image-caption {
    display: block;
    line-height: 1.5;
    font-size: .78rem;
    color: #777;
    text-align: center;
    padding: 8px 14px 10px;
    background: #f5f5f5;
    border-top: 1px solid #e8e8e8;
    font-style: italic;
}

/* ---- Hero imagen solo móvil ---- */
.atlas-mobile-hero {
    display: none;
    margin: 0;
}
.atlas-mobile-hero img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    display: block;
}

/* ---- Wrapper 3 áreas: intro | sidebar / body | sidebar ---- */
.atlas-page-wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 40px clamp(14px, 3vw, 40px) 72px;
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "intro sidebar"
        "body  sidebar";
    gap: 0 40px;
    align-items: start;
}
.atlas-intro-wrap {
    grid-area: intro;
    min-width: 0;
    padding-bottom: 8px;
}
.atlas-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: 100px;
    align-self: start;
}
.atlas-main {
    grid-area: body;
    min-width: 0;
}

/* ---- Móvil: foto → intro → ficha → body ---- */
@media (max-width: 900px) {
    /* atlas-mobile-hero eliminado — imagen va dentro del contenido */
    .atlas-page-wrap {
        display: flex;
        flex-direction: column;
        padding: 20px clamp(14px, 4vw, 24px) 48px;
        gap: 0;
    }
    .atlas-intro-wrap { order: 1; }
    .atlas-sidebar    { order: 2; position: static; margin: 20px 0; }
    .atlas-main       { order: 3; }
    /* Imagen inline visible también en móvil */
}

/* ---- Ficha técnica ---- */
.atlas-ficha {
    background: #fff;
    border-left: 4px solid #2d9e6b;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 3px 18px rgba(0,0,0,.10);
    overflow: hidden;
    font-size: .84rem;
    width: 100%;
}
.atlas-ficha-title {
    background: #2d9e6b;
    color: #fff;
    font-weight: 700;
    font-size: .88rem;
    padding: 11px 16px;
    margin: 0;
}
.atlas-ficha table { width: 100%; border-collapse: collapse; }
.atlas-ficha td {
    padding: 9px 13px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    line-height: 1.45;
    font-size: .84rem;
}
.atlas-ficha td:first-child { font-weight: 600; color: #1b4332; white-space: nowrap; width: 44%; }
.atlas-ficha td:last-child { color: #333; }
.atlas-ficha tr:last-child td { border-bottom: none; }
.uicn-badge {
    display: inline-block; color: #fff;
    font-size: .76rem; font-weight: 700;
    padding: 2px 9px; border-radius: 4px;
}

/* Google Ads slot (oculto hasta activar) */
.atlas-ads-slot { margin-top: 20px; }

/* ---- Contenido ---- */
.atlas-content h1 { display: none !important; }
.atlas-content h2 {
    font-size: 1.28rem !important; font-weight: 800 !important;
    color: #1b4332 !important;
    border-bottom: 2px solid #dff0e8;
    padding-bottom: 7px; margin: 38px 0 14px !important;
}
.atlas-content h3 {
    font-size: 1.06rem !important; font-weight: 700 !important;
    color: #2d5a3d !important; margin: 24px 0 9px !important;
}
.atlas-content p { color: #2e2e2e; line-height: 1.88; margin: 0 0 14px; font-size: 1rem; }
.atlas-content ul,
.atlas-content ol { color: #2e2e2e; line-height: 1.85; padding-left: 22px; margin: 0 0 16px; }
.atlas-content li { margin-bottom: 5px; }
.atlas-content a  { color: #2d9e6b; }
.atlas-content strong { color: #1b4332; }
.atlas-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .9rem; }
.atlas-content table th { background: #e8f5e9; color: #1b4332; padding: 8px 12px; text-align: left; }
.atlas-content table td { padding: 7px 12px; border-bottom: 1px solid #eee; }

/* ---- Curiosidades ---- */
.atlas-curios {
    margin-top: 48px;
    background: #fdf6ee;
    border: 1px solid #e4cfa0;
    border-left: 5px solid #c8893b;
    border-radius: 0 14px 14px 0;
    padding: 28px 28px 24px;
}
.atlas-curios-heading {
    font-size: 1.18rem; font-weight: 800; color: #7a4515;
    margin: 0 0 18px; display: flex; align-items: center; gap: 10px;
}
.atlas-curios-list { margin: 0; padding: 0; list-style: none; color: #3d2a10; line-height: 1.85; font-size: .97rem; }
.atlas-curios-list li { margin-bottom: 12px; display: flex; gap: 10px; align-items: flex-start; }
.atlas-curios-list li:last-child { margin-bottom: 0; }
.curio-icon { flex-shrink: 0; font-size: 1.05rem; margin-top: 3px; }

/* ---- Animales relacionados ---- */
.atlas-relacionados { margin-top: 48px; border-top: 2px solid #e0f0e8; padding-top: 28px; }
.atlas-relacionados-title { font-size: 1.1rem; font-weight: 800; color: #1b4332; margin: 0 0 18px; }
.atlas-rel-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
@media (max-width: 600px) { .atlas-rel-grid { grid-template-columns: repeat(2,1fr); } }
.atlas-rel-card {
    display: block; text-decoration: none;
    border-radius: 10px; overflow: hidden;
    background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.08);
    transition: transform .18s, box-shadow .18s;
}
.atlas-rel-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.13); }
.atlas-rel-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.atlas-rel-card-noimg {
    width: 100%; height: 100px;
    background: linear-gradient(135deg,#2d9e6b,#1b4332);
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}
.atlas-rel-card-name { font-size: .8rem; font-weight: 700; color: #1b4332; padding: 7px 9px 9px; line-height: 1.3; }

/* ---- Curiosidades grid (page-pillar.php) ---- */
.curio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
    max-width: 720px;
}
@media (max-width: 600px) {
    .curio-grid { grid-template-columns: 1fr; }
}
.curio-card {
    border-radius: 14px;
    padding: 20px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.curio-card-emoji {
    font-size: 1.8rem;
    line-height: 1;
}
.curio-card-text {
    font-size: .92rem;
    color: #fff;
    line-height: 1.65;
    text-shadow: 0 1px 2px rgba(0,0,0,.2);
}

/* ---- Récords del grupo (page-pillar.php) ---- */
.records-box {
    background: #f0faf5;
    border: 1px solid #b7dfc9;
    border-left: 5px solid #2d9e6b;
    border-radius: 0 12px 12px 0;
    padding: 24px 28px;
    margin-top: 36px;
    max-width: 520px;
}
.records-box h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1b4332;
    margin: 0 0 16px;
}
.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.records-table tr:not(:last-child) td {
    border-bottom: 1px solid #d4eddd;
}
.records-table td {
    padding: 8px 10px;
    vertical-align: top;
    color: #2e2e2e;
    line-height: 1.5;
}
.records-table td:first-child {
    font-weight: 700;
    color: #1b4332;
    width: 45%;
    white-space: nowrap;
}

/* ---- Cierre SEO (page-pillar.php) ---- */
.seo-footer-text {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid #dff0e8;
    color: #2e2e2e;
    font-size: .97rem;
    line-height: 1.8;
}
.seo-footer-text p { margin: 0 0 14px; }
.seo-footer-text h2,
.seo-footer-text h3 { color: #1b4332; }

/* ============================================
   PILAR — Layout 3 columnas
============================================ */
.pilar-columns {
    display: flex;
    align-items: stretch;
    max-width: 1280px;
    margin: 0 auto;
}

/* Columna izquierda: bloque verde con título del grupo */
.column-pilar-left {
    width: 300px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2d9e6b 0%, #0f5c35 100%);
}

/* Columna central: contenido principal */
.column-pilar-center {
    flex: 1;
    min-width: 0;
}

/* Columna derecha: reservada (oculta por defecto) */
.column-pilar-right {
    width: 260px;
    flex-shrink: 0;
    display: none;
}

/* Contenido del header verde */
.pillar-header {
    padding: 48px 24px 40px;
    text-align: center;
    color: #fff;
}
.pillar-header h1 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    margin: 0 0 10px;
    color: #fff;
}
.pillar-meta { font-size: .9rem; opacity: .75; color: #fff; }

@media (max-width: 900px) {
    .pilar-columns { flex-direction: column; }
    .column-pilar-left { width: 100%; position: static; }
}

/* ---- Bloque de vídeo YouTube ---- */
.atlas-video {
    margin-top: 48px;
}
.atlas-video-title {
    font-size: 1.18rem !important;
    font-weight: 800 !important;
    color: #1b4332 !important;
    border-bottom: 2px solid #dff0e8;
    padding-bottom: 7px;
    margin: 0 0 16px !important;
}
.atlas-video-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    background: #000;
}
.atlas-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* ── Botón hamburger móvil: verde en lugar de azul Astra ── */
[data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-trigger-fill {
    background: #2d9e6b !important;
    color: #fff !important;
}
[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg {
    fill: #fff !important;
}

/* ── Sección hábitats en home ── */
.habitat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 32px;
}
@media (max-width: 900px) { .habitat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .habitat-grid { grid-template-columns: repeat(2, 1fr); } }

.habitat-card {
    background: var(--hc, #2d9e6b);
    border-radius: 16px;
    padding: 28px 16px 22px;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.habitat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    text-decoration: none;
}
.habitat-card-emoji { font-size: 2.4rem; line-height: 1; }
.habitat-card-name  { color: #fff; font-weight: 800; font-size: 1rem; line-height: 1.2; }
.habitat-card-desc  { color: rgba(255,255,255,.8); font-size: .8rem; }
.habitat-card-count { color: rgba(255,255,255,.7); font-size: .75rem; margin-top: 2px; }

/* ── Todos los animales page ───────────────────── */
.todos-animales-hero { position:relative; margin:0 0 2rem; border-radius:16px; overflow:hidden; max-height:420px; }
.todos-animales-hero-img { width:100%; height:420px; object-fit:cover; display:block; }
.todos-animales-hero-caption { position:absolute; bottom:0; left:0; right:0; background:rgba(0,0,0,.55); color:#fff; font-size:.85rem; padding:.6rem 1rem; }
.todos-animales-intro { font-size:1.08rem; line-height:1.75; margin-bottom:2rem; }
.todos-animales-stats { display:flex; gap:1rem; flex-wrap:wrap; background:#f0faf5; border-radius:12px; padding:1.2rem 1.5rem; margin:0 0 2.5rem; }
.stat-item { flex:1; min-width:120px; text-align:center; }
.stat-num { display:block; font-size:2rem; font-weight:700; color:#2d9e6b; }
.stat-label { font-size:.8rem; color:#555; }
.habitat-explora-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1.2rem; margin:1.5rem 0 2.5rem; }
.habitat-explora-card { background:var(--hc,#2d9e6b); color:#fff; border-radius:14px; padding:1.4rem 1.2rem; display:flex; flex-direction:column; gap:.6rem; }
.habitat-explora-card h3 { margin:0; font-size:1.1rem; color:#fff; }
.habitat-explora-card p { margin:0; font-size:.88rem; line-height:1.6; opacity:.93; }
.habitat-explora-icon { font-size:2rem; line-height:1; }
.habitat-explora-btn { display:inline-block; margin-top:auto; background:rgba(255,255,255,.2); color:#fff; border:1px solid rgba(255,255,255,.4); border-radius:8px; padding:.4rem .9rem; font-size:.82rem; text-decoration:none; transition:background .2s; }
.habitat-explora-btn:hover { background:rgba(255,255,255,.35); color:#fff; }
.todos-animales-video { margin:3rem 0 1rem; }
.todos-animales-video h2 { margin-bottom:1rem; }
@media(max-width:900px) { .habitat-explora-grid { grid-template-columns:repeat(2,1fr); } }
@media(max-width:600px) { .habitat-explora-grid { grid-template-columns:1fr; } .todos-animales-hero-img { height:240px; } .todos-animales-stats { gap:.6rem; } }

/* ── Página de contacto ── */
.atlas-contact-page { max-width: 640px; }
.contact-intro { font-size: 1.05rem; color: #444; margin-bottom: 32px; line-height: 1.7; }
.atlas-contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 600; font-size: .9rem; color: #1b4332; }
.form-group label span { color: #c0392b; }
.form-group input,
.form-group select,
.form-group textarea {
    border: 1.5px solid #cde0d4; border-radius: 8px;
    padding: 10px 14px; font-size: .95rem; font-family: inherit;
    color: #333; background: #fff; transition: border-color .2s; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #2d9e6b; }
.form-group textarea { resize: vertical; }
.form-check { display: flex; align-items: flex-start; gap: 10px; }
.form-check input[type=checkbox] { margin-top: 3px; accent-color: #2d9e6b; width:16px; height:16px; flex-shrink:0; }
.form-check label { font-size: .88rem; color: #555; line-height: 1.5; }
.form-check label a { color: #2d9e6b; }
.form-check label span { color: #c0392b; }
.atlas-btn-send {
    background: linear-gradient(135deg, #2d9e6b, #1b5e3b);
    color: #fff; border: none; border-radius: 8px;
    padding: 13px 28px; font-size: 1rem; font-weight: 700;
    cursor: pointer; align-self: flex-start;
    transition: opacity .2s, transform .15s;
}
.atlas-btn-send:hover { opacity: .9; transform: translateY(-1px); }
.contact-sent { background: #e8f5e9; border-left: 4px solid #2d9e6b; padding: 18px 22px; border-radius: 0 10px 10px 0; margin-top: 20px; }

/* ── Páginas legales / contenido con clases propias ── */
.atlas-legal-page,
.atlas-contact-page {
    max-width: 860px;
}
.atlas-content-page-wrap .atlas-legal-page h2,
.atlas-legal-page h2 {
    font-size: 1.15rem; font-weight: 700; color: #1b4332;
    margin: 28px 0 10px; padding-bottom: 6px;
    border-bottom: 2px solid #dff0e8;
}
.atlas-legal-page p,
.atlas-legal-page li { color: #333; line-height: 1.85; font-size: .97rem; }
.atlas-legal-page ul,
.atlas-legal-page ol { padding-left: 22px; margin: 0 0 16px; }
.atlas-legal-page li { margin-bottom: 6px; }
.atlas-legal-page a { color: #2d9e6b; }
.atlas-legal-page strong { color: #1b4332; }
.atlas-legal-page table,
.legal-table {
    width: 100%; border-collapse: collapse;
    margin: 14px 0 20px; font-size: .88rem;
}
.atlas-legal-page table th,
.legal-table th {
    background: #e8f5e9; color: #1b4332;
    padding: 8px 12px; text-align: left;
}
.atlas-legal-page table td,
.legal-table td {
    padding: 7px 12px; border-bottom: 1px solid #eee; vertical-align: top;
}
.atlas-legal-page table tr:last-child td,
.legal-table tr:last-child td { border-bottom: none; }

/* ── Banner de cookies ── */
#atlas-cookie-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99999;
    background: #1b4332; color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 14px 24px;
    font-size: .88rem; line-height: 1.5;
    box-shadow: 0 -2px 12px rgba(0,0,0,.2);
}
#atlas-cookie-bar p { margin: 0; flex: 1; }
#atlas-cookie-bar a { color: #7dd3a8; text-decoration: underline; }
#atlas-cookie-bar button {
    background: #2d9e6b; color: #fff; border: none;
    padding: 9px 22px; border-radius: 6px;
    font-weight: 700; font-size: .88rem; cursor: pointer;
    white-space: nowrap; flex-shrink: 0;
    transition: background .2s;
}
#atlas-cookie-bar button:hover { background: #3ab87e; }
@media (max-width: 600px) {
    #atlas-cookie-bar { flex-direction: column; align-items: flex-start; padding: 16px; }
    #atlas-cookie-bar button { width: 100%; text-align: center; }
}

/* ═══════════════════════════════════════════════════
   FAQ ACORDEÓN — Yoast FAQ Block (atlas-child)
═══════════════════════════════════════════════════ */
.schema-faq-section {
    border-bottom: 1px solid #d4edd9;
    margin-bottom: 0;
}
.schema-faq-section:first-child { border-top: 1px solid #d4edd9; }
.schema-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #1b4332;
    background: none;
    border: none;
    text-align: left;
}
.schema-faq-question::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 400;
    color: #2d9e6b;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.2s ease;
}
.schema-faq-section.faq-open .schema-faq-question::after { content: '−'; }
.schema-faq-answer {
    display: none;
    padding: 0 0 16px 0;
    color: #333;
    line-height: 1.7;
    margin: 0;
}
.schema-faq-section.faq-open .schema-faq-answer { display: block; }

/* Grid de subcats en páginas pilar — máximo 4 columnas */
.atlas-subcats-grid.pillar-subcat-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 20px;
    margin: 24px 0 36px;
}
@media (max-width: 600px) { .atlas-subcats-grid.pillar-subcat-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 380px) { .atlas-subcats-grid.pillar-subcat-grid { grid-template-columns: 1fr !important; } }

/* Grid posts directos en página pilar */
.pillar-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin: 24px 0 40px;
}
.atlas-animal-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform .2s, box-shadow .2s;
}
.atlas-animal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.13);
}
.atlas-animal-img {
    width: 100%;
    aspect-ratio: 4/3;
    background-size: cover;
    background-position: center;
}
.atlas-animal-img--empty {
    background: #e8f4fd;
}
.atlas-animal-body {
    padding: 10px 12px;
}
.atlas-animal-name {
    font-size: .9rem;
    line-height: 1.3;
    display: block;
}

/* ── Grid de categorías principales (página Todos los animales) ── */
.atlas-catindex-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: 32px 0 48px;
}
.atlas-catindex-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 16px rgba(0,0,0,.08);
    border: 1px solid #e8e8e8;
    transition: transform .2s, box-shadow .2s;
}
.atlas-catindex-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
}
.atlas-catindex-img {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
}
.atlas-catindex-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #f5f5f5;
}
.atlas-catindex-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.atlas-catindex-emoji { font-size: 1.4rem; }
.atlas-catindex-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
}
.atlas-catindex-count {
    font-size: .8rem;
    color: #888;
}
.atlas-catindex-desc {
    font-size: .85rem;
    color: #555;
    line-height: 1.5;
    margin: 4px 0 0;
}
@media (max-width: 900px) {
    .atlas-catindex-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .atlas-catindex-grid { grid-template-columns: 1fr; }
}

/* ---- Curiosidades en sidebar (rankings) ---- */
.atlas-curios-sidebar {
    font-size: .9rem;
    line-height: 1.7;
    color: #3d2a10;
}
.atlas-curios-sidebar li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e4cfa0;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.atlas-curios-sidebar li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.atlas-curios-sidebar .curio-icon {
    font-size: .95rem;
    margin-top: 2px;
    flex-shrink: 0;
}


/* Curiosidades en sidebar: sin barra verde, más padding */
.atlas-ficha.atlas-ficha--curiosidades {
    border-left: none;
    border-radius: 12px;
}
.atlas-ficha.atlas-ficha--curiosidades .atlas-curios-sidebar {
    padding: 16px 18px 18px;
}

/* ── Shortcode [atlas_regiones] ─────────────────────────── */
.atlas-regiones-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin: 32px 0 48px;
}
@media (max-width: 900px) { .atlas-regiones-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .atlas-regiones-grid { grid-template-columns: 1fr; } }

.atlas-region-card {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transition: transform .25s, box-shadow .25s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.atlas-region-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    text-decoration: none;
    color: inherit;
}
.atlas-region-card__img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}
.atlas-region-card__placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.atlas-region-card__emoji {
    font-size: 3.5rem;
}
.atlas-region-card__body {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.atlas-region-card__title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1b4332;
    margin: 0 0 8px;
    line-height: 1.3;
}
.atlas-region-card__desc {
    font-size: .88rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 14px;
    flex: 1;
}
.atlas-region-card__link {
    font-size: .85rem;
    font-weight: 700;
    color: #2d7d4a;
}
