/*
Theme Name: Consejero Editorial
Theme URI: https://consejero.org/
Author: Con Tu Consejo
Description: Tema editorial para la biblioteca de recursos de Consejero.org.
Version: 1.2.0
Text Domain: consejero-editorial
*/

:root {
  --ink: #222831;
  --charcoal: #393e46;
  --slate: #6b6e74;
  --gold: #ffd369;
  --paper: #eeeeee;
  --white: #ffffff;
  --line: rgba(34, 40, 49, .14);
  --muted: #646870;
  --max: 1180px;
  --reading: 760px;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(34, 40, 49, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f8f8f7;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #101318; }
.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 248, 247, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.admin-bar .site-header { top: 32px; }
.header-inner { min-height: 82px; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 42px; height: 42px; border-radius: 50% 50% 50% 12px; background: var(--gold); position: relative; flex: 0 0 auto; }
.brand-mark::after { content: ""; position: absolute; inset: 10px; border: 3px solid var(--ink); border-radius: 50%; }
.brand-name { font-weight: 850; letter-spacing: -.045em; font-size: 1.42rem; line-height: 1; }
.brand-note { display: block; margin-top: 4px; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.nav-menu { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-menu a { text-decoration: none; font-size: .86rem; font-weight: 750; letter-spacing: .02em; }
.nav-menu a:hover { color: var(--slate); }
.header-action { display: inline-flex; align-items: center; min-height: 43px; padding: 0 18px; border-radius: 999px; background: var(--ink); color: white; text-decoration: none; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.header-action:hover { background: var(--gold); color: var(--ink); }
.nav-toggle { display: none; border: 0; background: transparent; padding: 8px; color: var(--ink); font: inherit; font-weight: 800; }

.hero { padding: 48px 0 28px; }
.hero-grid { display: grid; grid-template-columns: .92fr 1.08fr; min-height: 430px; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--white); box-shadow: 0 20px 60px rgba(34, 40, 49, .08); }
.hero-copy { padding: clamp(38px, 5vw, 64px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; color: var(--ink); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 19px; color: var(--slate); font-size: .74rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hero .eyebrow { color: var(--slate); }
.eyebrow::before { content: ""; width: 28px; height: 3px; background: currentColor; border-radius: 9px; }
.hero-title { margin: 0; max-width: 650px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.65rem, 4.2vw, 4.15rem); font-weight: 600; line-height: 1.01; letter-spacing: -.045em; text-wrap: balance; }
.hero-excerpt { margin: 22px 0 27px; max-width: 540px; color: var(--muted); font-size: .98rem; line-height: 1.65; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 51px; padding: 0 24px; border-radius: 999px; background: var(--gold); color: var(--ink); text-decoration: none; font-weight: 850; font-size: .82rem; letter-spacing: .045em; text-transform: uppercase; transition: transform .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); background: #ffe29b; }
.button-dark { background: var(--ink); color: white; }
.button-outline { background: transparent; border: 1px solid var(--line); }
.hero-media { min-height: 100%; position: relative; order: -1; background: var(--paper); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(32%); }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(34,40,49,.12), transparent 48%), linear-gradient(135deg, rgba(255,211,105,.16), transparent 48%); }

.mission-strip { padding: 30px 0 64px; }
.mission-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; padding: 26px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.mission-number { font-family: Georgia, serif; font-size: 2.1rem; font-weight: 700; letter-spacing: -.04em; }
.mission-text { margin: 0; max-width: 720px; color: var(--muted); font-size: .95rem; }
.text-link { font-weight: 850; text-decoration-color: var(--gold); text-decoration-thickness: 4px; }

.section { padding: 78px 0; }
.section-soft { background: var(--paper); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.section-heading h2 { margin: 0; max-width: 700px; font-family: Georgia, serif; font-size: clamp(2.2rem, 4vw, 4.1rem); line-height: 1.03; letter-spacing: -.045em; }
.section-heading p { margin: 0 0 7px; max-width: 440px; color: var(--muted); font-size: .94rem; }

.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.topic-card { min-height: 150px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 18px; background: var(--white); border: 1px solid transparent; text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
.topic-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.topic-card:nth-child(4n+1) { background: var(--ink); color: white; }
.topic-card:nth-child(4n+2) { background: var(--gold); }
.topic-name { font-size: 1.08rem; font-weight: 850; letter-spacing: -.025em; }
.topic-count { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; opacity: .72; }

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 22px; }
.post-card { display: flex; flex-direction: column; min-width: 0; }
.post-card-image { display: block; aspect-ratio: 16/10; overflow: hidden; border-radius: 18px; background: #d9d9d9; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, filter .3s ease; }
.post-card:hover img { transform: scale(1.035); filter: grayscale(25%); }
.post-card-body { padding: 20px 5px 4px; }
.post-meta { margin: 0 0 10px; color: var(--slate); font-size: .7rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.post-card h3 { margin: 0; font-family: Georgia, serif; font-size: 1.48rem; line-height: 1.15; letter-spacing: -.03em; }
.post-card h3 a { text-decoration: none; }
.post-card p { margin: 13px 0 0; color: var(--muted); font-size: .89rem; line-height: 1.58; }
.posts-grid .post-card:first-child { grid-column: span 2; }
.posts-grid .post-card:first-child .post-card-image { aspect-ratio: 16/7.6; }
.posts-grid .post-card:first-child h3 { font-size: clamp(1.7rem, 3vw, 2.65rem); }

.ctc-banner { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr .7fr; border-radius: 30px; background: var(--gold); }
.ctc-copy { padding: clamp(42px, 7vw, 78px); }
.ctc-copy h2 { margin: 0; max-width: 660px; font-family: Georgia, serif; font-size: clamp(2.4rem, 4.5vw, 4.6rem); line-height: 1; letter-spacing: -.05em; }
.ctc-copy p { max-width: 690px; margin: 25px 0 30px; }
.ctc-side { display: grid; place-items: center; min-height: 360px; background: var(--ink); color: white; }
.ctc-monogram { width: 185px; height: 185px; border: 5px solid var(--gold); border-radius: 50%; display: grid; place-items: center; font-size: 2.8rem; font-weight: 900; letter-spacing: -.08em; }

.archive-hero { padding: 76px 0 44px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,211,105,.10), transparent 72%); }
.archive-hero h1 { margin: 0; max-width: 880px; font-family: Georgia, serif; font-size: clamp(3rem, 6vw, 5.65rem); line-height: .98; letter-spacing: -.052em; }
.archive-hero p { max-width: 720px; margin: 22px 0 0; color: var(--muted); }
.archive-content { padding: 56px 0 90px; }
.archive-summary { margin: 0 0 28px; color: var(--muted); font-size: .86rem; text-transform: uppercase; letter-spacing: .08em; }
.archive-summary strong { color: var(--ink); font-size: 1.05rem; }
.category-filter { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.category-chip { display: inline-flex; min-height: 40px; align-items: center; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--charcoal); text-decoration: none; font-size: .78rem; font-weight: 750; }
.category-chip:hover, .category-chip.is-current { background: var(--ink); border-color: var(--ink); color: var(--white); }

.single-header { padding: 76px 0 42px; text-align: center; }
.single-header .eyebrow { justify-content: center; }
.single-title { margin: 0 auto; max-width: 960px; font-family: Georgia, serif; font-size: clamp(2.8rem, 5.4vw, 5.15rem); font-weight: 600; line-height: 1; letter-spacing: -.052em; text-wrap: balance; }
.single-meta { margin: 23px 0 0; color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.single-meta span { margin-inline: 7px; color: var(--gold); }
.article-rule { width: min(calc(100% - 40px), 900px); height: 1px; margin: 0 auto 52px; background: linear-gradient(90deg, transparent, var(--line) 16%, var(--gold) 50%, var(--line) 84%, transparent); }
.single-cover { width: min(calc(100% - 40px), var(--max)); margin: 0 auto 58px; max-height: 700px; overflow: hidden; border-radius: 28px; background: var(--paper); }
.single-cover img { width: 100%; max-height: 700px; object-fit: cover; }
.entry-content { width: min(calc(100% - 40px), var(--reading)); margin: 0 auto; padding-bottom: 80px; font-family: Georgia, "Times New Roman", serif; font-size: 1.16rem; line-height: 1.82; }
.entry-content > * { margin-top: 0; margin-bottom: 1.45em; }
.entry-content p:empty, .entry-content div[type="empty-line"] { display: none; }
.entry-content iframe { width: 100%; max-width: 100%; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--ink); font-family: Inter, ui-sans-serif, sans-serif; line-height: 1.13; letter-spacing: -.035em; margin-top: 2.2em; }
.entry-content h2 { font-size: 2rem; }
.entry-content h3 { font-size: 1.5rem; }
.entry-content blockquote { margin: 2em 0; padding: 10px 0 10px 26px; border-left: 5px solid var(--gold); color: var(--charcoal); font-size: 1.28rem; }
.entry-content figure { margin: 2.2em 0; }
.entry-content figure img, .entry-content > img { margin-inline: auto; border-radius: 14px; }
.entry-content a { text-decoration-color: var(--gold); text-decoration-thickness: 3px; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-footer { width: min(calc(100% - 40px), var(--reading)); margin: 0 auto 70px; padding-top: 26px; border-top: 1px solid var(--line); }
.entry-footer a { font-weight: 800; }
.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 34px; }
.post-navigation div:last-child { text-align: right; }
.post-navigation a { display: inline-flex; flex-direction: column; max-width: 290px; text-decoration: none; font-family: Georgia, serif; font-size: 1.05rem; line-height: 1.25; }
.post-navigation span { margin-bottom: 6px; color: var(--slate); font-family: Inter, sans-serif; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.related-section { padding: 68px 0 88px; background: var(--paper); }
.compact-heading h2 { font-size: clamp(2.1rem, 4vw, 3.7rem); }
.related-grid .post-card:first-child { grid-column: auto; }
.related-grid .post-card:first-child .post-card-image { aspect-ratio: 16/10; }
.related-grid .post-card:first-child h3 { font-size: 1.48rem; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 52px; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 13px; display: inline-grid; place-items: center; border-radius: 999px; background: white; border: 1px solid var(--line); text-decoration: none; font-weight: 750; }
.pagination .current { background: var(--ink); color: white; }
.empty-state { padding: 60px 0; text-align: center; }
.empty-state h2 { font-family: Georgia, serif; font-size: 2.2rem; }
.search-form { display: flex; gap: 10px; max-width: 620px; margin: 28px 0 0; }
.search-form label { flex: 1; }
.search-field { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 999px; background: white; padding: 0 20px; font: inherit; }
.search-submit { border: 0; cursor: pointer; }

.site-footer { background: var(--ink); color: white; }
.footer-main { padding: 70px 0 48px; display: grid; grid-template-columns: 1.2fr .6fr .6fr; gap: 50px; }
.footer-brand { max-width: 500px; }
.footer-brand .brand { color: white; }
.footer-brand p { margin: 22px 0 0; color: #c6c9ce; }
.footer-heading { color: var(--gold); font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 850; }
.footer-links { list-style: none; margin: 17px 0 0; padding: 0; }
.footer-links li { margin: 8px 0; }
.footer-links a { color: #e8e8e8; text-decoration: none; font-size: .9rem; }
.footer-bottom { padding: 22px 0 28px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(255,255,255,.12); color: #aeb2b8; font-size: .76rem; }

@media (max-width: 920px) {
  .admin-bar .site-header { top: 46px; }
  .nav-toggle { display: block; }
  .primary-nav { display: none; position: absolute; top: 82px; left: 0; right: 0; padding: 18px 20px 24px; background: #f8f8f7; border-bottom: 1px solid var(--line); }
  .primary-nav.is-open { display: block; }
  .nav-menu { align-items: stretch; flex-direction: column; gap: 6px; }
  .nav-menu a { display: block; padding: 10px 0; }
  .header-action { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { min-height: auto; }
  .hero-media { min-height: 360px; aspect-ratio: 16 / 9; }
  .hero-media::after { background: linear-gradient(0deg, rgba(34,40,49,.16), transparent 48%); }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .ctc-banner { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { width: min(calc(100% - 26px), var(--max)); }
  .header-inner { min-height: 68px; gap: 16px; }
  .primary-nav { top: 68px; }
  .brand { gap: 10px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-mark::after { inset: 9px; border-width: 2.5px; }
  .brand-name { font-size: 1.32rem; }
  .brand-note { display: none; }
  .nav-toggle { min-width: 48px; min-height: 48px; padding: 0; font-size: .93rem; }
  .nav-menu a { min-height: 44px; display: flex; align-items: center; }
  .hero { padding: 14px 0 22px; }
  .hero-grid { border-radius: 18px; }
  .hero-copy { min-height: auto; padding: 28px 22px 30px; }
  .hero .eyebrow { margin-bottom: 14px; font-size: .68rem; }
  .hero-title { max-width: 100%; font-size: clamp(2.15rem, 10.8vw, 3rem); line-height: 1.02; letter-spacing: -.04em; overflow-wrap: break-word; }
  .hero-excerpt { display: -webkit-box; margin: 17px 0 22px; font-size: .93rem; line-height: 1.55; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .hero .button { width: 100%; }
  .hero-media { min-height: 0; aspect-ratio: 16 / 10; }
  .button { min-height: 48px; padding-inline: 21px; }
  .mission-strip { padding: 10px 0 48px; }
  .mission-inner { padding: 23px 21px; }
  .mission-inner { grid-template-columns: 1fr; gap: 10px; }
  .mission-inner .text-link { margin-top: 6px; }
  .section { padding: 58px 0; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 14px; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 130px; padding: 18px; }
  .posts-grid { grid-template-columns: 1fr; }
  .posts-grid .post-card:first-child { grid-column: auto; }
  .posts-grid .post-card:first-child .post-card-image { aspect-ratio: 16/10; }
  .ctc-side { min-height: 260px; }
  .ctc-copy { padding: 34px 24px 38px; }
  .ctc-copy h2 { font-size: clamp(2.15rem, 10.5vw, 3.2rem); }
  .archive-hero { padding: 52px 0 34px; }
  .archive-hero h1 { font-size: clamp(2.65rem, 12vw, 3.7rem); }
  .archive-hero .search-form { display: grid; }
  .archive-hero .search-submit { width: 100%; }
  .category-filter { flex-wrap: nowrap; margin-right: -13px; padding-right: 13px; overflow-x: auto; scrollbar-width: none; }
  .category-filter::-webkit-scrollbar { display: none; }
  .category-chip { white-space: nowrap; }
  .single-header { padding-top: 54px; }
  .single-title { font-size: clamp(2.25rem, 11vw, 3.35rem); line-height: 1.02; overflow-wrap: break-word; }
  .single-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 8px; }
  .single-meta span { margin: 0; }
  .article-rule { width: calc(100% - 44px); margin-bottom: 38px; }
  .single-cover { width: calc(100% - 26px); margin-bottom: 38px; border-radius: 18px; }
  .entry-content { width: calc(100% - 34px); font-size: 1.06rem; }
  .post-navigation { grid-template-columns: 1fr; }
  .post-navigation div:last-child { text-align: left; }
  .footer-main { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
}
