/* Mei no Sekai — estilos comunes (índice + cuentos) */

:root {
    --bg: #ffffff;
    --text: #111111;
    --text-body: #222222;
    --text-mid: #555555;
    --text-soft: #9a9a9a;
    --line: #111111;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Cormorant Garamond', serif;
}

img { max-width: 100%; }

/* ---------- ÍNDICE ---------- */

.site-header {
    text-align: center;
    padding: 24px 10px 16px;
    border-bottom: 2px solid var(--line);
}

.site-header h1 {
    margin: 0;
    font-weight: 400;
    font-size: 2.2rem;
    letter-spacing: 1px;
}

.subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-top: 4px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    padding: 14px;
}

.card {
    border: 2px solid var(--line);
    aspect-ratio: 1 / 1;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.card img {
    width: 70%;
    height: auto;
    object-fit: contain;
    transition: transform 0.25s ease;
}

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

.label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-soft);
}

.soon {
    border: 2px dashed #ccc;
    color: #ccc;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
}

/* ---------- CUENTO ---------- */

.story-container {
    width: 90%;
    max-width: 680px;
    margin: 8vh auto 10vh;
}

.back-link {
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    color: var(--text-mid);
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 3rem;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--text);
    border-bottom: 1px solid var(--text);
}

h1.story-title {
    font-size: 3rem;
    font-weight: 600;
    margin: 0 0 2rem;
    line-height: 1.2;
    text-align: center;
}

.story-content {
    font-size: 1.4rem;
    line-height: 1.8;
    color: var(--text-body);
}

.story-content p { margin-bottom: 1.2rem; }

.separator {
    text-align: center;
    font-size: 1.2rem;
    margin: 2.5rem 0;
    color: var(--text-mid);
    letter-spacing: 5px;
    clear: both;
}

.dialogue { margin-left: 1rem; }

/* Ilustración a todo el ancho */
.story-image {
    width: 100%;
    height: auto;
    margin: 2rem 0;
    display: block;
}

/* Ilustración pequeña flotando a la derecha / izquierda */
.story-image-right,
.story-image-left {
    width: 140px;
    height: auto;
    border-radius: 4px;
}

.story-image-right {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
}

.story-image-left {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
}

/* Navegación al final del cuento */
.story-nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.story-nav .back-link { margin-bottom: 0; }

/* ---------- MÓVIL ---------- */

@media (max-width: 600px) {
    .site-header h1 { font-size: 1.6rem; }
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }

    h1.story-title { font-size: 2.2rem; }
    .story-content { font-size: 1.2rem; }
    .story-container { margin-top: 5vh; }
    .story-image-right { width: 100px; margin-left: 1rem; }
    .story-image-left { width: 100px; margin-right: 1rem; }
}
