:root {
  --color-bg: #fdfcfa;
  --color-text: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-accent: #a4402c;
  --color-border: #e6e2db;
  --font-serif: "Lora", Georgia, serif;
  --font-sans: "Inter", -apple-system, sans-serif;
  --max-width: 760px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.65;
  font-size: 17px;
  position: relative;
  min-height: 100vh;
  /* Red de seguridad: si algo (un link larguísimo, una tabla ancha, etc.)
     se sale del ancho de la pantalla, que no arrastre scroll horizontal
     a toda la página. */
  overflow-x: hidden;
}

/* Fondo ambiental sutil: dos manchas de color muy difuminadas, fijas detrás del contenido */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px circle at 15% -10%, rgba(164, 64, 44, 0.08), transparent 60%),
    radial-gradient(500px circle at 110% 20%, rgba(90, 110, 140, 0.08), transparent 60%);
  pointer-events: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 600px) {
  .container { padding: 0 24px; }
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 24px 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text);
}

.site-nav a {
  margin-left: 24px;
  color: var(--color-text);
  font-size: 0.95rem;
}
.site-nav a:first-child { margin-left: 0; }

.main-content { padding-top: 48px; padding-bottom: 80px; }

/* Layout de la home: columna central (posts/proyectos) + barra lateral de
   noticias a la derecha. Usa su propio ancho máximo (más amplio que
   --max-width, pensado para lectura de un solo artículo) en vez de la
   clase .container, para no afectar el ancho del resto del sitio. */
.home-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: flex-start;
  gap: 56px;
}
.home-layout-main { flex: 1; min-width: 0; }
.home-layout-sidebar {
  width: 300px;
  flex-shrink: 0;
  border-left: 1px solid var(--color-border);
  padding-left: 28px;
}
@media (max-width: 600px) {
  .home-layout { padding: 0 24px; }
}
@media (max-width: 880px) {
  .home-layout { flex-direction: column; gap: 40px; }
  .home-layout-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: 28px;
  }
}

.home-sidebar-title { font-size: 1.2rem; margin-top: 0; }
.news-feed-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  color: inherit;
}
.news-feed-item:first-of-type { padding-top: 0; }
.news-feed-item:hover { text-decoration: none; }
.news-feed-item:hover .news-feed-title { text-decoration: underline; }
.news-feed-text { flex: 1; min-width: 0; }
.news-feed-title { margin: 0 0 6px; font-size: 0.92em; font-weight: 600; line-height: 1.4; }
.news-feed-meta { margin: 0; font-size: 0.82em; color: var(--color-muted); line-height: 1.4; }
.news-feed-thumb { width: 76px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

h1, h2, h3 {
  font-family: var(--font-serif);
  line-height: 1.25;
}

h1 { font-size: 2.1rem; margin-bottom: 0.3em; }
h2 { font-size: 1.5rem; }

.post-excerpt, .post-meta, .card-summary { color: var(--color-muted); }

.post-meta { font-size: 0.9rem; margin-bottom: 1.5em; }

.post-list-item, .card {
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border);
}
.post-list-item:first-child, .card:first-child { padding-top: 0; }

.post-list-item-with-thumb {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.post-thumb-wrap {
  flex-shrink: 0;
  display: block;
  width: 120px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
}
.post-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  transition: transform 0.2s ease;
}
.post-thumb-wrap:hover .post-thumb { transform: scale(1.05); }
.post-list-item-body { flex: 1; min-width: 0; }

.home-align-center .post-list-item-with-thumb { justify-content: center; }
.home-align-right .post-list-item-with-thumb { justify-content: flex-end; }

.post-excerpt p { margin: 0; }

@media (max-width: 480px) {
  .post-thumb-wrap { width: 90px; height: 70px; }
}

.post-body img, .post-photo-grid img, .cover-image {
  max-width: 100%;
  border-radius: 4px;
  margin: 1.2em 0;
}

.post-body { overflow-wrap: anywhere; }
.post-body p { margin: 1em 0; }
.post-body strong, .post-body b { font-weight: 600; }
.post-body blockquote {
  margin: 1.5em 0;
  padding: 0.4em 1.2em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-muted);
  font-family: var(--font-serif);
  font-style: italic;
}
.post-body ul, .post-body ol { padding-left: 1.4em; margin: 1em 0; }
.post-body li { margin: 0.3em 0; }
.post-body a { text-decoration: underline; }
.post-body h2 { margin-top: 1.4em; }
.post-body h3 { margin-top: 1.2em; font-size: 1.2rem; }
.post-body mark { padding: 0 2px; border-radius: 2px; }
.post-body hr { border: none; border-top: 1px solid var(--color-border); margin: 2em 0; }

.post-body figure.table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 1.5em 0;
}
.post-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
}
.post-body table td, .post-body table th {
  border: 1px solid var(--color-border);
  padding: 8px 12px;
}
.post-body table th { background: #f4f1ec; }

/* Imagen a ancho completo de pantalla (estilo "block" del editor) */
.post-body figure.image-style-block,
.post-body .image-style-block {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}
.post-body figure.image-style-block img,
.post-body .image-style-block img {
  width: 100%;
  border-radius: 0;
  margin: 0;
}
.post-body figure.image-style-block figcaption {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  padding: 8px 20px 0;
}

.post-body figure.image-style-align-left { float: left; margin: 0.3em 1.5em 1em 0; max-width: 45%; }
.post-body figure.image-style-align-right { float: right; margin: 0.3em 0 1em 1.5em; max-width: 45%; }
.post-body figure.image-style-align-left img,
.post-body figure.image-style-align-right img { margin: 0; }

.post-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* Galería de fotos de proyectos: miniaturas livianas + visor a pantalla completa */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin: 1.5em 0;
}
.photo-gallery-item { margin: 0; }
.photo-gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.photo-gallery-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  transition: transform 0.15s ease;
}
.photo-gallery-trigger:hover img { transform: scale(1.04); }
.photo-gallery-item figcaption { margin-top: 6px; text-align: center; }

.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: 0;
  border-radius: 4px;
}
.lightbox-caption { color: #fff; opacity: 0.85; margin: 12px 0 0; text-align: center; max-width: 700px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 10px;
}
.lightbox-close { top: 10px; right: 16px; font-size: 2rem; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { opacity: 0.7; }

@media (max-width: 480px) {
  .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
}

.system-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--color-border);
  overflow: hidden;
  margin-top: 4px;
}
.system-bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 4px;
}

.tag-list { margin: 8px 0; }
.tag {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 2px 12px;
  margin-right: 6px;
}

.comments-section { margin-top: 3em; border-top: 1px solid var(--color-border); padding-top: 2em; }

.comment {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}
.comment-author { font-weight: 600; }
.comment-date { font-size: 0.85rem; color: var(--color-muted); margin-left: 8px; }

form input[type=text], form input[type=email], form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 1rem;
  margin-bottom: 12px;
  background: white;
}

button, input[type=submit] {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
button:hover, input[type=submit]:hover { opacity: 0.9; }

.messages { list-style: none; padding: 0; margin-bottom: 24px; }
.message { padding: 10px 16px; border-radius: 4px; margin-bottom: 8px; font-size: 0.9rem; }
.message.success { background: #e6f4ea; color: #1e4620; }
.message.error { background: #fbe9e7; color: #8a2c1d; }

.pagination { display: flex; gap: 16px; margin-top: 32px; }

.honeypot-field { display: none !important; }

/* Cabecera de inicio a todo el ancho de la pantalla */
.home-hero {
  position: relative;
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 24px;
  background-color: var(--color-bg);
}
.home-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.home-hero--has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: var(--hero-overlay, 0.45);
}
.home-hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  padding: 48px 20px;
  width: 100%;
}
.home-hero-content--left { text-align: left; margin-right: auto; }
.home-hero-content--center { text-align: center; margin-left: auto; margin-right: auto; }
.home-hero-content--right { text-align: right; margin-left: auto; }
.home-hero--has-image .home-hero-content,
.home-hero--has-image .home-hero-content .home-hero-title {
  color: #fff;
}
.home-hero-title { font-weight: 700; margin: 0 0 0.4em; line-height: 1.15; font-family: var(--font-serif, inherit); }
.home-hero-title p { margin: 0; }
.home-hero-content p { color: inherit; opacity: 0.9; }
.home-hero-subtitle { color: inherit; opacity: 0.9; margin: 0 0 1.2em; }
.home-hero-subtitle p { margin: 0; }

.home-hero-button {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity 0.15s ease;
}
.home-hero-button:hover { opacity: 0.85; }

/* Feed de notas cortas */
.note-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}
.note-item:first-child { padding-top: 0; }
.note-text { margin: 0 0 0.5em; white-space: pre-wrap; }
.note-image { max-width: 100%; border-radius: 6px; margin: 0.5em 0; }

.note-link-card {
  display: flex;
  gap: 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  margin: 0.5em 0;
}
.note-link-card:hover { background: #f4f1ec; }
.note-link-card-img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  flex-shrink: 0;
  margin: 0;
}
.note-link-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px 10px 0;
  min-width: 0;
}
.note-link-card-title { font-weight: 600; }
.note-link-card-desc {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.note-link-card-url {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0 1.5em; }
.board-pill {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--color-text);
}
.board-pill.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

/* Layout de tarjetas en cuadrícula para la sección de artículos en portada */
.home-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
  margin: 20px 0;
}
.post-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.post-card-thumb-wrap { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.post-card-thumb { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; transition: transform 0.2s ease; }
.post-card-thumb-wrap:hover .post-card-thumb { transform: scale(1.05); }
.post-card-body { padding: 16px; }
.post-card-body h3 { margin: 0 0 6px; font-size: 1.1rem; }

.profile-photo {
  max-width: 220px;
  border-radius: 50%;
  display: block;
}

/* Cabecera con imagen de portada difuminada detrás del título */
.post-hero {
  position: relative;
  margin: -20px -20px 32px;
  padding: 64px 20px 40px;
  border-radius: 8px;
  overflow: hidden;
  color: #fff;
}
.post-hero-bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(18px) brightness(0.55) saturate(1.1);
  transform: scale(1.1);
}
.post-hero-content { position: relative; z-index: 1; max-width: var(--max-width); margin: 0 auto; }
.post-hero h1 { color: #fff; }
.post-hero .post-meta { color: rgba(255,255,255,0.8); }
.post-hero .post-meta a { color: #fff; }
