/* =============== RESET =============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: white;
}

/* =============== HEADER / NAVBAR (TAL CUAL PEDISTE) =============== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Navbar transparente en scroll */
.header.transparent {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(30px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 60px;
    margin-right: 10px;
    border-radius: 20%;
}

.logo-img img {
    height: 100%;
    display: block;
}

/* Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

/* hover SIN línea naranja */
.nav-link:hover {
    color: #555;
}

/* solo el activo tiene línea naranja */
.nav-link.active {
    color: #ff6b35;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ff6b35;
    transition: width 0.3s ease;
}

/* subrayado solo en el activo */
.nav-link.active::after {
    width: 100%;
}

/* Hamburguesa móvil */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* =============== HERO GENERAL (POR SI USAS .hero EN OTRAS PÁGINAS) =============== */
.hero {
    position: relative;
    height: 60vh;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: url('silueta-de-construccion.jpg') center/cover;
    color: white;
    margin-top: 100px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 1rem;
}

.hero-content h1 {
    font-size: 3rem;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
    font-weight: 300;
}

/* =============== BLOG HERO ESPECÍFICO =============== */
.blog-hero {
    margin-top: 110px; /* separa del navbar fijo */
    padding: 60px 1.5rem 40px;
    text-align: center;
}

.blog-hero h1 {
    font-size: clamp(2rem, 3vw + 0.5rem, 3rem);
    margin-bottom: 10px;
    background: linear-gradient(135deg, #1e3f73, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.blog-hero p {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: #555;
}

/* =============== FLOATING ELEMENTS (FONDO DECORATIVO) =============== */
.floating-element {
    position: fixed;
    width: 180px;
    height: 180px;
    background: rgba(255, 107, 53, 0.12);
    border-radius: 50%;
    top: -80px;
    right: -60px;
    z-index: -1;
    filter: blur(2px);
    animation: float 12s infinite linear;
}

.floating-element:nth-of-type(2) {
    width: 130px;
    height: 130px;
    top: 40%;
    left: -50px;
    animation-duration: 16s;
}

.floating-element:nth-of-type(3) {
    width: 200px;
    height: 200px;
    bottom: -100px;
    right: 25%;
    animation-duration: 14s;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(20px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

/* =============== TITULOS GENERALES =============== */
.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 3vw + 0.5rem, 3rem);
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, #e9ecef, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* fade-in */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============== CATEGORIES SECTION =============== */
.categories-section {
    padding: 40px 1.5rem 20px;
}

.categories-title {
    text-align: center;
    font-size: clamp(1.6rem, 2.5vw + 0.5rem, 2.3rem);
    margin-bottom: 25px;
}

.categories-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 25px;
}

.category-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    text-align: center;
    padding: 15px 15px 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.category-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.category-name {
    margin-top: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    color: #333;
}

.category-count {
    font-size: 0.9rem;
    color: #777;
    margin-top: 4px;
}

/* =============== BLOG GRID (TARJETAS) =============== */
.blog-grid {
    max-width: 1200px;
    margin: 40px auto 60px;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* Tarjeta base */
.blog-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeUp 0.8s ease forwards;
    animation-play-state: paused;
    opacity: 0;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* Imagen */
.blog-card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* Contenido */
.blog-card-content {
    padding: 18px 18px 20px;
}

.blog-card-date {
    font-size: 0.9rem;
    color: #999;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 8px 0 10px;
    color: #222;
}

.blog-card-excerpt {
    font-size: 0.98rem;
    color: #555;
    line-height: 1.6;
}

/* Autor */
.blog-card-author {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ff6b35;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.author-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.author-info p {
    font-size: 0.8rem;
    color: #777;
}

/* =============== FEATURED POST (DESTACADO) =============== */
.featured-post {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
    gap: 20px;
    align-items: stretch;
}

.featured-image img {
    width: 100%;
    height: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
}

.featured-content {
    padding: 18px 18px 20px;
}

.featured-badge {
    display: inline-block;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ff6b35;
    color: #fff;
    margin-bottom: 6px;
}

/* Animación */
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(25px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* =============== RESPONSIVE =============== */
@media (max-width: 900px) {

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.5rem 0;
    }

    .hero {
        height: 50vh;
        margin-top: 70px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .featured-post {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {

    .logo-img {
        height: 50px;
    }

    .hero {
        height: 45vh;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .blog-hero {
        padding-top: 90px;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }
}
