@font-face {
  font-family: 'SUSE';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/assets/fonts/suse-variable-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'SUSE';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/assets/fonts/suse-variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-body: 'SUSE', sans-serif;

  --color-bg: #fff;
  --color-text: #111;
  --color-text-strong: #000;
  --color-text-secondary: #333;
  --color-text-tertiary: #666;
  --color-text-muted: #999;
  --color-border: #ddd;
  --color-accent: #f46654;
}

/* Modo oscuro: sigue la preferencia del sistema por defecto; el botón bajo el
   selector de idioma la fuerza a mano guardando la elección en localStorage
   (ver assets/js/theme.js). El acento de marca (coral) no cambia. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #111;
    --color-text: #f2f2f2;
    --color-text-strong: #fff;
    --color-text-secondary: #ccc;
    --color-text-tertiary: #aaa;
    --color-text-muted: #888;
    --color-border: #333;
  }
}

:root[data-theme="dark"] {
  --color-bg: #111;
  --color-text: #f2f2f2;
  --color-text-strong: #fff;
  --color-text-secondary: #ccc;
  --color-text-tertiary: #aaa;
  --color-text-muted: #888;
  --color-border: #333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 1px;
}

/* Header / navigation */

.site-header {
  padding: 24px 32px;
  margin: 0 auto 24px;
  max-width: 1280px;
  position: relative;
  text-align: center;
}

.site-logo {
  display: inline-block;
  margin-bottom: 16px;
}

.site-logo img {
  display: block;
  height: 28px;
  width: auto;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.main-nav a {
  text-decoration-color: currentColor;
  text-underline-offset: auto;
}

.main-nav a.is-active {
  color: var(--color-accent);
}

.lang-switch {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.lang-switch-langs {
  display: flex;
  gap: 8px;
}

.lang-switch a {
  text-decoration-color: currentColor;
  text-underline-offset: auto;
}

.lang-switch a.is-active {
  color: var(--color-accent);
}

/* Botón de modo oscuro, bajo el selector de idioma */
.theme-toggle {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 0;
}

.theme-toggle:hover {
  color: var(--color-accent);
}

.theme-toggle-icon {
  width: 14px;
  height: 14px;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

/* El logo es un SVG en un solo color oscuro: en modo oscuro se invierte
   para seguir siendo legible sobre el fondo */
:root[data-theme="dark"] .site-logo img {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-logo img {
    filter: invert(1);
  }
}

/* El "multiply" de la foto de About y las miniaturas de News está pensado
   para fundirse con un fondo claro; en modo oscuro se desactiva, si no las
   fotos se verían casi negras */
:root[data-theme="dark"] .about img,
:root[data-theme="dark"] .news-item-thumb {
  mix-blend-mode: normal;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .about img,
  :root:not([data-theme="light"]) .news-item-thumb {
    mix-blend-mode: normal;
  }
}

.sub-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 300;
  color: var(--color-text-tertiary);
}

.sub-nav a.is-active {
  color: var(--color-accent);
  font-weight: 600;
}

/* Masonry — CSS Grid con el alto de fila calculado por JS (assets/js/masonry.js),
   para un empaquetado real tipo Pinterest que conserva el orden de lectura del HTML */

.masonry {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 4px;
  gap: 16px;
  padding: 0 32px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

@media (min-width: 700px) {
  .masonry { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
  .masonry { grid-template-columns: repeat(4, 1fr); }
}

.masonry-item {
  display: block;
  position: relative;
}

.masonry-item-media {
  display: block;
  position: relative;
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.masonry-item-title {
  display: block;
  font-size: 13px;
  margin-top: 6px;
}

/* En "Illustration" y "Other" el título no va debajo de la miniatura:
   aparece superpuesto, tintado en coral al 80%, al pasar el ratón */
.masonry-item-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  padding: 16px;
  border-radius: 12px;
  background: rgba(244, 102, 84, 0.8);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  text-align: center;
}

.masonry-item:hover .masonry-item-overlay {
  opacity: 1;
}

.masonry-item-overlay-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

/* En "Editorial design" las miniaturas se inclinan ligeramente en 3D al
   pasar el ratón, como si fueran un libro/revista físico.

   PUNTOS DE ACCESO — versiones anteriores, guardadas por si se prefiere volver.
   Para reactivar una: comenta el bloque "book cover v3" activo más abajo y
   descomenta la versión deseada (revisa también site/snippets/masonry-item.php,
   ya que v3 añade envoltorios extra para el lomo trasero y las páginas).

   v1 — solo giro, sin lomo ni brillo:

.page-editorial-design .masonry {
  perspective: 1200px;
}

.page-editorial-design .masonry-item img {
  transition: transform 0.4s ease;
}

.page-editorial-design .masonry-item:hover img {
  transform: rotate3d(0, 1, 0, 20deg);
}
*/

/* v2 — inspirada en https://codepen.io/filipz/pen/PwwbrYo (lomo + brillo diagonal):

.page-editorial-design .masonry {
  perspective: 1200px;
}

.page-editorial-design .masonry-item-media::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.55));
  border-radius: 0 12px 12px 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.page-editorial-design .masonry-item-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 60%);
  background-size: 250% 250%;
  background-position: 130% 0;
  opacity: 0;
  transition: opacity 0.4s ease, background-position 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.page-editorial-design .masonry-item-media img {
  position: relative;
  transform-origin: right center;
  transition: transform 0.4s ease;
}

.page-editorial-design .masonry-item:hover .masonry-item-media::before {
  opacity: 1;
}

.page-editorial-design .masonry-item:hover .masonry-item-media::after {
  opacity: 1;
  background-position: -30% 0;
}

.page-editorial-design .masonry-item:hover .masonry-item-media img {
  transform: rotate3d(0, 1, 0, 20deg);
}
*/

/* v3 (activa) — inspirada en https://codepen.io/filipz/pen/VYwqwXN: la portada
   se abre sobre su borde izquierdo dejando ver un lomo trasero oscuro y unas
   páginas que se abanican ligeramente, con un brillo suave sobre la cubierta */

/* Estos envoltorios solo existen para el efecto libro; en el resto de
   categorías permanecen ocultos y sin afectar al layout */
.masonry-item-backcover,
.masonry-item-pages,
.masonry-item-spine,
.masonry-item-shine {
  display: none;
}

.page-editorial-design .masonry {
  perspective: 2000px;
}

/* Las portadas se ven un 10% más pequeñas, pero siguen ocupando el mismo
   hueco en la rejilla, así que la separación crece de forma proporcional */
.page-editorial-design .masonry-item-media {
  transform: scale(0.9);
}

.page-editorial-design .masonry-item-backcover {
  display: block;
  position: absolute;
  width: 96%;
  height: 96%;
  top: 2%;
  left: 2%;
  background: #111;
  border-radius: 0 12px 12px 0;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
  z-index: 0;
}

.page-editorial-design .masonry-item-pages {
  display: block;
  position: absolute;
  width: 90%;
  height: 94%;
  top: 3%;
  left: 5%;
  z-index: 1;
}

.page-editorial-design .masonry-item-page {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 98%;
  height: 100%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0 12px 12px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transform-origin: right center;
  transition: transform 0.4s ease;
}

.page-editorial-design .masonry-item-cover {
  display: block;
  position: relative;
  border-radius: 2px 12px 12px 2px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.075), 0 30px 45px rgba(0, 0, 0, 0.06), 0 60px 80px rgba(0, 0, 0, 0.05);
  transform: perspective(2000px) rotateY(0deg) translateX(0) scaleX(1);
  transform-origin: left center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  z-index: 2;
}

.page-editorial-design .masonry-item-cover img {
  border-radius: 2px 12px 12px 2px;
}

.page-editorial-design .masonry-item-spine {
  display: block;
  position: absolute;
  width: 20px;
  height: 100%;
  margin-left: 16px;
  top: 0;
  left: 0;
  border-left: 2px solid rgba(0, 0, 0, 0.06);
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
  transition: margin-left 0.4s ease;
  pointer-events: none;
}

.page-editorial-design .masonry-item-shine {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 2px 12px 12px 2px;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 100%);
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.page-editorial-design .masonry-item:hover .masonry-item-cover {
  transform: perspective(2000px) rotateY(-12deg) translateX(-6px) scaleX(0.96);
  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.125), 20px 20px 40px rgba(0, 0, 0, 0.1), 40px 40px 60px rgba(0, 0, 0, 0.075);
}

.page-editorial-design .masonry-item:hover .masonry-item-spine {
  margin-left: 10px;
}

.page-editorial-design .masonry-item:hover .masonry-item-shine {
  opacity: 0.2;
}

.page-editorial-design .masonry-item:hover .masonry-item-page:nth-child(1) {
  transform: translateX(4px);
}

.page-editorial-design .masonry-item:hover .masonry-item-page:nth-child(2) {
  transform: translateX(2px);
}

.page-editorial-design .masonry-item:hover .masonry-item-page:nth-child(3) {
  transform: translateX(0);
}

/* Project page */

.project {
  padding: 0 32px 32px;
  max-width: 900px;
  margin: 0 auto;
}

.project-header h1 {
  font-weight: 500;
  font-size: 28px;
  margin-bottom: 8px;
}

.project-text {
  color: var(--color-text-secondary);
}

.project-text a,
.about-text a,
.legal-text a,
.post-text a {
  text-decoration-line: underline;
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.project-meta-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-text-strong);
  margin-bottom: 2px;
}

.project-client-value {
  display: block;
  color: var(--color-text);
}

.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  margin: 6px 0 0;
}

.project-tags li {
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--color-accent);
  color: #fff;
}

.project-gallery video {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  margin: 0 auto 16px;
}

.project-gallery img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 16px;
}

/* Navegación entre proyectos o noticias de la misma sección.
   En pantallas anchas: dos raíles discretos fijos en los bordes, con la flecha
   y el título en vertical. En pantallas estrechas: una fila al final de la página. */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 32px;
  font-size: 13px;
}

.pager-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pager-link.is-next {
  margin-left: auto;
  flex-direction: row-reverse;
}

.pager-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pager-link:hover {
  color: var(--color-accent);
}

@media (min-width: 1000px) {
  .pager {
    display: block;
    max-width: none;
    padding: 0;
  }

  .pager-link {
    position: fixed;
    top: 120px;
    flex-direction: column;
    align-items: center;
    width: 24px;
  }

  .pager-link.is-prev { left: 12px; }
  .pager-link.is-next { right: 12px; margin-left: 0; flex-direction: column; }

  .pager-label {
    writing-mode: vertical-rl;
    max-height: 40vh;
  }
}

/* About page */

.about {
  padding: 0 32px 32px;
  max-width: 700px;
  margin: 0 auto;
}

.about-text {
  font-weight: 300;
  line-height: 1.4;
}

.about img {
  mix-blend-mode: multiply;
  border-radius: 12px;
  width: 100%;
  height: auto;
  margin-bottom: 24px;
}

/* Tag view */

.tag-header {
  padding: 0 32px 16px;
  color: var(--color-text-tertiary);
  max-width: 1280px;
  margin: 0 auto;
}

/* News list */

.news-list {
  padding: 0 32px 48px;
  max-width: 700px;
  margin: 0 auto;
}

.news-item {
  padding: 24px 0;
}

.news-item:first-child {
  padding-top: 0;
}

.news-item-link {
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.news-item-thumb {
  display: block;
  mix-blend-mode: multiply;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.news-item-body {
  display: block;
  min-width: 0;
  flex: 1;
}

.news-item-date {
  display: block;
  font-size: 13px;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.news-item-title {
  font-weight: 500;
  font-size: 20px;
  margin: 0;
}

.news-item-excerpt {
  color: var(--color-text-secondary);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Single post */

.post {
  padding: 0 32px 32px;
  max-width: 700px;
  margin: 0 auto;
}

.post-date {
  display: block;
  font-size: 13px;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.post-header h1 {
  font-weight: 500;
  font-size: 28px;
  margin: 0 0 16px;
}

.post-text {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.post-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  margin: 24px 0;
}

.post-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.post-tags li {
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
}

/* Legal pages (Privacy Policy, etc.) */

.legal {
  padding: 0 32px 32px;
  max-width: 700px;
  margin: 0 auto;
}

.legal h1 {
  font-weight: 600;
  font-size: 28px;
  margin-bottom: 16px;
}

.legal-text {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.legal-text h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 32px 0 8px;
}

.legal-text ul {
  padding-left: 20px;
  margin: 8px 0;
}

.legal-text em {
  color: var(--color-text-muted);
  font-style: normal;
  font-size: 13px;
}

/* Footer */

.site-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  margin: 32px auto 0;
  max-width: 1280px;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.site-footer a {
  text-decoration-line: underline;
}
