/* ============================================
   CalendarioMexico — Month Pages v4.3
   Premium design · Lexend · Red/coral palette
   Mobile-first · CWV optimized · A11y
   ============================================ */

/* ── CLS Prevention ─────────────────────────── */
.cdmx-mes { contain: layout style; font-family: 'Lexend', system-ui, sans-serif; max-width: 900px; margin: 0 auto; padding: 0 16px 48px; color: #1a1a1a; }
.cdmx-cal-wrap { min-height: 380px; }

/* ── Breadcrumb ─────────────────────────────── */
.cdmx-month-breadcrumb { margin: 16px 0 20px; }
.cdmx-month-breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: #888; }
.cdmx-month-breadcrumb a { color: #c0392b; text-decoration: none; font-weight: 600; }
.cdmx-month-breadcrumb a:hover { text-decoration: underline; }

/* ── Hero header ────────────────────────────── */
.cdmx-mes-hero {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 50%, #d35400 100%);
    border-radius: 16px;
    padding: 36px 32px;
    margin-bottom: 28px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.cdmx-mes-hero::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
    pointer-events: none;
}
.cdmx-mes-hero h1 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 12px;
    color: #fff;
}
.cdmx-mes-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: .82rem;
    opacity: .88;
    margin-bottom: 16px;
}
.cdmx-mes-hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.cdmx-mes-hero-intro {
    font-size: .95rem;
    line-height: 1.75;
    opacity: .92;
    max-width: 720px;
}

/* ── Legend ──────────────────────────────────── */
.cdmx-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 24px;
    font-size: .82rem;
    color: #666;
}
.cdmx-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.cdmx-legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.cdmx-legend-dot--r { background: #c0392b; }
.cdmx-legend-dot--o { background: #e67e22; }
.cdmx-legend-dot--b { background: #2980b9; }

/* ── Month navigation pills ─────────────────── */
.cdmx-mes-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
    padding: 0;
    list-style: none;
}
.cdmx-mes-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: #f5f5f5;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    transition: all .2s;
    min-height: 40px;
}
.cdmx-mes-nav a:hover {
    background: #fff5f5;
    border-color: #c0392b;
    color: #c0392b;
}
.cdmx-mes-nav .active a,
.cdmx-mes-nav a[aria-current="page"] {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
    font-weight: 700;
}

/* ── Calendar table ─────────────────────────── */
.cdmx-cal-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
    margin-bottom: 32px;
}
.cdmx-cal {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}
.cdmx-cal thead th {
    background: #1a1a2e;
    color: #fff;
    padding: 14px 10px;
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: none;
}
.cdmx-cal thead th:nth-child(6) { color: #fbbf24; }
.cdmx-cal thead th:nth-child(7) { color: #f87171; }
.cdmx-cal td {
    border: 1px solid #f0f0f0;
    height: 110px;
    vertical-align: top;
    padding: 8px;
    transition: background .15s;
    position: relative;
}
.cdmx-cal td:hover { background: #fafafa; }
.cdmx-cal .empty-cell { background: #f9f9f9; }

/* Day number */
.day-number {
    display: block;
    text-align: right;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    margin-bottom: 6px;
    line-height: 1;
}
.day-number:hover { color: #c0392b; }
.holiday-number { color: #c0392b !important; font-weight: 800; }
.vacation-number { color: #e67e22 !important; }

/* Day events inside cells */
.day-events { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.day-events li a, .day-events li span {
    display: block;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: .68rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.day-events li a:hover { opacity: .85; }
.event-official a, .event-official span { background: #c0392b; }
.event-traditional a, .event-traditional span { background: #e67e22; }
.event-civic a, .event-civic span { background: #2980b9; }

/* Today highlight */
.calendar-day[aria-current="date"] { background: #fff5f5; box-shadow: inset 0 0 0 2px #c0392b; }
.calendar-day[aria-current="date"] .day-number { color: #c0392b; font-weight: 900; }

/* ── SEO content ────────────────────────────── */
.cdmx-mes-content { line-height: 1.8; margin-bottom: 32px; }
.cdmx-mes-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 32px 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}
.cdmx-mes-content h3 { font-size: 1.1rem; font-weight: 700; margin: 24px 0 10px; color: #333; }
.cdmx-mes-content p { font-size: .95rem; color: #444; margin-bottom: 14px; }
.cdmx-mes-content a { color: #c0392b; font-weight: 600; text-decoration: none; }
.cdmx-mes-content a:hover { text-decoration: underline; }

/* ── FAQ ────────────────────────────────────── */
.cdmx-month-faq { margin-bottom: 32px; }
.cdmx-month-faq > h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.cdmx-faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}
.cdmx-faq-item summary {
    padding: 14px 18px;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    list-style: none;
}
.cdmx-faq-item summary::before { content: '▸'; margin-right: 10px; color: #c0392b; font-weight: 800; transition: transform .2s; }
.cdmx-faq-item[open] summary::before { transform: rotate(90deg); }
.cdmx-faq-item summary::-webkit-details-marker { display: none; }
.cdmx-faq-item summary:hover { background: #fafafa; }
.cdmx-faq-body { padding: 0 18px 16px; font-size: .92rem; color: #555; line-height: 1.65; }

/* ── CTA download ───────────────────────────── */
.cdmx-mes-cta {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    border-radius: 14px;
    padding: 28px 24px;
    color: #fff;
    margin-bottom: 28px;
    text-align: center;
}
.cdmx-mes-cta h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px; color: #fff; }
.cdmx-mes-cta p { font-size: .9rem; opacity: .8; margin-bottom: 16px; }
.cdmx-mes-cta a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #c0392b;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    margin: 0 6px;
    min-height: 44px;
    transition: background .2s;
}
.cdmx-mes-cta a:hover { background: #e74c3c; color: #fff; }

/* ── Prev/Next navigation ───────────────────── */
.cdmx-month-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #eee;
    margin-bottom: 24px;
}
.cdmx-pager-prev, .cdmx-pager-next, .cdmx-pager-home {
    color: #c0392b;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.cdmx-pager-prev:hover, .cdmx-pager-next:hover, .cdmx-pager-home:hover { background: #fff5f5; text-decoration: underline; }
.cdmx-pager-prev { justify-self: start; }
.cdmx-pager-home { justify-self: center; font-size: .82rem; color: #888; }
.cdmx-pager-next { justify-self: end; text-align: right; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
    .cdmx-mes-hero { padding: 28px 20px; }
    .cdmx-mes-hero h1 { font-size: 1.3rem; }
    .cdmx-mes-nav { gap: 4px; }
    .cdmx-mes-nav a { padding: 6px 10px; font-size: .72rem; }
    .cdmx-cal td { height: 85px; padding: 5px; }
    .day-number { font-size: .95rem; }
    .day-events li a, .day-events li span { font-size: .6rem; padding: 2px 4px; }
    .cdmx-month-pager { grid-template-columns: 1fr; text-align: center; }
    .cdmx-pager-prev, .cdmx-pager-next, .cdmx-pager-home { justify-self: center; }
}
@media (max-width: 480px) {
    .cdmx-mes-hero h1 { font-size: 1.15rem; }
    .cdmx-cal td { height: 65px; }
    .day-events { display: none; }
}

/* ═══ EVENTOS DESTACADOS ═══ */
.cdmx-mes-eventos-detail { margin: 32px 0; }
.cdmx-mes-eventos-detail h2 { font-size: 1.35rem; font-weight: 800; color: #1a1a2e; margin: 0 0 16px; }
.cdmx-eventos-grid { display: flex; flex-direction: column; gap: 10px; }
.cdmx-evento-card {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 14px 16px; transition: box-shadow .2s, transform .2s;
}
.cdmx-evento-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-1px); }
.cdmx-evento-date {
    display: flex; flex-direction: column; align-items: center;
    min-width: 50px; background: #f9fafb; border-radius: 8px; padding: 6px 8px;
}
.cdmx-evento-day { font-size: 1.5rem; font-weight: 900; color: #1a1a2e; line-height: 1; }
.cdmx-evento-month { font-size: .7rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; }
.cdmx-evento-info { flex: 1; min-width: 0; }
.cdmx-evento-name { font-size: .95rem; font-weight: 700; color: #1a1a2e; text-decoration: none; display: block; }
.cdmx-evento-name:hover { color: #c0392b; }
.cdmx-evento-type {
    display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px;
    border-radius: 20px; margin-top: 4px;
}
.cdmx-evento-badge { display: block; font-size: .75rem; color: #c0392b; margin-top: 3px; }
.cdmx-evento-badge a { color: #c0392b; font-weight: 700; text-decoration: underline; }
.cdmx-evento-link {
    flex-shrink: 0; font-size: .8rem; font-weight: 700; color: #c0392b;
    text-decoration: none; white-space: nowrap;
}

/* ═══ QUE HACER ESTE MES ═══ */
.cdmx-mes-actividades { margin: 32px 0; }
.cdmx-mes-actividades h2 { font-size: 1.35rem; font-weight: 800; color: #1a1a2e; margin: 0 0 16px; }
.cdmx-actividades-list { display: flex; flex-direction: column; gap: 6px; }
.cdmx-actividad-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: #f9fafb; border: 1px solid #e5e7eb;
    border-radius: 8px; text-decoration: none; color: #1a1a2e;
    font-size: .9rem; font-weight: 600; transition: all .15s;
}
.cdmx-actividad-item:hover { background: #fef2f2; border-color: #c0392b; color: #c0392b; }
.cdmx-actividad-arrow { color: #c0392b; font-size: 1.1rem; flex-shrink: 0; }

/* ═══ LINKS UTILES ═══ */
.cdmx-mes-links-utiles { margin: 32px 0; }
.cdmx-mes-links-utiles h2 { font-size: 1.35rem; font-weight: 800; color: #1a1a2e; margin: 0 0 16px; }
.cdmx-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cdmx-link-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: 16px; background: #fff; border: 1.5px solid #e5e7eb;
    border-radius: 10px; text-decoration: none; transition: all .2s;
}
.cdmx-link-card:hover { border-color: #c0392b; box-shadow: 0 4px 12px rgba(192,57,43,.1); transform: translateY(-2px); }
.cdmx-lc-icon { font-size: 1.5rem; }
.cdmx-lc-title { font-size: .9rem; font-weight: 800; color: #1a1a2e; }
.cdmx-lc-desc { font-size: .75rem; color: #6b7280; line-height: 1.4; }

/* ═══ FAQ EXPANDIDAS ═══ */
.cdmx-faq-body a { color: #c0392b; font-weight: 700; text-decoration: underline; }
.cdmx-faq-body a:hover { color: #96281b; }

/* ═══ POSTS RELACIONADOS ═══ */
.cdmx-mes-related { margin: 32px 0; }
.cdmx-mes-related h2 { font-size: 1.35rem; font-weight: 800; color: #1a1a2e; margin: 0 0 16px; }
.cdmx-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cdmx-related-card {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 16px; background: #fff; border: 1.5px solid #e5e7eb;
    border-radius: 8px; text-decoration: none; transition: all .15s;
}
.cdmx-related-card:hover { border-color: #c0392b; background: #fef2f2; }
.cdmx-related-title { font-size: .85rem; font-weight: 700; color: #1a1a2e; flex: 1; }
.cdmx-related-card:hover .cdmx-related-title { color: #c0392b; }
.cdmx-related-arrow { color: #c0392b; font-size: 1.1rem; flex-shrink: 0; }

@media (max-width: 640px) {
    .cdmx-links-grid { grid-template-columns: 1fr 1fr; }
    .cdmx-related-grid { grid-template-columns: 1fr; }
    .cdmx-evento-card { flex-wrap: wrap; }
    .cdmx-evento-link { width: 100%; text-align: right; }
}

/* ═══ CTA BUTTONS ═══ */
.cdmx-cta-btn {
    display: inline-block; padding: 12px 28px; border-radius: 50px;
    font-size: .95rem; font-weight: 700; cursor: pointer; border: none;
    background: #c0392b; color: #fff; text-decoration: none;
    transition: all .2s; margin: 4px;
}
.cdmx-cta-btn:hover { background: #96281b; transform: translateY(-1px); }
.cdmx-cta-btn--ghost {
    background: rgba(255, 255, 255, 0.12); color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.55);
}
.cdmx-cta-btn--ghost:hover { border-color: #ffffff; color: #ffffff; background: rgba(255, 255, 255, 0.22); }

/* ═══ PRINT STYLES ═══ */
@media print {
    /* Hide everything except the calendar content */
    body * { visibility: hidden; }
    .cdmx-mes, .cdmx-mes * { visibility: visible; }
    .cdmx-mes { position: absolute; left: 0; top: 0; width: 100%; max-width: 100%; padding: 0; margin: 0; }

    /* Hide non-essential sections */
    .cdmx-mes-cta, .cdmx-month-pager, .cdmx-mes-actividades,
    .cdmx-mes-links-utiles, .cdmx-mes-related, .cdmx-month-faq,
    .cdmx-mes-nav, nav, header, footer, .site-header, .site-footer,
    #wpadminbar, .cdmx-evento-link, .cdmx-evento-badge a { display: none !important; }

    /* Calendar grid optimized for print */
    .cdmx-mes-hero { background: #fff !important; color: #1a1a2e !important; padding: 10px 0 !important; border-bottom: 3px solid #c0392b; }
    .cdmx-mes-hero h1 { color: #1a1a2e !important; font-size: 18pt !important; }
    .cdmx-mes-hero p { color: #333 !important; }

    .cdmx-cal-wrap { min-height: auto; }
    .cdmx-cal { border: 2px solid #333; }
    .cdmx-cal th { background: #1a1a2e !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 6px !important; font-size: 9pt; }
    .cdmx-cal td { height: auto !important; padding: 4px !important; border: 1px solid #ccc; }
    .day-number { font-size: 11pt; }
    .holiday-number { color: #c0392b !important; font-weight: 900; }
    .day-events li a, .day-events li span { font-size: 7pt !important; padding: 1px 3px !important; }
    .day-events { display: block !important; }

    /* Events section clean for print */
    .cdmx-mes-eventos-detail { page-break-before: auto; }
    .cdmx-evento-card { border: 1px solid #ccc !important; box-shadow: none !important; padding: 6px 10px !important; }

    /* SEO content section */
    .cdmx-mes-content { font-size: 10pt; }

    /* Footer text */
    .cdmx-mes::after {
        content: 'calendariodemexico.com — Calendario 2026 Mexico';
        display: block; text-align: center; font-size: 8pt; color: #999;
        padding-top: 12px; border-top: 1px solid #ccc; margin-top: 20px;
    }

    /* Force color printing */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

    /* Hide share buttons on print */
    .cdmx-share { display: none !important; }
}

/* ═══ Share Buttons ═══ */
.cdmx-share {
    margin: 28px 0 32px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.cdmx-share h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
    font-family: 'Lexend', system-ui, sans-serif;
}
.cdmx-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cdmx-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    border: none;
    cursor: pointer;
    min-height: 44px;
    transition: opacity .2s;
    font-family: 'Lexend', system-ui, sans-serif;
}
.cdmx-share-btn:hover {
    opacity: .85;
    text-decoration: none;
    color: #fff;
}
.cdmx-share-btn--wa { background: #25d366; }
.cdmx-share-btn--fb { background: #1877f2; }
.cdmx-share-btn--tw { background: #000; }
.cdmx-share-btn--tg { background: #0088cc; }
.cdmx-share-btn--copy { background: #555; }
.cdmx-share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .cdmx-share-buttons {
        flex-direction: column;
    }
    .cdmx-share-btn {
        justify-content: center;
    }
