/* assets/css/tn-master-article-style.css */
/* =========================================
   TN MASTER ARTICLE STYLE - VERSION 5.7
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,400&display=swap');

.tn-article-container {
    --tn-primary: #566C4F;      
    --tn-secondary: #A51352;
    --tn-bg-light: #f9f9f9;
    --tn-text-dark: #333;
    max-width: 100%; margin: 0 auto; font-family: inherit;
}
.tn-article-block { margin-bottom: 30px; scroll-margin-top: 100px; }

/* TITULOS BLOQUES (PC/Tablet 23px, Movil 18px) */
.tn-section-title {
    color: var(--tn-text-dark); 
    position: relative; 
    padding-left: 15px; 
    margin-bottom: 15px; 
    font-weight: 700;
    font-size: 23px; 
    line-height: 1.3;
}
.tn-section-title::before {
    content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; 
    background: var(--tn-primary); border-radius: 2px;
}

@media (max-width: 768px) {
    .tn-section-title { font-size: 18px; }
}

/* TOC */
.tn-toc-box {
    background: #fff; border: 1px solid #e0e0e0; border-left: 4px solid var(--tn-primary);
    padding: 20px; margin-bottom: 20px; border-radius: 6px; display: inline-block; min-width: 300px;
}
.tn-toc-box h4 { margin: 0 0 10px 0; border-bottom: 1px solid #eee; padding-bottom: 5px; font-size: 1.2rem; }
.tn-toc-box ul { list-style: none; padding: 0; margin: 0; }
.tn-toc-box li { margin-bottom: 5px; border-bottom: 1px dashed #f5f5f5; }
.tn-toc-box a { text-decoration: none; color: #555; font-size: 0.95rem; transition: color 0.2s; }
.tn-toc-box a:hover { color: var(--tn-primary); padding-left: 5px; }

/* HERO */
.tn-hero-smart {
    position: relative; height: 400px; display: flex; align-items: flex-end; 
    background-size: cover; background-position: center; border-radius: 8px; overflow: hidden;
    margin-bottom: 20px;
}
.tn-hero-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.tn-hero-content { position: relative; z-index: 2; padding: 30px; width: 100%; }
.tn-hero-smart h1 { 
    color: #fff; 
    font-size: 2.8rem; margin: 0 0 10px 0; 
    font-family: 'Merriweather', serif; 
    font-weight: 700;
    font-style: italic; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); 
}
.tn-hero-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.tn-badge-tax {
    background-color: rgba(86, 108, 79, 0.8);
    color: #fff; 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-weight: 600; 
    font-size: 0.8rem; 
    text-transform: uppercase;
    backdrop-filter: blur(2px);
    border: none;
}

/* MORFOLOGIA */
.tn-morph-container { margin-bottom: 30px; }
.tn-morph-full-desc { 
    background: #fff; padding: 20px; border: 1px solid #eee; border-radius: 8px; 
    margin-bottom: 20px; font-size: 1.05em; line-height: 1.7; color: #444; 
}
.tn-morph-grid-trio {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px;
}
.tn-morph-item { background: #fff; border: 1px solid #eee; border-radius: 6px; overflow: hidden; height: 100%; }
.tn-morph-head { 
    background: var(--tn-bg-light); padding: 10px 15px; 
    border-bottom: 2px solid var(--tn-primary); 
    color: var(--tn-primary); 
    font-weight: bold; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; text-transform: uppercase;
}
.tn-morph-icon {
    width: 20px; height: 20px; margin-right: 5px; fill: currentColor;
}
.tn-morph-content { padding: 15px; font-size: 0.9rem; color: #666; line-height: 1.6; }
.tn-morph-notes-full { background: #fff; border: 1px solid #eee; border-radius: 6px; overflow: hidden; }

/* COMPARADOR (NUEVO DISEÑO POR FILAS) */
.tn-comparison-box { margin: 20px 0; overflow-x: auto; }
.tn-vs-table { display: grid; border: 1px solid #ddd; border-radius: 8px; min-width: 300px; /* Reducido min-width */ }

/* Encabezados de Especie */
.tn-vs-header {
    background: var(--tn-primary); color: #fff; padding: 12px; font-weight: bold; text-align: center;
    font-size: 0.95rem; font-style: italic; display: flex; align-items: center; justify-content: center;
}
.tn-vs-header.col-main { background: color-mix(in srgb, var(--tn-primary), black 10%); }
.tn-vs-header.col-comp { 
    background: #fff; color: var(--tn-text-dark); 
    border-bottom: 3px solid var(--tn-primary);
}

/* Fila de Sección (Hoja, Flor, Fruto) */
.tn-vs-section-title {
    background: #eef5eb; /* Verde muy clarito solicitado */
    color: var(--tn-primary);
    padding: 8px 12px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    letter-spacing: 1px;
}

/* Celdas de datos */
.tn-vs-cell { 
    padding: 12px; 
    border-bottom: 1px solid #eee; 
    background: #fff; 
    font-size: 0.9rem; 
    color: #555;
    /* Borde derecho para separar columnas, excepto la última */
    border-right: 1px solid #eee;
}
.tn-vs-cell:last-child { border-right: none; }

.tn-vs-notes { margin-top: 15px; background: #fffbe6; padding: 15px; border: 1px solid #f0e6b6; border-radius: 6px; font-size: 0.9rem; }

/* GALERIA & MAPAS */
.tn-gallery-wrapper, .tn-map-wrapper { 
    background: #fff; border: 1px solid #eee; padding: 15px; border-radius: 8px; margin-bottom: 30px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.02); 
}
.tn-species-swiper { width: 100%; height: 150px; padding-bottom: 0; overflow: hidden; }
.tn-species-swiper .swiper-slide { height: 100%; width: auto; }
.tn-species-swiper img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; cursor: pointer; transition: filter 0.3s; }
.tn-species-swiper img:hover { filter: brightness(0.9); }
.tn-dynamic-map { z-index: 1; background: #f0f0f0; height: 350px; width: 100%; border-radius: 6px; }
.tn-heatmap-map { z-index: 1; background-color: #f8f9fa; border: 1px solid #e2e4e7; border-radius: 6px; overflow: hidden; }

/* LEYENDA */
.tn-heatmap-legend-box {
    margin-top: 10px; padding: 8px 12px; background: #fcfcfc; border-top: 1px solid #eee;
    border-radius: 0 0 6px 6px; font-size: 0.8rem; color: #666; display: flex; align-items: center; gap: 15px;
}
.tn-heat-bar {
    width: 150px; height: 8px; border-radius: 4px; display: inline-block;
    background: linear-gradient(to right, #5a8a30, #f0f921, #ff9800, #f44336, #A51352); border: 1px solid #ddd;
}

/* EXTRAS & HIGHLIGHTS */
.tn-narrative-text { font-size: 1.05rem; line-height: 1.7; color: #444; }
.tn-highlight-box { padding: 20px; border-radius: 8px; margin: 25px 0; position: relative; }
.tn-style-box { background: var(--tn-bg-light); border-left: 4px solid var(--tn-primary); }
.tn-style-didyouknow { 
    background: #f1f5f0; border: 1px solid var(--tn-primary); padding-left: 60px; color: #2c4c22;
}
.tn-icon-bulb { 
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%); 
    font-size: 28px; color: var(--tn-primary);
}
.tn-book-cta-box { background: #222; color: #fff; padding: 30px; text-align: center; border-radius: 8px; }
.tn-cta-button { display: inline-block; margin-top: 15px; padding: 10px 25px; background: var(--tn-primary); color: #fff; font-weight: bold; border-radius: 50px; text-decoration: none; transition: background 0.3s; }
.tn-cta-button:hover { background: color-mix(in srgb, var(--tn-primary), black 10%); }

@media (max-width: 768px) {
    .tn-hero-smart { height: 300px; } .tn-hero-smart h1 { font-size: 1.8rem; }
    .tn-morph-grid-trio { grid-template-columns: 1fr; }
    .tn-comparison-box { overflow-x: scroll; }
    .tn-toc-box { width: 100%; }
}