/*
Theme Name: Luna de Fresa
Theme URI: https://lunadefresa.com
Author: Luna de Fresa Editorial
Author URI: https://lunadefresa.com
Description: Conservative political opinion blog covering Cuba, Central America, and South America. Pro-libertad, pro-mercado libre, pro-democracia.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lunadefresa
Tags: blog, news, political, conservative, latin-america
*/

/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
  --primary: #1b1b4b;
  --accent-gold: #C5A44E;
  --accent-red: #BF0A30;
  --bg-light: #f6f6f8;
  --text-dark: #1a1a2e;
  --text-muted: #6b7280;
}

/* =============================================
   BASE RESET & TYPOGRAPHY
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'DM Sans', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* =============================================
   ARTICLE CONTENT TYPOGRAPHY
   ============================================= */
.article-content {
  font-family: 'DM Sans', 'Inter', serif;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #1f2937;
}

.article-content h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-gold);
}

.article-content h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content a {
  color: var(--accent-red);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.article-content a:hover {
  color: var(--primary);
}

.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

/* =============================================
   WP BLOCK QUOTE - GOLD BORDER
   ============================================= */
.article-content blockquote,
.wp-block-quote {
  border-left: 4px solid var(--accent-gold);
  background: linear-gradient(135deg, rgba(197,164,78,0.08) 0%, rgba(27,27,75,0.05) 100%);
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #374151;
}

.wp-block-quote p {
  margin-bottom: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.wp-block-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--accent-gold);
  font-style: normal;
  font-weight: 600;
}

/* =============================================
   POST CARD HOVER
   ============================================= */
.post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(27,27,75,0.15);
}

.post-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

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

.post-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =============================================
   CATEGORY BADGE
   ============================================= */
.category-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}

.pagination-wrap .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  color: var(--primary);
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.pagination-wrap .page-numbers:hover,
.pagination-wrap .page-numbers.current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination-wrap .page-numbers.dots {
  border: none;
  background: transparent;
  cursor: default;
}

/* =============================================
   NO-SCROLLBAR UTILITY
   ============================================= */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* =============================================
   STICKY HEADER
   ============================================= */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* =============================================
   MOBILE DRAWER
   ============================================= */
#mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 90vw);
  height: 100vh;
  background: var(--primary);
  z-index: 200;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 1.5rem;
}

#mobile-drawer.open {
  right: 0;
}

#drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  display: none;
}

#drawer-overlay.open {
  display: block;
}

/* =============================================
   PRIMARY NAV MENU
   ============================================= */
#primary-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#primary-menu > li > a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

#primary-menu > li > a:hover,
#primary-menu > li.current-menu-item > a,
#primary-menu > li.current_page_item > a {
  color: var(--accent-gold);
  background: rgba(255,255,255,0.08);
}

/* Mobile drawer menu */
#drawer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

#drawer-menu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: color 0.2s;
}

#drawer-menu li a:hover {
  color: var(--accent-gold);
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27,27,75,0.92) 0%, rgba(191,10,48,0.5) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

/* =============================================
   CATEGORY SCROLL
   ============================================= */
.category-scroll-wrap {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.category-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s, transform 0.2s;
}

.category-chip:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* =============================================
   RELATED POSTS CAROUSEL
   ============================================= */
.related-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.related-post-card {
  flex: 0 0 260px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-decoration: none;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.related-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(27,27,75,0.12);
}

.related-post-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.related-post-card-body {
  padding: 0.875rem;
}

.related-post-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =============================================
   AUTHOR BIO CARD
   ============================================= */
.author-bio-card {
  background: linear-gradient(135deg, var(--primary) 0%, #2d2d6b 100%);
  border-radius: 12px;
  padding: 1.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.author-bio-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-bio-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.author-bio-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

/* =============================================
   SHARE BUTTONS
   ============================================= */
.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s, transform 0.2s;
}

.share-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.share-btn-facebook { background: #1877f2; }
.share-btn-x { background: #000; }
.share-btn-whatsapp { background: #25d366; }

/* =============================================
   BREADCRUMBS
   ============================================= */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--accent-red);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span.sep {
  color: #d1d5db;
}

/* =============================================
   FOOTER
   ============================================= */
#site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s;
}

.footer-social a:hover {
  background: var(--accent-gold);
}

/* =============================================
   404 PAGE
   ============================================= */
.error-404-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

/* =============================================
   SEARCH
   ============================================= */
.search-form-wrap {
  display: flex;
  gap: 0.5rem;
}

.search-form-wrap input[type="search"] {
  flex: 1;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-form-wrap input[type="search"]:focus {
  border-color: var(--primary);
}

.search-form-wrap button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  transition: background 0.2s;
}

.search-form-wrap button:hover {
  background: var(--accent-red);
}

/* =============================================
   FALLBACK CATEGORY CARD
   ============================================= */
.fallback-card {
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.9);
}

.fallback-card .material-symbols-outlined {
  font-size: 3rem;
}

/* =============================================
   READING TIME
   ============================================= */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =============================================
   TAG PILLS
   ============================================= */
.tag-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  border: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s;
}

.tag-pill:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .hero-section {
    min-height: 360px;
  }

  .author-bio-card {
    flex-direction: column;
    text-align: center;
  }
}

/* === Table Styles === */
.entry-content table,
.post-content table,
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.entry-content thead,
.post-content thead,
article thead {
  background: #1a1f36;
  color: #ffffff;
}

.entry-content th,
.post-content th,
article th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}

.entry-content td,
.post-content td,
article td {
  padding: 12px 16px;
  border-bottom: 1px solid #e8e8e8;
  vertical-align: top;
}

.entry-content tbody tr:last-child td,
.post-content tbody tr:last-child td,
article tbody tr:last-child td {
  border-bottom: none;
}

.entry-content tbody tr:nth-child(even),
.post-content tbody tr:nth-child(even),
article tbody tr:nth-child(even) {
  background: #f8f9fb;
}

.entry-content tbody tr:hover,
.post-content tbody tr:hover,
article tbody tr:hover {
  background: #fff3e0;
  transition: background 0.2s ease;
}

@media (max-width: 768px) {
  .entry-content table,
  .post-content table,
  article table {
    display: block;
    overflow-x: auto;
    font-size: 0.85rem;
  }
  
  .entry-content th,
  .entry-content td,
  .post-content th,
  .post-content td,
  article th,
  article td {
    padding: 8px 10px;
  }
}
