/* Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-blue-hover);
}

.container {
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    padding: 80px 0 40px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-strong);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-subtitle {
    max-width: 700px;
    margin: 0 auto;
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Barra de búsqueda + categoría */
.blog-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0 20px 40px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.blog-search-wrap {
    position: relative;
    flex: 1 1 260px;
    max-width: 380px;
}

.blog-search-wrap input[type="search"] {
    width: 100%;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-strong);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.2s ease;
}

.blog-search-wrap input[type="search"]::placeholder {
    color: var(--text-muted);
}

.blog-search-wrap input[type="search"]:focus {
    border-color: var(--accent-blue);
}

.blog-category-select {
    flex: 0 1 240px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-strong);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-family: var(--font-family);
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.blog-category-select:focus {
    border-color: var(--accent-blue);
}

/* Grid Layout */
.posts-section {
    padding: 0 0 100px;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* Post Cards */
.post-card {
    background-color: var(--bg-alt);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.post-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-blue);
}

.post-img-holder {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.post-img-holder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-img-holder img {
    transform: scale(1.05);
}

.post-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--accent-blue);
    color: #fff;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    z-index: 1;
}

/* Botón de compartir */
.share-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.share-btn:hover {
    background-color: var(--accent-blue);
    transform: scale(1.05);
}

.share-btn-copied {
    background-color: #22c55e !important;
}

.share-btn-text {
    position: static;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-strong);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.share-btn-text:hover {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: none;
}

.post-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}

.post-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
}

/* Etiquetas (tags) de un post */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.post-tag-chip {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 999px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    .hero-subtitle {
        font-size: 16px;
    }
}

/* ==========================================================================
   Detalle de Post (post.php)
   ========================================================================== */

.single-post-container {
    max-width: 800px;
    margin: 40px auto 100px;
    padding: 0 20px;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.back-to-blog:hover {
    color: var(--accent-blue);
}

.single-post-header {
    margin-bottom: 30px;
}

.single-post-badge {
    display: inline-block;
    background-color: var(--accent-blue);
    color: #fff;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.single-post-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1.2;
    margin-bottom: 15px;
}

.single-post-meta {
    font-size: 14px;
    color: var(--text-muted);
}

.single-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.single-post-featured-img {
    width: 100%;
    max-height: 440px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.single-post-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text);
}

.single-post-body p {
    margin-bottom: 24px;
}

.single-post-body h2,
.single-post-body h3 {
    color: var(--text-strong);
    margin: 40px 0 20px;
}

