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

body {
    font-family: "PT Sans", Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.8em;
    color: #555555;
    background-color: #f5f5f5;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #d0d0d0;
}

body.dark-mode .blog-header {
    border-bottom-color: #ffcd38;
}

body.dark-mode .blog-header h1,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    color: #e0e0e0;
}

body.dark-mode .blog-header p {
    color: #e0e0e0;
}

body.dark-mode .portfolio-link {
    background-color: #ffcd38;
    color: #222222;
}

body.dark-mode .portfolio-link:hover,
body.dark-mode .back-to-blog-link:hover {
    background-color: #1a1a1a;
    color: #e0e0e0;
    box-shadow: inset 0 0 0 2px #ffcd38, 0 4px 12px rgba(255, 205, 56, 0.3);
}

body.dark-mode .post-card {
    border-color: #3a3a3a;
}

body.dark-mode .post-card:hover {
    border-color: #ffcd38;
}

body.dark-mode .post-card-title a {
    color: #e0e0e0;
}

body.dark-mode .post-card-title a:hover {
    color: #33b5e5;
}

body.dark-mode .post-card-excerpt {
    color: #b0b0b0;
}

body.dark-mode .read-more {
    background-color: #ffcd38;
    color: #222222;
}

body.dark-mode .read-more:hover {
    background-color: #1a1a1a;
    color: #e0e0e0;
    box-shadow: inset 0 0 0 2px #ffcd38, 0 4px 12px rgba(255, 205, 56, 0.3);
}

body.dark-mode .section-title {
    color: #e0e0e0;
    border-left-color: #ffcd38;
}

body.dark-mode .content-wrapper {
    background-color: #242424;
}

body.dark-mode .about-section {
    border-top-color: #3a3a3a;
}

body.dark-mode .tag-cloud-section {
    border-top-color: #3a3a3a;
    border-bottom-color: #3a3a3a;
}

h1, h2, h3, h4 {
    font-family: "Oswald", Helvetica, sans-serif;
    color: #222222;
    font-weight: 400;
}

a {
    color: #0099cc;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #006699;
}

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

.blog-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 3px solid #ffcd38;
}

.blog-header h1 {
    font-size: 42px;
    margin-bottom: 10px;
    color: #222222;
}

.blog-header p {
    font-size: 16px;
    color: #222222;
    font-family: "Oswald", Helvetica, sans-serif;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.portfolio-link,
.back-to-blog-link {
    display: inline-block;
    padding: 10px 25px;
    background-color: #ffcd38;
    color: #222222;
    font-family: "Oswald", Helvetica, sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    transition: background-color 0.3s, transform 0.2s;
}

.portfolio-link:hover,
.back-to-blog-link:hover {
    background-color: #ffffff;
    color: #222222;
    box-shadow: inset 0 0 0 2px #ffcd38, 0 4px 12px rgba(255, 205, 56, 0.3);
    transform: translateY(-2px);
}

body.dark-mode .portfolio-link:hover,
body.dark-mode .back-to-blog-link:hover {
    background-color: #1a1a1a;
    color: #e0e0e0;
    box-shadow: inset 0 0 0 2px #ffcd38, 0 4px 12px rgba(255, 205, 56, 0.3);
}

/* Unified content wrapper - single background like post pages */
.content-wrapper {
    background-color: #ffffff;
    padding: 60px 50px 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.featured-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 24px;
    color: #222222;
    margin-bottom: 30px;
    padding-left: 15px;
    border-left: 4px solid #ffcd38;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 35px;
    margin-bottom: 40px;
}

.posts-grid.single-post {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.posts-grid.small-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Post cards - no separate background, just border */
.post-card {
    background-color: transparent;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: #ffcd38;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-thumbnail {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.small-cards .post-thumbnail {
    height: 180px;
}

.post-card-content {
    padding: 25px;
}

.small-cards .post-card-content {
    padding: 20px;
}

.post-card-title {
    font-size: 24px;
    margin-bottom: 12px;
    color: #222222;
}

.small-cards .post-card-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.post-card-title a {
    color: #222222;
    transition: color 0.3s;
}

body.dark-mode .post-card-title a {
    color: #e0e0e0;
}

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

body.dark-mode .post-card-title a:hover {
    color: #33b5e5;
}

.post-card-excerpt {
    color: #555555;
    margin-bottom: 15px;
    line-height: 1.6em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-mode .post-card-excerpt {
    color: #b0b0b0;
}

.small-cards .post-card-excerpt {
    font-size: 14px;
    margin-bottom: 12px;
}

.post-card-tags {
    margin-bottom: 15px;
}

.small-cards .post-card-tags {
    margin-bottom: 12px;
}

.tag-small {
    display: inline-block;
    background-color: #ffcd38;
    color: #222;
    padding: 3px 10px;
    margin: 3px 5px 3px 0;
    border-radius: 3px;
    font-size: 11px;
    font-family: "Oswald", Helvetica, sans-serif;
    text-transform: uppercase;
}

.small-cards .tag-small {
    font-size: 10px;
    padding: 2px 8px;
}

.read-more {
    display: inline-block;
    padding: 6px 16px;
    background-color: #ffcd38;
    color: #222222;
    font-family: "Oswald", Helvetica, sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    transition: background-color 0.3s, transform 0.2s;
}

.small-cards .read-more {
    font-size: 11px;
    padding: 5px 14px;
}

.read-more:hover {
    background-color: #ffffff;
    color: #222222;
    box-shadow: inset 0 0 0 2px #ffcd38, 0 4px 12px rgba(255, 205, 56, 0.3);
    transform: translateY(-2px);
}

.read-more::after {
    content: " →";
}

/* About section - no separate background, just border separator */
.about-section {
    padding-top: 40px;
    margin-top: 50px;
    border-top: 2px solid #e5e5e5;
    transition: border-color 0.3s;
}

.about-section h3 {
    margin-bottom: 15px;
    font-size: 24px;
}

.about-section p {
    margin-bottom: 10px;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toggle-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    background-color: #ffcd38;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

body.dark-mode .toggle-btn {
    background-color: #2a2a2a;
}

body.dark-mode .toggle-btn:hover {
    background-color: #ffcd38;
}

/* ============================================================================
   TÍTULO DEL BLOG ENLAZADO
   ============================================================================ */

.blog-header h1 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-header h1 a:hover {
    color: #ffcd38;
}


/* ============================================================================
   NUBE DE TAGS - no separate background
   ============================================================================ */

.tag-cloud-section {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 2px solid #e5e5e5;
    border-bottom: 2px solid #e5e5e5;
}

.tag-cloud-section h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: #222222;
    margin-bottom: 1.5rem;
    text-align: center;
}

body.dark-mode .tag-cloud-section h3 {
    color: #e0e0e0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    line-height: 2;
}

.tag-cloud a {
    display: inline-block;
    background-color: transparent;
    color: #555555;
    padding: 6px 16px;
    border-radius: 6px;
    border: 2px solid #ffcd38;
    font-size: 14px;
    font-family: "PT Sans", sans-serif;
    font-weight: 400;
    transition: all 0.3s;
    text-decoration: none;
}

body.dark-mode .tag-cloud a {
    color: #b0b0b0;
}

.tag-cloud a:hover {
    background-color: #ffcd38;
    transform: translateY(-2px);
}

.tag-cloud a.active {
    background-color: #ffcd38;
}


/* ============================================================================
   TAG SECTION (para tag-indexes)
   ============================================================================ */

.tag-section {
    margin-bottom: 3rem;
}

.tag-section .section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.tag-highlight {
    color: #ffcd38;
    font-weight: 600;
}


/* ============================================================================
   HEADER LINKS - Unified button navigation
   ============================================================================ */

.header-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}


/* ============================================================================
   DARK MODE SUPPORT
   ============================================================================ */

body.dark-mode .back-link {
    color: #b0b0b0;
}


/* ============================================================================
   RESPONSIVE
   ============================================================================ */

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

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .blog-header h1 {
        font-size: 32px;
    }

    .content-wrapper {
        padding: 30px 20px;
    }

    .posts-grid, .posts-grid.small-cards {
        grid-template-columns: 1fr;
    }

    .post-thumbnail, .small-cards .post-thumbnail {
        height: 200px;
    }

    .about-section {
        padding-top: 25px;
        margin-top: 30px;
    }

    .dark-mode-toggle {
        top: 10px;
        right: 10px;
    }

    .toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .tag-cloud {
        gap: 0.75rem;
    }
    
    .tag-cloud a {
        font-size: 0.9em;
        padding: 0.2rem 0.5rem;
    }
    
    .header-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .back-to-blog-link,
    .portfolio-link {
        width: 100%;
        text-align: center;
    }
}