/*
Theme Name: Rubén Cortés — Canela Fina
Theme URI: https://canelafina.com.mx/
Author: Maya Comunicación
Author URI: https://mayacomunicacion.com.mx/
Description: Tema editorial de autor para la columna Canela Fina de Rubén Cortés.
Version: 1.0.3
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ruben-cortes
Tags: blog, news, editorial, one-column, custom-logo, featured-images, translation-ready
*/

:root {
  --rc-paper: #f5f0e8;
  --rc-paper-deep: #ebe3d6;
  --rc-ink: #171717;
  --rc-muted: #6e6a63;
  --rc-rule: #d4cabc;
  --rc-red: #9f201f;
  --rc-red-dark: #741716;
  --rc-white: #fffdf9;
  --rc-shadow: 0 18px 50px rgba(23, 23, 23, .08);
  --rc-serif: "Libre Baskerville", Georgia, serif;
  --rc-sans: "Inter", Arial, sans-serif;
  --rc-content: 1220px;
  --rc-reading: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--rc-paper);
  color: var(--rc-ink);
  font-family: var(--rc-sans);
  font-size: 16px;
  line-height: 1.65;
}

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

a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover, a:focus { color: var(--rc-red); }

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link:focus {
  background: var(--rc-ink);
  color: var(--rc-white);
  clip: auto !important;
  clip-path: none;
  height: auto;
  left: 1rem;
  padding: .75rem 1rem;
  top: 1rem;
  width: auto;
  z-index: 100000;
}

.site-shell { overflow: hidden; }
.site-container { width: min(calc(100% - 3rem), var(--rc-content)); margin-inline: auto; }

.topline {
  border-bottom: 1px solid var(--rc-rule);
  color: var(--rc-muted);
  font-size: .72rem;
  letter-spacing: .14em;
  padding: .7rem 0;
  text-transform: uppercase;
}

.topline-inner { display: flex; justify-content: space-between; gap: 1rem; }
.topline a { text-decoration: none; }

.site-header { border-bottom: 1px solid var(--rc-ink); padding: 1.35rem 0 1rem; }
.masthead { align-items: end; display: flex; justify-content: space-between; gap: 2rem; }
.site-branding { text-decoration: none; }
.site-title { font-family: var(--rc-serif); font-size: clamp(2rem, 5vw, 4.3rem); font-weight: 700; letter-spacing: -.06em; line-height: .95; }
.site-tagline { color: var(--rc-red); font-size: .75rem; font-weight: 800; letter-spacing: .16em; margin-top: .75rem; text-transform: uppercase; }
.custom-logo { max-height: 76px; width: auto; }

.menu-toggle { background: transparent; border: 1px solid var(--rc-ink); color: var(--rc-ink); display: none; font: 700 .72rem var(--rc-sans); letter-spacing: .12em; padding: .65rem .8rem; text-transform: uppercase; }
.primary-navigation { margin-top: 1.6rem; }
.primary-navigation ul { align-items: center; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.primary-navigation a { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.primary-navigation .current-menu-item a, .primary-navigation a:hover { color: var(--rc-red); }

.section-label { align-items: center; color: var(--rc-red); display: flex; font-size: .72rem; font-weight: 800; gap: .7rem; letter-spacing: .18em; margin: 0 0 1.1rem; text-transform: uppercase; }
.section-label::after { background: var(--rc-red); content: ""; height: 1px; width: 52px; }
.section-heading { font-family: var(--rc-serif); font-size: clamp(1.8rem, 4vw, 3.2rem); letter-spacing: -.05em; line-height: 1.05; margin: 0; }

.front-hero { border-bottom: 1px solid var(--rc-ink); padding: clamp(2.5rem, 7vw, 6rem) 0 3rem; }
.hero-grid { align-items: center; display: grid; gap: clamp(2rem, 6vw, 6rem); grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
.hero-copy h1 { font-family: var(--rc-serif); font-size: clamp(2.8rem, 7vw, 6.8rem); letter-spacing: -.07em; line-height: .95; margin: 0 0 1.3rem; max-width: 850px; }
.hero-excerpt { color: #3b3935; font-family: var(--rc-serif); font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.55; max-width: 640px; }
.hero-meta, .post-meta { color: var(--rc-muted); font-size: .73rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.hero-image { background: var(--rc-paper-deep); min-height: 430px; position: relative; }
.hero-image img { height: 100%; min-height: 430px; object-fit: cover; width: 100%; }
.image-placeholder { align-items: center; color: var(--rc-muted); display: flex; font-size: .73rem; font-weight: 800; height: 100%; justify-content: center; letter-spacing: .1em; min-height: 260px; padding: 2rem; text-align: center; text-transform: uppercase; }
.read-link { align-items: center; color: var(--rc-red); display: inline-flex; font-size: .75rem; font-weight: 800; gap: .65rem; letter-spacing: .1em; margin-top: 1.4rem; text-decoration: none; text-transform: uppercase; }
.read-link::after { content: "→"; font-size: 1.15rem; line-height: 0; transition: transform .2s ease; }
.read-link:hover::after { transform: translateX(4px); }

.latest-section, .archive-section, .books-section, .about-strip { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-header { align-items: end; border-bottom: 1px solid var(--rc-rule); display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; padding-bottom: 1rem; }
.section-header .read-link { margin: 0; }
.post-grid { display: grid; gap: 1px; grid-template-columns: repeat(3, 1fr); }
.post-card { border-right: 1px solid var(--rc-rule); padding: 0 1.5rem; }
.post-card:first-child { padding-left: 0; }
.post-card:last-child { border-right: 0; padding-right: 0; }
.post-card-image { background: var(--rc-paper-deep); display: block; margin-bottom: 1.25rem; aspect-ratio: 1.55; overflow: hidden; }
.post-card-image img { height: 100%; object-fit: cover; transition: transform .4s ease; width: 100%; }
.post-card:hover .post-card-image img { transform: scale(1.035); }
.post-card h2 { font-family: var(--rc-serif); font-size: clamp(1.25rem, 2vw, 1.8rem); letter-spacing: -.04em; line-height: 1.2; margin: .55rem 0 .8rem; }
.post-card h2 a { text-decoration: none; }
.post-card-excerpt { color: #4d4943; font-size: .95rem; line-height: 1.55; }

.about-strip { background: var(--rc-ink); color: var(--rc-white); }
.about-grid { align-items: center; display: grid; gap: 3rem; grid-template-columns: 1fr 1fr; }
.about-strip .section-label { color: #dc918b; }
.about-strip .section-label::after { background: #dc918b; }
.about-strip h2 { font-family: var(--rc-serif); font-size: clamp(2rem, 4vw, 4.3rem); letter-spacing: -.06em; line-height: 1.08; margin: 0; }
.about-strip p { color: #d8d2c8; font-family: var(--rc-serif); font-size: 1.15rem; line-height: 1.6; }
.about-strip .read-link { color: #dc918b; }

.topic-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; list-style: none; margin: 0; padding: 0; }
.topic-list a { border: 1px solid var(--rc-rule); display: block; font-family: var(--rc-serif); font-size: 1.2rem; padding: 1.25rem; text-decoration: none; transition: background .2s ease, color .2s ease; }
.topic-list a:hover { background: var(--rc-red); border-color: var(--rc-red); color: var(--rc-white); }

.books-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(4, 1fr); }
.book-card { border-top: 2px solid var(--rc-ink); padding-top: 1rem; }
.book-card h3 { font-family: var(--rc-serif); font-size: 1.25rem; line-height: 1.15; margin: 0 0 .5rem; }
.book-card p { color: var(--rc-muted); font-size: .88rem; margin: 0; }

.newsletter-cta { background: var(--rc-red); color: var(--rc-white); padding: 2rem; }
.newsletter-cta h2 { font-family: var(--rc-serif); font-size: clamp(1.6rem, 3vw, 2.5rem); letter-spacing: -.04em; line-height: 1.05; margin: 0 0 .8rem; }
.newsletter-cta p { color: #f4d9d5; margin: 0 0 1.1rem; }
.newsletter-cta .read-link { color: var(--rc-white); }

.page-main { padding: clamp(3rem, 6vw, 5rem) 0; }
.page-header { border-bottom: 1px solid var(--rc-ink); margin-bottom: 2.5rem; padding-bottom: 1.35rem; }
.page-title { font-family: var(--rc-serif); font-size: clamp(2.6rem, 6vw, 5.5rem); letter-spacing: -.07em; line-height: .98; margin: 0; }
.page-description { color: var(--rc-muted); font-family: var(--rc-serif); font-size: 1.15rem; max-width: 700px; }
.archive-grid { display: grid; gap: 2.3rem 1.5rem; grid-template-columns: repeat(3, 1fr); }
.archive-grid .post-card { border: 0; padding: 0; }
.pagination { border-top: 1px solid var(--rc-rule); display: flex; justify-content: space-between; margin-top: 3rem; padding-top: 1rem; }
.pagination a, .pagination span { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }

.single-header { margin: 0 auto 2.5rem; max-width: 980px; text-align: center; }
.single-header .post-meta { justify-content: center; }
.single-title { font-family: var(--rc-serif); font-size: clamp(2.5rem, 6vw, 6.5rem); letter-spacing: -.07em; line-height: .98; margin: 1rem 0 1.25rem; }
.single-dek { color: #4d4943; font-family: var(--rc-serif); font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.5; margin: 0 auto; max-width: 760px; }
.single-featured { margin: 0 auto 3rem; max-width: 1120px; }
.single-featured img { margin: 0 auto; max-height: 680px; object-fit: cover; width: 100%; }
.entry-content { font-family: var(--rc-serif); font-size: 1.12rem; line-height: 1.85; margin-inline: auto; max-width: var(--rc-reading); }
.entry-content h2, .entry-content h3 { font-family: var(--rc-sans); letter-spacing: -.03em; line-height: 1.2; margin-top: 2.5rem; }
.entry-content blockquote { border-left: 3px solid var(--rc-red); color: var(--rc-red-dark); font-size: 1.45rem; font-style: italic; margin: 2rem 0; padding: .5rem 0 .5rem 1.5rem; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption { color: var(--rc-muted); font: .75rem/1.4 var(--rc-sans); margin-top: .5rem; }
.post-footer { border-top: 1px solid var(--rc-rule); margin: 3rem auto 0; max-width: var(--rc-reading); padding-top: 1.25rem; }
.share-links { align-items: center; display: flex; flex-wrap: wrap; gap: .8rem; }
.share-links a { border: 1px solid var(--rc-rule); font-size: .7rem; font-weight: 800; letter-spacing: .08em; padding: .55rem .7rem; text-decoration: none; text-transform: uppercase; }
.related-posts { border-top: 1px solid var(--rc-ink); margin-top: 5rem; padding-top: 1.4rem; }
.related-posts .post-grid { margin-top: 1.5rem; }

.site-footer { background: var(--rc-paper-deep); border-top: 1px solid var(--rc-ink); padding: 2.6rem 0 1.4rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.2fr .8fr .8fr; }
.footer-brand { font-family: var(--rc-serif); font-size: 2rem; letter-spacing: -.06em; line-height: 1; }
.footer-copy { color: var(--rc-muted); font-size: .9rem; max-width: 380px; }
.footer-title { font-size: .72rem; font-weight: 800; letter-spacing: .12em; margin: 0 0 .75rem; text-transform: uppercase; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: .35rem 0; }
.footer-links a { font-size: .9rem; text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--rc-rule); color: var(--rc-muted); display: flex; font-size: .72rem; justify-content: space-between; margin-top: 2rem; padding-top: 1rem; }

.no-results { border: 1px solid var(--rc-rule); padding: 2rem; }
.search-form { display: flex; gap: .5rem; margin-top: 1.5rem; max-width: 600px; }
.search-field { background: var(--rc-white); border: 1px solid var(--rc-rule); flex: 1; font: inherit; padding: .8rem 1rem; }
.search-submit { background: var(--rc-ink); border: 0; color: var(--rc-white); cursor: pointer; font: 800 .72rem var(--rc-sans); letter-spacing: .08em; padding: .8rem 1rem; text-transform: uppercase; }

@media (max-width: 900px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .hero-image { min-height: 360px; }
  .hero-image img { min-height: 360px; }
  .post-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
  .post-card, .post-card:first-child, .post-card:last-child { border-right: 0; padding: 0; }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-container { width: min(calc(100% - 2rem), var(--rc-content)); }
  .topline-inner { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .masthead { align-items: center; }
  .menu-toggle { display: block; }
  .primary-navigation { display: none; margin-top: 1.2rem; }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .post-grid, .archive-grid, .books-grid, .topic-list, .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: .4rem; }
  .hero-image, .hero-image img { min-height: 260px; }
  .section-header { align-items: flex-start; flex-direction: column; }
}
