/**
 * Magefan Blog Custom Styling - Casa Nissei (Design Valor & Magazine)
 * Theme: MageBig/martfury/layout01
 */

:root {
    --blog-primary: #fcb800;
    --blog-primary-hover: #e5a700;
    --blog-primary-text: #855500;
    --blog-dark: #0f172a;
    --blog-text: #334155;
    --blog-muted: #64748b;
    --blog-light-bg: #f8fafc;
    --blog-border: #e2e8f0;
    --blog-pill-bg: #fff8e5;
    --blog-pill-border: rgba(252, 184, 0, 0.4);
    --blog-pill-text: #855500;
    --blog-card-radius: 12px;
    --blog-transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --blog-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --blog-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* Reset layout padding override from theme */
.post-view, .post-list-wrapper {
    padding-right: 0 !important;
}

/* ==========================================================================
   0. UNIVERSAL SVG SIZE ENFORCEMENT & COMPONENT PROTECTION
   ========================================================================== */
.post-view-valor svg,
.post-info-modern svg,
.post-card svg,
.magazine-hero-section svg,
.post-list-modern-grid svg,
.post-related-posts-section svg,
.post-related-products-section svg {
    max-width: 100%;
    box-sizing: border-box;
}

.post-card-meta-item svg,
.post-info-modern .item svg,
.hero-main-meta svg,
.magazine-side-meta svg {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    stroke: #94a3b8;
}

/* ==========================================================================
   1. ARTICLE CARD & EQUALIZED IMAGES (CAPTURAS 1 Y 2)
   ========================================================================== */

/* Uniform image container with strict equalized width and 16:9 ratio */
.post-card-thumb-wrapper {
    position: relative;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f172a;
    border-top-left-radius: var(--blog-card-radius);
    border-top-right-radius: var(--blog-card-radius);
}

.post-card-thumb {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.post-card-thumb img,
.post-card-thumb-wrapper img,
.post-card-thumb-wrapper a img {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-top-left-radius: var(--blog-card-radius);
    border-top-right-radius: var(--blog-card-radius);
    transition: transform 0.35s ease;
}

.post-card:hover .post-card-thumb img {
    transform: scale(1.03);
}

/* Column container for 2-column list */
.post-card-col {
    display: flex;
    margin-bottom: 24px;
}

.post-card-col .post-card {
    height: 100%;
    margin-bottom: 0;
}

/* Post Card Container with modern card elevation */
.post-card {
    background: #ffffff;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-card-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

/* Body with improved typography and formatting (Captura 2) */
.post-card-body {
    padding: 18px 22px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category Pills */
.post-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.post-category-pill-valor {
    background: var(--blog-pill-bg);
    color: var(--blog-pill-text) !important;
    border: 1px solid var(--blog-pill-border);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 16px;
    text-decoration: none !important;
    line-height: 1.3;
    display: inline-block;
    transition: all 0.2s ease;
}

.post-category-pill-valor:hover {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #111827 !important;
}

/* Metadata Row (Date & Reading Time) */
.post-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12.5px;
    color: var(--blog-muted);
    margin-bottom: 10px;
    font-weight: 500;
}

.post-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Title */
.post-card-title {
    font-size: 18.5px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 10px 0;
    letter-spacing: -0.2px;
}

.post-card-title a {
    color: var(--blog-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card-title a:hover {
    color: #b45309;
}

/* Excerpt */
.post-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer / Read More Button */
.post-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.post-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--blog-pill-text) !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.post-card-readmore svg {
    width: 14px !important;
    height: 14px !important;
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.post-card-readmore:hover {
    color: #5c3b00 !important;
}

.post-card-readmore:hover svg {
    transform: translateX(4px);
}

/* Video Badge Overlay */
.post-media-badge-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

.post-media-badge-overlay svg {
    width: 11px !important;
    height: 11px !important;
    fill: currentColor;
}

/* ==========================================================================
   2. MAGAZINE HERO SECTION (PORTADA DEL BLOG)
   ========================================================================== */

.magazine-hero-section {
    display: flex;
    align-items: stretch;
    gap: 32px;
    margin-bottom: 32px;
}

.magazine-hero-main {
    flex: 0 0 calc(58% - 16px);
    max-width: calc(58% - 16px);
    display: flex;
    flex-direction: column;
}

.hero-main-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hero-main-thumb-wrap {
    position: relative;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    background: #0f172a;
}

.hero-main-thumb {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.hero-main-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.4s ease;
}

.hero-main-card:hover .hero-main-thumb img {
    transform: scale(1.03);
}

.hero-main-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.hero-main-title {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 8px 0;
}

.hero-main-title a {
    color: var(--blog-dark);
    text-decoration: none;
}

.hero-main-title a:hover {
    color: #b45309;
}

.hero-main-meta {
    font-size: 12px;
    color: var(--blog-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-main-excerpt {
    font-size: 13.5px;
    line-height: 1.55;
    color: #475569;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Right Side 5 Compact Posts */
.magazine-hero-side {
    flex: 0 0 calc(42% - 16px);
    max-width: calc(42% - 16px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.magazine-side-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 0;
    border-bottom: none;
}

.magazine-side-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.magazine-side-thumb {
    position: relative;
    flex: 0 0 135px;
    width: 135px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
}

.magazine-side-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 8px;
}

.magazine-side-body {
    flex: 1;
    min-width: 0;
}

.magazine-side-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 4px 0;
}

.magazine-side-title a {
    color: var(--blog-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.magazine-side-title a:hover {
    color: #b45309;
}

.magazine-side-meta {
    font-size: 11.5px;
    color: var(--blog-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.side-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-play-icon svg {
    width: 12px !important;
    height: 12px !important;
    fill: #ffffff;
    margin-left: 2px;
}

/* Post Grid Header */
.post-grid-header {
    margin: 28px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: none;
}

.post-grid-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--blog-dark);
    margin: 0;
}

/* Post List Modern Grid - 2 Columns */
.post-list-modern-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
}

.post-list-modern-grid .post-card-col {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
    display: flex !important;
    margin-bottom: 24px !important;
}

.post-list-modern-grid .post-card-col .post-card {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
}

@media (max-width: 767px) {
    .post-list-modern-grid .post-card-col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   3. POST DETAIL VIEW (PDP - CAPTURAS 3, 4 Y 5)
   ========================================================================== */

.post-view-valor .post-view-article {
    background: #ffffff;
    border-radius: var(--blog-card-radius);
    border: 1px solid var(--blog-border);
    padding: 32px 36px;
    box-shadow: var(--blog-shadow-sm);
    margin-bottom: 30px;
}

.post-view-valor .post-article-header {
    margin-bottom: 22px;
}

.post-view-valor .post-article-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--blog-dark);
    margin: 0 0 14px 0;
}

.post-article-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--blog-border);
    font-size: 13px;
    color: var(--blog-muted);
}

.post-meta-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.post-meta-author a {
    color: var(--blog-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-meta-author a:hover {
    color: #b45309;
}

.post-meta-sep {
    color: #cbd5e1;
    font-weight: 300;
}

.post-meta-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.post-meta-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--blog-muted);
}

.post-meta-stat svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0;
}

/* Post Hero Media: Featured Image 100% & YouTube Video 100% */
.post-featured-image-wrapper,
.post-hero-media,
.post-article-hero.post-featured-image-wrapper,
.post-ftimg-hld {
    width: 100% !important;
    margin: 20px 0 24px 0 !important;
    border-radius: var(--blog-card-radius);
    overflow: hidden;
    background: #f8fafc;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.post-featured-image-wrapper img,
.post-featured-image-full,
.post-article-hero img,
.post-ftimg-hld img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
}

.post-video-hero-wrapper,
.post-article-hero.post-video-hero-wrapper,
.post-article-hero.post-video-hero {
    width: 100% !important;
    margin: 0 0 28px 0 !important;
    border-radius: var(--blog-card-radius);
    overflow: hidden;
    background: #000000;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
}

.post-video-responsive,
.post-hero-video-wrapper {
    position: relative !important;
    width: 100% !important;
    padding-bottom: 56.25% !important; /* 16:9 Aspect Ratio */
    height: 0 !important;
    overflow: hidden !important;
}

.post-video-responsive iframe,
.post-hero-video-wrapper iframe,
.post-video-hero iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* Article Content Body */
.post-article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--blog-text);
    margin-bottom: 28px;
}

.post-article-content p {
    margin-bottom: 1.4em;
}

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

/* Article Tags */
.post-article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid var(--blog-border);
    margin-bottom: 24px;
}

.post-tags-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--blog-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.post-tag-pill-valor {
    background: var(--blog-pill-bg);
    color: var(--blog-pill-text) !important;
    border: 1px solid var(--blog-pill-border);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none !important;
    transition: var(--blog-transition);
}

.post-tag-pill-valor:hover {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #111827 !important;
}

/* Share Section */
.post-share-section-valor {
    padding-top: 20px;
    border-top: 1px solid var(--blog-border);
    margin-bottom: 10px;
}

.post-share-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--blog-dark);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-share-buttons-valor {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-share-btn-valor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155 !important;
    text-decoration: none !important;
    transition: var(--blog-transition);
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.post-share-btn-valor svg {
    width: 15px !important;
    height: 15px !important;
    fill: currentColor;
    flex-shrink: 0;
}

.post-share-btn-valor:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--blog-shadow-sm);
    border-color: #cbd5e1;
    color: var(--blog-dark) !important;
}

.post-share-btn-valor.btn-fb:hover { color: #1877f2 !important; }
.post-share-btn-valor.btn-x:hover  { color: #000000 !important; }
.post-share-btn-valor.btn-pin:hover { color: #e60023 !important; }
.post-share-btn-valor.btn-in:hover { color: #0a66c2 !important; }
.post-share-btn-valor.btn-wa:hover { color: #25d366 !important; }
.post-share-btn-valor.btn-copy-link:hover { color: #b45309 !important; }

/* Toast */
.post-copy-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--blog-shadow-md);
    z-index: 99999;
    display: none;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   POST READ MORE / ARTÍCULOS RELACIONADOS (3 COLUMNAS)
   ========================================================================== */

.post-read-more-section {
    margin: 36px 0 32px 0;
    padding-top: 24px;
    border-top: 1px solid var(--blog-border);
}

.post-read-more-section .post-section-header {
    margin-bottom: 20px;
}

.post-read-more-section .post-section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--blog-dark);
    margin: 0;
}

.post-related-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.post-related-card {
    background: #ffffff;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-card-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.post-related-card-thumb {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f172a;
}

.post-related-card-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.35s ease;
}

.post-related-card:hover .post-related-card-thumb img {
    transform: scale(1.04);
}

.post-related-card-body {
    padding: 14px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-related-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px 0;
}

.post-related-card-title a {
    color: var(--blog-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-related-card-title a:hover {
    color: #b45309;
}

.post-related-card-meta {
    font-size: 12px;
    color: var(--blog-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-related-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.rel-cat-pill {
    font-size: 11px;
    font-weight: 600;
    color: var(--blog-pill-text);
    background: var(--blog-pill-bg);
    border: 1px solid var(--blog-pill-border);
    padding: 2px 8px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.rel-cat-pill:hover {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #111827;
}

/* Related Products */
.post-related-products-section {
    margin: 30px 0;
}

.post-related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 16px;
}

.post-product-card {
    background: #ffffff;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-card-radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    transition: var(--blog-transition);
}

.post-product-card:hover {
    box-shadow: var(--blog-shadow-md);
    transform: translateY(-4px);
    border-color: #cbd5e1;
}

.post-product-card-photo {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.post-product-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.post-product-card-name {
    font-size: 13.5px;
    font-weight: 600;
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.post-product-card-name a {
    color: var(--blog-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-product-card-name a:hover {
    color: #b45309;
}

.post-product-card-price {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    margin-top: auto;
}

.post-product-card-btn {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #111827 !important;
    text-decoration: none !important;
    background: var(--blog-primary);
    border: 1px solid var(--blog-primary);
    padding: 7px 12px;
    border-radius: 6px;
    text-align: center;
    transition: var(--blog-transition);
}

.post-product-card-btn:hover {
    background: var(--blog-primary-hover);
    border-color: var(--blog-primary-hover);
    color: #111827 !important;
}

/* Ocultar bloques nativos redundantes en el pie del articulo */
.post-bottom .mfblog-related-posts-block,
.post-bottom .block.related,
.post-bottom .nextprev {
    display: none !important;
}

/* ==========================================================================
   4. RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 991px) {
    .magazine-hero-section {
        flex-direction: column;
    }

    .magazine-hero-main,
    .magazine-hero-side {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .post-view-valor .post-view-article {
        padding: 24px 20px;
    }

    .post-view-valor .post-article-title {
        font-size: 24px;
    }

    .post-related-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

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

@media (max-width: 600px) {
    .post-card-body {
        padding: 14px 16px 16px;
    }

    .post-card-title {
        font-size: 16px;
    }

    .post-article-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-share-buttons-valor {
        gap: 8px;
    }

    .post-share-btn-valor {
        flex: 1 0 calc(50% - 8px);
        justify-content: center;
        padding: 8px 10px;
        font-size: 12px;
    }

    .post-related-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .post-related-products-grid {
        grid-template-columns: 1fr;
    }
}
