/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #f39c12;
}

.header-sub {
    font-size: 14px;
    color: #bbb;
}

/* ============================================
   MAIN
   ============================================ */
main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 40px 20px;
    text-align: center;
}

main h2 {
    font-size: 26px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.opis {
    font-size: 14px;
    color: #888;
    margin-bottom: 30px;
}

/* ============================================
   FLEXBOX GRID - 9 BOXOVA
   ============================================ */
.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

/* ============================================
   BOX - SWAP IMAGE
   ============================================ */
.box {
    position: relative;
    width: calc(33.333% - 12px);
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    background-color: #ccc;
}

/* Obje slike zauzimaju cijeli box */
.box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Defaultna slika - vidljiva */
.box .slika-default {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

/* Hover slika - skrivena */
.box .slika-hover {
    opacity: 0;
    transform: scale(1.08);
    z-index: 2;
}

/* Na hover: sakrij defaultnu, prikaži hover sliku */
.box:hover .slika-default {
    opacity: 0;
    transform: scale(1.08);
}

.box:hover .slika-hover {
    opacity: 1;
    transform: scale(1);
}

/* LABEL */
.label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 13px;
    font-weight: bold;
    padding: 20px 12px 10px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s;
}

.box:hover .label {
    opacity: 1;
}

/* Okvir na hover */
.box::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid #f39c12;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 4;
    pointer-events: none;
}

.box:hover::after {
    opacity: 1;
}

/* ============================================
   RESPONZIVNOST
   ============================================ */
@media (max-width: 768px) {
    .box {
        width: calc(50% - 8px);
    }
}

@media (max-width: 480px) {
    .box {
        width: 100%;
    }

    main h2 { font-size: 20px; }
    .logo { font-size: 22px; }
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: #2c3e50;
    color: #777;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}
