/*
Theme Name: Adolfo Carreno
Theme URI: https://adolfocarreno.com
Author: Adolfo Carreno
Author URI: https://adolfocarreno.com
Description: A lean, modern, minimalistic editorial blog theme inspired by the clean visual style of Bloomberg and the New York Times. Features serif typography, restrained color palette, and professional grid layouts.
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: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-chronicle
Tags: blog, news, editorial, one-column, two-columns, custom-menu, featured-images, translation-ready
*/

/* ─── VARIABLES ─── */
:root {
  --ink: #0a0a0a;
  --paper: #fafaf8;
  --grey-100: #f2f2f0;
  --grey-200: #e4e4e0;
  --grey-300: #c8c8c4;
  --grey-500: #7a7a76;
  --grey-600: #5a5a56;
  --accent: #c0272d;
  --accent-dark: #9a1f24;
  --serif-display: 'Playfair Display', Georgia, serif;
  --serif-body: 'Source Serif 4', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
  --max-width: 1280px;
  --content-width: 720px;
  --gutter: 24px;
  --rule: 1px solid var(--grey-200);
  --rule-dark: 2px solid var(--ink);
}

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ─── UTILITY ─── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── HEADER ─── */
.site-header {
  border-bottom: var(--rule-dark);
  padding: 1rem 0;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: var(--rule);
  margin-bottom: 0.75rem;
}
.header-date {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-500);
}
.masthead { text-align: center; padding: 0.25rem 0; }
.masthead h1,
.masthead .site-title {
  font-family: var(--serif-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.masthead .site-title a { text-decoration: none; color: inherit; }
.masthead .tagline,
.masthead .site-description {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-500);
  margin-top: 4px;
}

/* ─── NAV ─── */
.site-nav {
  border-top: var(--rule);
  border-bottom: var(--rule);
  padding: 0.6rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.site-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-nav ul ul { display: none; }
.site-nav li { position: relative; }
.site-nav a {
  position: relative;
  padding: 2px 0;
  transition: color 0.2s;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a:hover::after { width: 100%; }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a { color: var(--accent); }

/* Nav Search */
.nav-container {
  display: flex;
  align-items: center;
  position: relative;
}
.nav-container > ul {
  flex: 1;
  display: flex;
  justify-content: center;
}
.nav-search {
  display: flex;
  align-items: center;
  position: absolute;
  right: 0;
  border: 1px solid var(--grey-200);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.nav-search:focus-within { border-color: var(--grey-500); }
.nav-search-field {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 0.76rem;
  padding: 5px 10px;
  width: 160px;
  color: var(--ink);
}
.nav-search-field::placeholder { color: var(--grey-300); }
.nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--grey-500);
  padding: 5px 8px;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-search-btn:hover { color: var(--ink); }

/* ─── CATEGORY LABEL ─── */
.category-label {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.category-label a { color: var(--accent); }
.category-label a:hover { color: var(--accent-dark); }

/* ─── SECTION HEADER ─── */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-top: 2rem;
}
.section-header h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.section-header::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--ink);
}

/* ─── HERO / FEATURED ─── */
.hero {
  padding: 2.5rem 0 2rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}
.hero-main .category-label { margin-bottom: 0.75rem; font-size: 0.68rem; }
.hero-main h2 {
  font-family: var(--serif-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}
.hero-main h2 a:hover { color: var(--accent-dark); }
.hero-main .hero-excerpt {
  font-family: var(--serif-body);
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--grey-600);
  margin-bottom: 1rem;
}
.hero-image {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--grey-200);
  overflow: hidden;
  margin-top: 0.5rem;
  position: relative;
}
.hero-image img { display: block; width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.hero-sidebar {
  border-left: var(--rule);
  padding-left: 2rem;
}
.hero-sidebar .sidebar-item {
  padding: 1.25rem 0;
  border-bottom: var(--rule);
}
.hero-sidebar .sidebar-item:first-child { padding-top: 0; }
.hero-sidebar .sidebar-item:last-child { border-bottom: none; }
.hero-sidebar h3 {
  font-family: var(--serif-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-sidebar h3 a:hover { color: var(--accent-dark); }

.byline {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--grey-500);
}
.byline .author { font-weight: 600; color: var(--ink); }

.meta {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--grey-500);
}

/* ─── HERO AD WIDGET ─── */
.hero-ad-widget {
  margin-top: 0.5rem;
}
.hero-ad-widget img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── POST GRID ─── */
.posts-section {
  padding-bottom: 2rem;
  border-bottom: var(--rule);
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.post-card .card-image {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--grey-200);
  overflow: hidden;
  margin-bottom: 0.85rem;
  position: relative;
}
.post-card .card-image img {
  display: block;
  width: 100%; height: 100%; object-fit: cover;
  position: absolute;
  top: 0; left: 0;
  transition: transform 0.4s ease;
}
.post-card:hover .card-image img { transform: scale(1.03); }
.post-card h3 {
  font-family: var(--serif-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.post-card h3 a:hover { color: var(--accent-dark); }
.post-card .card-excerpt {
  font-family: var(--serif-body);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--grey-600);
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: calc(1.55em * 3);
}
.post-card .meta .author { font-weight: 600; color: var(--ink); }

/* ─── LONGFORM SECTION ─── */
.longform-section { padding: 2rem 0; }

/* ─── SINGLE POST ─── */

/* WordPress Block Alignments */
.post-body .aligncenter {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center;
}
.post-body .aligncenter img {
  margin-left: auto;
  margin-right: auto;
}
.post-body .wp-block-image {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.post-body .wp-block-image img {
  display: inline-block;
  height: auto;
}
.post-body .wp-block-image.aligncenter,
.post-body .wp-block-image.is-style-default,
.post-body figure.wp-block-image:not(.alignleft):not(.alignright) {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: auto !important;
  margin-right: auto !important;
}
.post-body .alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}
.post-body .alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
.post-body .wp-block-image figcaption {
  text-align: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--grey-500);
  margin-top: 0.35rem;
}
.post-body .is-style-rounded img {
  border-radius: 50%;
}
.post-body .has-text-align-center {
  text-align: center;
}
.single-post-content { padding: 2.5rem 0 3rem; }
.single-post-content .post-header {
  max-width: var(--content-width);
  margin: 0 auto 2rem;
  text-align: center;
}
.single-post-content .post-header .category-label {
  font-size: 0.68rem;
  margin-bottom: 0.75rem;
}
.single-post-content .post-header h1 {
  font-family: var(--serif-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.single-post-content .post-header .deck {
  font-family: var(--serif-body);
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--grey-600);
  max-width: 580px;
  margin: 0 auto 1.25rem;
}
.single-post-content .post-header .post-meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--grey-500);
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.single-post-content .post-header .post-meta .author { font-weight: 600; color: var(--ink); }
.single-post-content .featured-image {
  max-width: var(--content-width);
  margin: 0 auto 0.5rem;
  background: var(--grey-200);
  overflow: hidden;
}
.single-post-content .featured-image img { width: 100%; height: auto; display: block; }
.single-post-content .image-caption {
  max-width: var(--content-width);
  margin: 0 auto 2.5rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--grey-500);
  padding-top: 0.35rem;
}
.single-post-content .post-body {
  max-width: var(--content-width);
  margin: 0 auto;
}
.single-post-content .post-body p {
  font-family: var(--serif-body);
  font-size: 1.12rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  color: #1a1a1a;
}
.single-post-content .post-body > p:first-child::first-letter {
  font-family: var(--serif-display);
  font-size: 4.2rem;
  float: left;
  line-height: 0.8;
  margin: 0.06em 0.12em 0 0;
  font-weight: 900;
  color: var(--ink);
}
.single-post-content .post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
}
.single-post-content .post-body blockquote p {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--grey-600);
}
.single-post-content .post-body h2 {
  font-family: var(--serif-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  line-height: 1.25;
}
.single-post-content .post-body h3 {
  font-family: var(--serif-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}
.single-post-content .post-body ul,
.single-post-content .post-body ol {
  font-family: var(--serif-body);
  font-size: 1.12rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: #1a1a1a;
}
.single-post-content .post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.single-post-content .post-body a:hover { color: var(--accent-dark); }
.single-post-content .post-body figure {
  margin: 2rem 0;
}
.single-post-content .post-body figcaption {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--grey-500);
  margin-top: 0.35rem;
}

/* ─── POST NAVIGATION ─── */
.post-navigation {
  max-width: var(--content-width);
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: var(--rule-dark);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}
.post-navigation a {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey-500);
  transition: color 0.2s;
}
.post-navigation a:hover { color: var(--accent); }
.post-navigation .nav-title {
  display: block;
  font-family: var(--serif-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin-top: 0.35rem;
  line-height: 1.3;
}

/* ─── ARCHIVE / CATEGORY PAGES ─── */
.archive-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: var(--rule-dark);
  margin-bottom: 2rem;
}
.archive-header h1 {
  font-family: var(--serif-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1.15;
}
.archive-header .archive-description {
  font-family: var(--serif-body);
  font-size: 1rem;
  color: var(--grey-600);
  margin-top: 0.5rem;
  max-width: 600px;
}

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: var(--rule);
  transition: all 0.15s;
}
.pagination .page-numbers.current {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pagination .page-numbers:hover:not(.current) {
  border-color: var(--ink);
}

/* ─── 404 ─── */
.error-404 {
  text-align: center;
  padding: 5rem 0;
}
.error-404 h1 {
  font-family: var(--serif-display);
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 1rem;
}
.error-404 p {
  font-family: var(--serif-body);
  font-size: 1.1rem;
  color: var(--grey-600);
  margin-bottom: 2rem;
}
.error-404 .search-form { max-width: 400px; margin: 0 auto; }

/* ─── SEARCH FORM ─── */
.search-form {
  display: flex;
  gap: 0;
}
.search-form .search-field {
  flex: 1;
  border: var(--rule);
  border-right: none;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 0.88rem;
  background: #fff;
  outline: none;
}
.search-form .search-field:focus { border-color: var(--ink); }
.search-form .search-submit {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 8px 20px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ─── FOOTER ─── */
.site-footer {
  border-top: var(--rule-dark);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand h3 {
  font-family: var(--serif-display);
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}
.footer-brand p {
  font-size: 0.82rem;
  color: var(--grey-500);
  line-height: 1.5;
  max-width: 320px;
}
.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a {
  font-size: 0.82rem;
  color: var(--grey-600);
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: var(--rule);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--grey-500);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-bottom .social-links { display: flex; gap: 1rem; }
.footer-bottom .social-links a:hover { color: var(--ink); }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease-out both; }
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.12s; }
.fade-up:nth-child(3) { animation-delay: 0.19s; }
.fade-up:nth-child(4) { animation-delay: 0.26s; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-sidebar {
    border-left: none; padding-left: 0;
    border-top: var(--rule); padding-top: 1.5rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  }
  .hero-sidebar .sidebar-item { padding: 0; border-bottom: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
@media (max-width: 768px) {
  .posts-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .site-nav ul { justify-content: flex-start; padding: 0 0.5rem; }
  .post-navigation { flex-direction: column; }
  .nav-search { display: none; }
}
