/* Plantilla Cromo - Joomla 6 */
:root {
  --cromo-red: #c8102e;
  --cromo-green: #7a9a01;
  --cromo-text: #3d3d3d;
  --cromo-muted: #8a8a8a;
  --cromo-line: #e6e6e6;
  --cromo-bg: #ffffff;
  --cromo-bg-soft: #f6f6f4;
  --sidebar-w: 250px;
  --gap: 20px;
  --radius: 4px;
  --font: "Helvetica Neue", Arial, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.6 var(--font);
  color: var(--cromo-text);
  background: var(--cromo-bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--cromo-green); text-decoration: none; }
a:hover, a:focus-visible { color: var(--cromo-red); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cromo-green); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; color: #222; font-weight: 600; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }

/* ---------- Barra lateral (a la derecha, como la web original) ---------- */
.cside {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--sidebar-w);
  border-left: 1px solid var(--cromo-line);
  background: var(--cromo-bg);
  overflow-y: auto;
  z-index: 10;
}
.cside__inner { padding: 32px 24px 24px; text-align: center; min-height: 100%; display: flex; flex-direction: column; }
.brand { display: inline-flex; flex-direction: column; align-items: center; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 120px; height: auto; }
.brand__tagline { margin-top: .25rem; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--cromo-muted); }
.nav-toggle { display: none; }
.cside__content { display: flex; flex-direction: column; flex: 1; }

.cside__nav ul { list-style: none; margin: 28px 0 0; padding: 0; }
.cside__nav li { margin: 0; }
.cside__nav a {
  display: block; padding: 6px 0;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cromo-green);
}
.cside__nav .active > a, .cside__nav .current > a { color: var(--cromo-red); }

.cside .card, .cside .moduletable { margin-top: 28px; font-size: 13px; text-align: left; }
.cside .card-header, .cside .moduletable > h3 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--cromo-muted); margin: 0 0 .5rem; font-weight: 700; }
.cside .card-body p { margin: 0 0 .6rem; }
.cside .social { display: inline-block; margin-right: 6px; }
.cside .social img { width: 32px; height: 32px; }
.cside .social .image_hover { display: none; }
.cside .social a:hover img { display: none; }
.cside .social a:hover .image_hover { display: inline; }
.cside .hotline { display: inline-flex; align-items: center; gap: 6px; margin-top: .25rem; }
.cside .hotline img { width: 28px; height: 28px; }

.cside__footer { margin-top: auto; padding-top: 28px; font-size: 11px; color: var(--cromo-muted); }
.cside__footer p { margin: 0 0 .5rem; }
.cside__footer img { width: 24px; height: 24px; margin: 0 3px; }
.cside__footer ul { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; justify-content: center; gap: 12px; }
.cside__footer ul a { color: var(--cromo-muted); }
.copyright { margin-top: .5rem; }

/* ---------- Contenido ---------- */
.main { margin-right: var(--sidebar-w); padding: 24px 28px 48px; min-height: 100vh; }
.main > .com-content-article, .main > .item-page, .main > .com-content-category { max-width: 860px; }

/* Mensajes del sistema */
#system-message-container joomla-alert, .alert { display: block; padding: .75rem 1rem; margin-bottom: 1rem; border-left: 4px solid var(--cromo-green); background: var(--cromo-bg-soft); }

/* ---------- Portfolio ---------- */
.pf-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; margin: 0 0 22px; font-size: 12px; text-transform: lowercase; }
.pf-filters__label { color: var(--cromo-muted); margin-right: 6px; }
.pf-filter {
  font: inherit; cursor: pointer; border: 0; background: none;
  padding: 4px 10px; border-radius: 999px; color: var(--cromo-muted);
}
.pf-filter:hover { color: var(--cromo-text); background: var(--cromo-bg-soft); }
.pf-filter.is-active { color: #fff; background: var(--cromo-green); font-weight: 700; }

.pf-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pf-item[hidden] { display: none; }
.pf-link { position: relative; display: block; color: inherit; text-decoration: none; border-radius: 2px; overflow: hidden; background: #fff; }
.pf-link:hover { text-decoration: none; }
.pf-thumb { display: block; aspect-ratio: 8 / 5; background: #fff; }
.pf-thumb { overflow: hidden; }
/* Las miniaturas antiguas traen un margen blanco incrustado: se amplían un poco para recortarlo */
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.19); transition: transform .35s ease; }
.pf-caption {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0) 65%);
  opacity: 0; transition: opacity .25s ease;
}
.pf-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.pf-cat { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.pf-link:hover .pf-caption, .pf-link:focus-visible .pf-caption { opacity: 1; }
.pf-link:hover .pf-thumb img { transform: scale(1.25); }
.pf-pagination { margin-top: 24px; }

/* Ventana modal */
.pf-modal { width: min(1000px, 94vw); height: min(88vh, 900px); padding: 0; border: 0; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
.pf-modal::backdrop { background: rgba(20,20,20,.75); }
.pf-modal__frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pf-modal__close {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
.pf-modal__close:hover { background: var(--cromo-red); }

/* ---------- Ficha de trabajo / artículos ---------- */
.contentpane { padding: 24px 28px; background: #fff; }
.com-content-article .page-header h1, .com-content-article .page-header h2 { margin: 0 0 .75rem; font-size: 24px; }
.com-content-article .article-info, .com-content-article .icons { display: none; }
.com-content-article .fields-container { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 13px; }
.com-content-article .field-label { color: var(--cromo-muted); font-weight: 700; }
.com-content-article .item-image, .com-content-article figure.item-image { margin: 0 0 1rem; }
.com-content-article .item-image img { width: 100%; height: auto; border-radius: var(--radius); }
.pf-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 1rem 0; }
.pf-gallery figure { margin: 0; }
.pf-gallery img { width: 100%; border-radius: var(--radius); display: block; }
.pf-gallery figcaption { font-size: 12px; color: var(--cromo-muted); margin-top: 4px; }
.pf-video { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0; }
.pf-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.pf-links { margin-top: 1rem; font-weight: 600; }
.pagenavigation { display: none; }

/* ---------- Móvil / tablet ---------- */
@media (max-width: 900px) {
  .cside { position: sticky; top: 0; bottom: auto; width: auto; border-left: 0; border-bottom: 1px solid var(--cromo-line); overflow: visible; }
  .cside__inner { padding: 10px 16px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; text-align: left; min-height: 0; }
  .brand { flex-direction: row; gap: 10px; }
  .brand img { width: 44px; }
  .nav-toggle { display: inline-block; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--cromo-line); background: #fff; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
  .cside__content { display: none; width: 100%; padding: 8px 0 12px; }
  .cside.is-open .cside__content { display: flex; }
  .cside__nav ul { margin-top: 0; }
  .cside__footer { text-align: center; }
  .main { margin-right: 0; padding: 16px; }
  .pf-grid { grid-template-columns: 1fr; gap: 10px; }
  .pf-caption { opacity: 1; padding: 10px 12px; }
  .pf-title { font-size: 14px; }
  .pf-cat { font-size: 10px; }
  .pf-modal { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-thumb img, .pf-caption { transition: none; }
}
