/* ============================================================
   RITMO CARTAGENA — Blog Styles
   ============================================================ */

/* --- CSS Custom Properties (from design-system.css) --- */
:root {
  --color-primary: #FF2236;
  --color-primary-light: #FF4D5E;
  --color-primary-dark: #D91A2B;
  --color-secondary: #C87E22;
  --color-secondary-light: #EBA92C;
  --color-cta: #C87E22;
  --color-cta-hover: #A86A1B;
  --color-cta-light: #EBA92C;
  --color-accent: #EBA92C;
  --color-sand: #EBDEC5;
  --color-sand-light: #F5F0E3;
  --color-bg: #FFFDF8;
  --color-bg-warm: #F5F0E3;
  --color-bg-section: #EBDEC5;
  --color-text: #2C1810;
  --color-text-muted: #6B5744;
  --color-text-light: #8C7A68;
  --color-white: #FFFFFF;
  --color-border: #DDD2BD;
  --color-border-light: #EBDEC5;

  --font-heading: 'Cormorant', Georgia, 'Times New Roman', serif;
  --font-body: 'Montserrat', 'Segoe UI', Tahoma, sans-serif;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.875rem + 0.3vw, 1rem);
  --text-lg: clamp(1.0625rem, 0.95rem + 0.5vw, 1.125rem);
  --text-xl: clamp(1.1875rem, 1rem + 0.75vw, 1.3125rem);
  --text-2xl: clamp(1.4375rem, 1.15rem + 1.2vw, 1.6875rem);
  --text-3xl: clamp(1.75rem, 1.35rem + 1.7vw, 2.125rem);
  --text-4xl: clamp(2.125rem, 1.5rem + 2.5vw, 2.8125rem);
  --text-5xl: clamp(2.625rem, 1.75rem + 3.5vw, 3.75rem);

  --weight-light: 300;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;
  --tracking-widest: 0.2em;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  --max-width: 1280px;
  --max-width-narrow: 960px;
  --max-width-text: 720px;
  --nav-height: 80px;
  --border-radius: 8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 8px 30px rgba(44, 24, 16, 0.1);
  --shadow-xl: 0 16px 50px rgba(44, 24, 16, 0.12);
  --shadow-gold: 0 4px 20px rgba(200, 126, 34, 0.25);

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* --- Base Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-primary);
}
h1 { font-size: var(--text-5xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-md); max-width: 70ch; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-cta);
  margin-bottom: var(--space-sm);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
.container-narrow { max-width: var(--max-width-narrow); }

.section { padding: var(--space-5xl) 0; }
.section-sm { padding: var(--space-3xl) 0; }

/* --- Grid --- */
.grid { display: grid; gap: var(--space-xl); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.875rem 2rem;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 48px;
}
.btn-primary {
  background: var(--color-cta);
  color: var(--color-white);
  border-color: var(--color-cta);
}
.btn-primary:hover {
  background: var(--color-cta-hover);
  color: var(--color-white);
  border-color: var(--color-cta-hover);
  box-shadow: var(--shadow-gold);
}
.btn-outline-dark {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline-dark:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* --- Card --- */
.card {
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card-body { padding: var(--space-lg); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: 0 var(--space-xl);
  transition: all var(--transition-slow);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.nav-logo img {
  height: 30px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: color var(--transition-fast);
}
.nav-links a:hover { color: var(--color-cta); }

.nav-cta {
  padding: 0.625rem 1.5rem !important;
  background: var(--color-cta) !important;
  color: var(--color-white) !important;
  border-radius: var(--border-radius) !important;
  font-weight: var(--weight-semibold) !important;
  text-transform: uppercase !important;
  letter-spacing: var(--tracking-wide) !important;
  font-size: var(--text-xs) !important;
  transition: all var(--transition-base) !important;
}
.nav-cta:hover {
  background: var(--color-cta-hover) !important;
  box-shadow: var(--shadow-gold) !important;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--transition-base);
}

@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(var(--nav-height) + 0.5rem);
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: var(--space-xl);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { color: var(--color-text) !important; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--color-sand);
  color: var(--color-text);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand .nav-logo {
  display: inline-flex;
  margin-bottom: var(--space-md);
}
.footer .nav-logo img {
  height: 25px;
  filter: none;
}
.footer-brand p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
  max-width: 300px;
}

.footer-col h5 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: #124720;
  margin-bottom: var(--space-lg);
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.footer-col a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.footer-col a:hover { color: var(--color-primary); }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  margin: 0;
}

.footer-legal {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.footer-legal a {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.footer-legal a:hover { color: var(--color-primary); }
.footer-legal span {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  opacity: 0.5;
}

.footer-social {
  display: flex;
  gap: var(--space-md);
}
.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition-base);
}
.footer-social a:hover {
  border-color: #124720;
  color: #124720;
  background: rgba(18, 71, 32, 0.08);
}
.footer-social svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   BLOG ARCHIVE (home.php)
   ============================================================ */
.blog-hero {
  padding-top: calc(var(--nav-height) + var(--space-4xl));
  padding-bottom: var(--space-3xl);
  text-align: center;
  background: var(--color-bg);
}
.blog-hero h1 {
  margin-bottom: var(--space-md);
}
.blog-hero p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.blog-hero .divider-gold {
  width: 60px;
  height: 2px;
  background: var(--color-cta);
  margin: var(--space-md) auto var(--space-lg);
}

/* Post card */
.post-card {
  display: flex;
  flex-direction: column;
}
.post-card a {
  text-decoration: none;
  color: inherit;
}

.post-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

.post-card-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-sand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: var(--text-3xl);
}

.post-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-category {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-cta);
  margin-bottom: var(--space-sm);
}

.post-card h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
  transition: color var(--transition-fast);
}
.post-card:hover h3 { color: var(--color-cta); }

.post-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-lg);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

.post-card-meta span.sep {
  opacity: 0.4;
}

/* No posts */
.no-posts {
  text-align: center;
  padding: var(--space-4xl) 0;
}
.no-posts h2 { margin-bottom: var(--space-md); }
.no-posts p { margin: 0 auto; }

/* Pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-3xl) 0;
}
.blog-pagination a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-cta);
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--color-cta);
  border-radius: var(--border-radius);
  transition: all var(--transition-base);
}
.blog-pagination a:hover {
  background: var(--color-cta);
  color: var(--color-white);
  box-shadow: var(--shadow-gold);
}

/* ============================================================
   SINGLE POST (single.php)
   ============================================================ */
.article-header {
  padding-top: calc(var(--nav-height) + var(--space-3xl));
  padding-bottom: var(--space-2xl);
  text-align: center;
}

.article-category {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-cta);
  margin-bottom: var(--space-md);
}

.article-header h1 {
  margin-bottom: var(--space-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.article-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.article-meta span.sep { opacity: 0.4; }

.article-featured-image {
  max-width: var(--max-width);
  margin: 0 auto var(--space-3xl);
  padding: 0 var(--space-xl);
}
.article-featured-image img {
  width: 100%;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

/* Article content */
.article-content {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-xl) var(--space-4xl);
}

.article-content p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-lg);
  max-width: none;
}

.article-content h2 {
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
}
.article-content h3 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}
.article-content h4 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.article-content a {
  color: var(--color-cta);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}
.article-content a:hover { color: var(--color-cta-hover); }

.article-content img {
  border-radius: var(--border-radius);
  margin: var(--space-xl) 0;
}

.article-content blockquote {
  border-left: 3px solid var(--color-cta);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  background: var(--color-sand-light);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
  color: var(--color-text-muted);
}
.article-content blockquote p {
  margin-bottom: 0;
  font-size: var(--text-lg);
}

.article-content ul,
.article-content ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.article-content li {
  margin-bottom: var(--space-sm);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.article-content pre {
  background: var(--color-text);
  color: var(--color-sand-light);
  padding: var(--space-xl);
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: var(--space-xl) 0;
  font-size: var(--text-sm);
}

.article-content code {
  background: var(--color-sand-light);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.article-content pre code {
  background: none;
  padding: 0;
}

.article-content figure {
  margin: var(--space-xl) 0;
}
.article-content figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  text-align: center;
  margin-top: var(--space-sm);
}

/* Post navigation */
.post-navigation {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-xl) var(--space-3xl);
  display: flex;
  justify-content: space-between;
  gap: var(--space-xl);
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-2xl);
}
.post-navigation a {
  text-decoration: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-cta);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  transition: color var(--transition-fast);
}
.post-navigation a:hover { color: var(--color-cta-hover); }
.post-navigation .nav-next { margin-left: auto; }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--color-cta);
  outline-offset: 2px;
}
::selection {
  background: var(--color-primary);
  color: var(--color-white);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
