/* ── Hover Grid – Front-end styles ── */

.hg-grid {
    display: grid;
    gap: clamp(8px, 1.4vw, 20px);
    width: 100%;
    max-width: 100%;
}

/* ── Kafel (sekcja 1 i 2) – cały kafel jest linkiem ── */
.hg-tile {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    border-radius: 4px;
    background-image: var(--hg-bg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #eee;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    cursor: pointer;
}

.hg-tile:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    z-index: 1;
}

/* Overlay z tytułem – zawsze widoczny gdy tytuł jest ustawiony */
.hg-tile__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.4rem 1rem;
    text-align: center;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.32) 48%,
        rgba(0, 0, 0, 0.0) 100%
    );
    pointer-events: none;
}

.hg-tile__title {
    color: #ffffff;
    font-size: clamp(0.85rem, 1.3vw, 1.15rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ══════════════════════════════════════════════════
   SEKCJA 1 — [pierwszy_grid] — 6 kwadratowych kafli w rzędzie
   ══════════════════════════════════════════════════ */

.hg-grid--six {
    grid-template-columns: repeat(6, 1fr);
}

.hg-grid--six .hg-tile {
    aspect-ratio: 1 / 1;
}

@media (max-width: 1100px) {
    .hg-grid--six { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .hg-grid--six { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
    .hg-grid--six { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════
   SEKCJA 2 — [drugi_grid] — układ mozaikowy (8 kafli), wg schematu
   Desktop: 6 kolumn / 2 rzędy
   b1,b2  – wysokie kafle (pełna wysokość, 1 kolumna)
   b3,b4  – kwadraty (górny rząd)
   b5     – szeroki kafel (górny rząd, 2 kolumny)
   b6     – szeroki kafel (dolny rząd, 2 kolumny)
   b7,b8  – kwadraty (dolny rząd)
   ══════════════════════════════════════════════════ */

.hg-grid--bento {
    grid-template-columns: repeat(6, 1fr);
    grid-template-areas:
        "b1 b2 b3 b4 b5 b5"
        "b1 b2 b6 b6 b7 b8";
}

.hg-grid--bento .hg-tile--1 { grid-area: b1; aspect-ratio: 1 / 2.05; }
.hg-grid--bento .hg-tile--2 { grid-area: b2; aspect-ratio: 1 / 2.05; }
.hg-grid--bento .hg-tile--3 { grid-area: b3; aspect-ratio: 1 / 1; }
.hg-grid--bento .hg-tile--4 { grid-area: b4; aspect-ratio: 1 / 1; }
.hg-grid--bento .hg-tile--5 { grid-area: b5; aspect-ratio: 2.05 / 1; }
.hg-grid--bento .hg-tile--6 { grid-area: b6; aspect-ratio: 2.05 / 1; }
.hg-grid--bento .hg-tile--7 { grid-area: b7; aspect-ratio: 1 / 1; }
.hg-grid--bento .hg-tile--8 { grid-area: b8; aspect-ratio: 1 / 1; }

/* Tablet: 3 kolumny, mozaika uproszczona ale wciąż zróżnicowana */
@media (max-width: 900px) {
    .hg-grid--bento {
        grid-template-columns: repeat(3, 1fr);
        grid-template-areas:
            "b1 b2 b3"
            "b1 b2 b4"
            "b5 b5 b5"
            "b6 b6 b6"
            "b7 b8 b8";
    }

    .hg-grid--bento .hg-tile--1,
    .hg-grid--bento .hg-tile--2 { aspect-ratio: 1 / 1.4; }

    .hg-grid--bento .hg-tile--5,
    .hg-grid--bento .hg-tile--6 { aspect-ratio: 3 / 1; }
}

/* Mobile: 2 kolumny, prosty stos par + pełna szerokość dla szerokich kafli */
@media (max-width: 560px) {
    .hg-grid--bento {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "b1 b2"
            "b3 b4"
            "b5 b5"
            "b6 b6"
            "b7 b8";
    }

    .hg-grid--bento .hg-tile--1,
    .hg-grid--bento .hg-tile--2 { aspect-ratio: 1 / 1; }

    .hg-grid--bento .hg-tile--5,
    .hg-grid--bento .hg-tile--6 { aspect-ratio: 2 / 1; }
}

/* ══════════════════════════════════════════════════
   SEKCJA 3 — shortcode ustawiany w kokpicie — 6 kafli + przycisk pod spodem
   ══════════════════════════════════════════════════ */

.hg-grid--six-btn {
    grid-template-columns: repeat(6, 1fr);
    align-items: start;
}

.hg-tile3 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hg-tile3__image {
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    background-image: var(--hg-bg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #eee;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.hg-tile3:hover .hg-tile3__image {
    transform: scale(1.02);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.hg-tile3__btn {
    display: block;
    text-align: center;
    padding: 0.7rem 1rem;
    background: #111111;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 3px;
    transition: background 0.25s ease, transform 0.25s ease;
}

.hg-tile3__btn:hover {
    background: #000000;
    transform: translateY(-2px);
}

@media (max-width: 1100px) {
    .hg-grid--six-btn { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .hg-grid--six-btn { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
    .hg-grid--six-btn { grid-template-columns: 1fr; }
}
