/**
 * PAGES / INTERIOR
 * -----------------------------------------------------------------------------
 * Estilos compartidos por las páginas internas: Servicios, Proyectos,
 * Nosotros, Contacto, tienda sin WooCommerce, blog y fichas individuales.
 *
 * Se carga en todo el sitio MENOS en la portada.
 */

/* =============================================================
   CONTACTO
============================================================= */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 0.85fr;
    gap: var(--gap-grid-lg);
    align-items: start;
}

/* --- Datos de contacto ------------------------------------------------- */

.contact-info {
    display: grid;
    gap: var(--space-md);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.contact-item__label {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-md);
    color: var(--heading);
    margin-bottom: 2px;
}

.contact-item__value {
    font-size: var(--fs-lg);
    color: var(--text);
    line-height: 1.45;
}

.contact-item__value a:hover {
    color: var(--blue);
}

/* --- Bloque de cobertura ----------------------------------------------- */

.coverage {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.coverage__title {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-md);
    color: var(--heading);
    margin-bottom: var(--space-xs);
}

.coverage__regions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.coverage__regions span {
    padding: 5px 13px;
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    font-size: var(--fs-base);
    color: var(--text);
}

/* =============================================================
   NOSOTROS
============================================================= */

/*
 * Proporción fija, no `min-height`.
 *
 * Con `min-height` el contenedor no tenía altura propia, así que el
 * `height: 100%` de la imagen resolvía a `auto` y esta se pintaba a su altura
 * natural. Cuando la foto salía más baja que ese mínimo —una imagen 3:2 en
 * una columna de ~540 px da unos 360 px— el mínimo estiraba la caja igual y
 * asomaba una banda del fondo gris de `.media` por debajo de la foto.
 *
 * Con `aspect-ratio` la caja mide lo que debe a cualquier ancho y la imagen la
 * llena por completo con `object-fit: cover`.
 */
.about-media {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.about-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Marcas con las que trabajamos ------------------------------------- */

.brand-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    padding: var(--space-sm);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    font-size: var(--fs-xl);
    color: var(--heading);
    transition: var(--transition);
}

/*
 * La tarjeta acepta ahora el logotipo de la marca además de su nombre: se
 * limita el alto para que las tres cajas midan igual, sea cual sea la
 * proporción del archivo que suba el fabricante.
 */
.brand img {
    max-width: 100%;
    max-height: 56px;
    width: auto;
    object-fit: contain;
}

.brand:hover {
    border-color: var(--border-blue);
    box-shadow: var(--shadow-sm);
}

.brand img {
    max-height: 44px;
    width: auto;
    object-fit: contain;
}

/* --- Hitos / línea de tiempo ------------------------------------------- */

.timeline {
    display: grid;
    gap: var(--space-md);
    position: relative;
    padding-left: var(--space-lg);
}

.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 1.5px;
    background: var(--border-strong);
}

.timeline__item {
    position: relative;
}

.timeline__item::before {
    content: "";
    position: absolute;
    left: calc(var(--space-lg) * -1 + 3px);
    top: 6px;
    width: 11px;
    height: 11px;
    border-radius: var(--radius-circle);
    background: var(--blue);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--border-blue);
}

.timeline__year {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    font-size: var(--fs-md);
    color: var(--blue);
}

/* =============================================================
   FICHA DE PROYECTO / SERVICIO
============================================================= */

/*
 * Encuadre fijo 16:9. Antes era `max-height: 460px` con la imagen a
 * `height: 100%`: como el contenedor no tenía altura propia, la foto se
 * pintaba a su tamaño natural y el sobrante se recortaba por abajo, así que
 * cada proyecto se veía con un recorte distinto según el alto de su archivo.
 */
.entry-media {
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    aspect-ratio: 16 / 9;
    background: var(--bg-soft);
}

.entry-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.entry-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--gap-grid-lg);
    align-items: start;
}

.entry-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-md));
    display: grid;
    gap: var(--space-md);
}

.sidebar-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

/* Lista de enlaces dentro de una tarjeta lateral */
.link-list {
    display: grid;
    gap: 10px;
}

.link-list a {
    color: var(--text);
    font-size: var(--fs-md);
    transition: var(--transition);
}

.link-list a:hover {
    color: var(--blue);
}

.sidebar-card__title {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-xl);
    color: var(--heading);
    margin-bottom: var(--space-sm);
}

/* =============================================================
   BLOG / LISTADOS GENÉRICOS
============================================================= */

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.post-card:hover {
    transform: var(--lift-lg);
    border-color: var(--border-blue);
    box-shadow: var(--shadow-md);
}

.post-card__media {
    height: 190px;
    background: var(--bg-soft);
}

.post-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__body {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__date {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-2xs);
}

.post-card__title {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-xl);
    letter-spacing: 0;
    color: var(--heading);
    margin-bottom: var(--space-xs);
}

.post-card__title a:hover {
    color: var(--blue);
}

.post-card .btn-link {
    margin-top: auto;
    align-self: flex-start;
}

/* =============================================================
   PAGINACIÓN
============================================================= */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    justify-content: center;
    margin-top: var(--space-xl);
}

.pagination .page-numbers {
    min-width: 42px;
    height: 42px;
    padding: 0 var(--space-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    transition: var(--transition);
}

.pagination .page-numbers:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.pagination .page-numbers.current {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
}

/* =============================================================
   ESTADO VACÍO
============================================================= */

.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    background: var(--bg-alt);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-xl);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-circle);
    background: var(--white);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
}

.empty-state__icon svg {
    width: 28px;
    height: 28px;
}

.empty-state h2 {
    font-size: var(--fs-h3);
    margin-bottom: var(--space-xs);
}

/* =============================================================
   RESPONSIVE
============================================================= */

@media (max-width: 480px) {

    .brand-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1000px) {

    .contact-grid,
    .entry-layout {
        grid-template-columns: 1fr;
    }

    .entry-sidebar {
        position: static;
    }

    /* En una columna la foto se tumba: 4:3 a ancho completo ocupa demasiado. */
    .about-media {
        aspect-ratio: 16 / 9;
    }
}

/* =============================================================
   COMENTARIOS
============================================================= */

.comments-area {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.comment-list {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.comment-list .comment-body {
    padding: var(--space-md);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.comment-list .children {
    margin-top: var(--space-sm);
    padding-left: var(--space-md);
    display: grid;
    gap: var(--space-sm);
}

.comment-author .avatar {
    border-radius: var(--radius-circle);
}

.comment-meta {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.comment-reply-link {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--blue);
}
