/* ============================================================
   CEROADIEZ — Interior Pages
   Páginas interiores, posts, archivo, sidebar
   ============================================================ */

/* ── SHARED INTERIOR WRAP ── */
.interior-wrap {
  padding-top: 72px; /* header height */
}

/* ── PAGE HERO ── */
.page-hero {
  background: var(--black);
  color: var(--white);
  padding: clamp(3.5rem, 7vw, 6rem) var(--pad-x) clamp(3rem, 5vw, 5rem);
  border-bottom: 1px solid #1a1a1a;
}

.page-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .1em;
  color: #555;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #555;
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover { color: #aaa; }

.page-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.05;
  color: var(--white);
}

.page-title em {
  font-style: italic;
  font-weight: 400;
}

.archive-desc {
  font-size: 1rem;
  color: #777;
  margin-top: 1rem;
  max-width: 560px;
  line-height: 1.7;
}

/* ── POST HERO ── */
.post-hero {
  background: var(--black);
  color: var(--white);
  padding: clamp(3.5rem, 7vw, 6rem) var(--pad-x) clamp(3rem, 5vw, 5rem);
  border-bottom: 1px solid #1a1a1a;
}

.post-hero-inner {
  max-width: 820px;
  margin: 0 auto;
}

.post-category-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #666;
  border: 1px solid #2a2a2a;
  padding: .35rem .9rem;
  margin-bottom: 1.5rem;
}

.post-hero-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 2rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: .82rem;
  color: #666;
  flex-wrap: wrap;
}

.post-meta-author {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.author-avatar-img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50%;
  object-fit: cover;
}

.post-meta-sep { color: #333; }

/* ── FEATURED IMAGE ── */
.post-featured-image {
  max-height: 520px;
  overflow: hidden;
  background: var(--off-white);
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── CONTENT WRAP LAYOUTS ── */
.page-content-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5.5rem) var(--pad-x);
  display: grid;
  gap: 5rem;
}

/* Full width (no sidebar) */
.page-content--full {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

/* With sidebar */
.page-content-wrap:has(.page-content--with-sidebar) {
  grid-template-columns: 1fr 320px;
  align-items: start;
}

.page-content-wrap:has(.sidebar) {
  grid-template-columns: 1fr 320px;
  align-items: start;
}

/* ── PROSE (content styles) ── */
.prose {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--black);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--black);
  margin-top: 2.5em;
  margin-bottom: .8em;
}

.prose h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
.prose h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
.prose h4 { font-size: 1.1rem; }

.prose p { margin-bottom: 1.5em; }

.prose a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--gray-light);
  transition: text-decoration-color var(--transition);
}

.prose a:hover { text-decoration-color: var(--black); }

.prose strong { font-weight: 500; }

.prose em { font-style: italic; }

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.prose li { margin-bottom: .5em; }

.prose blockquote {
  border-left: 3px solid var(--black);
  padding: 1rem 0 1rem 2rem;
  margin: 2.5em 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--gray-dark);
}

.prose blockquote p { margin-bottom: 0; }

.prose img {
  width: 100%;
  height: auto;
  display: block;
  margin: 2.5em 0;
}

.prose figure {
  margin: 2.5em 0;
}

.prose figcaption {
  font-size: .8rem;
  color: var(--gray-mid);
  text-align: center;
  margin-top: .7rem;
  letter-spacing: .06em;
}

.prose pre {
  background: var(--black);
  color: var(--white);
  padding: 1.5rem;
  overflow-x: auto;
  font-size: .88rem;
  line-height: 1.65;
  margin: 2em 0;
}

.prose code {
  font-size: .88em;
  background: var(--off-white);
  padding: .15em .4em;
  border: 1px solid var(--gray-light);
}

.prose pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--gray-light);
  margin: 3em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: .92rem;
}

.prose th {
  background: var(--off-white);
  padding: .8rem 1rem;
  text-align: left;
  font-weight: 500;
  border-bottom: 2px solid var(--gray-light);
}

.prose td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-light);
}

/* ── POST TAGS ── */
.post-tags {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-light);
}

.post-tags-label {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.tag-pill {
  display: inline-block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--black);
  border: 1px solid var(--gray-light);
  padding: .3rem .8rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.tag-pill:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ── AUTHOR BOX ── */
.author-box {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 2.5rem;
  background: var(--off-white);
  margin-top: 3.5rem;
}

.author-box-avatar {
  width: 72px !important;
  height: 72px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-box-label {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gray-mid);
  display: block;
  margin-bottom: .4rem;
}

.author-box-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
  margin-bottom: .5rem;
}

.author-box-bio {
  font-size: .88rem;
  line-height: 1.7;
  color: var(--gray-dark);
  margin: 0;
}

/* ── POST NAVIGATION ── */
.post-nav {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--gray-light);
}

.post-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-decoration: none;
  color: var(--black);
  padding: 1.5rem;
  border: 1px solid var(--gray-light);
  transition: background var(--transition), color var(--transition);
}

.post-nav-item:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.post-nav-next { align-items: flex-end; text-align: right; }

.post-nav-dir {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.post-nav-item:hover .post-nav-dir { color: #777; }

.post-nav-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

/* ── RELATED POSTS ── */
.related-posts {
  background: var(--off-white);
  border-top: 1px solid var(--gray-light);
}

.related-posts-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--pad-x);
}

.related-posts-inner .section-tag { margin-bottom: 2.5rem; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  background: var(--gray-light);
}

/* ── ARCHIVE ── */
.archive-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5.5rem) var(--pad-x);
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 5rem;
  align-items: start;
}

.archive-main { min-width: 0; }

/* Featured post */
.archive-featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--gray-light);
  margin-bottom: 1.5px;
  overflow: hidden;
}

.archive-featured-image {
  display: block;
  overflow: hidden;
  background: var(--off-white);
  aspect-ratio: 4/3;
}

.archive-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.archive-featured:hover .archive-featured-image img { transform: scale(1.03); }

.archive-featured-body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.archive-featured-title {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.archive-featured-title a {
  text-decoration: none;
  color: var(--black);
  transition: color var(--transition);
}

.archive-featured-title a:hover { color: var(--gray-dark); }

.archive-featured-excerpt {
  font-size: .92rem;
  line-height: 1.75;
  color: var(--gray-dark);
}

/* Posts grid */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
  background: var(--gray-light);
}

/* Pagination */
.archive-pagination {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-light);
}

.archive-pagination .page-numbers {
  display: flex;
  gap: .5rem;
  align-items: center;
  list-style: none;
  flex-wrap: wrap;
}

.archive-pagination .page-numbers li a,
.archive-pagination .page-numbers li span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .6rem 1rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
  border: 1px solid var(--gray-light);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.archive-pagination .page-numbers li a:hover,
.archive-pagination .page-numbers li span.current {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.no-posts {
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

.no-posts p {
  font-size: 1rem;
  color: var(--gray-dark);
}

/* ── SIDEBAR ── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 90px;
}

.sidebar-widget {
  padding: 2rem;
  border: 1px solid var(--gray-light);
  margin-top: -1px;
  background: var(--white);
}

.widget-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 1.5rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--gray-light);
}

/* Search */
.search-wrap {
  display: flex;
  border: 1px solid var(--gray-light);
  overflow: hidden;
}

.search-field {
  flex: 1;
  padding: .7rem 1rem;
  font-family: var(--sans);
  font-size: .88rem;
  border: none;
  background: var(--white);
  color: var(--black);
  outline: none;
}

.search-field::placeholder { color: var(--gray-mid); }

.search-btn {
  width: 42px;
  background: var(--black);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.search-btn:hover { background: #333; }
.search-btn svg { stroke: var(--white); }

/* Categories */
.sidebar-categories {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-categories li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 0;
  font-size: .88rem;
  color: var(--black);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-light);
  transition: color var(--transition);
}

.sidebar-categories li:last-child a { border-bottom: none; }
.sidebar-categories li a:hover { color: var(--gray-dark); }

.cat-count {
  font-size: .72rem;
  color: var(--gray-mid);
  background: var(--off-white);
  padding: .15rem .5rem;
  letter-spacing: .08em;
}

/* Recent posts */
.sidebar-recent {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-recent li a {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: .9rem 0;
  text-decoration: none;
  color: var(--black);
  border-bottom: 1px solid var(--gray-light);
  transition: opacity var(--transition);
}

.sidebar-recent li:last-child a { border-bottom: none; }
.sidebar-recent li a:hover { opacity: .7; }

.recent-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--off-white);
}

.recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gray-light);
}

.recent-info {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
}

.recent-title {
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-date {
  font-size: .72rem;
  color: var(--gray-mid);
  letter-spacing: .06em;
}

/* Sidebar CTA */
.sidebar-cta { background: var(--black); border-color: var(--black); }

.sidebar-cta-tag {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: .8rem;
}

.sidebar-cta-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.02em;
  margin-bottom: .8rem;
  line-height: 1.2;
}

.sidebar-cta-text {
  font-size: .85rem;
  color: #666;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* Tags */
.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ── RESPONSIVE INTERIOR ── */
@media (max-width: 1024px) {
  .archive-wrap {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .page-content-wrap:has(.sidebar),
  .page-content-wrap:has(.page-content--with-sidebar) {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .archive-featured {
    grid-template-columns: 1fr;
  }

  .archive-featured-image {
    aspect-ratio: 16/9;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .post-nav-inner {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .author-box {
    flex-direction: column;
    gap: 1rem;
  }
}
