/*
Theme Name: dds_apikw_local_guide
Theme URI: https://apikw.com
Author: Martín Villalba
Author URI: https://apikw.com
Description: Portal especializado en descubrir, recomendar y enseñar a usar las mejores aplicaciones tecnológicas para Argentina. Tema informativo, sin datos dinámicos, con enfoque local.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: dds_apikw_local_guide
*/

/* ====== Variables base ====== */
:root {
    --green: #2F6B47;
    --green-dark: #245538;
    --sand: #F5F0E1;
    --sand-soft: #EFE8D5;
    --ink: #1F2926;
    --ink-soft: #3a463f;
    --copper: #D97A3E;
    --copper-dark: #c2632b;
    --card-bg: #ffffff;
    --line: #d8d2c2;
    --radius: 8px;
    --shell: min(92%, 1180px);
    --font-base: "Inter", "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ====== Reset / base ====== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--sand);
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a {
    color: var(--green);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--copper); }

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 0.6em;
}
h1 { font-size: 2.05rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; letter-spacing: 0.01em; }

p { margin: 0 0 1.1em; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }

/* ====== Contenedor de ancho (fuente única) ====== */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

/* ====== Botones ====== */
.btn,
.wp-block-button__link,
button.read-more {
    display: inline-block;
    background: var(--copper);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 0.6em 1.2em;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.btn:hover,
button.read-more:hover { background: var(--copper-dark); color: #fff; }

/* ====== Cabecera ====== */
.site-head {
    background: var(--card-bg);
    border-bottom: 3px solid var(--green);
}
.site-head-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo { display: block; height: 46px; width: auto; }
.brand-wordmark {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--green);
    text-transform: none;
    line-height: 1;
}
.brand-text { min-width: 0; }
.brand-text .site-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    display: block;
    line-height: 1.4;
    max-width: 640px;
}
.brand-text .site-desc {
    font-size: 0.8rem;
    color: var(--ink-soft);
    display: block;
    line-height: 1.45;
    margin-top: 4px;
    max-width: 640px;
}

/* ====== Navegación ====== */
.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--sand-soft);
    color: var(--green);
}
.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 9px 13px;
    font-size: 1rem;
    cursor: pointer;
}

/* ====== Estructura de la página ====== */
.site-main { padding: 34px 0 50px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}
.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.layout-single .content-area { min-width: 0; }

.content-area { min-width: 0; }

/* ====== Migas de pan ====== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0 0 22px;
}
.breadcrumbs a { color: var(--green); }
.breadcrumbs .sep { margin: 0 6px; color: var(--copper); }

/* ====== Barra lateral ====== */
.sidebar {
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}
.sidebar .widget { margin-bottom: 26px; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1.05rem;
    color: var(--ink);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--green);
}
.sidebar a { color: var(--green); }
.sidebar a:hover { color: var(--copper); }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: 6px 0; border-bottom: 1px solid var(--sand-soft); color: var(--ink); }
.sidebar li:last-child { border-bottom: none; }
.sidebar .post-date { display: block; font-size: 0.78rem; color: var(--ink-soft); }

/* ====== Tarjetas de entradas (horizontales, A8 + A10) ====== */
.cards { display: flex; flex-direction: column; gap: 22px; }

.card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-row { flex-direction: row; }

.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
}
.card-thumb-placeholder svg { width: 64px; height: 64px; display: block; }

.card-body {
    flex: 1;
    min-width: 0;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.25rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--green); }
.card-meta {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin: 0 0 10px;
}
.card-region {
    display: inline-block;
    background: var(--sand-soft);
    color: var(--green-dark);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.card-excerpt { margin-bottom: 14px; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-actions { margin-top: auto; }

/* ====== Entradas / páginas ====== */
.entry {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
}
.entry-title { margin-top: 0; }
.entry-meta { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 18px; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: var(--radius); }
.entry-thumb { margin-bottom: 22px; }
.entry-thumb img { width: 100%; border-radius: var(--radius); display: block; }

/* ====== Tablas ====== */
.entry-content table,
table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 1.2em;
}
.entry-content table th,
.entry-content table td,
table th, table td {
    border: 1px solid var(--line);
    padding: 9px 12px;
    text-align: left;
}
.entry-content table th,
table th { background: var(--sand-soft); }

/* ====== Portada ====== */
.front-section { margin-bottom: 46px; }
.front-section > h2 {
    border-left: 5px solid var(--copper);
    padding-left: 14px;
}
.front-lede {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 760px;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
}
.feature-card .app-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.feature-card .app-icon svg { width: 28px; height: 28px; display: block; }
.feature-card h3 { margin: 0 0 8px; }
.feature-card .app-author { font-size: 0.78rem; color: var(--ink-soft); margin-top: 12px; }

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.step {
    background: var(--sand-soft);
    border-radius: var(--radius);
    padding: 20px;
    min-width: 0;
}
.step .step-num {
    display: inline-flex;
    width: 34px; height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--copper);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}
.region-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.region-tag {
    background: var(--green);
    color: #fff;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}
.front-latest .cards { margin-top: 8px; }

/* ====== Paginación ====== */
.pagination {
    margin: 34px 0 0;
}
.pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px 6px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--ink);
    font-weight: 600;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

/* ====== Formulario de búsqueda ====== */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}
.search-form button {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
}
.search-form button:hover { background: var(--green-dark); }

/* ====== Comentarios ====== */
.comments-area { margin-top: 36px; }
.comments-area .comment-list { list-style: none; padding: 0; margin: 0 0 24px; }
.comments-area .comment-body {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.comments-area .comment-author { font-weight: 700; }
.comments-area .comment-meta { font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 8px; }
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

/* ====== 404 ====== */
.error-404 { text-align: left; }
.error-404 .big { font-size: 4rem; color: var(--copper); margin: 0; }

/* ====== Pie de página ====== */
.site-foot {
    background: var(--ink);
    color: var(--sand);
    padding: 44px 0 0;
    margin-top: 20px;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}
.foot-col { min-width: 0; }
.site-foot .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--copper);
}
.site-foot p,
.site-foot li,
.site-foot { color: var(--sand); }
.site-foot a { color: #f0d9c4; }
.site-foot a:hover { color: var(--copper); }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { padding: 5px 0; }
.site-foot .post-date { display: block; font-size: 0.78rem; color: #b9c2bc; }
.foot-contact-email { font-weight: 600; }
.site-foot-bottom {
    border-top: 1px solid #34403a;
    margin-top: 36px;
    padding: 18px 0;
    font-size: 0.82rem;
    color: #b9c2bc;
}

/* ====== Banner de cookies (A11: la regla [hidden] va ANTES de los estilos principales) ====== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: var(--ink);
    color: var(--sand);
    padding: 16px 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.18);
}
.cookie-banner .shell {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; }
.cookie-banner a { color: #f0d9c4; }
.cookie-banner button {
    background: var(--copper);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 22px;
    font-weight: 600;
    cursor: pointer;
}
.cookie-banner button:hover { background: var(--copper-dark); }

/* ====== Responsive ====== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 34px; }
    .feature-grid,
    .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main-nav {
        order: 3;
        width: 100%;
        margin-left: 0;
    }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .main-nav[data-collapsed="true"] ul { display: none; }
    .nav-toggle { display: inline-block; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    .layout-single { width: 100%; }
    .feature-grid,
    .steps-grid { grid-template-columns: 1fr; }
    .entry { padding: 22px 18px; }

    .card-row { flex-direction: column; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .card-thumb-placeholder { min-height: 0; aspect-ratio: 16 / 9; }
}
