/* ============================================================
Theme for llamita.pe — Minimalist | Mobile First
============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --font-content: 'Source Serif 4', Georgia, serif;
    --font-ui: 'DM Sans', sans-serif;

    --color-bg:             #F7F3ED;
    --color-bg-muted:       #EAE4D9;

    --color-text:           #1C1A17;
    --color-text-muted:     #6B6560;
    --color-text-heading:   #2E2118;
    --color-border:         #C9C0B3;

    --color-link:           #9B3030;
    --color-link-hover:     #6E1F1F;

    --color-callout-bg:     #EDE3D5;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── NoScript ─────────────────────────────────────────────────── */
.no-js header,
.no-js .main,
.no-js footer {
    display: none;
}

.noscript {
    display: block;
    padding: 2rem;
    text-align: center;
    font-family: var(--font-ui);
    color: var(--color-text-muted);
}

/* ── Body ─────────────────────────────────────────────────── */
body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    font-size: 16px;
    font-family: var(--font-ui);
    font-optical-sizing: auto; /* Hack for better font rendering */
    -webkit-font-smoothing: antialiased; /* Hack for rendering on WebKit/MacOS */
    color: var(--color-text);
    background: var(--color-bg-muted);
}

/* ── Main ─────────────────────────────────────────────────── */
.main {
    display: grid;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    height: 50px;
}

.nav {
    list-style: none;
    display: flex;
    gap: 1.2rem;

    a {
        color: var(--color-text-muted);
        text-decoration: none;
        font-weight: 500;

        &:hover {
            color: var(--color-link);
        }
    }
}

/* ── Content ─────────────────────────────────────────────────── */
#content {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.1rem 2rem;
    font-family: var(--font-content);
    font-optical-sizing: auto; /* Hack for better font rendering */
    font-weight: 350;
    background: var(--color-bg);
    box-shadow: 
        0 10px 30px rgba(28, 26, 23, 0.06), /* Sombra exterior ultra suave y sutil */
        0 1px 8px rgba(28, 26, 23, 0.03);
}


/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    padding: 1rem;
    text-align: center;
    
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);

    & p:nth-child(2) {
        margin-top: 0.4rem;
        font-size: 0.85rem;
        font-weight: 400;
    }

    .heart {
        display: inline-block;
        width: 14px;
        height: 14px;
        vertical-align: middle;
        background-color: var(--color-link);
        mask: url('/assets/img/heart.svg') center / contain no-repeat;
    }
}

/* ── UI Styles ─────────────────────────────────────────────────── */
.loading {
    color: var(--color-text-muted);
    font-style: italic;
}

/* ── Markdown ───────────────────────────────────────────────── */
.content {
    /* ── Small ──────────────────────────────────────────────── */
    small {
        display: block;
        text-align: right;
        font-size: 0.85rem;
        font-weight: 400;
        font-style: italic;
        color: var(--color-text-muted);
    }

    :is(h1, h2, h3, h4, h5) {
        text-align: center;
    }

    :is(h1, h2, h4, h6) {
        color: var(--color-text-heading);
    }

    :is(h2, h3, h4, h5) {
        white-space: pre-line;
        line-height: 1.4;
    }

    h1 {
        font-size: 1.6rem;
        font-weight: 600;
        font-family: var(--font-ui);
        margin: 2rem 1rem 2rem;
    }

    h2 {
        display: grid;
        grid-template-columns: 1fr fit-content(90%) 1fr;
        align-items: center;
        gap: 0.8rem;
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        margin: 4rem 0 2rem;

        &::before,
        &::after {
            content: '';
            height: 1px;
            background: rgba(107, 45, 62, 0.2);
        }
    }

    h3 {
        color: var(--color-link);
        font-size: 0.95rem;
        font-weight: 500;
        letter-spacing: 0.08em;
        margin: 2.8rem 1rem 2rem;
    }

    h4 {
        font-size: 0.9rem;
        font-weight: 500;
        margin: 2rem 1rem 2rem;
    }

    h5 {
        color: var(--color-text-muted);
        font-size: 0.9rem;
        font-weight: 500;
        margin: 2rem 1rem 2rem;
    }

    h6 {
        font-size: 1rem;
        font-weight: 600;
        margin: 1.5rem 0 0.7rem;
    }

    p {
        text-align: left;
        line-height: 1.7;
        margin: 0.7rem 0 0;
    }

    strong {
        font-weight: 550;
    }

    em {
        color: var(--color-link);
        font-weight: 550;
    }

    ul,
    ol { 
        list-style: none;
        margin: 0;
    }

    li {
        margin: 0.7rem 0 0;
        padding-left: 1.5rem;
    }

    blockquote {
        width: 80%;
        margin: 1.5rem auto;
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
        background: var(--color-callout-bg);
        border-left: 2px solid var(--color-link);

        p {
            margin: 0 0 0.3rem;
            line-height: 1.6;

            &:last-child {
                margin: 0;
            }
        }
    }

    img {
        display: block;
        max-width: 240px;
        margin: 0 auto;
    }

    /* ── Tables ─────────────────────────────────────────────── */
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.9rem;
        margin: 1.5rem 0;
    }

    th,
    td {
        padding: 0.6rem 0.8rem;
        border: 1px solid var(--color-border);
    }

    th {
        background: var(--color-callout-bg);
        color: var(--color-text-heading);
        font-family: var(--font-ui);
        font-weight: 600;
        letter-spacing: 0.05em;
        text-align: left;
    }

    td {
        vertical-align: top;
        line-height: 1.5;
    }

    /* ── Links ─────────────────────────────────────────────── */
    a {
        color: var(--color-link);
        text-decoration: none;

        &:hover {
            color: var(--color-link-hover);
        }
    }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (min-width: 640px) {
    .main {
        padding: 0 0.8rem;
    }

    #content {
        padding: 1.4rem 2rem 3rem;
    }

    .content {
        h1 {
            font-size: 2rem;
            margin: 2rem 8rem 2rem;
        }

        h2 {
            font-size: 1.2rem;
            margin: 4rem 3rem 1rem;
        }

        h3 {
            font-size: 1.05rem;
        }

        :is(h4, h5) {
            font-size: 0.90rem;
        }

        blockquote {
            width: 50%;
        }
    }
}
