/* ═══════════════════════════════════════════════════════
   MOBILE FIRST — styles.css
   ═══════════════════════════════════════════════════════ */

/* ── Layout general ── */
.main-wrapper { padding: 15px 0 30px; }
.content-grid {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 24px;
}

/* ── Sidebar: en móvil va debajo del main ── */
@media (max-width: 968px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { order: 2; }
}

/* ── Hero: 1 columna en móvil ── */
@media (max-width: 768px) {
    .hero-wrap {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }
    .hero-main  { height: 260px !important; }
    .hero-main-title { font-size: 17px !important; }
    .hero-side {
        grid-template-rows: none !important;
        grid-template-columns: repeat(2, 1fr) !important;
        height: auto !important;
        gap: 3px;
    }
    .hero-side-item { height: 130px; }
}

@media (max-width: 480px) {
    .hero-main { height: 210px !important; }
    .hero-main-title { font-size: 15px !important; }
    .hero-side { grid-template-columns: 1fr 1fr !important; }
    .hero-side-item { height: 110px; }
    .hero-side-title { font-size: 11px !important; }
}

/* ── News grid (.nc): columnas responsivas ── */
@media (max-width: 1024px) {
    .news-grid-4 { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
    .news-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
    .nc-img { height: 130px !important; }
    .nc-title { font-size: 12px !important; -webkit-line-clamp: 2 !important; }
}
@media (max-width: 480px) {
    /* Tarjeta horizontal en móvil chico */
    .news-grid-4 { grid-template-columns: 1fr !important; gap: 10px !important; }
    .nc {
        flex-direction: row !important;
        align-items: stretch;
        height: 90px;
        overflow: hidden;
    }
    .nc-img {
        width: 90px !important;
        height: 90px !important;
        min-width: 90px;
        flex-shrink: 0;
        border-radius: 0 !important;
        overflow: hidden;
    }
    .nc-img img { width: 100%; height: 100%; object-fit: cover; }
    .nc-body {
        padding: 8px 10px !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
        flex: 1;
        min-width: 0;
    }
    .nc-cat { font-size: 9px !important; margin-bottom: 3px; display: block; }
    .nc-title {
        font-size: 12px !important;
        font-weight: 700 !important;
        color: #222 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        min-height: auto !important;
        line-height: 1.4 !important;
        margin-bottom: 4px;
    }
    .nc-meta { font-size: 10px !important; color: #888 !important; }
}

/* ── Section bar (tabs): scroll horizontal en móvil ── */
.section-bar {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
}
.section-bar::-webkit-scrollbar { display: none; }
@media (max-width: 480px) {
    .section-bar-label { font-size: 11px !important; padding: 8px 12px !important; }
    .section-bar a { font-size: 12px !important; padding: 8px 11px !important; }
    .section-bar-promo { display: none; }
}

/* ── Lo más leído ── */
@media (max-width: 480px) {
    .mr-item { gap: 10px; padding-right: 10px; }
    .mr-img  { width: 72px !important; height: 58px !important; }
    .mr-num  { width: 24px !important; font-size: 16px !important; padding-left: 6px !important; }
    .mr-desc { display: none !important; }
    .mr-title { font-size: 12px !important; }
    .mr-meta  { font-size: 10px !important; gap: 6px !important; }
    .mr-ver-mas { display: none; }
}

/* ── Post single ── */
@media (max-width: 768px) {
    .post-header  { padding: 20px 20px 16px !important; }
    .post-body    { padding: 20px !important; }
    .share-section { padding: 18px 20px !important; }
    .post-title   { font-size: 22px !important; }
    .post-meta-bar { gap: 12px !important; font-size: 12px !important; }
    .post-featured-image { max-height: 260px; }
    .related-grid { grid-template-columns: repeat(2,1fr) !important; gap: 12px !important; }
    .related-wrapper { padding: 0 12px; }
}
@media (max-width: 480px) {
    .post-header  { padding: 16px !important; }
    .post-body    { padding: 16px !important; }
    .post-title   { font-size: 18px !important; line-height: 1.3 !important; }
    .post-content { font-size: 14px !important; line-height: 1.7 !important; }
    .share-buttons { flex-wrap: wrap; gap: 8px; }
    .share-btn    { font-size: 12px !important; padding: 8px 12px !important; }
    .related-grid { grid-template-columns: 1fr !important; }
    .breadcrumbs  { font-size: 11px !important; padding: 8px 0 !important; }
    .author-avatar { display: none; }
}

/* ── Noticias.php grid (.ng) ── */
@media (max-width: 768px) {
    .ng { grid-template-columns: repeat(2,1fr) !important; gap: 12px !important; }
    .ng-img { height: 150px !important; }
}
@media (max-width: 480px) {
    .ng { grid-template-columns: 1fr !important; gap: 10px !important; }
    .ng-card { flex-direction: row !important; height: 90px !important; overflow: hidden; }
    .ng-img  { width: 90px !important; height: 90px !important; flex-shrink: 0; border-radius: 0 !important; }
    .ng-body { padding: 8px 10px !important; }
    .ng-title { font-size: 12px !important; -webkit-line-clamp: 2 !important; min-height: auto !important; }
    .ng-excerpt { display: none; }
    .ng-meta { font-size: 10px !important; padding-top: 6px !important; }
}

/* ── Categoría header ── */
@media (max-width: 480px) {
    .category-header { padding: 24px 0 !important; }
    .category-title  { font-size: 22px !important; }
}

/* ── Búsqueda ── */
@media (max-width: 480px) {
    .search-hero { padding: 30px 0 !important; }
    .search-hero h1 { font-size: 22px !important; }
    .search-box { flex-direction: column; border-radius: 10px; }
    .search-input-big { font-size: 14px !important; padding: 14px 18px !important; }
    .search-btn-big   { font-size: 14px !important; padding: 14px !important; }
}

/* ── Contacto ── */
@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr !important; }
    .contact-form-card, .contact-info-card { padding: 20px !important; }
    .form-row-2 { grid-template-columns: 1fr !important; }
}

/* ── Modal compartir — estilos BASE ── */
.share-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .6);
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.share-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px 20px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
    position: relative;
    animation: shareModalIn .25s ease;
}
@keyframes shareModalIn {
    from { opacity: 0; transform: scale(.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1)  translateY(0);     }
}
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.share-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #222;
}
.share-modal-close {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 32px; height: 32px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #555;
    transition: background .2s;
    flex-shrink: 0;
    min-height: unset;
}
.share-modal-close:hover { background: #ddd; color: #111; }
.share-modal-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #eee;
    display: block;
}
.share-modal-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.share-modal-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.share-modal-btn {
    flex: 1 1 calc(50% - 5px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .2s, transform .15s;
    color: #fff;
    min-height: unset;
}
.share-modal-btn:hover { opacity: .85; transform: translateY(-1px); }
.share-modal-btn.facebook  { background: #1877f2; }
.share-modal-btn.whatsapp  { background: #25d366; }
.share-modal-btn.instagram { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.share-modal-btn.tiktok    { background: #010101; }

/* ── Modal compartir — responsive ── */
@media (max-width: 480px) {
    .share-modal-content { padding: 20px 16px; border-radius: 12px 12px 0 0; }
    .share-modal-overlay { align-items: flex-end !important; }
    .share-modal-buttons { flex-direction: column; }
    .share-modal-btn { width: 100%; justify-content: center; padding: 12px !important; }
}

/* ── Footer ── */
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 20px !important; }
    .footer-top  { padding: 28px 0 20px !important; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr !important; }
    .footer-social-inner { gap: 7px; justify-content: center; }
    .fsb-btn { padding: 8px 14px !important; font-size: 12px !important; }
    .footer-col:nth-child(3),
    .footer-col:nth-child(4) { display: none; }
}

/* ── Botones flotantes ── */
@media (max-width: 768px) {
    .wa-float-global {
        bottom: calc(var(--player-h, 64px) + 56px + 14px) !important;
        right: 12px !important;
        width: 46px !important; height: 46px !important;
    }
    .back-to-top {
        bottom: calc(var(--player-h, 64px) + 56px + 66px) !important;
        right: 12px !important;
        width: 38px !important; height: 38px !important;
        font-size: 14px !important;
    }
    .wa-tip { display: none !important; }
}

/* ── Player: más compacto en móvil ── */
@media (max-width: 480px) {
    .ra-player { height: 56px !important; }
    :root { --player-h: 56px; }
    .ra-logo { width: 36px !important; height: 36px !important; }
    .ra-name { font-size: 11px !important; }
    .ra-status { font-size: 10px !important; }
    .ra-play-btn { width: 36px !important; height: 36px !important; font-size: 14px !important; }
    .ra-slider { width: 70px !important; }
    #raVolPct { display: none !important; }
}

/* ── Imágenes y video responsivos en posts ── */
.post-content img { width: 100% !important; height: auto !important; border-radius: 4px; }
.post-content iframe {
    width: 100% !important;
    max-width: 100% !important;
}
.video-wrapper iframe,
.video-wrapper video {
    height: auto !important;
    aspect-ratio: 16/9;
}

/* ── Galería responsive ── */
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2,1fr) !important; gap: 6px !important; }
}

/* ── Evitar overflow horizontal global ── */
.container, main, .content-grid, .main-wrapper {
    max-width: 100%;
    overflow-x: hidden;
}

/* ── Touch targets mínimos (accesibilidad) ── */
@media (max-width: 768px) {
    a, button { min-height: 44px; }
    .nc-share, .ng-share, .mr-share-btn { min-height: 36px; min-width: 36px; }
    .page-link { min-height: 44px !important; min-width: 44px !important; }
}