/* PT26 Design System — tokens y estilos del contenido que llega del CMS.
   Se carga después del CSS exportado de Webflow. */

:root {
  /* Color · neutros y estados */
  --background1: #222223;
  --white-portfolio: #f4f4f5;
  --dark-grey: #2e2b2b;
  --button-hover: #32343a;
  --button-active: #43464d;
  --text-caption: #979797;
  --dim-grey: #525254;

  /* Tema por defecto (Portfolio): el acento es background1 */
  --accent: var(--background1);
  --on-accent: var(--white-portfolio);

  /* Tipografía */
  --font-display: 'Clashdisplay Variable', sans-serif;
  --font-sans: Archivo, sans-serif;

  /* Espaciado */
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-72: 72px;
  --space-120: 120px;

  /* Forma, opacidad y motion */
  --radius-8: 8px;
  --radius-10: 10px;
  --radius-pill: 50px;
  --opacity-secondary: 0.6;
  --opacity-link-hover: 0.8;
  --motion-link: 0.2s;
  --motion-hover: 0.3s;
  --motion-button: 0.4s;
}

/* ---------- Home: tarjetas de proyecto ---------- */

.cms-card .div-block-thumbnail-hover:hover {
  -webkit-backdrop-filter: blur(var(--hover-blur, 15px));
  backdrop-filter: blur(var(--hover-blur, 15px));
}

.cms-card .background-video {
  height: 100%;
}

.cms-card .text-block-thumbnail-title,
.cms-card .text-block-thumbnail-subtitle {
  padding: 0 var(--space-16);
}

/* Las filas incompletas conservan el ancho de columna */
@media (min-width: 768px) {
  .cms-grid {
    justify-content: flex-start;
  }
  .cms-grid.big > .div-block-work-big {
    flex: 0 0 calc((100% - var(--space-32)) / 2);
    width: auto;
  }
  .cms-grid.small > .div-block-work-small {
    flex: 0 0 calc((100% - 2 * var(--space-32)) / 3);
    width: auto;
  }
}

.cms-empty {
  font-family: var(--font-sans);
  opacity: var(--opacity-secondary);
}

/* ---------- Caso de proyecto ---------- */

.project-sidebar {
  background-color: var(--sidebar-bg, var(--white-portfolio));
  flex-direction: column;
  justify-content: space-between;
  width: var(--sidebar-w, 25%);
  /* Alto de la ventana: el texto se desplaza dentro y las etiquetas quedan abajo. */
  height: 100vh;
  height: 100dvh;
  padding: var(--space-40) var(--space-32) var(--space-40) var(--space-40);
  display: flex;
  position: fixed;
  overflow: hidden;
}

/* Zona de scroll propia de la barra lateral */
.project-sidebar .div-block-project-info {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: var(--space-32);
}

.project-sidebar .div-block-project-info::-webkit-scrollbar,
.project-tags .tags-block::-webkit-scrollbar {
  display: none;
}

/* Etiquetas: plegadas a cinco filas; "Ver más" las abre hasta el alto disponible */
.project-tags {
  flex: 0 0 auto;
  flex-direction: column;
  max-height: 100%;
  display: flex;
  position: relative;
}

.project-tags::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: var(--space-32);
  background: linear-gradient(to top, var(--sidebar-bg, var(--white-portfolio)), transparent);
  pointer-events: none;
}

.project-tags .tags-block {
  flex: 0 1 auto;
  min-height: 0;
  max-height: var(--tags-max, none);
  overflow: hidden;
}

.project-tags.is-open .tags-block {
  max-height: none;
  overflow-y: auto;
  scrollbar-width: none;
}

.tags-toggle {
  flex: none;
  align-self: flex-start;
  margin-top: var(--space-12);
  padding: 0;
  background: none;
  border: 0;
  color: var(--background1);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  text-decoration: underline;
  cursor: pointer;
  transition: opacity var(--motion-link);
}

.tags-toggle:hover {
  opacity: var(--opacity-link-hover);
}

.cms-project {
  background-color: var(--white-portfolio);
  min-height: 100vh;
}

.cms-project .work-column {
  width: calc(100% - var(--sidebar-w, 25%));
  margin-left: var(--sidebar-w, 25%);
}

.cms-project .text-block-project-title {
  margin: 0;
}

.project-role {
  opacity: var(--opacity-secondary);
  margin-top: var(--space-8);
}

/* ProjectTag: accent + on-accent, pill */
.tag-proyecto {
  background-color: var(--accent);
  border-radius: var(--radius-pill);
}

.tag-proyecto .text-tag {
  color: var(--on-accent);
}

@media (max-width: 991px) {
  .project-sidebar {
    width: 100%;
    height: auto;
    position: static;
    overflow: visible;
  }
  .cms-project .work-column {
    width: 100%;
    margin-left: 0;
  }
  /* Sin barra fija: el texto fluye entero y no hace falta el degradado */
  .project-sidebar .div-block-project-info {
    flex: none;
    overflow: visible;
    padding-bottom: 0;
  }
  .project-tags {
    max-height: none;
    margin-top: var(--space-16);
  }
  .project-tags::before {
    display: none;
  }
}

@media (max-width: 479px) {
  .project-sidebar {
    padding-top: 0;
  }
}

/* Filas multimedia: a sangre, sin huecos y en ángulo recto */
.cms-row {
  display: flex;
  width: 100%;
}

.cms-item {
  min-width: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

.cms-item > img,
.cms-item > video {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  border-radius: 0;
}

.cms-item > .w-video {
  width: 100%;
  align-self: flex-start;
}

.cms-row.is-multi .cms-item > img,
.cms-row.is-multi .cms-item > video,
.cms-row.has-height .cms-item > img,
.cms-row.has-height .cms-item > video {
  object-fit: cover;
  height: 100%;
}

.cms-row.is-multi .cms-item > .w-video {
  align-self: center;
}

.cms-row.has-height {
  height: calc(var(--h) * 1px);
}

.cms-row.has-height .cms-item > .w-video {
  height: 100%;
  padding-top: 0 !important;
  align-self: stretch;
}

@media (max-width: 991px) {
  .cms-row.has-height {
    height: calc(var(--h) / 15 * 1vw);
  }
}

/* Bloques de texto y HTML */
.cms-text {
  padding: var(--space-72) var(--space-40);
}

.cms-text > * {
  max-width: 720px;
}

@media (max-width: 767px) {
  .cms-text {
    padding: var(--space-40) var(--space-24);
  }
}

/* Los embeds pegados como HTML ocupan todo el ancho, sin franjas ni huecos */
.cms-html > iframe,
.cms-html > p > iframe:only-child {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
}

.cms-html > p:has(> iframe:only-child) {
  margin: 0;
}

.cms-html iframe {
  vertical-align: top;
}

/* ---------- Contenido escrito en el CMS (Markdown / HTML) ----------
   Archivo para leer, Clash Display para titular; sin sombras ni radios en imágenes. */

.cms-content {
  font-family: var(--font-sans);
  color: var(--background1);
}

.cms-content > :first-child {
  margin-top: 0;
}

.cms-content > :last-child {
  margin-bottom: 0;
}

.cms-content p,
.cms-content li {
  font-size: 16px;
  line-height: 28px;
}

.cms-content p {
  margin: 0 0 var(--space-16);
}

.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: var(--space-32) 0 var(--space-16);
}

.cms-content h1,
.cms-content h2 {
  font-size: 40px;
  line-height: 50px;
  letter-spacing: 1px;
}

.cms-content h3 {
  font-size: 30px;
  line-height: 35px;
  letter-spacing: 1px;
}

.cms-content h4 {
  font-size: 24px;
  line-height: 32px;
}

.cms-content a {
  display: inline;
  color: inherit;
  text-decoration: underline;
  transition: opacity var(--motion-link);
}

.cms-content a:hover {
  opacity: var(--opacity-link-hover);
}

.cms-content ul,
.cms-content ol {
  margin: 0 0 var(--space-16);
  padding-left: var(--space-24);
}

.cms-content blockquote {
  border-left: 2px solid var(--background1);
  margin: var(--space-24) 0;
  padding: 0 0 0 var(--space-24);
  font-size: 20px;
  line-height: 34px;
  opacity: var(--opacity-secondary);
}

.cms-content small {
  font-size: 14px;
  line-height: 26px;
}

.cms-content hr {
  border: 0;
  border-top: 1px solid var(--background1);
  opacity: 0.2;
  margin: var(--space-32) 0;
}

.cms-content img,
.cms-content video {
  max-width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}

.cms-content code {
  font-size: 14px;
  background: rgba(34, 34, 35, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-8);
}

.cms-content pre {
  background: var(--background1);
  color: var(--white-portfolio);
  padding: var(--space-24);
  border-radius: var(--radius-8);
  overflow: auto;
}

.cms-content pre code {
  background: none;
  padding: 0;
}

.cms-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 var(--space-16);
  font-size: 14px;
  line-height: 26px;
}

.cms-content th,
.cms-content td {
  border-bottom: 1px solid rgba(34, 34, 35, 0.2);
  padding: var(--space-8) var(--space-12);
  text-align: left;
}

/* La descripción de la barra lateral conserva su escala fluida original */
.text-block-project-description.cms-content p,
.text-block-project-description.cms-content li {
  font-size: inherit;
  line-height: inherit;
}

.text-block-project-description.cms-content p {
  margin-bottom: 0.8em;
}

/* ---------- Formulario de contacto ---------- */

.cms-hp {
  position: absolute;
  left: -9999px;
}

/* ---------- Home: textos editables ---------- */

/* About me admite Markdown: conserva su tamaño de texto y el aire entre párrafos */
.paragraph-about-me.cms-content,
.paragraph-about-me.cms-content p,
.paragraph-about-me.cms-content li {
  font-size: 18px;
  line-height: 26px;
}

.paragraph-about-me.cms-content p {
  margin-bottom: 26px;
}

.paragraph-about-me.cms-content > :last-child {
  margin-bottom: 0;
}

/* El CSS de Webflow pone los enlaces en bloque; dentro de un texto van en línea */
.heading-jumbo a,
.text-block-greeting a {
  display: inline;
  color: inherit;
  text-decoration: underline;
}
