/*
Theme Name: WP Insiders
Theme URI: https://example.com/wp-insiders
Author: DAIZP V3
Author URI: https://example.com
Description: Un tema de WordPress premium, ultraligero y optimizado para AdSense con tipografía SF Pro.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wp-insiders
*/

/* --- Design System & Variables --- */
:root {
    --bg-main: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e2e8f0;
    --radius: 12px;
    --surface: #f8fafc;
    --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
    --container-width: 1200px;
    --reading-width: 800px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
    background: #000;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 0;
    border-bottom: 1px solid #222;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    overflow: hidden;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.ticker-label {
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.news-ticker {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    height: 1.2rem;
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll 45s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding-right: 60px;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.ticker-item:hover {
    color: var(--accent);
}

@keyframes ticker-scroll {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

.module-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: #ccc;
}

.module-icon {
    color: var(--accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.utc-label {
    opacity: 0.5;
    margin-left: 4px;
}

.stock-item {
    margin-left: 12px;
}

.stock-item:first-of-type {
    margin-left: 0;
}

.stock-up  { color: #10b981; }
.stock-down{ color: #ef4444; }

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    box-shadow: 0 1px 0 var(--border), 0 4px 16px -4px rgb(0 0 0 / 0.08);
}

.header-left {
    display: flex;
    align-items: center;
}

.site-logo img {
    max-height: 56px;
    width: auto;
    display: block;
}

.site-title {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
}

.site-title a {
    color: #000;
    text-decoration: none;
    background: linear-gradient(135deg, #000 60%, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-title a:hover {
    opacity: 0.85;
}

.site-desc {
    display: none;
}

/* ============================================================
   PRIMARY NAVIGATION
   ============================================================ */
.site-nav {
    display: flex;
    align-items: center;
}

.site-nav ul,
.site-nav li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-menu > li > a {
    display: block;
    padding: 6px 12px;
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.nav-menu > li > a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
    color: var(--accent);
}

.nav-menu > li.current-menu-item > a {
    position: relative;
}

.nav-menu > li.current-menu-item > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* ============================================================
   HOMEPAGE GRID
   ============================================================ */
.post-loop {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 30px;
}

.post-item {
    grid-column: span 4;
    border-bottom: 1px solid var(--border);
    padding-bottom: 30px;
}

.post-item:first-child {
    grid-column: span 8;
    display: flex;
    gap: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 40px;
    margin-bottom: 20px;
}

.post-item:first-child .post-image-wrapper { flex: 1.5; }
.post-item:first-child .post-content-wrapper { flex: 1; }
.post-item:first-child .post-title {
    font-size: 2.2rem;
    line-height: 1.1;
}

.post-image-wrapper {
    margin-bottom: 15px;
    overflow: hidden;
}

.post-image-wrapper img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.post-meta {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-meta span {
    color: var(--text-muted);
}

.post-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post-container {
    max-width: var(--reading-width);
}

.single-post-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 25px;
}

.single-post-meta {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    margin-bottom: 30px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.single-post-meta .author {
    color: var(--text-primary);
    text-transform: uppercase;
}

.featured-image {
    margin-bottom: 40px;
}

.featured-image img {
    width: 100%;
    height: auto;
}

.post-content {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #333;
}

.post-content p  { margin-bottom: 25px; }
.post-content h2 { font-size: 2rem;   font-weight: 800; margin: 40px 0 20px; }
.post-content h3 { font-size: 1.5rem; font-weight: 800; margin: 30px 0 15px; }

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */
.toc-container {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 32px;
    margin: 40px 0;
    border: 1px solid var(--border);
}

.toc-title {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toc-title::before {
    content: "";
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent);
    flex-shrink: 0;
}

.toc-list li {
    margin-bottom: 12px;
    list-style: none;
}

.toc-list a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
    text-decoration: none;
}

.toc-list a:hover {
    color: var(--accent);
    padding-left: 8px;
}

/* ============================================================
   SOCIAL SHARE
   ============================================================ */
.social-share {
    display: flex;
    gap: 10px;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.share-btn:hover   { opacity: 0.8; }
.btn-facebook      { background: #1877f2; }
.btn-twitter       { background: #000; }
.btn-linkedin      { background: #0077b5; }
.btn-whatsapp      { background: #25d366; }

/* ============================================================
   ADSENSE
   ============================================================ */
.adsense-area {
    margin: 40px 0;
    text-align: center;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 60px;
}

.pagination a,
.pagination span {
    padding: 12px 20px;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    border: 1px solid var(--border);
    text-decoration: none;
}

.pagination .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--text-primary);
    color: #fff;
    padding: 80px 0 40px;
    margin-top: 100px;
    text-align: center;
}

.site-footer p   { opacity: 0.6; margin-bottom: 20px; }
.site-footer a   { color: #fff; margin: 0 12px; font-weight: 600; opacity: 0.8; text-decoration: none; }
.site-footer a:hover { opacity: 1; color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .top-bar-right { display: none; }
}

@media (max-width: 768px) {
    .site-nav { display: none; }
}

@media (max-width: 640px) {
    .site-title        { font-size: 1.75rem; }
    .single-post-title { font-size: 2.25rem; }
    .post-loop         { grid-template-columns: 1fr; }

    .post-item:first-child {
        flex-direction: column;
        grid-column: span 1;
    }
}
