/* ===========================================================================
   Blog de TTS, Aditu, Aldiberean y Elia.
   El MISMO fichero en los cuatro proyectos (también Elia): el original es el de TTS, ver tts_api/scripts/elh_blog_sync.sh.
   Los colores y la letra son las variables de elh_shell.css.
   =========================================================================== */
.elh-blog { box-sizing: border-box; width: 100%; max-width: 1248px; margin: 0 auto; padding: calc(2rem - var(--elh-header-gap, 0px)) 24px 4rem; color: #27313c; font-family: var(--elh-font); }
.elh-blog__sheet { padding: 3.2rem 4rem 4rem; border: 1px solid rgba(20, 33, 61, .06); border-radius: 24px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -12px rgba(16, 24, 40, .1); }
.elh-blog__meta { display: block; margin: 0; font-size: .85rem; color: var(--elh-muted); }

.elh-blog__hero { padding-bottom: 2.6rem; border-bottom: 1px solid var(--elh-line); }
.elh-blog__kicker { color: var(--elh-teal-dark); font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.elh-blog__hero h1 { margin: .4rem 0 .6rem; color: var(--elh-blue); font-family: var(--elh-font); font-size: 3.4rem !important; font-weight: 600; line-height: 1.05; letter-spacing: -.025em; }
.elh-blog__hero p { max-width: 620px; margin: 0; color: var(--elh-muted); font-size: 1.2rem; line-height: 1.55; }

.elh-blog__featured { display: grid; grid-template-columns: 7fr 5fr; gap: 3rem; align-items: center; padding: 3rem 0; border-bottom: 1px solid var(--elh-line); color: inherit !important; text-decoration: none !important; }
.elh-blog__featured .elh-blog__media { border-radius: 18px; aspect-ratio: 16 / 10; }
.elh-blog__featured-body { display: flex; flex-direction: column; gap: 1rem; }
.elh-blog__featured-body h2 { margin: 0; color: #14213d; font-family: var(--elh-font); font-size: 2.4rem !important; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; transition: color .15s; }
.elh-blog__featured-body p { margin: 0; color: var(--elh-muted); font-size: 1.1rem; line-height: 1.65; }
.elh-blog__featured:hover h2 { color: var(--elh-blue); }
.elh-blog__more { display: inline-flex; align-items: center; gap: .45rem; color: var(--elh-teal-dark); }

.elh-blog__section-title { margin: 3rem 0 1.6rem; color: #14213d; font-family: var(--elh-font); font-size: 1.5rem !important; font-weight: 600; letter-spacing: -.01em; }
.elh-blog__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3.2rem 2.2rem; }
.elh-blog__card { display: flex; flex-direction: column; gap: .9rem; color: inherit !important; text-decoration: none !important; }
.elh-blog__card .elh-blog__media { border-radius: 14px; aspect-ratio: 3 / 2; }
.elh-blog__card h3 { margin: 0; color: #14213d; font-family: var(--elh-font); font-size: 1.3rem !important; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; transition: color .15s; }
.elh-blog__card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: var(--elh-muted); font-size: .98rem; line-height: 1.6; }
.elh-blog__card:hover h3 { color: var(--elh-blue); text-decoration: underline; text-decoration-color: var(--elh-teal); text-decoration-thickness: 2px; text-underline-offset: 5px; }

.elh-blog__media { position: relative; overflow: hidden; background: #f1f4f7; }
.elh-blog__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.elh-blog__card:hover .elh-blog__media img, .elh-blog__featured:hover .elh-blog__media img { transform: scale(1.04); }
.elh-blog__media-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--elh-blue) 0%, var(--elh-teal) 100%); color: rgba(255, 255, 255, .85); font-size: 3rem; }
.elh-blog__empty { margin: 3rem 0 1rem; color: var(--elh-muted); font-size: 1.1rem; }

.elh-blog__pages { display: flex; justify-content: center; gap: 1rem; margin-top: 3.5rem; }
.elh-blog__btn { display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.3rem; border: 1px solid var(--elh-line); border-radius: 999px; background: #fff; color: #14213d !important; text-decoration: none !important; }
.elh-blog__pages[hidden], .elh-blog__btn[hidden] { display: none; }
/* Lista: el aviso mientras se cargan las siguientes al hacer scroll (elh_blog.js); vacío, marca dónde empezar a cargar */
.elh-blog__loading { min-height: 1.5rem; margin: 2.5rem 0 0; color: var(--elh-muted); font-size: .95rem; text-align: center; }
.elh-blog__btn:hover { border-color: var(--elh-teal); color: var(--elh-teal-dark) !important; }

.elh-blog__post { max-width: 760px; margin: 0 auto; }
.elh-blog__back { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.2rem; color: var(--elh-teal-dark) !important; font-size: .9rem; text-decoration: none !important; }
.elh-blog__back:hover { color: var(--elh-blue) !important; }
.elh-blog__post h1 { margin: 0 0 1rem; color: var(--elh-blue); font-family: var(--elh-font); font-size: 3rem !important; font-weight: 600; line-height: 1.1; letter-spacing: -.025em; }
.elh-blog__post > .elh-blog__meta { padding-bottom: 1.6rem; margin-bottom: 2.4rem; border-bottom: 1px solid var(--elh-line); font-size: .95rem; }
.elh-blog__cover { display: block; width: 100%; height: auto; margin-bottom: 2.4rem; border-radius: 14px; }
.elh-blog__article { font-size: 1.15rem; line-height: 1.8; }
.elh-blog__article h2 { margin: 2.6rem 0 1rem; color: #14213d; font-family: var(--elh-font); font-size: 1.8rem !important; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
.elh-blog__article h3 { margin: 2rem 0 .7rem; color: #14213d; font-family: var(--elh-font); font-size: 1.35rem !important; font-weight: 600; }
.elh-blog__article p { margin: 0 0 1.4rem; line-height: inherit !important; }
.elh-blog__article strong, .elh-blog__article b { color: #14213d; font-weight: 600; }
.elh-blog__article a { color: var(--elh-teal-dark) !important; text-decoration: underline !important; text-decoration-thickness: 1px !important; text-underline-offset: 3px; }
.elh-blog__article a:hover { color: var(--elh-blue) !important; }
.elh-blog__article img { display: block; max-width: 100% !important; height: auto !important; margin: 2.2rem auto; border-radius: 14px; }
.elh-blog__article ul, .elh-blog__article ol { margin: 0 0 1.4rem; padding-left: 1.4rem; }
.elh-blog__article li { margin-bottom: .5rem; }
.elh-blog__article li::marker { color: var(--elh-teal); }
.elh-blog__article blockquote { margin: 2rem 0; padding: .2rem 0 .2rem 1.4rem; border-left: 3px solid var(--elh-teal); color: #14213d; font-size: 1.3rem; line-height: 1.6; }
.elh-blog__article iframe, .elh-blog__article video { display: block; width: 100%; max-width: 100%; margin: 2.2rem auto; border: 0; border-radius: 14px; aspect-ratio: 16 / 9; }
.elh-blog__related { margin-top: 4.5rem; padding: 1rem 0 0 !important; border-top: 1px solid var(--elh-line); }

@media (max-width: 991.98px) {
	.elh-blog { padding: calc(2rem - var(--elh-header-gap, 0px)) 12px 2.5rem; }
	.elh-blog__sheet { padding: 2rem 1.25rem 2.5rem; border-radius: 16px; }
	.elh-blog__hero h1 { font-size: 2.5rem !important; }
	.elh-blog__featured { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 2rem 0; }
	.elh-blog__featured-body h2 { font-size: 1.8rem !important; }
	.elh-blog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.elh-blog__post h1 { font-size: 2.2rem !important; }
}
@media (max-width: 575.98px) { .elh-blog__grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .elh-blog__media img { transition: none; } }

/* ---------------- entrada: índice al lado (si tiene subtítulos), fecha y minutos, avisos */
.elh-blog__layout { max-width: 760px; margin: 0 auto; }
.elh-blog__layout .elh-blog__post { max-width: none; margin: 0; min-width: 0; }
.elh-blog__layout.has-toc { display: grid; grid-template-columns: 220px minmax(0, 760px); justify-content: center; gap: 3rem; max-width: none; }
.elh-blog__aside { display: none; }
.elh-blog__layout.has-toc .elh-blog__aside { display: block; }
.elh-blog__toc { position: sticky; top: 2rem; max-height: calc(100vh - 4rem); overflow-y: auto; padding: 2.9rem 0 1rem; }
.elh-blog__aside-title { display: block; margin-bottom: .7rem; color: var(--elh-muted); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.elh-blog__toc ol { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--elh-line); }
.elh-blog__toc li a { display: block; margin-left: -2px; padding: .35rem 0 .35rem 1rem; border-left: 2px solid transparent; color: var(--elh-muted); font-size: .9rem; line-height: 1.4; text-decoration: none; transition: color .15s, border-color .15s; }
.elh-blog__toc li.is-sub a { padding-left: 1.8rem; font-size: .85rem; }
.elh-blog__toc li a:hover { color: var(--elh-ink); }
.elh-blog__toc li a.is-active { border-left-color: var(--elh-teal); color: var(--elh-blue); font-weight: 600; }
.elh-blog__article h2, .elh-blog__article h3 { scroll-margin-top: 1.5rem; }
.elh-blog__dot { display: inline-block; width: 3px; height: 3px; margin: 0 .6rem; border-radius: 50%; background: currentColor; opacity: .5; vertical-align: middle; }
.elh-blog__state { display: inline-block; margin-left: .6rem; padding: .1rem .55rem; border-radius: 999px; background: #fff4d6; color: #7a4d00; font-size: .78rem; font-weight: 600; }
.elh-blog__post > .elh-blog__meta { padding-bottom: 1.2rem; margin-bottom: 1.4rem; }
.elh-blog__notice { display: flex; gap: .7rem; align-items: flex-start; margin: 0 0 1.4rem; padding: .8rem 1rem; border-radius: 12px; background: var(--elh-blue-soft); color: var(--elh-ink); font-size: .95rem; line-height: 1.5; }
.elh-blog__notice > i { margin-top: .2rem; color: var(--elh-blue); }
.elh-blog__notice a { color: var(--elh-blue) !important; font-weight: 600; text-decoration: underline !important; }

/* ---------------- edición en la web (quien tiene permiso): la barra de la página y el editor */
.elh-blog__editbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; margin: -1.4rem -1.6rem 2.4rem; padding: .7rem 1rem; border: 1px dashed #c8a400; border-radius: 14px; background: #fffbea; font-size: .9rem; }
.elh-blog__editbar-title { display: inline-flex; align-items: center; gap: .4rem; margin-right: .3rem; color: #7a4d00; font-weight: 600; }
.elh-blog__editbar-langs { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.elh-blog__langchip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border: 1px solid var(--elh-line); border-radius: 999px; background: #fff; color: var(--elh-ink) !important; font-size: .8rem; font-weight: 600; text-decoration: none !important; }
.elh-blog__langchip i { color: var(--elh-muted); font-size: .72rem; }
.elh-blog__langchip.is-current { border-color: var(--elh-teal-dark); background: var(--elh-teal-dark); color: #fff !important; }
.elh-blog__langchip.is-current i { color: #fff; }
.elh-blog__langchip.is-missing { border-style: dashed; color: var(--elh-muted) !important; }
.elh-blog__editbtn { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border: 1px solid var(--elh-line); border-radius: 999px; background: #fff; color: var(--elh-ink) !important; font: inherit; font-size: .9rem; line-height: 1.3; text-decoration: none !important; cursor: pointer; }
.elh-blog__editbtn:hover { border-color: var(--elh-teal-dark); color: var(--elh-teal-dark) !important; }
.elh-blog__editbtn.is-main { border-color: var(--elh-blue); background: var(--elh-blue); color: #fff !important; }
.elh-blog__editbtn.is-main:hover { background: #142e8a; color: #fff !important; }
.elh-blog__editbtn.is-quiet { border-color: transparent; background: transparent; color: var(--elh-muted) !important; }
.elh-blog__editbtn.is-danger { border-color: var(--elh-danger); color: var(--elh-danger) !important; }
.elh-blog__editbtn.is-danger.is-quiet { border-color: transparent; }
.elh-blog__pending { margin: 2rem 0 0; padding: 1.2rem 1.4rem; border: 1px dashed #c8a400; border-radius: 14px; background: #fffbea; }
.elh-blog__pending .elh-blog__section-title { margin: 0 0 .8rem; font-size: 1.1rem !important; }
.elh-blog__pending ul { margin: 0; padding: 0; list-style: none; }
.elh-blog__pending li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .2rem; padding: .35rem 0; }
.elh-blog__pending a { color: var(--elh-ink) !important; font-weight: 600; }
.elh-blog__pending .elh-blog__pending-view { margin-left: .6rem; color: var(--elh-teal-dark) !important; font-weight: 400; font-size: .85rem; }

.elh-editor__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.elh-editor__head h1 { margin: 0; color: var(--elh-blue); font-family: var(--elh-font); font-size: 2.2rem !important; font-weight: 600; }
.elh-editor__messages { margin: 0 0 1.2rem; padding: 0; list-style: none; }
.elh-editor__messages li { padding: .7rem 1rem; border-radius: 10px; background: #e7f6ef; color: #0d5c3a; }
.elh-editor__messages li.is-error { background: var(--elh-danger-bg); color: var(--elh-danger); }
.elh-editor__messages li.is-info { background: var(--elh-blue-soft); color: var(--elh-blue); }
.elh-editor__tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--elh-line); }
.elh-editor__tab { display: flex; flex-direction: column; min-width: 92px; margin-bottom: -1px; padding: .55rem 1rem; border: 1px solid transparent; border-radius: 10px 10px 0 0; color: var(--elh-muted) !important; text-decoration: none !important; }
.elh-editor__tab strong { color: var(--elh-ink); font-size: 1rem; }
.elh-editor__tab small { font-size: .78rem; }
.elh-editor__tab:hover { background: var(--elh-blue-hover); }
.elh-editor__tab.is-current { border-color: var(--elh-line); border-bottom-color: #fff; background: #fff; }
.elh-editor__tab.is-current strong { color: var(--elh-blue); }
.elh-editor__mt { margin-bottom: 1.2rem; }
.elh-editor__note { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; margin: 0 0 .6rem; padding: .7rem 1rem; border-radius: 10px; background: var(--elh-blue-soft); color: var(--elh-ink); font-size: .92rem; }
.elh-editor__note > i { color: var(--elh-blue); }
.elh-editor__note.is-busy { background: #e7f6f5; }
.elh-editor__note.is-error { background: var(--elh-danger-bg); color: var(--elh-danger); }
.elh-editor__mt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.elh-editor__hint, .elh-editor__field small { color: var(--elh-muted); font-size: .82rem; }
.elh-editor__form { display: flex; flex-direction: column; gap: 1.4rem; }
.elh-editor__field { display: flex; flex-direction: column; gap: .4rem; }
.elh-editor__field > label { color: var(--elh-ink); font-weight: 600; }
.elh-editor__field input[type=text], .elh-editor__field input:not([type]), .elh-editor__field input[type=datetime-local], .elh-editor__field textarea { width: 100%; padding: .6rem .8rem; border: 1px solid var(--elh-line); border-radius: 10px; background: #fff; color: var(--elh-ink); font: inherit; }
.elh-editor__field input[name=title] { font-size: 1.5rem; font-weight: 600; }
.elh-editor__field input:focus, .elh-editor__field textarea:focus, .elh-editor__area:focus { border-color: var(--elh-blue); outline: 2px solid var(--elh-blue-soft); }
.elh-editor__field .errorlist, .elh-editor__errors { margin: 0; padding: 0; list-style: none; color: var(--elh-danger); font-size: .88rem; }
.elh-editor__toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .2rem; padding: .35rem; border: 1px solid var(--elh-line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--elh-blue-hover); }
.elh-editor__toolbar button { min-width: 2.2rem; padding: .35rem .55rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--elh-ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.elh-editor__toolbar button:hover, .elh-editor__toolbar button[aria-pressed=true] { border-color: var(--elh-line); background: #fff; }
.elh-editor__toolbar.is-html button:not(.elh-editor__html) { opacity: .35; pointer-events: none; }
.elh-editor__html { margin-left: auto; }
.elh-editor__sep { width: 1px; margin: .2rem .25rem; background: var(--elh-line); }
.elh-editor__area { min-height: 360px; max-height: 75vh; overflow-y: auto; padding: 1.2rem 1.4rem; border: 1px solid var(--elh-line); border-radius: 0 0 10px 10px; background: #fff; }
.elh-editor__area:empty::before { content: "…"; color: var(--elh-faint); }
.elh-editor__source { width: 100%; min-height: 360px; padding: 1rem; border: 1px solid var(--elh-line); border-radius: 0 0 10px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: .88rem !important; }
.elh-editor__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2rem; }
.elh-editor__cover img { max-width: 100%; max-height: 180px; border-radius: 10px; object-fit: cover; }
.elh-editor__check { display: inline-flex !important; align-items: center; gap: .5rem; font-weight: 400 !important; }
.elh-editor__actions { display: flex; flex-wrap: wrap; gap: .6rem; padding-top: 1.2rem; border-top: 1px solid var(--elh-line); }
.elh-editor__danger { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; margin-top: 2rem; }

@media (max-width: 991.98px) {
	.elh-blog__layout.has-toc { display: block; max-width: 760px; margin: 0 auto; }
	.elh-blog__layout.has-toc .elh-blog__aside { display: none; }
	.elh-blog__editbar { margin: -.8rem -.4rem 1.8rem; }
	.elh-editor__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .elh-blog__toc li a { transition: none; } }

/* ---------------- tema oscuro (lo demás del blog, en elh_theme.css) */
html.theme-dark .elh-blog__state { background: #3d3214; color: #ffd98a; }
html.theme-dark .elh-blog__langchip,
html.theme-dark .elh-blog__editbtn, html.theme-dark .elh-editor__field input, html.theme-dark .elh-editor__field textarea,
html.theme-dark .elh-editor__area, html.theme-dark .elh-editor__toolbar button:hover { background: var(--dk-input); }
html.theme-dark .elh-blog__editbtn.is-main { background: var(--dk-fill); border-color: var(--dk-fill); }
html.theme-dark .elh-blog__editbtn.is-quiet { background: transparent; }
html.theme-dark .elh-blog__langchip.is-current { background: #006664; border-color: #006664; }
html.theme-dark .elh-blog__editbar, html.theme-dark .elh-blog__pending { border-color: #8a7420; background: #2a2614; }
html.theme-dark .elh-blog__editbar-title { color: #ffd98a; }
html.theme-dark .elh-editor__tab.is-current { border-bottom-color: var(--dk-surface); background: var(--dk-surface); }
html.theme-dark .elh-editor__toolbar { background: var(--dk-soft); }
html.theme-dark .elh-editor__messages li { background: #143a2a; color: #9fe6c4; }
html.theme-dark .elh-editor__note.is-busy { background: #133533; }
.elh-editor__note.is-review { background: #fff4d6; color: #5c3b00; }
.elh-editor__note.is-review > i { color: #7a4d00; }
html.theme-dark .elh-editor__note.is-review { background: #3d3214; color: #ffd98a; }
html.theme-dark .elh-editor__note.is-review > i { color: #ffd98a; }

/* Testuko irudi-oinak eta bideoak; editorean: igotzen, arrastatzean eta aholkua */
.elh-blog__article figure { margin: 2.2rem auto; }
.elh-blog__article figure img { margin: 0 auto .6rem; }
.elh-blog__article figcaption { color: var(--elh-muted); font-size: .9rem; line-height: 1.5; text-align: center; }
.elh-blog__article video { display: block; height: auto; aspect-ratio: auto; background: #000; }
.elh-editor__busy { display: inline-flex; align-items: center; gap: .4rem; margin-left: .5rem; color: var(--elh-teal-dark); font-size: .85rem; }
.elh-editor__busy[hidden] { display: none; }
.elh-editor__area.is-dropping { border-color: var(--elh-teal-dark); background: #eef8f7; outline: 2px dashed var(--elh-teal); outline-offset: -6px; }
.elh-editor__area figure { margin: 1rem 0; }
.elh-editor__tip { display: block; margin-top: .35rem; color: var(--elh-muted); font-size: .82rem; }
html.theme-dark .elh-editor__area.is-dropping { background: #12302f; }
