/*
Theme Name: Licencia
Theme URI: https://licencia.ai/blog
Author: Licencia.ai
Author URI: https://licencia.ai
Description: Tema editorial del blog de Licencia.ai — IA para proyectos de edificación. Reproduce el look & feel de la web: tipografía Source Serif 4 + Inter, fondo negro y acento rojo, con el header y el footer de la home.
Version: 1.3.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: licencia
Tags: blog, editorial, custom-logo, custom-menu, featured-images, translation-ready, two-columns, right-sidebar
*/

/* ============================================================
   Design tokens — espejo de licencia.ai (assets/styles/app.css)
   ============================================================ */
:root {
    --color-bg: #f5f0e8;
    --color-bg-dark: #0a0a0a;
    --color-card: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #6b6b6b;
    --color-text-light: #f5f5f5;
    --color-text-light-muted: #b8b8b8;
    --color-primary: #d22730;
    --color-primary-dim: #8a1a20;
    --color-border: #e2dcd0;
    --color-border-dark: #1f1f1f;
    --container-max: 1240px;
    --container-padding: 32px;
    --radius: 10px;
    --radius-sm: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--color-text-light);
    background: var(--color-bg-dark);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: #e8565d; }

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

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ============================================================
   Header — idéntico al de la web (assets/styles/app.css → .site-header*)
   ============================================================ */
.site-header {
    background: var(--color-bg);
    padding: 18px 0;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
}
.site-header__logo {
    display: inline-flex;
    align-items: center;
}
.site-header__logo-img {
    height: 22px;
    width: auto;
    display: block;
}
.site-header__nav {
    display: flex;
    align-items: center;
    gap: 30px;
}
.site-header__nav a {
    color: var(--color-text);
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    transition: color .15s ease;
}
.site-header__nav a:hover { color: var(--color-primary); }

/* Botones idénticos a la web (.btn / .btn--gradient / .btn--sm). El color: #fff
   en :hover neutraliza el a:hover global del tema (que si no teñiría el texto). */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
    text-align: center;
    text-decoration: none;
}
.btn:hover { opacity: 0.9; }
.btn--gradient {
    background: linear-gradient(90deg, #0a0a0a 0%, #4a0a0d 60%, var(--color-primary) 100%);
    color: #fff;
}
.btn--gradient:hover { color: #fff; }
.btn--sm { padding: 10px 20px; font-size: 13px; }

@media (max-width: 1024px) {
    .site-header__inner { padding: 0 32px; }
    .site-header__nav { display: none; }
}

/* ============================================================
   Page hero (título del blog)
   ============================================================ */
.blog-hero {
    padding: 64px 0 40px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.blog-hero__eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin: 0 0 14px;
}
.blog-hero h1 {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
    margin: 0 0 16px;
    color: var(--color-text-light);
}
.blog-hero p {
    max-width: 640px;
    font-size: 1.15rem;
    color: var(--color-text-light-muted);
    margin: 0;
}

/* ============================================================
   Listado de posts
   ============================================================ */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    padding: 48px 0 72px;
}
.post-card {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 44px -20px rgba(0, 0, 0, .7);
    border-color: rgba(255, 255, 255, .24);
}
.post-card__thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #1c1c1c; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-meta {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-text-light-muted);
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}
.post-meta .cat { color: var(--color-primary); }
.post-card__title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.4rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
}
.post-card__title a { color: var(--color-text-light); }
.post-card__title a:hover { color: var(--color-primary); }
.post-card__excerpt { color: var(--color-text-light-muted); font-size: 0.98rem; margin: 0 0 18px; }
.readmore {
    margin-top: auto;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.readmore::after { content: "→"; transition: transform .15s ease; }
.readmore:hover::after { transform: translateX(3px); }

/* ============================================================
   Single / Page
   ============================================================ */
.article {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 0 72px;
}
.article__header { margin-bottom: 36px; }
.article__title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 14px 0 18px;
}
.article__title { color: var(--color-text-light); }
.article__meta { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-light-muted); }
.article__meta .cat { color: var(--color-primary); }
.article__featured { margin: 0 0 36px; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); }

.entry-content { font-size: 1.12rem; line-height: 1.75; }
.entry-content h2 { font-family: var(--font-serif); font-weight: 600; font-size: 1.7rem; letter-spacing: -0.01em; margin: 2.2em 0 .6em; }
.entry-content h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.35rem; margin: 1.8em 0 .5em; }
.entry-content p { margin: 0 0 1.3em; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content blockquote {
    margin: 1.8em 0;
    padding: 6px 0 6px 24px;
    border-left: 3px solid var(--color-primary);
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--color-text-light-muted);
}
.entry-content img { border-radius: var(--radius); }
.entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: rgba(255, 255, 255, .09); padding: .15em .4em; border-radius: 4px; }
.entry-content pre { background: #000; color: var(--color-text-light); padding: 20px 22px; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, .1); overflow-x: auto; }
.entry-content pre code { background: none; padding: 0; }

/* ============================================================
   Paginación
   ============================================================ */
.pagination { display: flex; gap: 10px; justify-content: center; padding: 0 0 72px; flex-wrap: wrap; }
.pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 42px; height: 42px; padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius-sm);
    background: #141414; color: var(--color-text-light); font-weight: 600;
}
.pagination .page-numbers:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination .page-numbers.current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ============================================================
   Comentarios
   ============================================================ */
#comments { padding-top: 8px; }
.comment-list { list-style: none; margin: 0 0 44px; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.comments-title {
    font-family: var(--font-serif); font-weight: 600; font-size: 1.6rem;
    color: var(--color-text-light); margin: 0 0 24px;
}
.comment-list ol { list-style: none; }
.comment-body { background: #141414; border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius); padding: 18px 20px; }
.comment .children { list-style: none; margin: 16px 0 0 28px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.comment-author { display: flex; align-items: center; gap: 10px; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .fn { color: var(--color-text-light); font-style: normal; font-weight: 600; }
.comment-author .says { display: none; }
.comment-metadata { font-size: 12px; color: var(--color-text-light-muted); margin: 6px 0 10px; }
.comment-metadata a { color: var(--color-text-light-muted); }
.comment-content { color: var(--color-text-light); }
.comment-content p { margin: 0 0 .8em; }
.comment-awaiting-moderation { font-size: 13px; color: var(--color-primary); margin: 0 0 8px; }
.reply { margin-top: 8px; }
.comment-reply-link { font-size: 13px; font-weight: 600; color: var(--color-primary); }

/* Formulario de respuesta */
.comment-respond {
    background: #101010;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    padding: 30px 30px 32px;
}
.comment-reply-title {
    font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem;
    color: var(--color-text-light); margin: 0 0 6px;
}
.comment-reply-title small { font-size: .8rem; font-weight: 400; margin-left: 8px; }
.comment-reply-title small a { color: var(--color-text-light-muted); }
.comment-notes, .logged-in-as, .must-log-in {
    font-size: 14px; color: var(--color-text-light-muted); line-height: 1.6; margin: 0 0 20px;
}
.comment-notes a, .logged-in-as a, .must-log-in a { color: var(--color-primary); }
.comment-form .required { color: var(--color-primary); }
.comment-form label { display: block; font-size: 14px; font-weight: 600; color: var(--color-text-light); margin: 0 0 7px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    font-family: var(--font); font-size: 15px;
    padding: 12px 14px;
    color: var(--color-text-light);
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius-sm);
}
.comment-form input::placeholder, .comment-form textarea::placeholder { color: #6b6b6b; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--color-primary); }
.comment-form textarea { resize: vertical; min-height: 130px; }
.comment-form-comment, .comment-form-author, .comment-form-email, .comment-form-url { margin: 0 0 18px; }
/* Nombre y correo en una fila en escritorio. */
@media (min-width: 620px) {
    .comment-form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
    .comment-form > p { grid-column: 1 / -1; }
    .comment-form-author { grid-column: 1 / 2; }
    .comment-form-email { grid-column: 2 / 3; }
}
.comment-form-cookies-consent {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 13px; color: var(--color-text-light-muted); margin: 0 0 20px;
}
.comment-form-cookies-consent input { width: auto; margin-top: 3px; accent-color: var(--color-primary); }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; color: var(--color-text-light-muted); }
.form-submit { margin: 0; }
.comment-form .submit {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 13px 26px; font-family: inherit; font-size: 14px; font-weight: 500;
    color: #fff; cursor: pointer; border: none; border-radius: 0;
    background: linear-gradient(90deg, #0a0a0a 0%, #4a0a0d 60%, var(--color-primary) 100%);
    transition: opacity .15s ease;
}
.comment-form .submit:hover { opacity: .9; }

/* ============================================================
   Footer — idéntico al de la home (assets/styles/app.css → .site-footer/.subfooter)
   ============================================================ */
.site-footer {
    background: var(--color-bg-dark);
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 40px;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.site-footer__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10,10,10,1) 0%, rgba(10,10,10,0.55) 30%, rgba(10,10,10,0) 70%),
        linear-gradient(0deg, rgba(120,8,12,0.35) 0%, rgba(120,8,12,0) 60%);
    z-index: 0;
}
.site-footer__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: hidden;
}
.site-footer__brand {
    font-size: clamp(64px, 16vw, 240px);
    font-weight: 700;
    letter-spacing: -0.05em;
    margin: 0;
    line-height: 0.85;
    color: rgba(255,255,255,0.55);
}
.subfooter {
    background: #000;
    color: rgba(255,255,255,0.55);
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    letter-spacing: 0.02em;
}
.subfooter__text { margin: 0; }

/* ============================================================
   Utilidades WP
   ============================================================ */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sticky, .gallery-caption, .bypostauthor { display: block; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text { font-size: .85rem; color: var(--color-text-light-muted); text-align: center; }

@media (max-width: 720px) {
    .site-nav ul { gap: 16px; }
    .site-nav li.hide-mobile { display: none; }
    .blog-hero { padding: 44px 0 28px; }
    .post-list { grid-template-columns: 1fr; padding: 32px 0 56px; }
}
