/* ============================================================
   Andean Aid Storytelling — Liquid Glass
   Blanco + azul #175abc · estética Apple
   ============================================================ */

:root {
    --blue: #175abc;
    --blue-bright: #2a72d8;
    --blue-ink: #0d3c80;
    --blue-wash: #eef4fe;
    --ink: #0b1b33;
    /* Títulos: azul oscuro, más oscuro que el azul de los botones */
    --title: #0c2f5e;
    --muted: #5b6b85;
    --faint: #8695ab;
    --line: rgba(11, 27, 51, 0.08);

    --glass: rgba(255, 255, 255, 0.58);
    --glass-strong: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.75);

    --r-xl: 32px;
    --r-lg: 26px;
    --r-md: 18px;
    --r-sm: 13px;

    --shadow-soft: 0 18px 40px -22px rgba(23, 90, 188, 0.45), 0 2px 10px rgba(11, 27, 51, 0.04);
    --shadow-lift: 0 28px 60px -26px rgba(23, 90, 188, 0.55), 0 4px 16px rgba(11, 27, 51, 0.06);

    --spring: cubic-bezier(0.16, 1, 0.3, 1);

    /* Retematiza los iconos de cristal (Nucleo) al azul de la marca */
    --nc-gradient-1-color-1: #2f74d0;
    --nc-gradient-1-color-2: #175abc;
    --nc-gradient-2-color-1: rgba(255, 255, 255, 0.9);
    --nc-gradient-2-color-2: rgba(255, 255, 255, 0.55);
    --nc-light: #ffffff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: #f7faff;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Velo azulado: sin algo detrás, el cristal no se lee */
.aurora {
    position: fixed;
    inset: -25%;
    z-index: -1;
    background:
        radial-gradient(45% 40% at 15% 8%, #dce9ff 0%, transparent 62%),
        radial-gradient(38% 34% at 88% 4%, #e7f0ff 0%, transparent 60%),
        radial-gradient(48% 42% at 72% 92%, #eaf2ff 0%, transparent 64%),
        #f9fbff;
    filter: blur(20px);
    transform: translateZ(0);
}

a { color: var(--blue); text-decoration: none; }

img { max-width: 100%; display: block; }

/* ---------- Títulos ---------- */

h1, h2, h3 { color: var(--title); }

/* La etiqueta de año del archivo es un span dentro del botón */
.year__label { color: var(--title); }

/* Subtítulos dentro del contenido enriquecido */
.story__body h2, .story__body h3,
.editor__area h2, .editor__area h3 { color: var(--title); }

/* ---------- Cristal ---------- */

.glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
}

/* ---------- Barra superior ---------- */

.topbar {
    /* En móvil: logo y barra apilados y centrados */
    position: relative;
    z-index: 50;
    margin: 32px auto 0;
    max-width: 1120px;
    width: calc(100% - 24px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.brand { display: flex; align-items: center; min-width: 0; }
.brand__logo {
    height: 62px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 10px;
    border-radius: 999px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(23, 90, 188, 0.16);
    background: rgba(255, 255, 255, 0.7);
    color: var(--blue-ink);
    font-size: 13.5px;
    white-space: nowrap;
    font-weight: 550;
    cursor: pointer;
    transition: transform 0.35s var(--spring), background 0.3s, box-shadow 0.3s;
}

.chip:hover { background: #fff; box-shadow: 0 6px 18px -10px rgba(23, 90, 188, 0.6); }
.chip:active { transform: scale(0.96); }
.chip.is-active { background: var(--blue); color: #fff; border-color: transparent; }
.chip.is-active .icon { color: #fff; }
.chip:hover .icon { color: currentColor; }
.chip--icon { padding: 8px 10px; }
.chip--ghost { background: transparent; border-color: rgba(11, 27, 51, 0.1); color: var(--muted); }

/* ---------- Contenedor ---------- */

.shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px 18px calc(46px + env(safe-area-inset-bottom));
}

body.is-auth .shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px 18px;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 650;
}

.muted { color: var(--muted); font-size: 14px; }

/* ---------- Iconos ---------- */

.icon {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
}

.icon svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 36px; height: 36px; }


/* ---------- Interruptor de idioma ---------- */

.lang-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 74px;
    height: 32px;
    padding: 0 4px;
    border-radius: 999px;
    border: 1px solid rgba(23, 90, 188, 0.16);
    background: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    flex: 0 0 auto;
    overflow: hidden;
    transition: border-color 0.3s, background 0.3s;
}

.lang-switch:hover { background: #fff; }

.lang-switch__knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 32px;
    height: 24px;
    border-radius: 999px;
    background: var(--blue);
    box-shadow: 0 6px 14px -6px rgba(23, 90, 188, 0.95);
    transition: transform 0.4s var(--spring);
}

.lang-switch.is-en .lang-switch__knob { transform: translateX(32px); }

.lang-switch__opt {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
    transition: color 0.3s;
}

.lang-switch__opt.is-on { color: #fff; }

.auth { position: relative; width: min(420px, 100%); }
.auth__lang {
    position: absolute;
    top: -46px;
    left: 50%;
    transform: translateX(-50%);
}

/* ---------- Login ---------- */

.auth__card {
    width: min(420px, 100%);
    padding: 34px 28px 30px;
    text-align: center;
    animation: sheet 0.65s var(--spring) both;
}

.auth__logo {
    height: 64px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 22px;
}

.auth__title { margin: 0; font-size: 27px; letter-spacing: -0.02em; }
.auth__subtitle { margin: 6px 0 24px; color: var(--muted); font-size: 15px; }

/* ---------- Formularios ---------- */

.form { display: grid; gap: 16px; text-align: left; }
.form--editor { gap: 18px; }

.field { display: grid; gap: 7px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--muted); }

.field__control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(11, 27, 51, 0.08);
    border-radius: var(--r-md);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.field__control:focus-within {
    border-color: rgba(23, 90, 188, 0.55);
    box-shadow: 0 0 0 4px rgba(23, 90, 188, 0.12);
    background: #fff;
}

.field__control input,
.field__control select,
.field__control textarea {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    outline: none;
}

.field__control--area { padding: 12px 14px; }
.field__control textarea { resize: vertical; line-height: 1.6; }

.field-row { display: grid; gap: 14px; }

.icon-btn {
    border: 0;
    background: transparent;
    padding: 2px;
    cursor: pointer;
    opacity: 0.75;
    display: grid;
    place-items: center;
}

.icon-btn:hover { opacity: 1; }

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--muted);
}

.checkbox input { width: 17px; height: 17px; accent-color: var(--blue); }

/* ---------- Botones ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 22px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font: inherit;
    font-size: 15.5px;
    font-weight: 620;
    cursor: pointer;
    transition: transform 0.3s var(--spring), box-shadow 0.3s, filter 0.3s;
}

.btn:active { transform: scale(0.975); }

.btn--primary {
    background: linear-gradient(180deg, var(--blue-bright), var(--blue));
    color: #fff;
    box-shadow: 0 14px 26px -14px rgba(23, 90, 188, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn--primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-lift); }

.btn--primary .icon svg { filter: brightness(0) invert(1); }

.btn--glass {
    background: var(--glass-strong);
    border-color: var(--glass-border);
    color: var(--blue-ink);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    box-shadow: var(--shadow-soft);
}

.btn--glass:hover { background: #fff; }
.btn--block { width: 100%; }
.btn__plus { font-size: 19px; line-height: 1; margin-top: -2px; }

/* ---------- Avisos ---------- */

.alert {
    padding: 13px 16px;
    border-radius: var(--r-md);
    font-size: 14.5px;
    margin-bottom: 16px;
}

.alert--error { background: #fff1f1; color: #a01e2b; border: 1px solid #ffd9dc; }
.alert--ok { background: #eef8f1; color: #14683a; border: 1px solid #cdeed9; }

/* ---------- Muro ---------- */

.wall-head { margin: 8px 2px 20px; }
.wall-head__title { margin: 0; font-size: clamp(30px, 6vw, 42px); letter-spacing: -0.03em; }
.wall-head__meta { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

.pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 14px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.pills::-webkit-scrollbar { display: none; }

.pill {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(11, 27, 51, 0.08);
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font: inherit;
    font-size: 14.5px;
    font-weight: 560;
    cursor: pointer;
    transition: all 0.35s var(--spring);
}

.pill:hover { color: var(--blue-ink); background: #fff; }

.pill.is-active {
    background: var(--blue);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 22px -14px rgba(23, 90, 188, 0.9);
}

.pill__count {
    font-size: 12px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(11, 27, 51, 0.07);
}

.pill.is-active .pill__count { background: rgba(255, 255, 255, 0.24); }

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.card {
    display: block;
    overflow: hidden;
    color: inherit;
    transition: transform 0.5s var(--spring), box-shadow 0.4s;
    animation: sheet 0.6s var(--spring) both;
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.card.is-hidden { display: none; }

.card__media {
    aspect-ratio: 4 / 3;
    background: linear-gradient(160deg, #eaf2ff, #f7faff);
    overflow: hidden;
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--spring);
}

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

.card__placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    opacity: 0.4;
}

.card__body { padding: 15px 17px 17px; }

.card__date {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 640;
}

.card__title {
    margin: 5px 0 0;
    font-size: 18.5px;
    letter-spacing: -0.015em;
    line-height: 1.28;
}


/* ---------- Archivo en acordeón por año ---------- */

.wall-layout { display: grid; gap: 18px; }
.wall-main { min-width: 0; }

.archive { padding: 14px 14px 6px; }

.archive__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 6px 8px;
}

.archive__title {
    margin: 0;
    font-size: 11.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 680;
}

.archive__total { font-size: 12px; color: var(--faint); }

.year { border-top: 1px solid var(--line); }
.year:first-of-type { border-top: 0; }

.year__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 6px;
    background: none;
    border: 0;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.year__label { font-weight: 680; font-size: 17px; letter-spacing: -0.02em; }

.year__count {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
    background: rgba(11, 27, 51, 0.06);
    padding: 2px 8px;
    border-radius: 999px;
}

.icon--chev {
    width: 18px;
    height: 18px;
    color: var(--faint);
    transition: transform 0.4s var(--spring), color 0.3s;
}

.year.is-open .icon--chev { transform: rotate(90deg); color: var(--blue); }

.year__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--spring);
}

.year.is-open .year__panel { grid-template-rows: 1fr; }

.year__inner { overflow: hidden; min-height: 0; }

.year__months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 0 4px 14px;
}

.month {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 9px 4px;
    border-radius: 12px;
    border: 1px solid rgba(11, 27, 51, 0.07);
    background: rgba(255, 255, 255, 0.65);
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    transition: transform 0.3s var(--spring), background 0.3s, color 0.3s;
}

.month:hover { background: #fff; color: var(--blue-ink); transform: translateY(-1px); }
.month:active { transform: scale(0.97); }

.month.is-active {
    background: var(--blue);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 18px -12px rgba(23, 90, 188, 0.9);
}

.month__name { font-size: 13.5px; font-weight: 620; }
.month__count { font-size: 11px; opacity: 0.72; }

/* ---------- Historia ---------- */

.story { animation: sheet 0.55s var(--spring) both; }

.backlink {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14.5px;
    color: var(--muted);
    margin-bottom: 16px;
}

.backlink:hover { color: var(--blue); }
.backlink__chev { font-size: 20px; line-height: 1; }

.story__head { margin-bottom: 20px; }
.story__title {
    margin: 0;
    font-size: clamp(27px, 5.2vw, 40px);
    letter-spacing: -0.03em;
    line-height: 1.14;
}

.story__figure {
    margin: 0 0 24px;
    padding: 8px;
    overflow: hidden;
}

.story__image {
    /* La foto se muestra completa, con su proporción real: nada de recortes. */
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 82vh;
    margin: 0 auto;
    border-radius: 20px;
    object-fit: contain;
}

.story__body {
    font-size: 17.5px;
    line-height: 1.72;
    color: #17263f;
    max-width: 68ch;
    margin-bottom: 28px;
}

.downloads { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.downloads .btn { flex: 1 1 240px; }

.story__nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* ---------- Panel ---------- */

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 6px 2px 20px;
}

.panel-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.panel-head__title { margin: 0; font-size: clamp(25px, 4.4vw, 34px); letter-spacing: -0.025em; }

.counter { padding: 20px 22px; margin-bottom: 18px; }
.counter__text { display: flex; align-items: baseline; gap: 8px; }
.counter__text strong { font-size: 26px; letter-spacing: -0.02em; color: var(--blue-ink); }
.counter__text span { color: var(--muted); font-size: 14.5px; }

.counter__bar {
    margin: 12px 0 8px;
    height: 9px;
    border-radius: 999px;
    background: rgba(11, 27, 51, 0.07);
    overflow: hidden;
}

.counter__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blue-bright), var(--blue));
    transition: width 0.8s var(--spring);
}

.counter__hint { margin: 0; color: var(--faint); font-size: 13.5px; }

.list { display: grid; gap: 12px; }

.row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: inherit;
    transition: transform 0.4s var(--spring), box-shadow 0.35s;
}

.row:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.row__thumb {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--blue-wash);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row__main { flex: 1; min-width: 0; }
.row__title { margin: 0; font-size: 16.5px; letter-spacing: -0.01em; }
.row__meta { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.row__doc { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.row__link { color: inherit; }
.row__link:hover .row__title { color: var(--blue); }
.current-photo { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; }
.current-photo img { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow-soft); }

.tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 620;
    background: rgba(11, 27, 51, 0.07);
    color: var(--muted);
}

.tag--ok { background: #e7f4ec; color: #14683a; }
.tag--warn { background: #fff3e2; color: #8a5310; }

.pad { padding: 20px 22px; }

.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.user-row:last-of-type { border-bottom: 0; }
.user-row__main { display: grid; flex: 1; min-width: 0; }
.user-row__main span { font-size: 13.5px; }

.card-mail { padding: 24px 26px; margin-bottom: 18px; }
.card-mail h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -0.02em; }
.card-mail__data { display: grid; gap: 10px; margin: 0 0 14px; }
.card-mail__data div { display: flex; gap: 12px; align-items: baseline; }
.card-mail__data dt { min-width: 96px; color: var(--muted); font-size: 13px; }
.card-mail__data dd { margin: 0; font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.05em; }

/* ---------- Zona de arrastre ---------- */

.dropzone {
    position: relative;
    display: block;
    margin-top: 8px;
    border: 1.5px dashed rgba(23, 90, 188, 0.32);
    border-radius: var(--r-lg);
    background: rgba(238, 244, 254, 0.5);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s, background 0.3s, transform 0.3s var(--spring);
}

.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.dropzone.is-over {
    border-color: var(--blue);
    background: rgba(220, 233, 255, 0.75);
    transform: scale(1.01);
}

.dropzone__inner {
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 34px 20px;
    text-align: center;
    color: var(--muted);
}

.dropzone__inner p { margin: 0; font-size: 14.5px; }
.dropzone__inner strong { color: var(--blue-ink); }
.dropzone__inner .muted { font-size: 13px; }

.dropzone__preview {
    display: none;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
}

.dropzone.has-file .dropzone__inner { display: none; }
.dropzone.has-file .dropzone__preview { display: block; }

.form__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form__actions .btn { flex: 1 1 200px; }


/* ---------- Editor de texto ---------- */

.editor {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(11, 27, 51, 0.08);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.editor:focus-within {
    border-color: rgba(23, 90, 188, 0.55);
    box-shadow: 0 0 0 4px rgba(23, 90, 188, 0.12);
    background: #fff;
}

.editor__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
    background: rgba(238, 244, 254, 0.65);
}

.ebtn {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    color: var(--muted);
    padding: 6px 9px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ebtn:hover { background: rgba(23, 90, 188, 0.09); color: var(--blue-ink); }
.ebtn.is-active { background: var(--blue); color: #fff; }
.ebtn--ghost { margin-left: auto; }

.ebtn--icon { display: inline-flex; align-items: center; padding: 6px 7px; }
.ebtn--icon .icon { width: 17px; height: 17px; }

.editor__sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.editor__area {
    min-height: 190px;
    padding: 14px 16px;
    font-size: 16.5px;
    line-height: 1.68;
    outline: none;
}

.editor__area:empty::before {
    content: attr(data-placeholder);
    color: var(--faint);
    pointer-events: none;
}

.editor__area p { margin: 0 0 12px; }
.editor__area p:last-child { margin-bottom: 0; }
.editor__area h2 { font-size: 20px; margin: 18px 0 8px; letter-spacing: -0.01em; }
.editor__area blockquote {
    margin: 12px 0;
    padding-left: 14px;
    border-left: 3px solid var(--blue);
    color: var(--muted);
}
.editor__area ul, .editor__area ol { margin: 0 0 12px; padding-left: 22px; }
.editor__area li { margin: 4px 0; }
.editor__area a { color: var(--blue); text-decoration: underline; }

/* Contenido enriquecido dentro de la historia publicada */
.story__body h2 { font-size: 1.18em; margin: 1.5em 0 0.5em; letter-spacing: -0.01em; }
.story__body ul, .story__body ol { margin: 0 0 1em; padding-left: 1.4em; }
.story__body li { margin: 0.35em 0; }
.story__body blockquote {
    margin: 1.1em 0;
    padding-left: 16px;
    border-left: 3px solid var(--blue);
    color: var(--muted);
    font-style: italic;
}
.story__body a { color: var(--blue); text-decoration: underline; }
.story__body strong { font-weight: 650; }


/* ---------- Barra de búsqueda y filtros ---------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.filters__search {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1 1 260px;
    min-width: 0;
    padding: 11px 14px;
    border-radius: var(--r-md);
    border: 1px solid rgba(11, 27, 51, 0.08);
    background: rgba(255, 255, 255, 0.78);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.filters__search:focus-within {
    border-color: rgba(23, 90, 188, 0.55);
    box-shadow: 0 0 0 4px rgba(23, 90, 188, 0.12);
    background: #fff;
}

.filters__search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 15.5px;
    color: var(--ink);
    outline: none;
}

.filters__search--wall { margin-bottom: 16px; }

.filters select {
    padding: 11px 14px;
    border-radius: var(--r-md);
    border: 1px solid rgba(11, 27, 51, 0.08);
    background: rgba(255, 255, 255, 0.78);
    font: inherit;
    font-size: 14.5px;
    color: var(--ink);
    cursor: pointer;
}

.filters__count {
    margin-left: auto;
    font-size: 13px;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
}

.row.is-hidden { display: none; }

/* ---------- Vacío ---------- */

.empty {
    padding: 42px 26px;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-top: 8px;
}

.empty h2 { margin: 6px 0 0; font-size: 20px; letter-spacing: -0.02em; }
.empty p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }

/* ---------- Animación ---------- */

@keyframes sheet {
    from { opacity: 0; transform: translateY(16px) scale(0.995); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Escritorio ---------- */

@media (max-width: 720px) {
    .row { flex-wrap: wrap; row-gap: 10px; }
    .row__main { flex: 1 1 60%; }
    .row__doc { flex: 1 1 100%; justify-content: flex-start; }
    .row__created { display: none; }
    .list { gap: 10px; }
}

@media (max-width: 719px) {
    /* La barra ocupa todo el ancho y los botones muestran su texto,
       con medidas reducidas para que quepan también en 360px */
    .topbar__nav {
        /* La barra se ajusta a su contenido y queda centrada, sin huecos grandes */
        width: auto;
        justify-content: center;
        gap: 7px;
        padding: 6px;
    }

    .chip {
        padding: 8px 9px;
        font-size: 12.5px;
        gap: 5px;
    }

    .lang-switch { width: 62px; height: 29px; }
    .lang-switch__knob { width: 27px; height: 21px; }
    .lang-switch.is-en .lang-switch__knob { transform: translateX(27px); }
    .lang-switch__opt { font-size: 10.5px; }
}

@media (max-width: 359px) {
    /* Pantallas muy angostas: solo iconos */
    .chip__label { display: none; }
    .chip { padding: 9px 12px; }
}

@media (min-width: 720px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .field-row { grid-template-columns: 1fr 1fr; }
    .shell { padding-inline: 26px; }
    .brand__logo { height: 76px; max-width: 300px; }
    .chip { padding: 8px 14px; font-size: 14px; }
    .auth__logo { height: 72px; }
}

@media (min-width: 960px) {
    .wall-layout { grid-template-columns: 264px minmax(0, 1fr); gap: 26px; align-items: start; }
    .archive { position: sticky; top: 20px; }
}

@media (min-width: 720px) {
    /* Escritorio: logo y barra en la misma línea, centrados, 20px de separación */
    .topbar {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 20px;
    }
}

@media (min-width: 1180px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Accesibilidad ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
    border-radius: 8px;
}

.row__doc form { margin: 0; }

.drag {
    cursor: grab;
    color: var(--faint);
    font-size: 17px;
    line-height: 1;
    padding: 2px 2px 2px 0;
    user-select: none;
    flex: 0 0 auto;
}

.drag:active { cursor: grabbing; }
.row.is-dragging { opacity: 0.45; box-shadow: none; transform: none; }
.row__thumb { text-decoration: none; }
