/*
Theme Name: Alquimetra Blog
Theme URI: https://alquimetra.com
Author: Alquimetra
Author URI: https://alquimetra.com
Description: Tema a medida para el blog de Alquimetra. Replica la identidad visual de la landing: superficies cálidas off-white, tipografía Manrope/Inter, acentos ámbar y CTAs en degradado vino→ladrillo.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alquimetra
Tags: blog, custom-colors, featured-images, one-column
*/

/* ==========================================================================
   Design tokens — extraídos de Alquimetra-Landing/src/index.css
   ========================================================================== */

:root {
  --color-primary: #1C1917;        /* Aged Coal */
  --color-primary-deep: #0C0A09;   /* Deep Obsidian */
  --color-cta: #881337;            /* Vino Profundo */
  --color-secondary: #9A3412;      /* Fired Copper */
  --color-amber: #B45309;          /* Craft Amber */
  --color-gold: #CA8A04;           /* Artisan Gold */
  --color-botanical: #166534;      /* Cellar Moss */
  --color-brick: #BE4B31;          /* Fired Brick */
  --color-oak: #92400E;            /* Aged Oak */
  --color-slate: #44403C;          /* Warm Slate */
  --color-stone: #A8A29E;          /* Quarry Stone */
  --color-primary-container: #E7E5E4;
  --color-surface: #FAFAF9;
  --color-surface-low: #F5F5F4;
  --color-surface-lowest: #FFFFFF;
  --color-on-surface: #1C1917;
  --color-on-surface-variant: #57534E;
  --color-outline-variant: #A8A29E;
  --color-chip: #F4E6DA;

  --font-headline: "Manrope", sans-serif;
  --font-body: "Inter", sans-serif;

  --shadow-ambient: 0 8px 24px -4px rgba(28, 25, 23, .07), 0 2px 8px -2px rgba(28, 25, 23, .04);
  --shadow-hover: 0 20px 40px -8px rgba(28, 25, 23, .14), 0 8px 16px -4px rgba(28, 25, 23, .06);
  --shadow-deep: 0 28px 56px -10px rgba(28, 25, 23, .18), 0 10px 20px -4px rgba(28, 25, 23, .08);

  --radius-btn: 8px;
  --radius-card: 12px;
  --radius-card-lg: 16px;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-on-surface);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(180, 83, 9, .25); }

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

a { color: var(--color-amber); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--color-oak); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  color: var(--color-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
}

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--color-primary); color: #fff; padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius-btn) 0; font-family: var(--font-headline); font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.container--narrow { max-width: 760px; margin: 0 auto; }
.container--wide { max-width: 1200px; margin: 0 auto; }

@media (min-width: 768px) {
  .container { padding-left: 2.5rem; padding-right: 2.5rem; }
}

/* ==========================================================================
   Botones (idénticos a la landing)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border: 0;
  border-radius: var(--radius-btn);
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: .875rem;
  line-height: 1.4;
  cursor: pointer;
  transition: all .2s ease;
}

.btn-cta {
  background: linear-gradient(to bottom right, var(--color-cta), var(--color-brick));
  color: #fff;
  box-shadow: var(--shadow-ambient);
}
.btn-cta:hover { opacity: .9; color: #fff; }
.btn-cta:active { transform: scale(.95); }

.btn-dark {
  background: var(--color-primary);
  color: #fff;
}
.btn-dark:hover { background: var(--color-slate); color: #fff; }

/* ==========================================================================
   Header — clon del nav de la landing (App.tsx 56-88)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  border-bottom: 1px solid rgba(168, 162, 158, .1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

@media (min-width: 768px) {
  .header-inner { padding-left: 2.5rem; padding-right: 2.5rem; }
}

.brand { display: flex; align-items: center; gap: .5rem; }
.brand img { height: 2.25rem; width: auto; display: block; }

.site-nav {
  display: none;
  align-items: center;
  gap: 2.5rem;
  color: var(--color-on-surface-variant);
  font-weight: 500;
  font-size: .875rem;
}
.site-nav a { color: var(--color-on-surface-variant); }
.site-nav a:hover { color: var(--color-amber); }
.site-nav a.is-active { color: var(--color-amber); font-weight: 600; }

@media (min-width: 768px) {
  .site-nav { display: flex; }
}

.header-actions { display: flex; align-items: center; gap: .75rem; }
.header-actions .btn-dark { display: none; }
@media (min-width: 768px) {
  .header-actions .btn-dark { display: inline-flex; }
}

/* ==========================================================================
   Portada del blog
   ========================================================================== */

.site-main { padding: 3.5rem 0 5rem; }

.blog-hero { text-align: center; margin-bottom: 3.5rem; }

.blog-hero .badge { margin-bottom: 1.25rem; }

.blog-hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: .75rem;
}

.blog-hero p {
  color: var(--color-on-surface-variant);
  font-size: 1.125rem;
  max-width: 40rem;
  margin: 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  background: rgba(180, 83, 9, .12);
  color: var(--color-amber);
  border: 1px solid rgba(180, 83, 9, .25);
  border-radius: 9999px;
  padding: .3rem .9rem;
  font-family: var(--font-headline);
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
a.badge:hover { color: var(--color-oak); border-color: rgba(180, 83, 9, .5); }

/* Post destacado */

.post-featured {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--color-surface-lowest);
  border: 1px solid rgba(168, 162, 158, .2);
  border-radius: var(--radius-card-lg);
  box-shadow: var(--shadow-ambient);
  overflow: hidden;
  margin-bottom: 3rem;
  transition: box-shadow .3s ease, transform .3s ease;
}
.post-featured:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

@media (min-width: 900px) {
  .post-featured { grid-template-columns: 1.2fr 1fr; }
}

.post-featured .card-thumb { aspect-ratio: 16 / 10; height: 100%; }

.post-featured .featured-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  align-items: flex-start;
}

.post-featured h2 {
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 800;
  margin: 0;
}
.post-featured h2 a { color: var(--color-primary); }
.post-featured h2 a:hover { color: var(--color-amber); }

.post-featured .card-excerpt { font-size: 1.0625rem; }

/* Grilla de cards */

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-lowest);
  border: 1px solid rgba(168, 162, 158, .2);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-ambient);
  overflow: hidden;
  transition: box-shadow .3s ease, transform .3s ease;
}
.post-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

.card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--color-primary-container);
  overflow: hidden;
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.post-card:hover .card-thumb img,
.post-featured:hover .card-thumb img { transform: scale(1.04); }

.card-thumb--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--color-surface-low), var(--color-chip));
}
.card-thumb--placeholder img { width: 3.5rem; height: 3.5rem; object-fit: contain; opacity: .5; }

.card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  padding: 1.5rem;
  flex: 1;
}

.card-title {
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 0;
}
.card-title a { color: var(--color-primary); }
.card-title a:hover { color: var(--color-amber); }

.card-excerpt {
  color: var(--color-on-surface-variant);
  font-size: .9375rem;
  margin: 0;
}

.card-meta {
  margin-top: auto;
  padding-top: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--color-stone);
  font-size: .8125rem;
  font-weight: 500;
}
.card-meta a { color: inherit; }
.card-meta a:hover { color: var(--color-amber); }

/* Paginación */

.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 3.5rem;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .75rem;
  border-radius: var(--radius-btn);
  background: var(--color-surface-lowest);
  border: 1px solid rgba(168, 162, 158, .25);
  color: var(--color-on-surface-variant);
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: .875rem;
}
.pagination .page-numbers:hover { color: var(--color-amber); border-color: rgba(180, 83, 9, .4); }
.pagination .page-numbers.current {
  background: linear-gradient(to bottom right, var(--color-cta), var(--color-brick));
  border-color: transparent;
  color: #fff;
}
.pagination .page-numbers.dots { border: 0; background: transparent; }

/* Cabecera de archivo / categoría */

.archive-header { text-align: center; margin-bottom: 3rem; }
.archive-header h1 { font-size: clamp(1.875rem, 4vw, 2.75rem); font-weight: 800; }
.archive-header .archive-description { color: var(--color-on-surface-variant); max-width: 40rem; margin: 0 auto; }

/* ==========================================================================
   Entrada individual (single) y páginas
   ========================================================================== */

.entry-header { text-align: center; margin: 0 auto 2.5rem; max-width: 760px; }

.entry-header .badge { margin-bottom: 1.25rem; }

.entry-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  color: var(--color-stone);
  font-size: .875rem;
  font-weight: 500;
}
.entry-meta a { color: inherit; }
.entry-meta a:hover { color: var(--color-amber); }
.entry-meta .sep { opacity: .6; }

.entry-thumb {
  max-width: 1000px;
  margin: 0 auto 3rem;
  border-radius: var(--radius-card-lg);
  overflow: hidden;
  box-shadow: var(--shadow-deep);
}
.entry-thumb img { display: block; width: 100%; }

/* Prosa del contenido */

.entry-content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.0625rem;
  color: var(--color-on-surface);
}

.entry-content > * + * { margin-top: 1.25em; }

.entry-content h2 { font-size: 1.75rem; font-weight: 800; margin-top: 2em; }
.entry-content h3 { font-size: 1.375rem; font-weight: 700; margin-top: 1.75em; }
.entry-content h4 { font-size: 1.125rem; font-weight: 700; margin-top: 1.5em; }

.entry-content a { text-decoration: underline; text-decoration-color: rgba(180, 83, 9, .35); text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-color: var(--color-amber); }

.entry-content blockquote {
  margin: 2em 0;
  padding: .25em 0 .25em 1.5rem;
  border-left: 4px solid var(--color-cta);
  color: var(--color-on-surface-variant);
  font-style: italic;
}
.entry-content blockquote cite { font-style: normal; font-size: .875rem; color: var(--color-stone); }

.entry-content ul, .entry-content ol { padding-left: 1.5rem; }
.entry-content li { margin: .4em 0; }
.entry-content li::marker { color: var(--color-amber); }

.entry-content img, .entry-content figure img {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-ambient);
}
.entry-content figure { margin: 2em 0; }
.entry-content figcaption {
  text-align: center;
  color: var(--color-stone);
  font-size: .8125rem;
  margin-top: .75rem;
}

.entry-content code {
  background: var(--color-surface-low);
  border: 1px solid rgba(168, 162, 158, .25);
  border-radius: 6px;
  padding: .15em .4em;
  font-size: .875em;
}
.entry-content pre {
  background: var(--color-primary);
  color: var(--color-primary-container);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.6;
}
.entry-content pre code { background: transparent; border: 0; padding: 0; color: inherit; }

.entry-content hr {
  border: 0;
  border-top: 1px solid rgba(168, 162, 158, .3);
  margin: 3em auto;
  max-width: 200px;
}

.entry-content table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.entry-content th, .entry-content td {
  border: 1px solid rgba(168, 162, 158, .3);
  padding: .6rem .9rem;
  text-align: left;
}
.entry-content th { background: var(--color-surface-low); font-family: var(--font-headline); font-weight: 700; }

.wp-block-button__link, .entry-content .wp-block-button__link {
  background: linear-gradient(to bottom right, var(--color-cta), var(--color-brick));
  color: #fff;
  border-radius: var(--radius-btn);
  font-family: var(--font-headline);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-ambient);
}

/* Tags al pie de la entrada */

.entry-tags {
  max-width: 760px;
  margin: 2.5rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* Navegación anterior / siguiente */

.post-nav {
  max-width: 760px;
  margin: 3.5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(168, 162, 158, .3);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.post-nav a {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface-lowest);
  border: 1px solid rgba(168, 162, 158, .2);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-ambient);
  transition: box-shadow .3s ease;
}
.post-nav a:hover { box-shadow: var(--shadow-hover); }
.post-nav .nav-label {
  color: var(--color-stone);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.post-nav .nav-title { color: var(--color-primary); font-family: var(--font-headline); font-weight: 700; font-size: .9375rem; }
.post-nav a:hover .nav-title { color: var(--color-amber); }
.post-nav .nav-next { text-align: right; grid-column: 2; }
@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .nav-next { grid-column: auto; }
}

/* ==========================================================================
   Búsqueda / 404
   ========================================================================== */

.search-form {
  display: flex;
  gap: .5rem;
  max-width: 480px;
  margin: 0 auto;
}
.search-form .search-field {
  flex: 1;
  padding: .625rem 1rem;
  border: 1px solid rgba(168, 162, 158, .4);
  border-radius: var(--radius-btn);
  background: var(--color-surface-lowest);
  font-family: var(--font-body);
  font-size: .9375rem;
  color: var(--color-on-surface);
}
.search-form .search-field:focus {
  outline: 2px solid rgba(180, 83, 9, .4);
  outline-offset: 1px;
  border-color: var(--color-amber);
}

.page-404 { text-align: center; padding: 4rem 0; }
.page-404 .code {
  font-family: var(--font-headline);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 800;
  background: linear-gradient(to bottom right, var(--color-cta), var(--color-brick));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.page-404 h1 { font-size: 1.75rem; margin: 1rem 0 .5rem; }
.page-404 p { color: var(--color-on-surface-variant); margin-bottom: 2rem; }

/* ==========================================================================
   Comentarios
   ========================================================================== */

.comments-area { max-width: 760px; margin: 3.5rem auto 0; }
.comments-area .comments-title { font-size: 1.375rem; font-weight: 800; margin-bottom: 1.5rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment {
  background: var(--color-surface-lowest);
  border: 1px solid rgba(168, 162, 158, .2);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.comment-list .children { list-style: none; padding-left: 1.5rem; margin-top: 1rem; }
.comment-author { display: flex; align-items: center; gap: .6rem; font-family: var(--font-headline); font-weight: 700; font-size: .9375rem; }
.comment-author img { border-radius: 9999px; }
.comment-metadata { font-size: .8125rem; color: var(--color-stone); margin: .25rem 0 .75rem; }
.comment-metadata a { color: inherit; }
.comment-content { font-size: .9375rem; }
.comment-reply-link { font-size: .8125rem; font-weight: 600; }

.comment-respond { margin-top: 2rem; }
.comment-respond .comment-reply-title { font-size: 1.25rem; font-weight: 800; }
.comment-form label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .625rem .9rem;
  border: 1px solid rgba(168, 162, 158, .4);
  border-radius: var(--radius-btn);
  background: var(--color-surface-lowest);
  font-family: var(--font-body);
  font-size: .9375rem;
  margin-bottom: 1rem;
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: 2px solid rgba(180, 83, 9, .4);
  outline-offset: 1px;
  border-color: var(--color-amber);
}
.comment-form .submit {
  background: linear-gradient(to bottom right, var(--color-cta), var(--color-brick));
  color: #fff;
  border: 0;
  border-radius: var(--radius-btn);
  padding: .625rem 1.5rem;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  box-shadow: var(--shadow-ambient);
}
.comment-form .submit:hover { opacity: .9; }

/* ==========================================================================
   Footer — clon del footer de la landing (App.tsx 1174-1218)
   ========================================================================== */

.site-footer {
  background: var(--color-primary);
  color: rgba(168, 162, 158, .6);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 1280px;
  margin: 0 auto;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

.footer-brand img {
  height: 2rem;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .9;
  margin-bottom: 1rem;
}
.footer-brand p { color: rgba(168, 162, 158, .6); font-size: .875rem; margin: 0; max-width: 16rem; }

.footer-col h3 {
  color: rgba(255, 255, 255, .9);
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .6rem; }
.footer-col a { color: rgba(168, 162, 158, .6); font-size: .875rem; }
.footer-col a:hover { color: var(--color-amber); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  margin-top: 3rem;
  padding-top: 1.5rem;
  text-align: center;
  color: rgba(168, 162, 158, .5);
  font-size: .75rem;
}

/* ==========================================================================
   Utilidades WordPress obligatorias
   ========================================================================== */

.alignleft { float: left; margin: .5em 1.5em 1em 0; }
.alignright { float: right; margin: .5em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1000px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text { text-align: center; color: var(--color-stone); font-size: .8125rem; }
.sticky { /* clase requerida por WP */ }
.bypostauthor { /* clase requerida por WP */ }
.gallery-caption { color: var(--color-stone); font-size: .8125rem; }
