:root {
    --guinda: #651c32;
    --guinda-dark: #4a1424;
    --ambar: #a16207;
    --crema: #d1bca1;
    --gris: #475569;
    --line: #e3ddd5;
    --bg: #ffffff;
}

* { box-sizing: border-box; }

html, body {
    font-family: Roboto, 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    color: #222;
    background: var(--bg);
    line-height: 1.55;
}

a { color: var(--guinda); }

/* Accesibilidad: enlace para saltar al contenido + foco visible */
.pub-skip {
    position: absolute; left: -999px; top: 0; background: var(--guinda); color: #fff;
    padding: .6rem 1rem; z-index: 100;
}
.pub-skip:focus { left: 0; }
a:focus, .pub-card:focus { outline: 3px solid var(--ambar); outline-offset: 2px; }

/* Banner de demostración */
.pub-demo { background: var(--ambar); color: #fff; text-align: center; padding: .45rem 1rem; font-size: .85rem; }

/* Header */
.pub-header { border-bottom: 3px solid var(--guinda); }
.pub-header-inner { max-width: 1040px; margin: 0 auto; padding: 1rem 1.2rem; }
.pub-brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--guinda-dark); }
.pub-brand-mark { background: var(--guinda); color: #fff; width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; }
.pub-brand-text strong { display: block; font-size: 1.25rem; color: var(--guinda); }
.pub-brand-text small { color: var(--gris); font-size: .78rem; }

.pub-nav { background: var(--guinda); }
.pub-nav { display: flex; flex-wrap: wrap; max-width: 1040px; margin: 0 auto; padding: 0 1.2rem; }
.pub-nav a { color: #fff; text-decoration: none; padding: .7rem .9rem; font-size: .92rem; }
.pub-nav a:hover { background: var(--guinda-dark); }

/* Hero */
.pub-hero { background: linear-gradient(135deg, var(--guinda), var(--guinda-dark)); color: #fff; }
.pub-hero-inner { max-width: 1040px; margin: 0 auto; padding: 2.6rem 1.2rem; }
.pub-hero h1 { margin: 0 0 .5rem; font-size: 2rem; }
.pub-hero p { margin: 0; font-size: 1.05rem; color: #f3e7ea; max-width: 640px; }

/* Layout */
.pub-main { min-height: 50vh; }
.pub-container { max-width: 1040px; margin: 0 auto; padding: 2rem 1.2rem; }
.pub-h1 { color: var(--guinda); font-size: 1.7rem; margin: .3rem 0 .4rem; }
.pub-h2 { color: var(--guinda-dark); font-size: 1.25rem; margin: 2rem 0 .8rem; border-bottom: 2px solid var(--line); padding-bottom: .3rem; }
.pub-sub { color: var(--gris); margin: 0 0 1rem; }
.pub-muted { color: var(--gris); }
.pub-link { color: var(--guinda); font-weight: 600; }
.pub-breadcrumb { font-size: .85rem; color: var(--gris); margin-bottom: .5rem; }
.pub-breadcrumb a { color: var(--guinda); text-decoration: none; }

/* Listado de publicaciones */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list-item { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.pub-list-title { font-size: 1.1rem; font-weight: 600; color: var(--guinda); text-decoration: none; }
.pub-list-title:hover { text-decoration: underline; }
.pub-list-meta { color: var(--gris); font-size: .8rem; margin: .15rem 0; }
.pub-list-summary { margin: .3rem 0 0; color: #333; }

/* Tarjetas de áreas */
.pub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.pub-card { display: block; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--guinda); border-radius: 10px; padding: 1.1rem; text-decoration: none; color: inherit; }
.pub-card:hover { box-shadow: 0 6px 18px rgba(101,28,50,.12); }
.pub-card h3 { margin: 0 0 .3rem; color: var(--guinda); }
.pub-card p { margin: 0; color: var(--gris); font-size: .9rem; }

/* Documentos */
.pub-docs { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.pub-doc { display: flex; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; text-decoration: none; color: inherit; }
.pub-doc:hover { border-color: var(--guinda); }
.pub-doc-icon { background: #b3261e; color: #fff; font-size: .7rem; font-weight: 700; padding: .25rem .4rem; border-radius: 4px; }
.pub-doc small { display: block; color: var(--gris); }

/* Artículo */
.pub-article { background: #fff; }
.pub-article-meta { color: var(--gris); font-size: .85rem; margin-bottom: 1rem; }
.pub-article-body { font-size: 1.02rem; }
.pub-article-body p { margin: 0 0 1rem; }

/* Footer */
.pub-footer { background: var(--guinda-dark); color: #f0e6e9; margin-top: 2rem; }
.pub-footer-inner { max-width: 1040px; margin: 0 auto; padding: 1.6rem 1.2rem; font-size: .85rem; }
.pub-footer p { margin: .2rem 0; }

#blazor-error-ui { background: var(--ambar); color: #fff; bottom: 0; display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: #fff; }
.blazor-error-boundary::after { content: "Ocurrió un error."; }

/* Búsqueda + accesibilidad + responsive (UX-6) */
.pub-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pub-search-form { display: flex; gap: .4rem; align-items: center; }
.pub-search-form.pub-search-form--header { margin: 0; }
.pub-search-input { padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; min-width: 200px; }
.pub-search-input:focus { outline: 3px solid var(--ambar); }
.pub-search-btn { background: var(--guinda); color: #fff; border: none; border-radius: 8px; padding: .5rem 1rem; font-weight: 600; cursor: pointer; }
.pub-search-btn:hover { background: var(--guinda-dark); }
.pub-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
    .pub-search-form--header .pub-search-input { min-width: 130px; }
    .pub-hero h1 { font-size: 1.5rem; }
    .pub-nav { overflow-x: auto; }
}
