/* =========================================================================
   Diario Al Día — Modernization layer (child theme)
   Loads AFTER parent main.css. Overrides via CSS variables + refined selectors.
   Sections: 1 Tokens  2 Typography  3 Depth/cards  4 Header/nav  5 Sections
   6 Buttons/pills  7 Single/share/progress  8 WhatsApp FAB  9 Dark mode  10 Responsive
   ========================================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --shadow-md: 0 6px 16px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .06);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, .18), 0 8px 16px rgba(15, 23, 42, .08);

    /* themeable surfaces (light values; dark mode flips these) */
    --page-bg: #e9ebef;          /* boxed "outside" color (was harsh #000) */
    --surface-raised: #ffffff;   /* cards, header, nav */
    --accent: var(--red);
    --accent-soft: rgba(215, 25, 32, .10);
}

/* ---------- 2. Typography ---------- */
body {
    background: var(--page-bg);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.site-title,
.footer-title,
.card h2,
.list-card h2,
.card--large h2,
.section-heading h2,
.trending-box h2,
.newsletter-card h2,
.archive-header h1,
.page-content h1,
.article-header h1,
.widget-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.site-title,
.footer-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card h2,
.list-card h2 { line-height: 1.2; }
.card--large h2 { font-weight: 700; letter-spacing: -0.025em; }

/* keep UI/labels in the clean sans */
.main-nav a,
.legal-nav a,
.cat-label,
.meta,
.button,
.breaking-ticker,
.section-heading a { font-family: var(--font-body); }

/* ---------- 3. Depth + cards ---------- */
.site-header,
.site-main { background: var(--surface-raised); }

.card,
.trending-box,
.newsletter-card,
.widget,
.category-block {
    background: var(--surface-raised);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.card { border-radius: var(--radius); }
.trending-box,
.newsletter-card,
.widget,
.category-block { border-radius: var(--radius); }

/* hover lift on standalone cards (not the inner list cards of a category block) */
.hero-grid .card:hover,
.archive-posts .card:hover,
.related-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.category-block:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.category-block .card { box-shadow: none; }
.category-block .card:hover { transform: none; box-shadow: none; }

.card__media img,
.list-card__media img { transition: transform .45s cubic-bezier(.2, .6, .2, 1); }
.card:hover .card__media img,
.list-card:hover .list-card__media img { transform: scale(1.06); }

.card__media,
.list-card__media { border-radius: 0; }
.card .card__media { border-radius: var(--radius) var(--radius) 0 0; }

/* category-color-aware pill labels (JS sets --cat per label) */
.cat-label {
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--cat, var(--accent)) 12%, transparent);
    color: var(--cat, var(--accent));
    letter-spacing: .05em;
    font-size: 10.5px;
    transition: background .2s ease;
}
.cat-label:hover { background: color-mix(in srgb, var(--cat, var(--accent)) 20%, transparent); }

.list-card {
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 4px;
    border-bottom: 0;
    transition: background .2s ease;
}
.list-card:hover { background: var(--surface); }
.list-card__media { border-radius: var(--radius-sm); }

/* ---------- 4. Header + sticky blurred nav ---------- */
.brand-row,
.main-nav,
.menu-toggle { background: var(--surface-raised); }

@media (min-width: 769px) {
    .main-nav {
        position: sticky;
        top: 0;
        z-index: 30;
        background: color-mix(in srgb, var(--surface-raised) 80%, transparent);
        -webkit-backdrop-filter: saturate(1.5) blur(14px);
        backdrop-filter: saturate(1.5) blur(14px);
        transition: box-shadow .28s ease, background .28s ease;
    }
    body.nav-stuck .main-nav { box-shadow: var(--shadow-md); }

    /* animated underline on nav links */
    .main-nav a { position: relative; transition: color .18s ease; }
    .main-nav a::after {
        content: "";
        position: absolute;
        left: 0; right: 0; bottom: 8px;
        height: 2px;
        background: var(--accent);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform .22s ease;
    }
    .main-nav a:hover { color: var(--accent); }
    .main-nav a:hover::after,
    .main-nav .current-menu-item > a::after { transform: scaleX(1); }
}

/* dark-mode toggle button (JS injects .theme-toggle into .top-social) */
.theme-toggle {
    display: grid;
    place-items: center;
    width: 32px; height: 30px;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: background .15s ease;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .24); }
.theme-toggle svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 768px) {
    .theme-toggle { width: 38px; height: 32px; }
    .theme-toggle svg { width: 20px; height: 20px; }
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- 5. Section headings / trending / newsletter ---------- */
.section-heading,
.trending-box h2,
.widget-title { border-color: var(--accent); }

.section-heading h2 { letter-spacing: -0.01em; text-transform: none; font-size: 22px; }
.trending-box h2,
.widget-title { text-transform: none; letter-spacing: -0.01em; }

.trending-box li::before {
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
}
.trending-box li a { transition: color .18s ease; }
.trending-box li a:hover { color: var(--accent); }

.newsletter-card {
    background:
        radial-gradient(120% 120% at 100% 0, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
        var(--surface-raised);
}

/* ---------- 6. Buttons / inputs ---------- */
.button,
.search-form input[type="submit"],
.newsletter-card button,
.footer-newsletter button {
    border-radius: var(--radius-pill);
    letter-spacing: .03em;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, filter .15s ease;
}
.button:hover,
.search-form input[type="submit"]:hover,
.newsletter-card button:hover,
.footer-newsletter button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.05);
}
.button--secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.button--secondary:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}

.search-form input[type="search"],
.newsletter-card input,
.footer-newsletter input {
    border-radius: var(--radius-pill);
    background: var(--surface-raised);
    color: var(--text);
    padding: 0 16px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.search-form input:focus,
.newsletter-card input:focus,
.footer-newsletter input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- 7. Breaking ticker ---------- */
.breaking-ticker { border-radius: var(--radius-sm); overflow: hidden; }
.breaking-ticker strong { position: relative; }
.breaking-ticker strong::before {
    content: "";
    width: 8px; height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: #fff;
    animation: dad-pulse 1.4s ease-in-out infinite;
}
@keyframes dad-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.breaking-ticker a { transition: background .18s ease; }
.breaking-ticker a:hover { background: var(--accent-soft); }

/* ---------- 7b. Single post: reading progress + share ---------- */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ff8a3d));
    z-index: 100;
    transition: width .08s linear;
}

.article-body blockquote { border-color: var(--accent); font-family: var(--font-display); }

.dad-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.dad-share__label {
    margin-right: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.dad-share a,
.dad-share button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-raised);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.dad-share a:hover,
.dad-share button:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: #fff; }
.dad-share svg { width: 16px; height: 16px; fill: currentColor; }
.dad-share .dad-wa { background: #25D366; border-color: #25D366; color: #fff; }
.dad-share .dad-fb { background: #1877F2; border-color: #1877F2; color: #fff; }
.dad-share .dad-tw { background: #0f172a; border-color: #0f172a; color: #fff; }
.dad-share .dad-wa:hover { filter: brightness(1.08); }
.dad-share .dad-fb:hover { filter: brightness(1.08); }
.dad-share .dad-tw:hover { filter: brightness(1.25); }

/* ---------- 8. Floating WhatsApp channel button ---------- */
.dad-wa-fab {
    position: fixed;
    right: 20px; bottom: 20px;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px 13px 15px;
    border-radius: var(--radius-pill);
    background: #25D366;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 10px 24px rgba(37, 211, 102, .45);
    transition: transform .18s ease, box-shadow .18s ease;
}
.dad-wa-fab:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(37, 211, 102, .55); color: #fff; }
.dad-wa-fab svg { width: 24px; height: 24px; fill: #fff; }
.dad-wa-fab span { white-space: nowrap; }
@media (max-width: 600px) {
    .dad-wa-fab { padding: 14px; right: 16px; bottom: 16px; }
    .dad-wa-fab span { display: none; }
}

/* ---------- 9. Dark mode ---------- */
:root[data-theme="dark"] {
    --bg: #0e1218;
    --surface: #1b212b;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --border: #2a323d;
    --dark: #e6e9ee;
    --red: #ff4d52;
    --breaking: #2a1416;
    --page-bg: #06080b;
    --surface-raised: #141922;
    --accent: #ff4d52;
    --accent-soft: rgba(255, 77, 82, .16);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --bg: #0e1218; --surface: #1b212b; --text: #e6e9ee; --muted: #9aa4b2;
        --border: #2a323d; --dark: #e6e9ee; --red: #ff4d52; --breaking: #2a1416;
        --page-bg: #06080b; --surface-raised: #141922; --accent: #ff4d52; --accent-soft: rgba(255, 77, 82, .16);
    }
}

:root[data-theme="dark"] .card__media,
:root[data-theme="dark"] .list-card__media { background: #10151c; }
:root[data-theme="dark"] .brand-row { border-bottom-color: var(--border); }
:root[data-theme="dark"] .site-footer { background: #0b0e13; }
:root[data-theme="dark"] .footer-bottom-wrap { background: #070a0e; }
:root[data-theme="dark"] a:hover { color: var(--accent); }

/* ---------- 10. Responsive polish ---------- */
@media (max-width: 768px) {
    :root { --radius: 14px; }
    .list-card { padding: 10px; }
    .dad-share { gap: 8px; }
    .dad-share a span,
    .dad-share button span { display: none; }  /* icon-only share on phones */
    .dad-share a,
    .dad-share button { padding: 10px 13px; }
}

/* ---------- 11. Native WordPress comments ---------- */
.comments-area > h2,
.comment-reply-title {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
}
.comment-list { list-style: none; margin: 0 0 28px; padding: 0; }
.comment-list ol.children { list-style: none; margin: 0; padding-left: 20px; border-left: 2px solid var(--border); }
.comment-body {
    margin: 14px 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
}
.comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; }
.comment-author.vcard { display: flex; align-items: center; gap: 10px; font-style: normal; }
.comment-author .avatar { width: 40px; height: 40px; border-radius: 50%; }
.comment-author .fn { font-weight: 800; font-style: normal; }
.comment-author .says { display: none; }
.comment-metadata { color: var(--muted); font-size: 12.5px; }
.comment-metadata a { color: var(--muted); }
.comment-content { color: var(--text); font-size: 15.5px; line-height: 1.65; }
.comment-content p { margin: 0 0 .6em; }
.reply { margin-top: 8px; }
.comment-reply-link {
    display: inline-flex; align-items: center;
    padding: 5px 12px; border-radius: var(--radius-pill);
    border: 1px solid var(--border); background: var(--surface);
    font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
    transition: background .15s ease, color .15s ease;
}
.comment-reply-link:hover { background: var(--accent-soft); color: var(--accent); }
.comment-respond {
    margin-top: 8px; padding: 22px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface-raised); box-shadow: var(--shadow-sm);
}
.comment-form { display: grid; gap: 14px; }
.comment-form p { margin: 0; display: grid; gap: 6px; }
.comment-form label { font-size: 13px; font-weight: 700; color: var(--muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--text);
    padding: 11px 14px;
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.comment-form .form-submit { margin: 0; }
.comment-form .submit {
    min-height: 46px; padding: 0 26px;
    border: 0; border-radius: var(--radius-pill);
    background: var(--accent); color: #fff;
    font-weight: 900; text-transform: uppercase; letter-spacing: .03em;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.comment-form .submit:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); filter: brightness(1.05); }
.comment-form .comment-notes,
.comment-form .comment-form-cookies-consent { color: var(--muted); font-size: 12.5px; }
.comment-form-cookies-consent { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; }
.no-comments, .comment-awaiting-moderation { color: var(--muted); font-size: 14px; }
@media (min-width: 600px) {
    .comment-form-author, .comment-form-email, .comment-form-url { max-width: 420px; }
}
