/*
Theme Name: Estanco365
Theme URI: https://www.estanco365.com
Description: Directorio de estancos en Espana - Blog y annuaire
Version: 1.0
Author: Estanco365
Text Domain: estanco365
*/

/* ============================
   CSS CUSTOM PROPERTIES
   ============================ */
:root {
    --bg: #F9FBF9;
    --white: #FFFFFF;
    --text: #1a1a2e;
    --text-light: #5a5a6e;
    --text-muted: #999;
    --green: #2e7d32;
    --green-dark: #1b5e20;
    --green-light: #e8f5e9;
    --green-pale: #f1f8f1;
    --border: #e0e7e0;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1200px;
    --content-width: 780px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

/* ============================
   RESET & BASE
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ============================
   HEADER
   ============================ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex; align-items: center; justify-content: space-between;
}
.header-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text);
    font-family: var(--font-serif);
    font-size: 1.5rem; font-weight: 700;
}
.header-brand span { color: var(--green); }
.header-nav { display: flex; gap: 28px; align-items: center; }
.header-nav a {
    font-size: 0.92rem; font-weight: 500;
    color: var(--text-light); text-decoration: none;
    padding: 6px 0; border-bottom: 2px solid transparent;
    transition: all .2s;
}
.header-nav a:hover, .header-nav a.current { color: var(--green); border-bottom-color: var(--green); }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }

/* ============================
   HERO
   ============================ */
.hero {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    padding: 80px 24px 70px;
    text-align: center;
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: 2.6rem; font-weight: 700;
    margin-bottom: 14px; line-height: 1.2;
}
.hero p {
    font-size: 1.12rem; opacity: 0.9;
    max-width: 600px; margin: 0 auto 28px;
}
.hero-search {
    max-width: 560px; margin: 0 auto;
    display: flex; gap: 8px;
}
.hero-search input {
    flex: 1; padding: 14px 18px;
    border: none; border-radius: var(--radius-sm);
    font-size: 1rem; font-family: var(--font);
}
.hero-search button {
    padding: 14px 28px;
    background: var(--green-dark); color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    transition: background .2s;
}
.hero-search button:hover { background: #0d3b10; }

/* ============================
   CONTAINER
   ============================ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ============================
   SECTION TITLES
   ============================ */
.section-title {
    font-family: var(--font-serif);
    font-size: 1.8rem; font-weight: 700;
    text-align: center; margin-bottom: 8px;
}
.section-divider {
    width: 40px; height: 3px;
    background: var(--green);
    margin: 0 auto 14px;
    border-radius: 2px;
}
.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 36px;
}

/* ============================
   REGIONS GRID (homepage)
   ============================ */
.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 60px;
}
.region-card {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none; color: var(--text);
    transition: all .2s;
}
.region-card:hover {
    border-color: var(--green);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.region-card-name { font-weight: 600; font-size: 0.95rem; }
.region-card-count {
    background: var(--green-light);
    color: var(--green);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.82rem; font-weight: 700;
}

/* ============================
   ARTICLE CARDS (blog)
   ============================ */
.articles-section { padding: 60px 0; }
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}
.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform .2s, box-shadow .2s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.article-card-img {
    width: 100%; height: 210px;
    object-fit: cover;
}
.article-card-img-placeholder {
    width: 100%; height: 210px;
    background: var(--green-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
}
.article-card-body { padding: 20px; }
.article-card-body h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.article-card-body h3 a { color: var(--text); text-decoration: none; }
.article-card-body h3 a:hover { color: var(--green); }
.article-card-meta { font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 8px; }
.article-card-cats { margin-bottom: 8px; display: flex; gap: 6px; }
.article-card-cat {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--green); background: var(--green-light);
    padding: 3px 8px; border-radius: 4px;
}
.article-card-excerpt { font-size: 0.9rem; color: var(--text-light); margin: 8px 0; }

/* ============================
   SINGLE ARTICLE
   ============================ */
.single-hero {
    position: relative; overflow: hidden;
    max-height: 480px;
}
.single-hero img { width: 100%; height: 480px; object-fit: cover; }
.single-hero-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    padding: 60px 0 40px; color: #fff;
}
.single-hero-overlay .container { max-width: var(--content-width); }
.single-hero-overlay h1 { font-family: var(--font-serif); font-size: 2.2rem; margin-bottom: 10px; }
.single-hero-cats { margin-bottom: 12px; display: flex; gap: 8px; }
.single-hero-cat {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    color: #fff; background: var(--green);
    padding: 4px 10px; border-radius: 4px;
    text-decoration: none;
}
.single-hero-meta { font-size: 0.88rem; opacity: 0.85; }
.single-content-wrap { padding: 50px 24px 60px; }
.single-content {
    max-width: var(--content-width); margin: 0 auto;
    font-size: 1.05rem; line-height: 1.8;
}
.single-content h2 { font-family: var(--font-serif); font-size: 1.6rem; margin: 40px 0 16px; color: var(--green-dark); }
.single-content h3 { font-size: 1.2rem; margin: 30px 0 12px; }
.single-content p { margin-bottom: 18px; }
.single-content img { border-radius: var(--radius-sm); margin: 24px 0; }
.single-content ul, .single-content ol { margin: 0 0 18px 24px; }
.single-content li { margin-bottom: 6px; }
.single-content a { color: var(--green); text-decoration: underline; }
.single-content blockquote {
    border-left: 4px solid var(--green);
    margin: 24px 0; padding: 16px 24px;
    background: var(--green-pale);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

/* ============================
   PAGE
   ============================ */
.page-wrap {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 48px 24px 60px;
}
.page-wrap h1 {
    font-family: var(--font-serif);
    font-size: 2rem; margin-bottom: 12px;
}
.page-divider { width: 40px; height: 3px; background: var(--green); margin-bottom: 28px; border-radius: 2px; }
.page-content { font-size: 1.02rem; line-height: 1.7; }
.page-content h2 { margin: 32px 0 12px; font-size: 1.4rem; color: var(--green-dark); }
.page-content p { margin-bottom: 16px; }

/* ============================
   BUTTON
   ============================ */
.btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--green);
    color: #fff;
    border: none; border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background .2s;
}
.btn:hover { background: var(--green-dark); color: #fff; }

/* ============================
   PAGINATION
   ============================ */
.pagination { text-align: center; padding: 40px 0; }
.pagination .page-numbers {
    display: inline-block; padding: 8px 14px; margin: 0 3px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 0.9rem; text-decoration: none;
}
.pagination .page-numbers.current { background: var(--green); color: #fff; border-color: var(--green); }
.pagination .page-numbers:hover:not(.current) { border-color: var(--green); color: var(--green); }

/* ============================
   FOOTER
   ============================ */
.site-footer {
    background: #1a1a2e; color: rgba(255,255,255,0.7);
    padding: 50px 24px 30px;
}
.footer-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    gap: 40px; margin-bottom: 30px;
}
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer-col p { font-size: 0.88rem; line-height: 1.6; }
.footer-col a {
    display: block; color: rgba(255,255,255,0.65);
    font-size: 0.88rem; padding: 3px 0; text-decoration: none;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px; text-align: center;
    font-size: 0.82rem;
}

/* ============================
   404
   ============================ */
.page-404 { text-align: center; padding: 100px 24px; }
.page-404 h1 { font-family: var(--font-serif); font-size: 5rem; color: var(--green); margin-bottom: 10px; }
.page-404 h2 { font-size: 1.5rem; margin-bottom: 16px; }
.page-404 p { color: var(--text-light); margin-bottom: 28px; }

/* ============================
   RELATED POSTS
   ============================ */
.related-posts { padding: 50px 24px 60px; background: var(--green-pale); }
.related-posts h2 { font-family: var(--font-serif); font-size: 1.6rem; text-align: center; margin-bottom: 28px; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px; max-width: var(--max-width); margin: 0 auto;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .hero { padding: 50px 16px 40px; }
    .hero-search { flex-direction: column; }
    .header-nav { display: none; }
    .mobile-toggle { display: block; }
    .header-nav.open {
        display: flex; flex-direction: column;
        position: absolute; top: 64px; left: 0; right: 0;
        background: var(--white); padding: 16px 24px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .articles-grid { grid-template-columns: 1fr; }
    .regions-grid { grid-template-columns: 1fr; }
    .single-hero img { height: 300px; }
    .single-hero-overlay h1 { font-size: 1.5rem; }
    .section-title { font-size: 1.4rem; }
}
