/*
Theme Name: Arocar Mosaic
Theme URI: https://www.instagram.com/aroarcommunity
Description: Mosaico orgánico tipo célula/átomo con expansión en todas direcciones
Author: Arocar Community
Version: 1.0
*/

:root {
    --color-rojo: #FF0000;
    --color-amarillo: #FFD700;
    --color-negro: #000000;
    --color-blanco: #FFFFFF;
    --color-gris: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--color-blanco);
    color: var(--color-negro);
    overflow-x: hidden;
}

/* ========== HEADER ========== */
.site-header {
    text-align: center;
    padding: 60px 20px 40px;
    background-color: var(--color-blanco);
    border-bottom: 3px solid var(--color-rojo);
}

.site-logo {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--color-amarillo);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.3);
}

.site-logo:hover {
    transform: scale(1.08) rotate(5deg);
    border-color: var(--color-rojo);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.5);
}

.site-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--color-negro);
    margin-bottom: 15px;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.site-instagram {
    font-size: 1.2rem;
    color: var(--color-rojo);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
}

.site-instagram::before {
    content: '@';
    color: var(--color-amarillo);
    font-weight: 800;
}

.site-instagram:hover {
    color: var(--color-amarillo);
    transform: translateY(-2px);
}

/* ========== MOSAICO ORGÁNICO ========== */
.mosaic-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
}

.grid {
    width: 100%;
    column-count: 10;
    column-gap: 1px;
    max-width: 1400px;
    margin: 0 auto;
    line-height: 0;
}

.grid::after {
    content: '';
    display: block;
    clear: both;
}

/* Grid Items - Células orgánicas - Formato vertical TikTok */
.grid-item {
    width: 100%;
    height: auto;
    margin: 0 0 1px 0;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    background: #000;
    box-shadow: none;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    border: none;
    display: inline-block;
    vertical-align: top;
    break-inside: avoid;
    page-break-inside: avoid;
    opacity: 0.95;
}

.grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 215, 0, 0.08) 60%, rgba(255, 0, 0, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
    pointer-events: none;
}

.grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8), 0 0 50px rgba(255, 0, 0, 0.4);
    z-index: 100;
    opacity: 1;
}

.grid-item:hover::before {
    opacity: 1;
}

/* Tamaños variables para efecto orgánico - Adaptables */
.grid-item--width2 {
    width: 300px;
}

.grid-item--width3 {
    width: 280px;
}

.grid-item--height2,
.grid-item--height3 {
    height: auto;
}

/* Imagen dentro del item */
.grid-item__link {
    display: block;
    position: relative;
    width: 100%;
    height: auto;
    z-index: 1;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.grid-item__img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

.grid-item:hover .grid-item__img {
    transform: scale(1.08);
    filter: brightness(1.1) contrast(1.05);
}

/* Loading state */
.grid-item.loading {
    opacity: 0.5;
}

.grid-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--color-gris);
    border-top-color: var(--color-rojo);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== FOOTER ========== */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--color-negro);
    color: var(--color-blanco);
    border-top: 5px solid var(--color-rojo);
}

.footer-email {
    font-size: 1.1rem;
    color: var(--color-amarillo);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-email:hover {
    color: var(--color-rojo);
}

/* ========== LOADING ANIMATION ========== */
.mosaic-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: var(--color-rojo);
}

.mosaic-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .grid-item {
        width: 220px;
    }
    
    .grid-item--width2 {
        width: 460px;
    }
    
    .grid-item--width3 {
        width: 310px;
    }
}

@media (max-width: 1024px) {
    .site-title {
        font-size: 2.5rem;
    }
    
    .grid-item {
        width: 200px;
    }
    
    .grid-item--width2 {
        width: 420px;
    }
    
    .grid-item--width3 {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 40px 15px 30px;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .mosaic-container {
        padding: 30px 15px 60px;
    }
    
    .grid-item {
        width: 160px;
        margin: 6px;
    }
    
    .grid-item--width2 {
        width: 340px;
    }
    
    .grid-item--width3 {
        width: 240px;
    }
    
    .grid-item--height2,
    .grid-item--height3 {
        height: auto;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.5rem;
    }
    
    .site-instagram {
        font-size: 1rem;
    }
    
    .grid-item {
        width: 140px;
        margin: 5px;
    }
    
    .grid-item--width2,
    .grid-item--width3 {
        width: 140px;
    }
    
    .grid-item:hover {
        transform: scale(1.05) rotate(1deg);
    }
}

/* ========== EFECTO NÚCLEO CENTRAL ========== */
.grid-item:first-child {
    animation: pulse-core 3s ease-in-out infinite;
    z-index: 10 !important;
    border: 4px solid var(--color-rojo);
}

@keyframes pulse-core {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(255, 0, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 12px 50px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 0, 0, 0.4);
        transform: scale(1.03);
    }
}

/* Layout tipo átomo/nuclear - Núcleo fijo arriba, resto con Isotope */
.grid {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    padding-top: 650px;
}

/* El núcleo (primer item) - fijo arriba y centrado */
.grid-item--nuclear {
    width: 300px !important;
    max-width: 300px !important;
    height: auto !important;
    max-height: 600px !important;
    position: absolute !important;
    top: 0;
    left: 50%;
    transform: translateX(-50%) !important;
    z-index: 100;
}

/* Los demás items usan Isotope normal - Pegados */
.grid-item:not(.grid-item--nuclear) {
    position: relative;
    margin: 2px;
}

/* Lazy load fade-in */
.grid-item img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.grid-item img[loading="lazy"].loaded {
    opacity: 1;
}

/* ========== PARTÍCULAS ANIMADAS EN EL FONDO ========== */
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: float infinite ease-in-out;
    pointer-events: none;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(100px, -100px) scale(1.2);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50px, 100px) scale(0.8);
        opacity: 0.4;
    }
    75% {
        transform: translate(-100px, -50px) scale(1.1);
        opacity: 0.5;
    }
}

/* Variaciones de partículas */
.particle:nth-child(2n) {
    animation-direction: reverse;
}

.particle:nth-child(3n) {
    animation-duration: 25s !important;
}

.particle:nth-child(4n) {
    animation-duration: 18s !important;
}

/* ========== RESPONSIVE COLUMNS ========== */
@media (max-width: 1400px) {
    .grid {
        column-count: 8;
    }
}

@media (max-width: 1024px) {
    .grid {
        column-count: 6;
    }
}

@media (max-width: 768px) {
    .grid {
        column-count: 4;
    }
}

@media (max-width: 480px) {
    .grid {
        column-count: 3;
    }
}
/* HEADER HERO */
.site-header{
text-align:center;
padding:80px 20px 40px;
background:#ffffff;
}

/* LOGO */
.site-logo{
width:120px;
height:120px;
object-fit:cover;
border-radius:50%;
border:6px solid #FFD700;
box-shadow:0 0 25px rgba(255,215,0,0.6);
margin:0 auto 25px;
display:block;
}

/* TITULO GRANDE */
.site-title{
font-size:70px;
font-weight:900;
color:#ff2a2a;
letter-spacing:2px;
margin-bottom:10px;
text-transform:uppercase;
}

/* SUBTITULO */
.site-subtitle{
font-size:20px;
letter-spacing:4px;
color:#777;
margin-bottom:35px;
}

/* BOTON INSTAGRAM */
.site-instagram{
display:inline-block;
border:2px solid #000;
padding:14px 30px;
border-radius:40px;
font-size:18px;
font-weight:600;
text-decoration:none;
color:#000;
transition:all .3s ease;
}

.site-instagram:hover{
background:#000;
color:#fff;
}