:root {
    --base: #faf4ed;
    --surface: #fffaf3;
    --overlay: #f2e9e1;
    --muted: #9893a5;
    --subtle: #797593;
    --text: #575279;
    --highlight-med: #dfdad9;
    --love: #b4637a;
    --gold: #ea9d34;
    --pine: #286983;
    --foam: #56949f;
    --iris: #907aa9;

    --content-width: 40rem;
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-family: var(--font-sans);
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--base);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.site-header,
main,
.site-footer {
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2.5rem;
    padding-bottom: 1.5rem;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.site-nav ul {
    display: flex;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    color: var(--subtle);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--iris);
}

.site-nav a.active {
    color: var(--iris);
    font-weight: 600;
}

/* Buscador de la cabecera: la lupa (summary) despliega el formulario. */
.site-search {
    position: relative;
}

.site-search__toggle {
    cursor: pointer;
    list-style: none;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--subtle);
}

.site-search__toggle::-webkit-details-marker {
    display: none;
}

.site-search[open] .site-search__toggle {
    color: var(--iris);
}

.site-search__form {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 10;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--highlight-med);
    border-radius: 8px;
}

.site-search__form input {
    width: 14rem;
    max-width: 60vw;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--highlight-med);
    border-radius: 6px;
    background: var(--base);
    color: var(--text);
    font: inherit;
}

main {
    padding-block: 1rem 4rem;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--text);
}

h1 {
    font-size: 2.25rem;
    margin: 0 0 1.5rem;
}

h2 {
    font-size: 1.6rem;
    margin: 2.5rem 0 1rem;
}

h3 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
}

p {
    margin: 0 0 1.25rem;
}

.content a {
    color: var(--iris);
    font-style: italic;
    font-weight: 500;
    text-decoration: none;
}

.content a::before {
    content: "{";
    color: var(--muted);
}

.content a::after {
    content: "}";
    color: var(--muted);
}

.content a[href^="http"]::before {
    content: none;
}

.content a[href^="http"]::after {
    content: "\2197\FE0E";
    margin-left: 0.15em;
    color: var(--muted);
    font-size: 0.8em;
    font-style: normal;
    vertical-align: super;
}

.content a:hover {
    text-decoration: underline;
    text-decoration-color: var(--muted);
    text-underline-offset: 2px;
}

.content .page-return {
    float: right;
    margin-left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 500;
    color: var(--subtle);
    text-decoration: none;
}

.content .page-return::before,
.content .page-return::after {
    content: none;
}

.content .page-return:hover {
    color: var(--iris);
}

.page-image {
    display: block;
    width: 100%;
    margin: 0 0 1.5rem;
}

.page-date {
    margin: -0.75rem 0 1.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.page-updated {
    margin-top: 2.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* Entradas de un listado de categoría con extracto: compactas y separadas
   entre sí, con la fecha y el extracto pegados al título. */
.content .entry {
    margin: 2.5rem 0;
}

.content .entry h2 {
    margin: 0 0 0.25rem;
}

.content .entry .page-date {
    margin: 0 0 0.5rem;
}

.content .entry-excerpt {
    margin: 0;
}

.page-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

.page-categories a {
    color: var(--foam);
    font-size: 0.85rem;
    font-style: normal;
    font-weight: 400;
}

.page-categories a::before,
.page-categories a::after {
    content: none;
}

.page-categories a:hover {
    text-decoration: underline;
    text-decoration-color: var(--foam);
    text-underline-offset: 2px;
}

.page-return__icon {
    font-style: normal;
    line-height: 1;
}

blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--highlight-med);
    color: var(--subtle);
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.content img.izquierda {
    float: left;
    margin: 0.25rem 1.25rem 1rem 0;
}

.content img.derecha {
    float: right;
    margin: 0.25rem 0 1rem 1.25rem;
}

.content img.centro {
    display: block;
    margin: 1.5rem auto;
}

code {
    background: var(--surface);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
}

pre {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}

.hl-keyword,
.hl-tag {
    color: var(--pine);
}

.hl-function {
    color: var(--love);
}

.hl-string,
.hl-attribute {
    color: var(--gold);
}

.hl-number,
.hl-literal,
.hl-value {
    color: var(--iris);
}

.hl-variable,
.hl-property,
.hl-type {
    color: var(--foam);
}

.hl-operator {
    color: var(--subtle);
}

.hl-comment {
    color: var(--muted);
    font-style: italic;
}

.hl-addition {
    color: var(--pine);
}

.hl-deletion {
    color: var(--love);
}

hr {
    border: none;
    border-top: 1px solid var(--highlight-med);
    margin: 2.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

th,
td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--highlight-med);
}

thead th {
    border-bottom: 2px solid var(--highlight-med);
    color: var(--text);
    text-align: left;
}

dl {
    margin: 1.5rem 0;
}

dt {
    margin-top: 1rem;
    font-weight: 700;
    color: var(--text);
}

dl > dt:first-child {
    margin-top: 0;
}

dd {
    margin: 0.25rem 0 0;
    padding-left: 1rem;
    border-left: 2px solid var(--iris);
    color: var(--subtle);
}

.site-footer {
    padding-block: 2rem;
    border-top: 1px solid var(--highlight-med);
    color: var(--muted);
    font-size: 0.9rem;
}
