@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Variables ─── */
:root {
    --primary:       #6366F1;
    --primary-light: #ECEFFE;
    --primary-dark:  #4F46E5;
    --bg:            #F9FAFB;
    --surface:       #FFFFFF;
    --text:          #111827;
    --text-muted:    #6B7280;
    --text-faint:    #9CA3AF;
    --border:        #E5E7EB;
    --radius:        10px;
    --shadow:        0 1px 3px rgba(17,24,39,.06), 0 1px 2px rgba(17,24,39,.04);
    --shadow-md:     0 4px 20px rgba(17,24,39,.10);
    --font:          'Inter', sans-serif;
}

/* ─── Reset / Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }

/* ─── Navbar ─── */
.site-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.site-nav .container { max-width: 1200px; }
.site-nav .navbar-brand img { height: 36px; width: auto; }
.site-nav .nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted) !important;
    padding: .45rem .9rem !important;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.site-nav .nav-link:hover { color: var(--text) !important; background: var(--bg); }
.site-nav .navbar-toggler { border: 1px solid var(--border); }
.site-nav .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: .5rem;
    font-size: 13px;
}
.site-nav .dropdown-item { border-radius: 5px; padding: .4rem .75rem; }
.site-nav .dropdown-item:hover { background: var(--bg); color: var(--text); }

/* Legacy navbar classes (navbar.blade.php compatibility) */
.navbar { background: var(--surface); padding: .75rem 0; border-bottom: 1px solid var(--border); }
.navbar .container { display: flex; align-items: center; }
.logo-image { height: 36px; width: auto; }
#header_wrapper { padding: 0; }
#header_wrapper .navbar {
    background: var(--text);
    border-radius: 0;
    border: none;
    padding: .35rem 1rem;
}
#header_wrapper .navbar .nav-link { color: rgba(255,255,255,.75) !important; font-size: 13px; padding: .4rem .85rem !important; border-radius: 5px; }
#header_wrapper .navbar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.08); }
#header_wrapper .navbar .navbar-toggler { border-color: rgba(255,255,255,.2); }
#header_wrapper .navbar .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.6)' stroke-linecap='round' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); }
#header_wrapper .dropdown-menu { background: #1F2937; border-color: #374151; }
#header_wrapper .dropdown-item { color: rgba(255,255,255,.8); border-radius: 5px; }
#header_wrapper .dropdown-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.costume-nav-link { text-transform: uppercase; letter-spacing: .04em; }
ul.dropdown-lr { width: 200px; }

/* ─── Layout ─── */
.card-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.post-cards-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    padding: 28px 0;
    align-items: start;
}
.cards-container { min-width: 0; }
.side-container { min-width: 0; }

/* ─── Post Card – horizontal layout ─── */
.post-card {
    display: flex;
    flex-direction: row;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.post-card:hover {
    border-color: rgba(99,102,241,.45);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-card-img-wrap {
    display: block;
    flex-shrink: 0;
    width: 210px;
    height: 160px;
    overflow: hidden;
    position: relative;
}
.post-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.post-card:hover .post-card-img-wrap img { transform: scale(1.06); }

.post-card-body {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    flex: 1;
    min-width: 0;
}

.post-card-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    width: fit-content;
    transition: background .15s, color .15s;
}
.post-card-category:hover { background: var(--primary); color: #fff; }

.archive-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-muted);
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.archive-title i { color: var(--primary); font-size: 10px; }

.post-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--primary); }

.post-card-excerpt {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.post-card-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-faint);
    flex-wrap: wrap;
}
.post-card-meta i { margin-right: 2px; color: var(--primary); opacity: .8; }
.post-card-meta a { color: inherit; }
.post-card-meta a:hover { color: var(--primary); }

.post-card-read-more {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: gap .15s;
}
.post-card-read-more:hover { color: var(--primary-dark); gap: 6px; }

/* ─── Pagination ─── */
.pagination { display: inline-flex; gap: 4px; }
.page-link { border-radius: 6px !important; font-size: 13px; color: var(--text-muted); border-color: var(--border); }
.page-link:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination-wrap { text-align: center; padding: 8px 0 24px; }

/* ─── Article (post.blade.php) ─── */
.article-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.article-body { padding: 28px 32px; }

.article-breadcrumb {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
}
.article-breadcrumb a { color: #94a3b8; text-decoration: none; }
.article-breadcrumb a:hover { color: var(--primary); }
.article-breadcrumb span[aria-hidden] { margin: 0 5px; }

.article-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 2px 9px;
    border-radius: 4px;
    margin-bottom: 14px;
}
.article-category:hover { background: var(--primary); color: #fff; }

.article-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 14px;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.article-meta i { margin-right: 3px; color: var(--primary); }
.article-meta a { color: inherit; }
.article-meta a:hover { color: var(--primary); }

.article-share { margin-bottom: 20px; }
.share-buttons-row { display: flex; gap: 6px; align-items: center; }
.share-buttons-row > div {
    width: 32px; height: 32px;
    border-radius: 6px;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    transition: opacity .15s;
}
.share-buttons-row > div:hover { opacity: .8; }

.article-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 6px; margin-bottom: 24px; }

/* Article content */
#content-post-file {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
}
#content-post-file p { margin-bottom: 1.1em; }
#content-post-file p a { color: var(--primary); text-decoration: underline; }
#content-post-file strong { font-weight: 600; }
#content-post-file img { height: auto; border-radius: 6px; }
#content-post-file h2 { font-size: 18px; font-weight: 700; margin: 1.5em 0 .6em; }
#content-post-file h3 { font-size: 16px; font-weight: 600; margin: 1.2em 0 .5em; }
#content-post-file ul, #content-post-file ol { padding-left: 1.4em; margin-bottom: 1em; }
#content-post-file li { margin-bottom: .3em; }

blockquote {
    margin: 1.2em 0;
    padding: 12px 16px 12px 20px;
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    font-size: 14px;
    color: #4B5563;
    line-height: 1.7;
}
blockquote::before, blockquote::after { content: none; }

/* Article tags */
.article-tags {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.article-tags .post-tags-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
    margin-bottom: 10px;
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    margin: 3px 3px 3px 0;
    transition: all .15s;
}
.tag-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-pill i { font-size: 10px; }

/* ─── Barra de progreso de lectura ─── */
#read-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary);
    z-index: 9999;
    transition: width .1s linear;
    border-radius: 0 2px 2px 0;
}

/* ─── Botón volver arriba ─── */
#back-to-top {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    z-index: 1000;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#back-to-top:hover { background: #4F46E5; }

/* ─── Compartir ─── */
.share-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 28px 0 24px;
    padding: 16px 20px;
    background: #F9FAFB;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.share-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-faint);
    margin-right: 4px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.share-btn:hover { opacity: .85; transform: translateY(-1px); text-decoration: none; }
.share-twitter  { background: #f0f0f0; color: #111; }
.share-whatsapp { background: #25D366; color: #fff; }
.share-copy     { background: var(--primary-light); color: var(--primary); }

/* ─── Posts relacionados ─── */
.related-posts {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.related-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.related-card {
    display: block;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}
.related-card:hover { box-shadow: 0 4px 18px rgba(99,102,241,.12); transform: translateY(-2px); }
.related-card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.related-card-body { padding: 12px; }
.related-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: .06em;
}
.related-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 5px 0 6px;
    line-height: 1.4;
}
.related-date { font-size: 11px; color: var(--text-faint); }
@media (max-width: 700px) { .related-grid { grid-template-columns: 1fr; } }

/* ─── Sidebar ─── */
.sidebar-widget {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--primary);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Popular / Mira esto ─── */
.PopularPosts { counter-reset: rank; }
.PopularPosts .post {
    counter-increment: rank;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.PopularPosts .post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.PopularPosts .post-image-link {
    flex-shrink: 0;
    width: 72px;
    height: 54px;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    display: block;
}
.PopularPosts .post-image-link::before {
    content: counter(rank);
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 1;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
}
.PopularPosts .post-image-link img,
.PopularPosts .post-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.PopularPosts .post-info { flex: 1; min-width: 0; }
.PopularPosts .post-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}
.PopularPosts .post-title a {
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.PopularPosts .post-title a:hover { color: var(--primary); }
.post-meta { font-size: 11px; color: var(--text-faint); display: flex; gap: 8px; flex-wrap: wrap; }
.post-meta i { color: var(--primary); margin-right: 2px; opacity: .8; }
.post-meta a { color: inherit; }
.post-meta a:hover { color: var(--primary); }

/* ─── Categories ─── */
.list-category ul { list-style: none; padding: 0; margin: 0; }
.list-category ul li { padding: 0; border: none; }
.list-category ul li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    transition: color .15s;
}
.list-category ul li:last-child a { border-bottom: none; }
.list-category ul li a:hover { color: var(--primary); }
.list-category .label-count {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}
.fa-angle-double-right { font-size: 10px; color: var(--text-faint); }

/* ─── Tags ─── */
.tag-list ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list li { float: none; margin: 0; }
.tag-list li a {
    display: inline-block;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    height: auto;
    line-height: 1.4;
    transition: all .15s;
}
.tag-list li a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Subscribe ─── */
.subscribe-text { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.subscribe-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    margin-bottom: 8px;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.subscribe-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); background: var(--surface); }
.subscribe-btn {
    width: 100%;
    padding: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-family: var(--font);
    transition: background .15s, transform .1s;
}
.subscribe-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }


/* ─── Responsive ─── */
@media (max-width: 991px) {
    .post-cards-container { grid-template-columns: 1fr; }
    .side-container { order: 2; }
    .cards-container { order: 1; }
}

@media (max-width: 700px) {
    .post-card { flex-direction: column; }
    .post-card-img-wrap { width: 100%; height: 190px; }
    .post-card-excerpt { -webkit-line-clamp: 3; }
}

@media (max-width: 767px) {
    .article-body { padding: 20px 18px; }
    .article-title { font-size: 18px; }
}

@media (max-width: 575px) {
    .card-container { padding: 0 10px; }
    .article-body { padding: 16px 14px; }
    .post-card-body { padding: 12px 14px; }
}
