/* ============================================
   Tarraco Virtuals Theme — Base Styles
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1e293b;
    background: #f8fafc;
    line-height: 1.6;
}

a { color: #2563eb; text-decoration: none; transition: color 0.2s; }
a:hover { color: #1d4ed8; }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.section { padding: 60px 0; }
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #0f172a;
}
.section-subtitle {
    color: #64748b;
    margin-bottom: 32px;
    font-size: 1.05rem;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 32px;
    color: #0f172a;
}

.text-center { text-align: center; }

/* --- Header --- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.main-nav ul {
    display: flex;
    gap: 8px;
    list-style: none;
}

.main-nav a {
    padding: 8px 16px;
    border-radius: 8px;
    color: #475569;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.main-nav a:hover {
    background: #eef2ff;
    color: #2563eb;
}

.main-nav .current-menu-item a {
    background: #eef2ff;
    color: #2563eb;
    font-weight: 600;
}

.menu-toggle { display: none; }

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 8px;
        color: #475569;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        width: 100%;
        background: #fff;
        border-bottom: 1px solid #e2e8f0;
        padding: 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; }
    .section { padding: 40px 0; }
}

/* --- Posts Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
}

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

.post-card-img {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #e0e7ff;
}

.post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.post-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e7ff, #f0f4ff);
}

.post-card-body {
    padding: 20px;
}

.post-card-date {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 8px 0;
    line-height: 1.3;
}

.post-card-title a { color: #0f172a; }
.post-card-title a:hover { color: #2563eb; }

.post-card-excerpt {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.read-more {
    display: inline-block;
    margin-top: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 992px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .posts-grid { grid-template-columns: 1fr; }
}

/* --- Pagination --- */
.pagination {
    text-align: center;
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.9rem;
}

.pagination .current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* --- Single Post --- */
.single-post { padding: 40px 0; }

.single-hero {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    max-height: 500px;
}

.single-hero img { width: 100%; object-fit: cover; }

.single-header { margin-bottom: 32px; }

.single-cat {
    display: inline-block;
    background: #eef2ff;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.single-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}

.single-meta {
    display: flex;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.95rem;
}

.single-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #334155;
    max-width: 750px;
}

.single-content p { margin-bottom: 20px; }
.single-content h2, .single-content h3 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 700;
    color: #0f172a;
}
.single-content a { text-decoration: underline; }
.single-content img { border-radius: 8px; margin: 24px 0; }
.single-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 20px;
    margin: 24px 0;
    color: #475569;
    font-style: italic;
}

.single-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.single-tags a {
    display: inline-block;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #475569;
    margin-right: 6px;
}

.single-share {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #64748b;
    font-size: 0.9rem;
}

.single-share a {
    padding: 6px 12px;
    border-radius: 6px;
    background: #eef2ff;
    color: #2563eb;
    font-weight: 500;
    font-size: 0.85rem;
}

/* --- Comments --- */
.comments-area {
    max-width: 750px;
    margin: 40px auto;
    padding: 0 20px;
}

/* --- Footer --- */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 60px 0 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.footer-desc { font-size: 0.9rem; line-height: 1.6; }

.footer-nav ul { list-style: none; }
.footer-nav a { color: #94a3b8; display: block; padding: 4px 0; font-size: 0.95rem; }
.footer-nav a:hover { color: #fff; }

.footer-social { display: flex; flex-direction: column; gap: 8px; }
.footer-social a {
    color: #94a3b8;
    font-size: 0.95rem;
    padding: 4px 0;
}
.footer-social a:hover { color: #60a5fa; }

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}

.footer-laia { margin-top: 4px; color: #475569; font-size: 0.8rem; }

@media (max-width: 768px) {
    .footer-inner { grid-template-columns: 1fr; text-align: center; }
    .footer-social { flex-direction: row; justify-content: center; }
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.no-posts {
    text-align: center;
    padding: 60px;
    color: #94a3b8;
    font-size: 1.1rem;
}

/* --- Related posts in single --- */
.related-posts {
    background: #f1f5f9;
}

/**
 * Instagram feed grid
 */
.ig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.ig-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #e0e7ff;
    transition: transform 0.3s ease;
}

.ig-item:hover {
    transform: scale(1.03);
}

.ig-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Carousel --- */
.hero-carousel {
    position: relative;
    overflow: hidden;
    background: #eef2ff;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 450px;
}

.carousel-img {
    overflow: hidden;
}

.carousel-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
}

.carousel-cat {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    width: fit-content;
}

.carousel-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}

.carousel-title a {
    color: #1e293b;
    text-decoration: none;
}

.carousel-title a:hover {
    color: #2563eb;
}

.carousel-excerpt {
    color: #64748b;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.carousel-date {
    color: #94a3b8;
    font-size: 0.9rem;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
}

.carousel-btn {
    background: none;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.carousel-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eef2ff;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.carousel-dot.active {
    background: #2563eb;
}

@media (max-width: 768px) {
    .carousel-slide {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .carousel-img {
        height: 250px;
    }
    .carousel-content {
        padding: 30px;
    }
    .carousel-title {
        font-size: 1.5rem;
    }
    .ig-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
