/*
 * Enlaces del contenido de artículos (blog y noticias), marcados desde el menú
 * del enlace del editor. Lo cargan la web (layouts/frontend.php) y el panel
 * (layouts/admin_template.php), para que en el editor se vean igual.
 *
 *   a.enlace-boton  el enlace se ve como el botón azul de la web
 *   a.enlace-icono  delante, el tipo de archivo según la dirección (PDF, XLS,
 *                   DOC, PPT, IMG, ZIP, VÍDEO; cualquier otra: WEB)
 *
 * Las clases las conserva App\Libraries\HtmlArticulo::CLASES_ENLACE.
 */

/* Botón: el mismo que .ps-btn.ps-btn--primario */
:is(.ps-prosa, .note-editable) a.enlace-boton {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 48px; padding: 10px 24px; margin: 4px 8px 4px 0;
    border-radius: var(--ps-radio, 8px); background: var(--ps-azul, #0068AE); color: #fff;
    font-size: 16px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
    transition: background-color .15s ease;
}
:is(.ps-prosa, .note-editable) a.enlace-boton:hover,
:is(.ps-prosa, .note-editable) a.enlace-boton:focus-visible { background: var(--ps-azul-oscuro, #00508A); color: #fff; }

/* Icono del tipo de archivo: una etiqueta de color delante del texto */
a.enlace-icono::before {
    content: "WEB"; --tipo: #5F6F80;
    display: inline-block; margin-right: .45em; padding: .15em .45em;
    border-radius: 4px; background: var(--tipo); color: #fff;
    font-size: .7em; font-weight: 700; font-style: normal; letter-spacing: .04em; line-height: 1.4;
    vertical-align: .12em; text-decoration: none;
}
/* Dentro de un botón, la etiqueta en blanco con el color del tipo */
a.enlace-boton.enlace-icono::before { margin-right: 0; background: #fff; color: var(--tipo); vertical-align: 0; }

/* PDF: .pdf */
a.enlace-icono:is([href$=".pdf" i], [href*=".pdf?" i], [href*=".pdf#" i])::before { content: "PDF"; --tipo: #B42318; }
/* XLS: .xls .xlsx .xlsm .csv .ods */
a.enlace-icono:is([href$=".xls" i], [href*=".xls?" i], [href*=".xls#" i], [href$=".xlsx" i], [href*=".xlsx?" i], [href*=".xlsx#" i], [href$=".xlsm" i], [href*=".xlsm?" i], [href*=".xlsm#" i], [href$=".csv" i], [href*=".csv?" i], [href*=".csv#" i], [href$=".ods" i], [href*=".ods?" i], [href*=".ods#" i])::before { content: "XLS"; --tipo: #1E7B45; }
/* DOC: .doc .docx .odt .rtf */
a.enlace-icono:is([href$=".doc" i], [href*=".doc?" i], [href*=".doc#" i], [href$=".docx" i], [href*=".docx?" i], [href*=".docx#" i], [href$=".odt" i], [href*=".odt?" i], [href*=".odt#" i], [href$=".rtf" i], [href*=".rtf?" i], [href*=".rtf#" i])::before { content: "DOC"; --tipo: #0068AE; }
/* PPT: .ppt .pptx .pps .ppsx .odp */
a.enlace-icono:is([href$=".ppt" i], [href*=".ppt?" i], [href*=".ppt#" i], [href$=".pptx" i], [href*=".pptx?" i], [href*=".pptx#" i], [href$=".pps" i], [href*=".pps?" i], [href*=".pps#" i], [href$=".ppsx" i], [href*=".ppsx?" i], [href*=".ppsx#" i], [href$=".odp" i], [href*=".odp?" i], [href*=".odp#" i])::before { content: "PPT"; --tipo: #C2410C; }
/* IMG: .jpg .jpeg .png .gif .webp .svg .avif */
a.enlace-icono:is([href$=".jpg" i], [href*=".jpg?" i], [href*=".jpg#" i], [href$=".jpeg" i], [href*=".jpeg?" i], [href*=".jpeg#" i], [href$=".png" i], [href*=".png?" i], [href*=".png#" i], [href$=".gif" i], [href*=".gif?" i], [href*=".gif#" i], [href$=".webp" i], [href*=".webp?" i], [href*=".webp#" i], [href$=".svg" i], [href*=".svg?" i], [href*=".svg#" i], [href$=".avif" i], [href*=".avif?" i], [href*=".avif#" i])::before { content: "IMG"; --tipo: #138CCD; }
/* ZIP: .zip .rar .7z */
a.enlace-icono:is([href$=".zip" i], [href*=".zip?" i], [href*=".zip#" i], [href$=".rar" i], [href*=".rar?" i], [href*=".rar#" i], [href$=".7z" i], [href*=".7z?" i], [href*=".7z#" i])::before { content: "ZIP"; --tipo: #5F6F80; }
/* VÍDEO: .mp4 .mov .webm .m4v */
a.enlace-icono:is([href$=".mp4" i], [href*=".mp4?" i], [href*=".mp4#" i], [href$=".mov" i], [href*=".mov?" i], [href*=".mov#" i], [href$=".webm" i], [href*=".webm?" i], [href*=".webm#" i], [href$=".m4v" i], [href*=".m4v?" i], [href*=".m4v#" i])::before { content: "VÍDEO"; --tipo: #002A4A; }
