/*
Theme Name: Hamilton Child - Jorge Muriedas Portfolio
Theme URI: https://jorgemuriedas.com
Description: Child theme de Hamilton personalizado para portfolio de artista gráfico con sistema de gestión de obras y control de accesos
Author: Tu Nombre
Template: hamilton
Version: 1.0.0
Text Domain: hamilton-child
*/

/* ============================================================
   1. IMPORTAR PT MONO DESDE GOOGLE FONTS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=PT+Mono&display=swap');


/* ============================================
   IMPORTAR ESTILOS DEL TEMA PADRE
   ============================================ */

/* Los estilos del tema padre se cargan desde functions.php */

/* ============================================
   PERSONALIZACIONES PORTFOLIO OBRAS
   ============================================ */

/* Galería de obras - Grid responsive */
.obras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.obra-card {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.obra-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.obra-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

.obra-info {
    padding: 20px;
    background: #fff;
}

.obra-titulo {
    font-size: 1.2em;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.obra-meta {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0;
}

/* Badge de estado */
.estado-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.estado-disponible {
    background: #d4edda;
    color: #155724;
}

.estado-no-disponible {
    background: #f8d7da;
    color: #721c24;
}

.estado-vendida {
    background: #d1ecf1;
    color: #0c5460;
}

/* Obra individual - Single */
.single-obra .obra-imagen-principal {
    max-width: 100%;
    height: auto;
    margin: 40px auto;
    display: block;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.single-obra .obra-detalles {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
}

.single-obra .detalle-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.single-obra .detalle-item:last-child {
    border-bottom: none;
}

.single-obra .detalle-label {
    font-weight: 600;
    color: #333;
}

.single-obra .detalle-valor {
    color: #666;
}

/* Precio (solo visible para usuarios autorizados) */
.obra-precio {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 20px;
}

/* Filtros de catálogo */
.obras-filtros {
    margin: 30px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.obras-filtros select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    margin-right: 10px;
}

/* Mensajes de acceso */
.acceso-restringido {
    padding: 30px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    text-align: center;
    margin: 40px 0;
}

.acceso-restringido h3 {
    margin-top: 0;
    color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
    .obras-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .single-obra .obra-detalles {
        padding: 20px;
    }
}

/* ============================================
   ADMIN - Simplificación interfaz WordPress
   ============================================ */

/* Ocultar elementos innecesarios en el editor para Jorge */
body.post-type-obra .misc-pub-section:not(.misc-pub-post-status) {
    /* Mantener visible solo el estado de publicación */
}

/* Destacar el selector de estado de obra */
.estado-obra-selector {
    background: #fffbcc;
    padding: 15px;
    border: 2px solid #ffc107;
    border-radius: 5px;
    margin: 15px 0;
}

/* ============================================
   OPTIMIZACIÓN DE CARGA DE IMÁGENES
   ============================================ */

/* Lazy loading nativo */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================================
 * TIPOGRAFÍAS — AÑADIR AL FINAL DE style.css
 * Child Theme: hamilton-child
 * Proyecto: Jorge Muriedas Portfolio
 * ============================================================ */

/* ============================================================
   2. PT MONO COMO FUENTE GLOBAL — TODOS LOS ELEMENTOS
   ============================================================ */

html,
body,
body *,
h1, h2, h3, h4, h5, h6,
p, a, li, ul, ol,
span, div, section, article,
button, input, textarea, select,
.site-title,
.site-description,
.nav-menu,
.nav-menu a,
.main-navigation,
.main-navigation a,
.menu-item a,
blockquote,
caption,
label {
    font-family: 'PT Mono', monospace !important;
}

/* ============================================================
   3. ELIMINAR MAYÚSCULAS FORZADAS EN TODO EL SITIO
   ============================================================ */

/* Reset global */
* {
    text-transform: none !important;
}

/* Asegurar en elementos específicos que Hamilton suele forzar */
h1, h2, h3, h4, h5, h6,
.site-title,
.site-description,
.nav-menu a,
.main-navigation a,
.menu-item a,
.entry-title,
.page-title,
.widget-title,
.wp-block-heading,
button,
.button,
.wp-element-button {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Elementor — por si Pablo usa headings en Elementor */
.elementor-heading-title,
.elementor-widget-heading .elementor-heading-title,
.elementor h1,
.elementor h2,
.elementor h3,
.elementor h4,
.elementor h5,
.elementor h6 {
    text-transform: none !important;
    font-family: 'PT Mono', monospace !important;
    letter-spacing: normal !important;
}

/* Elementor — textos generales */
.elementor,
.elementor p,
.elementor a,
.elementor li,
.elementor span,
.elementor div {
    font-family: 'PT Mono', monospace !important;
}

/*
 * ============================================================
 * RESPONSIVE MOBILE — AÑADIR AL FINAL DE style.css
 * Child Theme: hamilton-child
 * Proyecto: Jorge Muriedas Portfolio
 * ============================================================ */

/* ============================================================
   RESPONSIVE MOBILE — Márgenes y grid
   Afecta a pantallas de 768px o menos (tablets y móviles)
   ============================================================ */

@media (max-width: 768px) {

    /* ----------------------------------------------------------
       1. MÁRGENES LATERALES — Todas las páginas (editor clásico)
       Añade espacio respirable a izquierda y derecha del contenido
    ---------------------------------------------------------- */

    .entry-content,
    .entry-header,
    .page-content,
    .post-content,
    .site-main,
    .content-area {
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box;
    }

    /* Asegurar que ningún contenedor desborda el ancho de pantalla */
    .site-content,
    .content-area,
    .site-main {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* ----------------------------------------------------------
       2. GRID DE OBRAS — Portafolio y catálogo
       En mobile: 1 sola columna, con márgenes laterales
    ---------------------------------------------------------- */

    .obras-grid,
    .obras-grid-cols-2,
    .obras-grid-cols-3,
    .obras-grid-cols-4 {
        grid-template-columns: 1fr !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Asegurar que las tarjetas de obra no desbordan */
    .obra-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .obra-card__img {
        width: 100% !important;
        height: auto !important;
    }

    /* ----------------------------------------------------------
       3. IMÁGENES GENERALES — Evitar desbordamiento horizontal
    ---------------------------------------------------------- */

    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* ----------------------------------------------------------
       4. BODY — Evitar scroll horizontal en toda la web
    ---------------------------------------------------------- */

    body {
        overflow-x: hidden !important;
    }

}

/* ============================================================
   RESPONSIVE TABLET — 769px a 1024px
   2 columnas en el grid (en lugar de 3)
   ============================================================ */

@media (min-width: 769px) and (max-width: 1024px) {

    .obras-grid-cols-3,
    .obras-grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

}

/* ============================================================
   BLOG — Entrada individual (single.php)
   ============================================================ */

.blog-cabecera-imagen {
    width: 100%;
    max-height: 520px;
    overflow: hidden;
}

.blog-imagen-destacada {
    width: 100%;
    height: 520px;
    object-fit: cover;
    display: block;
}

.blog-contenido-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 20px 5rem;
}

.blog-entrada-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1.5rem;
}

.blog-entrada-titulo {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: inherit;
}

.blog-entrada-fecha {
    font-size: 0.82rem;
    color: #888;
    margin: 0;
    letter-spacing: 0.03em;
}

.blog-entrada-contenido {
    font-size: 1rem;
    line-height: 1.8;
    color: inherit;
}

.blog-entrada-contenido p {
    margin-bottom: 1.5rem;
}

.blog-entrada-contenido img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
}

.blog-entrada-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #333;
}

.blog-volver {
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
}

.blog-volver:hover {
    color: inherit;
}


/* ============================================================
   BLOG — Listado de entradas (archive.php)
   ============================================================ */

.blog-listado-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 20px 5rem;
}

.blog-listado-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1.5rem;
}

.blog-listado-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.blog-listado {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.blog-preview {
    border-bottom: 1px solid #222;
    padding-bottom: 3rem;
}

.blog-preview__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.blog-preview__imagen {
    overflow: hidden;
    margin-bottom: 1.25rem;
    aspect-ratio: 16 / 7;
}

.blog-preview__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.blog-preview:hover .blog-preview__img {
    transform: scale(1.03);
}

.blog-preview__titulo {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

.blog-preview__fecha {
    font-size: 0.78rem;
    color: #888;
    margin: 0 0 0.75rem;
    letter-spacing: 0.03em;
}

.blog-preview__extracto {
    font-size: 0.9rem;
    color: #aaa;
    margin: 0;
    line-height: 1.6;
}

.blog-sin-entradas {
    color: #666;
    font-size: 0.9rem;
}

/* Paginacion del blog */
.nav-links {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.nav-links a {
    color: #888;
    text-decoration: none;
}

.nav-links a:hover {
    color: inherit;
}


/* ============================================================
   BLOG — Responsive mobile
   ============================================================ */

@media (max-width: 768px) {

    .blog-imagen-destacada {
        height: 240px;
    }

    .blog-entrada-titulo {
        font-size: 1.5rem;
    }

    .blog-preview__imagen {
        aspect-ratio: 16 / 9;
    }

}

/*
 * ============================================================
 * HOME — ÍNDICE VISUAL DE COLECCIONES
 * AÑADIR AL FINAL DE style.css
 * Child Theme: hamilton-child
 * Proyecto: Jorge Muriedas Portfolio
 * ============================================================
 */

/* ============================================================
   WRAPPER PRINCIPAL
   ============================================================ */

.home-colecciones-wrapper {
    width: 100%;
    padding: 0;
    margin: 0;
}

/* ============================================================
   GRID DE COLECCIONES
   Desktop: 2 columnas
   Mobile: 1 columna
   ============================================================ */

.home-colecciones-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    width: 100%;
}

/* ============================================================
   BLOQUE DE COLECCIÓN
   ============================================================ */

.home-coleccion-bloque {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    aspect-ratio: 4 / 3;
    background-color: #111;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* Efecto zoom suave en hover */

.home-coleccion-bloque::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-image: inherit;
    transition: transform 0.6s ease;
}

.home-coleccion-bloque:hover::before {
    transform: scale(1.05);
}

/* ============================================================
   OVERLAY CON NOMBRE Y CONTADOR
   ============================================================ */

.home-coleccion-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    transition: background 0.3s ease;
    gap: 0.4rem;
}

.home-coleccion-bloque:hover .home-coleccion-overlay {
    background: rgba(0, 0, 0, 0.55);
}

.home-coleccion-nombre {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.08em;
    text-align: center;
}

.home-coleccion-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.05em;
    text-align: center;
}

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

@media (max-width: 768px) {

    .home-colecciones-grid {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .home-coleccion-bloque {
        aspect-ratio: 3 / 2;
    }

    .home-coleccion-nombre {
        font-size: 1rem;
    }

}

/* ============================================================
   SIN COLECCIONES
   ============================================================ */

.home-sin-colecciones {
    text-align: center;
    padding: 4rem 0;
    color: #666;
    font-size: 0.9rem;
}