/* ── PUBLICACIONES PAGE ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Jost:wght@300;400;500;600&display=swap');

:root {
  --pub-navy:       #1B1D21;
  --pub-navy-mid:   #22252C;
  --pub-navy-light: #2E323C;
  --pub-orange:     #F5821F;
  --pub-cream:      #F0EBE1;
  --pub-cream-dim:  rgba(240,235,225,0.6);
  --pub-border:     rgba(240,235,225,0.1);
  --pub-radius:     6px;
}

/* ── ASTRA FULL-WIDTH OVERRIDE ── */
.page-template-page-publicaciones-php body,
.page-template-page-publicaciones-php #page,
.page-template-page-publicaciones-php .site-content,
.page-template-page-publicaciones-php #content,
.page-template-page-publicaciones-php .ast-container,
.page-template-page-publicaciones-php .content-area,
.page-template-page-publicaciones-php #primary,
.page-template-page-publicaciones-php .site-primary,
.page-template-page-publicaciones-php main,
.page-template-page-publicaciones-php article,
.page-template-page-publicaciones-php .entry-content {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}

.page-template-page-publicaciones-php body,
.page-template-page-publicaciones-php #page {
  background: #1B1D21 !important;
}

.page-template-page-publicaciones-php .pub-section-title,
.page-template-page-publicaciones-php .pub-title {
  color: var(--pub-cream) !important;
}

.page-template-page-publicaciones-php .pub-hero h1 {
  color: var(--pub-cream) !important;
}

.page-template-page-publicaciones-php .pub-hero h1 em {
  color: #F5821F !important;
}

/* ── GRAIN TEXTURE ── */
.publicaciones-page::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* ── PAGE ── */
.publicaciones-page {
  background: var(--pub-navy);
  color: var(--pub-cream);
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  box-sizing: border-box;
}

/* ── CONTAINER ── */
.pub-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── HERO ── */
.pub-hero {
  position: relative;
  background: var(--pub-navy);
  padding: 80px 0 60px;
  overflow: hidden;
  border-bottom: 1px solid var(--pub-border);
  text-align: center;
}

/* Subtle grid lines — scientific feel */
.pub-hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(245,130,31,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,130,31,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}


.pub-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(48px, 6.5vw, 88px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--pub-cream);
  margin: 0 auto 24px;
  position: relative;
  z-index: 1;
  animation: pubFadeUp 0.6s 0.1s ease both;
}

.pub-hero h1 em {
  font-style: italic;
  color: var(--pub-orange);
}

.pub-hero-sub {
  font-size: 15px;
  font-weight: 300;
  color: var(--pub-cream-dim);
  white-space: nowrap;
  margin: 0 auto 32px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
  animation: pubFadeUp 0.6s 0.2s ease both;
}

.pub-hero-sub em {
  font-style: italic;
  color: var(--pub-cream);
}

.pub-hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(240,235,225,0.35);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  animation: pubFadeUp 0.6s 0.3s ease both;
}

/* ── SECTION HEADER ── */
.pub-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--pub-border);
}

.pub-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--pub-cream);
  letter-spacing: -0.01em;
}

.pub-section-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--pub-orange);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── LIST SECTION ── */
.pub-list-section {
  padding-bottom: 100px;
}

/* ── DECADE TABS ── */
/* Inactive tabs borrow the faint treatment of .pub-year-number so they read as
   part of the same year vocabulary; activating one brings it forward. */
.pub-decade-nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0 44px;
  padding: 52px 0 0;
}

/* Centered divider, feathered at both ends to match the row separators
   rather than running edge to edge. */
.pub-decade-nav::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 42%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(240,235,225,0.16) 20%,
    rgba(240,235,225,0.16) 80%,
    transparent
  );
}

.pub-decade-tab {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  font-family: 'Jost', sans-serif;
  color: var(--pub-cream) !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 16px !important;
  margin: 0 !important;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.25s ease;
  /* Astra uppercases all buttons globally */
  text-transform: none !important;
}

.pub-decade-tab:hover {
  opacity: 0.75;
  background: none !important;
}

.pub-decade-tab.is-active {
  opacity: 1;
}

.pub-decade-tab:focus-visible {
  outline: 2px solid var(--pub-orange);
  outline-offset: 5px;
  opacity: 1;
}

/* Orange rule sits on the nav's own hairline border */
.pub-decade-tab::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--pub-orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pub-decade-tab.is-active::after {
  transform: scaleX(1);
}

.pub-decade-range {
  display: inline-block;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease;
}

.pub-decade-tab:active .pub-decade-range {
  transform: translateY(1px);
}

/* ── DECADE PANEL ── */
.pub-decade-panel[hidden] {
  display: none;
}

.pub-decade-panel:not([hidden]) {
  animation: pubFadeUp 0.45s ease both;
}

/* The tab bar already provides separation, so the first year heading in a
   panel does not need the full 56px it uses further down the page. */
.pub-decade-panel > .pub-year-group:first-child .pub-year-heading {
  padding-top: 34px;
}

/* ── YEAR GROUP ── */
.pub-year-group {
  margin-bottom: 0;
}

/* No rule under the year: the large faint numeral and the orange count already
   mark the break, and a full-width line here stacked up with the row rules. */
.pub-year-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 60px 0 8px;
}

.pub-year-number {
  font-family: 'Jost', sans-serif;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  color: var(--pub-cream);
  opacity: 0.25;
  letter-spacing: -0.02em;
}

.pub-year-count {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pub-orange);
}

/* ── PUBLICATION ROW ── */
.pub-row {
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding: 52px 0;
  transition: background 0.2s;
}

/* Separator between consecutive rows only. Feathered at both ends so it reads
   as a soft shadow rather than a drawn rule. */
.pub-row + .pub-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(240,235,225,0.09) 14%,
    rgba(240,235,225,0.09) 86%,
    transparent
  );
}

.pub-row:hover {
  background: rgba(245,130,31,0.03);
}

/* Figure */
.pub-figure {
  border-radius: var(--pub-radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--pub-navy-light);
  flex-shrink: 0;
}

.pub-figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}

.pub-row:hover .pub-figure img {
  transform: scale(1.04);
}

.pub-no-thumb {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pub-navy-light);
}

.pub-no-thumb svg {
  width: 48px; height: 48px;
  opacity: 0.12;
  color: var(--pub-cream);
}

/* Body */
.pub-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 20px;
}

.pub-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pub-type-pill {
  display: inline-block;
  background: var(--pub-orange);
  color: var(--pub-navy);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 2px;
}


.pub-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--pub-cream);
  margin: 0;
}

.pub-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.pub-row:hover .pub-title a {
  color: var(--pub-orange);
}

.pub-authors {
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
  color: rgba(240,235,225,0.45);
  margin: 0;
  line-height: 1.5;
}

.pub-citation {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pub-journal {
  font-size: 13px;
  font-weight: 600;
  color: var(--pub-cream);
  letter-spacing: 0.01em;
}

.pub-volume {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  color: rgba(240,235,225,0.4);
  padding: 2px 8px;
  border: 1px solid rgba(240,235,225,0.12);
  border-radius: 2px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pub-abstract {
  font-size: 14px;
  font-weight: 300;
  color: var(--pub-cream-dim);
  line-height: 1.75;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.pub-doi-link,
.pub-read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.pub-doi-link {
  color: rgba(240,235,225,0.35);
  border: 1px solid rgba(240,235,225,0.12);
  padding: 6px 14px;
  border-radius: 2px;
}

.pub-doi-link:hover {
  border-color: var(--pub-orange);
  color: var(--pub-orange);
}

.pub-doi-link svg,
.pub-read-link svg {
  width: 13px; height: 13px;
  flex-shrink: 0;
}

.pub-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pub-orange) !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  cursor: pointer;
  transition: color 0.2s;
  border-radius: 0 !important;
}

.pub-toggle-btn:hover {
  color: var(--pub-cream) !important;
  background: none !important;
}

.pub-toggle-btn svg {
  width: 14px; height: 14px;
  transition: transform 0.25s ease;
}

.pub-toggle-btn[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

/* Expanded abstract — removes the 3-line clamp */
.pub-abstract.is-expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

/* Empty state */
.pub-empty {
  padding: 80px 0;
  text-align: center;
  color: var(--pub-cream-dim);
  font-size: 15px;
  font-weight: 300;
}

/* ── ANIMATIONS ── */
@keyframes pubFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .pub-row {
    grid-template-columns: 180px 1fr;
    gap: 24px;
    padding: 32px 0;
  }
}

@media (max-width: 600px) {
  .pub-container { padding: 0 20px; }
  .pub-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .pub-figure { aspect-ratio: 16/9; }
  .pub-body { padding-right: 0; }

  .pub-decade-nav {
    padding-top: 36px;
    gap: 0 26px;
  }
  .pub-decade-nav::after { width: 70%; }
  .pub-decade-tab { padding-bottom: 12px !important; }
  .pub-decade-range { font-size: 20px; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .pub-hero h1,
  .pub-hero-sub,
  .pub-hero-stats,
  .pub-decade-panel:not([hidden]) {
    animation: none;
  }
  .pub-decade-tab,
  .pub-decade-tab::after,
  .pub-decade-range,
  .pub-figure img,
  .pub-toggle-btn svg {
    transition: none;
  }
  .pub-row:hover .pub-figure img {
    transform: none;
  }
}
