/* === Variables === */
:root {
    --primary: #3D5A6E;
    --primary-dark: #2C4355;
    --accent: #8B2020;
    --accent-light: #A63030;
    --bg: #F5F7FA;
    --text: #2D3748;
    --white: #FFFFFF;
    --gray-100: #F7FAFC;
    --gray-200: #EDF2F7;
    --gray-300: #E2E8F0;
    --gray-500: #718096;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: 0.25s ease;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.7; font-size: 16px; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 800px; }

/* === Buttons === */
.btn { display: inline-block; padding: 12px 28px; border-radius: var(--radius); font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; transition: all var(--transition); border: 2px solid transparent; cursor: pointer; }
.btn--primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }
.btn--accent { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-light); border-color: var(--accent-light); color: var(--white); }
.btn--outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--outline:hover { background: var(--primary); color: var(--white); }

/* === Header === */
.site-header { background: var(--primary-dark); padding: 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-md); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.site-logo { display: flex; align-items: center; gap: 12px; }
.site-logo img { border-radius: 50%; width: 44px; height: 44px; object-fit: cover; }
.site-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; color: var(--white); letter-spacing: -0.02em; }
.main-nav ul { display: flex; gap: 2px; align-items: center; }
.main-nav li { position: relative; }
.main-nav a { color: rgba(255,255,255,0.88); font-family: var(--font-heading); font-size: 0.82rem; font-weight: 600; padding: 20px 10px; display: block; transition: all var(--transition); text-transform: uppercase; letter-spacing: 0.03em; }
.main-nav a:hover,
.main-nav .current-menu-item a { color: var(--white); background: rgba(255,255,255,0.1); }
.menu-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: 8px; }

/* === Hero Section === */
.hero { position: relative; background: var(--primary-dark) center/cover no-repeat; min-height: 420px; display: flex; align-items: center; overflow: hidden; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary-dark) 0%, rgba(61,90,110,0.85) 50%, rgba(139,32,32,0.3) 100%); }
.hero__content { position: relative; z-index: 2; text-align: center; padding: 60px 20px; }
.hero__content h1 { color: var(--white); font-size: 2.8rem; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.02em; }
.hero__subtitle { color: rgba(255,255,255,0.9); font-size: 1.2rem; max-width: 600px; margin: 0 auto 32px; line-height: 1.6; }

/* === Sections === */
.section { padding: 60px 0; }
.section:nth-child(even) { background: var(--white); }
.section__title { font-size: 1.8rem; text-align: center; margin-bottom: 40px; position: relative; padding-bottom: 16px; }
.section__title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background: var(--accent); border-radius: 2px; }

/* === Card Grid === */
.card-grid { display: grid; gap: 24px; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }

/* === Cards === */
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__image { overflow: hidden; }
.card__image img { width: 100%; height: 200px; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card__image img { transform: scale(1.05); }
.card__body { padding: 20px; }
.card__tag { display: inline-block; background: var(--accent); color: var(--white); font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.card__title { font-family: var(--font-heading); font-size: 1.1rem; line-height: 1.4; margin-bottom: 8px; }
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--accent); }
.card__excerpt { font-size: 0.9rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 8px; }
.card__date { font-size: 0.8rem; color: var(--gray-500); }
.card__type { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--primary); text-transform: uppercase; margin-bottom: 4px; }

/* Card Horizontal */
.card--horizontal { display: grid; grid-template-columns: 240px 1fr; }
.card--horizontal .card__image img { height: 100%; min-height: 180px; }

/* === Temas Grid === */
.temas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.tema-card { background: var(--white); border-radius: var(--radius); padding: 28px 20px; text-align: center; box-shadow: var(--shadow-sm); transition: all var(--transition); border: 2px solid transparent; }
.tema-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-md); color: var(--text); }
.tema-card__icon { font-size: 2.2rem; display: block; margin-bottom: 12px; }
.tema-card__title { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 4px; }
.tema-card__count { font-size: 0.8rem; color: var(--gray-500); }

/* === About Preview === */
.about-preview { background: var(--primary-dark); color: var(--white); padding: 60px 0; }
.about-preview__inner { max-width: 700px; margin: 0 auto; text-align: center; }
.about-preview__text h2 { color: var(--white); margin-bottom: 16px; font-size: 1.8rem; }
.about-preview__text p { color: rgba(255,255,255,0.85); margin-bottom: 24px; line-height: 1.7; }

/* === Archive Header === */
.archive-header { background: var(--primary-dark); color: var(--white); padding: 48px 0 40px; margin-bottom: 40px; }
.archive-header h1 { color: var(--white); font-size: 2rem; margin-bottom: 8px; }
.archive-header__desc { color: rgba(255,255,255,0.8); font-size: 1.05rem; max-width: 600px; }
.archive-header .breadcrumb a { color: rgba(255,255,255,0.7); }
.archive-header .breadcrumb__current { color: var(--white); }
.archive-header .breadcrumb__sep { color: rgba(255,255,255,0.4); }

/* === Archive Filters === */
.archive-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-tag { display: inline-block; padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; color: var(--primary); background: var(--gray-200); transition: all var(--transition); }
.filter-tag:hover, .filter-tag--active { background: var(--primary); color: var(--white); }

/* === Breadcrumb === */
.breadcrumb { font-size: 0.8rem; margin-bottom: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 0; font-family: var(--font-heading); }
.breadcrumb a { color: var(--gray-500); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { margin: 0 6px; color: var(--gray-300); font-size: 0.65rem; opacity: 0.6; }
.breadcrumb__current { color: var(--text); font-weight: 600; max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Single Article === */
.single-hero { position: relative; max-height: 400px; overflow: hidden; }
.single-hero img { width: 100%; height: 400px; object-fit: cover; }
.single-hero__overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4) 100%); }

.single-article { padding: 40px 0 60px; }
.single-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.single-meta__tag { display: inline-block; background: var(--accent); color: var(--white); font-size: 0.75rem; font-weight: 600; padding: 3px 12px; border-radius: 20px; text-transform: uppercase; }
.single-meta__date { font-size: 0.85rem; color: var(--gray-500); }
.single-title { font-size: 2.2rem; line-height: 1.3; margin-bottom: 20px; }

/* === Author Box === */
.author-box { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); margin-bottom: 32px; }
.author-box__avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.author-box__name { font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; display: block; }
.author-box__role { font-size: 0.8rem; color: var(--gray-500); }

/* === Entry Content === */
.entry-content { font-size: 1.05rem; line-height: 1.8; }
.entry-content h2 { font-size: 1.5rem; margin: 36px 0 16px; padding-top: 12px; border-top: 2px solid var(--gray-200); }
.entry-content h3 { font-size: 1.25rem; margin: 28px 0 12px; }
.entry-content p { margin-bottom: 16px; }
.entry-content ul, .entry-content ol { margin: 16px 0; padding-left: 24px; list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 8px; }
.entry-content blockquote { border-left: 4px solid var(--accent); padding: 16px 20px; margin: 24px 0; background: var(--gray-100); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.entry-content th, .entry-content td { padding: 10px 14px; border: 1px solid var(--gray-300); text-align: left; }
.entry-content th { background: var(--primary); color: var(--white); font-family: var(--font-heading); font-weight: 600; }
.entry-content tr:nth-child(even) { background: var(--gray-100); }
.entry-content img { border-radius: var(--radius); margin: 20px 0; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.entry-content a:hover { color: var(--accent-light); }

/* === Single Regions === */
.single-regions { margin-top: 32px; padding: 16px 0; border-top: 1px solid var(--gray-200); font-size: 0.9rem; }
.single-regions__link { display: inline-block; background: var(--gray-200); padding: 4px 12px; border-radius: 20px; margin: 4px 4px 4px 0; font-size: 0.8rem; color: var(--primary); }
.single-regions__link:hover { background: var(--primary); color: var(--white); }

/* === Related Posts === */
.related-posts { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--gray-200); }
.related-posts h2 { font-size: 1.4rem; margin-bottom: 24px; }

/* === Page Hero === */
.page-hero { position: relative; max-height: 320px; overflow: hidden; }
.page-hero img { width: 100%; height: 320px; object-fit: cover; }
.page-hero__overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(44,67,85,0.3) 0%, rgba(44,67,85,0.7) 100%); }
.page-hero__content { position: absolute; bottom: 0; left: 0; right: 0; z-index: 2; padding-bottom: 32px; }
.page-hero__content h1 { color: var(--white); font-size: 2.4rem; }

.page-header { background: var(--primary-dark); padding: 40px 0 32px; margin-bottom: 40px; }
.page-header h1 { color: var(--white); font-size: 2rem; }
.page-header .breadcrumb a { color: rgba(255,255,255,0.7); }
.page-header .breadcrumb__current { color: var(--white); }
.page-header .breadcrumb__sep { color: rgba(255,255,255,0.4); }

/* === 404 === */
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 h1 { font-size: 2.5rem; margin-bottom: 16px; color: var(--primary-dark); }
.error-404 p { font-size: 1.1rem; color: var(--gray-500); margin-bottom: 32px; }
.error-404__actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 48px; }
.error-404__search h2 { font-size: 1.2rem; margin-bottom: 16px; }

/* === Search Form === */
.search-form { display: flex; max-width: 500px; margin: 0 auto; }
.search-form__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.search-form__input { flex: 1; padding: 12px 16px; border: 2px solid var(--gray-300); border-right: none; border-radius: var(--radius) 0 0 var(--radius); font-size: 1rem; font-family: var(--font-body); }
.search-form__input:focus { outline: none; border-color: var(--primary); }
.search-form__submit { border-radius: 0 var(--radius) var(--radius) 0; }

/* === Search Results === */
.search-results { display: flex; flex-direction: column; gap: 16px; }

/* === Pagination === */
.pagination { margin-top: 48px; text-align: center; }
.pagination .nav-links { display: flex; justify-content: center; gap: 4px; }
.pagination a, .pagination span { display: inline-block; padding: 8px 14px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; }
.pagination a { color: var(--primary); background: var(--white); border: 1px solid var(--gray-300); }
.pagination a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination .current { background: var(--primary); color: var(--white); border: 1px solid var(--primary); }

/* === No Results === */
.no-results { text-align: center; padding: 60px 20px; color: var(--gray-500); font-size: 1.1rem; }

/* === Footer === */
.site-footer { background: var(--primary-dark); color: var(--white); padding: 48px 0 24px; margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 24px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand img { width: 36px; height: 36px; border-radius: 50%; }
.footer-brand span { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; }
.footer-section h4 { font-family: var(--font-heading); font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; color: var(--white); }
.footer-info p { margin-bottom: 6px; font-size: 0.88rem; opacity: 0.8; line-height: 1.5; }
.footer-nav ul { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: rgba(255,255,255,0.8); font-size: 0.88rem; transition: color var(--transition); }
.footer-nav a:hover { color: var(--white); }
.footer-bottom { text-align: center; font-size: 0.8rem; opacity: 0.6; }

/* === Headings === */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); color: var(--primary-dark); line-height: 1.3; }
h1 { font-size: 2rem; margin-bottom: 16px; }
h2 { font-size: 1.5rem; margin-bottom: 12px; }
h3 { font-size: 1.25rem; margin-bottom: 8px; }

/* === Responsive === */
@media (max-width: 968px) {
    .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .hero__content h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--primary-dark); padding: 0; box-shadow: var(--shadow-lg); }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav a { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08); }

    .card-grid--3, .card-grid--2 { grid-template-columns: 1fr; }
    .card--horizontal { grid-template-columns: 1fr; }
    .card--horizontal .card__image img { height: 200px; }

    .hero { min-height: 320px; }
    .hero__content h1 { font-size: 1.8rem; }
    .hero__subtitle { font-size: 1rem; }

    .footer-inner { grid-template-columns: 1fr; text-align: center; }
    .footer-brand { justify-content: center; }
    .footer-nav ul { align-items: center; }

    .single-title { font-size: 1.6rem; }
    .page-hero__content h1 { font-size: 1.8rem; }
    .archive-header h1 { font-size: 1.5rem; }

    .error-404__actions { flex-direction: column; align-items: center; }
    .search-form { flex-direction: column; }
    .search-form__input { border-right: 2px solid var(--gray-300); border-radius: var(--radius); margin-bottom: 8px; }
    .search-form__submit { border-radius: var(--radius); }

    .temas-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .temas-grid { grid-template-columns: 1fr; }
    h1 { font-size: 1.5rem; }
}
