/* ========================================================================== */
/* WIKI STYLES (Стилі для сторінки Вікі) */
/* ========================================================================== */

/* Загальний контейнер Вікі */
.wiki-container {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 20px 50px 20px; /* Відступ зверху для фіксованого хедера */
    gap: 30px;
    min-height: 80vh;
    box-sizing: border-box;
    
    /* Анімація появи (як на головній) */
    opacity: 0;
    animation: contentFadeUp 0.8s ease-out 0.2s forwards;
}

.wiki {
    background-color: #ffffffc2;
    border-radius: 15px;
    color: var(--color-text-dark);
    transform: scale(1.1);
}

.book-img {
    filter: invert(0.2);
}


nav a:hover {
    background-color: #ffffffc2;
    border-radius: 15px;
    color: var(--color-text-dark);
    transform: scale(1.2);
}

.wiki-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wiki-nav li {
    margin-bottom: 10px;
}

.wiki-nav a {
    text-decoration: none;
    color: #cccccc;
    font-family: 'Nunito-bold', sans-serif;
    display: block;
    padding: 10px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}



/* --- КОНТЕНТ (Права частина) --- */
.wiki-content {
    flex: 1; /* Займає весь вільний простір */
    background: linear-gradient(169deg, #1b1a1b 0%, #1b1a1b 100%);
    border: 1px solid #cccccc; /* Світліша рамка для акценту */
    border-radius: 12px;
    padding: 40px;
    color: #ffffff;

}


/* Заголовки статті */
.wiki-title {
    font-family: 'Minecraft', monospace;
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #000;
}

.wiki-subtitle {
    font-family: 'Minecraft';
    font-size: 1.8em;
    margin-top: 40px;
    margin-bottom: 15px;
    color: #ddd;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

/* Текст статті */
.wiki-text {
    font-family: 'Nunito-normal', sans-serif;
    font-size: 1.1em;
    line-height: 1.7;
    color: #e0e0e0;
    margin-bottom: 15px;
}

/* Розділювач */
.wiki-divider {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 30px 0;
}

/* Блок "Важливо" */



/* ========================================================================== */
/* WIKI GRID (Сітка категорій) */
/* ========================================================================== */

/* ========================================================================== */
/* WIKI GRID (Сітка категорій - ВЕЛИКІ КВАДРАТИ) */
/* ========================================================================== */

.wiki-grid {
    display: grid;
    /* Змінено: minmax збільшено з 130px до 220px. 
       Тепер квадрати будуть значно ширшими */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px; /* Трохи більше відстані між ними */
    margin-top: 40px;
    margin-bottom: 40px;
}

/* Стиль самого квадрата */
.custom_food-card-small, .custom_items-card-small, .custom_mechanic-card-small , .commands-card-small, .secret-card-small, .badges-card-small, .mods-card-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    background: linear-gradient(145deg, #ffffff0d 0%, rgba(0, 0, 0, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px; /* Більш округлі кути */
    
    padding: 30px; /* Більше внутрішнього відступу */
    text-decoration: none;
    color: var(--color-primary);
    
    aspect-ratio: 1 / 1; 
    
    transition: all var(--transition-medium);
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
    min-height: 200px;

}

.custom_food-card-small:hover, .custom_items-card-small:hover, .custom_mechanic-card-small:hover ,.commands-card-small:hover, .secret-card-small:hover, .badges-card-small:hover, .mods-card-small:hover {
    transform: translateY(-7px) scale(1.02);
    background: #ffffff0d;
    border-color: #ffffff;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    box-shadow: 0 5px 20px #ffffff17;

}

.custom_food-card-icon, .custom_items-card-icon, .custom_mechanic-card-icon ,.commands-card-icon, .secret-card-icon, .badges-card-icon, .mods-card-icon {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* ЗБІЛЬШЕНІ ІКОНКИ */
.custom_food-card-icon img, .custom_items-card-icon img, .custom_mechanic-card-icon img, .commands-card-icon img, .secret-card-icon img, .badges-card-icon img, .mods-card-icon img {
    width: 175px; /* Було 60px, стало 100px */
    height: 175px;
    object-fit: contain;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
    transition: transform var(--transition-fast);
}

.custom_food-card-small:hover .custom_food-card-icon img, .custom_items-card-small:hover .custom_items-card-icon img, .custom_mechanic-card-small:hover .custom_mechanic-card-icon img ,.commands-card-small:hover .commands-card-icon img, .secret-card-small:hover .secret-card-icon img, .badges-card-small:hover .badges-card-icon img, .mods-card-small:hover .mods-card-icon img {
    transform: scale(1.1) rotate(3deg);
}

/* ЗБІЛЬШЕНИЙ ТЕКСТ */
.custom_food-card-title, .custom_items-card-title, .custom_mechanic-card-title , .commands-card-title, .secret-card-title, .badges-card-title, .mods-card-title {
    font-family: 'Minecraft', monospace;
    font-size: 1.5em; /* Було 1.1em, стало 1.5em */
    text-align: center;
    margin-top: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.back {
    display: inline-block;
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.95em;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back:hover {
    color: #ffffff;
    transform: translateX(-5px);
}


@media (max-width: 600px) {
    
    /* 1. ВАЖЛИВО: Зменшуємо відступи в основному блоці тексту.
       40px (як на ПК) забагато для телефону, карткам тісно. */
    .wiki-content {
        padding: 20px 15px; /* Зменшуємо до 15px з боків */
    }

    /* 2. Сітка на всю ширину */
    .wiki-grid {
        display: grid;
        grid-template-columns: 1fr; /* Одна колонка */
        gap: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
        padding: 0; /* Прибираємо зайві відступи сітки */
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 3. Налаштування карток */
    .custom_food-card-small, 
    .custom_items-card-small, 
    .custom_mechanic-card-small, 
    .commands-card-small,
    .secret-card-small {
        /* box-sizing обов'язковий, щоб padding не розширював блок */
        box-sizing: border-box; 
        
        width: 100%;          /* Займає всю доступну ширину колонки */
        max-width: 100%;      /* Забороняємо вилазити за межі */
        
        /* Робимо висоту автоматичною або трохи меншою за ширину, 
           щоб на вузьких екранах квадрат не займав весь екран по висоті */
        aspect-ratio: 1 / 1; 
        
        margin: 0;            /* Прибираємо margin auto, хай grid керує */
        padding: 15px;        /* Трохи менші внутрішні відступи */
    }
    
    /* 4. Іконки */
    .custom_food-card-icon img, 
    .custom_items-card-icon img, 
    .custom_mechanic-card-icon img, 
    .commands-card-icon img,
    .secret-card-icon img {
        width: 80%;  /* Оптимальний розмір, щоб не розпирало картку */
        height: 80%;
    }
    
    /* 5. Текст */
    .custom_food-card-title, 
    .custom_items-card-title, 
    .custom_mechanic-card-title, 
    .commands-card-title,
    .secret-card-title {
        font-size: 1.2em;
        margin-top: 10px;
    }
        .footer-nav-links {
        gap: 10px;
    }
    
    .footer-nav-links a {
        padding: 8px 12px;
    }

}
