/* Revista Científica — estilos mínimos OJS-like */
:root {
  --rc-gap: 1.25rem;
  --rc-gap-sm: .5rem;
  --rc-muted: #6b7280;
  --rc-border: #e5e7eb;
  --rc-primary: #1f6feb;
}

.rc-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--rc-gap);
}

.rc-title-xxl {
  font-size: 2rem;
  margin: 0 0 var(--rc-gap) 0;
}

.rc-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--rc-gap);
}

@media (max-width:900px) {
  .rc-grid {
    grid-template-columns: 1fr;
  }
}

.rc-col-main {
  min-width: 0;
}

.rc-col-side {
  min-width: 0;
}

.rc-h2 {
  font-size: 1.15rem;
  margin: 1.5rem 0 .75rem 0;
}

.rc-meta {
  color: var(--rc-muted);
  font-size: .95rem;
  margin: .25rem 0;
}

.rc-sub {
  color: var(--rc-muted);
  font-size: .9rem;
  margin: .25rem 0;
}

.rc-excerpt {
  margin: .5rem 0 1rem 0;
}

.rc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rc-item {
  padding: .75rem 0;
  border-bottom: 1px solid var(--rc-border);
}

.rc-title {
  text-decoration: none;
  font-weight: 600;
}

.rc-title:hover {
  text-decoration: underline;
}

.rc-cards .rc-card {
  padding: 1rem;
  border: 1px solid var(--rc-border);
  border-radius: .5rem;
  margin: 0 0 var(--rc-gap) 0;
}

.rc-actions {
  margin-top: .5rem;
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.rc-btn {
  display: inline-block;
  border: 1px solid var(--rc-border);
  padding: .35rem .6rem;
  border-radius: .375rem;
  text-decoration: none;
}

.rc-btn:hover {
  text-decoration: underline;
}

.rc-btn-primary {
  background: var(--rc-primary);
  border-color: var(--rc-primary);
  color: #fff;
}

.rc-btn-block {
  display: block;
  width: 100%;
  text-align: center;
  padding: .6rem .8rem;
  margin: .25rem 0 1rem 0;
}

.rc-orcid {
  display: inline-block;
  font-size: .8rem;
  color: #0a8a20;
  margin-left: .35rem;
}

.rc-chips {
  display: inline-flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin: .25rem 0 0 0;
  padding: 0;
  list-style: none;
  vertical-align: middle;
}

.rc-chip {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: .1rem .6rem;
  font-size: .85rem;
}

.rc-ed-header {
  display: flex;
  gap: var(--rc-gap);
  align-items: flex-start;
  margin-bottom: var(--rc-gap);
}

.rc-ed-thumb img {
  max-width: 180px;
  height: auto;
  border: 1px solid var(--rc-border);
  border-radius: .5rem;
}

@media (max-width: 900px) {
  .rc-ed-header {
    flex-direction: column;
  }
}

.rc-table {
  width: 100%;
  border-collapse: collapse
}

.rc-table th,
.rc-table td {
  padding: .5rem;
  border-bottom: 1px solid var(--rc-border);
}

.rc-table.small td,
.rc-table.small th {
  font-size: .9rem
}

.rc-box {
  border: 1px solid var(--rc-border);
  border-radius: .5rem;
  padding: .75rem;
  background: #fafafa;
}

.rc-box-row {
  margin: .35rem 0;
}

.rc-cite {
  width: 100%;
  height: 6rem;
  font-size: .95rem;
}

.rc-ed-portada img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rc-border);
  border-radius: .35rem;
}


/* ===== Compact list for [rc_indice_ediciones tipo="lista"] ===== */
.rc-index-ed--compact .rc-ediciones-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.rc-index-ed--compact .rc-edicion-row {
  display: grid;
  gap: 16px;
  align-items: center;
  grid-template-columns: 56px 2fr 1.2fr 1fr auto;
  padding: 12px 16px;
  border-bottom: 1px solid #e6e6e6;
}

.rc-index-ed--compact .rc-edicion-row:last-child {
  border-bottom: none;
}

.rc-index-ed--compact .rc-edicion-row:hover {
  background: #f7f7f7;
}

.rc-index-ed--compact .rc-edicion-portada img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  border: 1px solid #eee;
}

.rc-index-ed--compact .rc-edicion-portada--placeholder {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px dashed #eee;
  display: block;
}

.rc-index-ed--compact .rc-edicion-title {
  font-weight: 600;
}

.rc-index-ed--compact .rc-edicion-revista {
  text-align: center;
  color: #6b7280;
}

.rc-index-ed--compact .rc-edicion-count {
  color: #6b7280;
}

.rc-index-ed--compact .rc-edicion-actions {
  text-align: right;
}

.rc-index-ed--compact .rc-btn.rc-btn-link {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #111827;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 720px) {
  .rc-index-ed--compact .rc-edicion-row {
    grid-template-columns: 56px 1fr auto;
  }

  .rc-index-ed--compact .rc-edicion-revista,
  .rc-index-ed--compact .rc-edicion-count {
    display: none;
  }
}


/* ===== Compact row style for rc_indice_ediciones (without changing markup) ===== */
.rc-index-ed .rc-list.rc-cards {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.rc-index-ed .rc-card.rc-card--ed {
  display: grid;
  grid-template-columns: 56px 2fr 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #e6e6e6;
  background: #fff;
}

.rc-index-ed .rc-card.rc-card--ed:last-child {
  border-bottom: none;
}

.rc-index-ed .rc-card.rc-card--ed:hover {
  background: #f7f7f7;
}

.rc-index-ed .rc-card__thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
  display: block;
}

.rc-index-ed .rc-h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.rc-index-ed .rc-sub {
  color: #6b7280;
  text-align: center;
}

.rc-index-ed .rc-card__actions {
  text-align: right;
}

.rc-index-ed .rc-btn.rc-btn-link {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #111827;
  text-decoration: none;
  font-weight: 600;
}

/* Remove card grid gutters to make it feel like a tight list */
.rc-index-ed .rc-cards {
  gap: 0 !important;
}

.rc-index-ed .rc-cards.rc-cards--cols-2,
.rc-index-ed .rc-cards.rc-cards--cols-3,
.rc-index-ed .rc-cards.rc-cards--cols-4 {
  grid-template-columns: 1fr !important;
}

@media (max-width: 720px) {
  .rc-index-ed .rc-card.rc-card--ed {
    grid-template-columns: 56px 1fr auto;
  }

  .rc-index-ed .rc-sub {
    display: none;
  }
}


/* ===== Refinements: compact row alignment & single-line title ===== */
.rc-index-ed .rc-card.rc-card--ed {
  align-items: center;
  min-height: 68px;
}

.rc-index-ed .rc-card__thumb {
  align-self: center;
}

/* Title+year in one line with ellipsis */
.rc-index-ed .rc-h2,
.rc-index-ed .rc-h2 a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Count stays centered & single line */
.rc-index-ed .rc-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* Right column button aligned consistently */
.rc-index-ed .rc-actions {
  text-align: right;
  justify-self: end;
}

.rc-index-ed .rc-actions .rc-btn {
  line-height: 1;
  padding: 10px 14px;
}

/* Slightly denser vertical rhythm between rows */
.rc-index-ed .rc-card.rc-card--ed {
  padding-top: 10px;
  padding-bottom: 10px;
}

@media (max-width: 720px) {

  .rc-index-ed .rc-h2,
  .rc-index-ed .rc-h2 a {
    white-space: normal;
  }
}


/* ===== Fixed column widths for edition list ===== */
/* Desktop/tablet layout: [thumb][title 55%][count 15%][button 18%] */
.rc-index-ed .rc-card.rc-card--ed {
  display: grid;
  grid-template-columns: 56px minmax(0, 55%) 15% 18%;
  align-items: center;
  gap: 16px;
}

/* Keep title single line with ellipsis */
.rc-index-ed .rc-h2,
.rc-index-ed .rc-h2 a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Center count column and prevent wrapping */
.rc-index-ed .rc-sub {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fix action column alignment independent of title length */
.rc-index-ed .rc-actions {
  justify-self: end;
  /* right edge aligned per fixed 18% column */
  text-align: right;
  white-space: nowrap;
}

.rc-index-ed .rc-actions .rc-btn {
  line-height: 1;
  padding: 10px 14px;
}

/* Thumbnail size */
.rc-index-ed .rc-card__thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
  display: block;
}

/* Responsive: collapse to 3 columns on small screens */
@media (max-width: 720px) {
  .rc-index-ed .rc-card.rc-card--ed {
    grid-template-columns: 56px 1fr auto;
    /* title grows, button auto; count hidden */
  }

  .rc-index-ed .rc-sub {
    display: none;
  }
}


/* ===== Grid-areas layout: lock columns for title / count / button ===== */
.rc-index-ed .rc-card.rc-card--ed {
  display: grid;
  grid-template-columns: 56px minmax(0, 55%) 15% 18%;
  grid-template-areas:
    "thumb title count action"
    "thumb excerpt count action";
  align-items: center;
  gap: 16px;
}

/* Map children to fixed areas */
.rc-index-ed .rc-card__thumb {
  grid-area: thumb;
  align-self: center;
}

.rc-index-ed .rc-h2 {
  grid-area: title;
  margin: 0;
}

.rc-index-ed .rc-excerpt {
  grid-area: excerpt;
  margin: 0;
  color: #6b7280;
}

.rc-index-ed .rc-sub {
  grid-area: count;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-index-ed .rc-actions {
  grid-area: action;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

/* Keep title in one line with ellipsis */
.rc-index-ed .rc-h2 a {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Button sizing */
.rc-index-ed .rc-actions .rc-btn {
  line-height: 1;
  padding: 10px 14px;
}

/* Thumbnail look */
.rc-index-ed .rc-card__thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
  display: block;
}

/* Force list to a single column and no gaps even if theme overrides */
.rc-index-ed .rc-list.rc-cards {
  gap: 0 !important;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.rc-index-ed .rc-cards.rc-cards--cols-2,
.rc-index-ed .rc-cards.rc-cards--cols-3,
.rc-index-ed .rc-cards.rc-cards--cols-4 {
  grid-template-columns: 1fr !important;
}

/* Responsive */
@media (max-width: 720px) {
  .rc-index-ed .rc-card.rc-card--ed {
    grid-template-columns: 56px 1fr auto;
    grid-template-areas:
      "thumb title action"
      "thumb excerpt action";
  }

  .rc-index-ed .rc-sub {
    display: none;
  }
}

/* =========================================
   NEW EDITION LIST GRID STYLES
   ========================================= */

/* 1. Main Title */
.rc-main-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 2rem;
}

/* 2. Grid Container */
.rc-edition-grid {
  display: grid;
  /* REQUISITO CLAVE: grid-template-columns: repeat(3, 1fr) sin media queries */
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 2rem;
  width: 100%;
}

/* 3. Card Style */
.rc-edition-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  /* Gris claro sutil */
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  /* Ensure content flows correctly */
  position: relative;
  text-decoration: none;
  /* Just in case */
}

.rc-edition-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  /* Efecto suave hover */
}

/* Wrapper for internal content to handle padding/spacing if needed, 
   though padding is on parent. The PHP output has `rc-card-body` wrapper 
   but we can style elements directly or use the wrapper. */
.rc-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 4. Card Content */

/* Cover Image */
.rc-card-cover {
  margin-bottom: 1rem;
  width: 100%;
}

.rc-card-cover img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3/4;
  /* Consistent aspect ratio */
  object-fit: cover;
  border-radius: 4px;
}

/* Title */
.rc-card-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.rc-card-title a {
  color: #1f2937;
  /* Gris oscuro */
  text-decoration: none;
  font-weight: 700;
  font-family: sans-serif;
}

.rc-card-title a:hover {
  color: #111827;
}

/* Meta (Count) */
.rc-card-meta {
  font-size: 0.875rem;
  color: #9ca3af;
  /* Gris claro */
  margin-bottom: 1rem;
}

/* Button */
.rc-card-btn {
  margin-top: auto;
  /* Aligns to bottom */
  display: inline-block;
  align-self: flex-start;
  /* Or stretch if preferred */
  background-color: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.2s;
}

.rc-card-btn:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
  text-decoration: none;
}


/* =========================================
   SHORTCODE: [rc_edicion_actual] SUMMARY CARD
   ========================================= */

.rc-summary-card {
  max-width: 900px;
  margin: 0 auto 2rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  /* Subtle shadow */
  display: flex;
  overflow: hidden;
  /* Ensure image corner radius */
}

/* Left Column: Cover */
.rc-summary-cover {
  width: 50%;
  /* Increased from 30% to 50% */
  background: #f9fafb;
  /* Fallback bg */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.rc-summary-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Cover container logic */
  display: block;
}

/* Right Column: Content */
.rc-summary-content {
  width: 50%;
  /* Adjusted to match 50% cover */
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

/* Title & Meta reuse existing classes or new ones */
.rc-summary-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem;
}

.rc-summary-data {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 1.5rem;
}

/* Button VER - Styled like .rc-btn-pdf but normally bigger or action-like */
.rc-summary-btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  text-transform: uppercase;
  text-align: center;
  align-self: flex-start;
  /* Don't stretch on desktop */
  margin-bottom: 1.5rem;
}

.rc-summary-btn:hover {
  background: #1d4ed8;
  color: #fff;
}

/* Article List (clean, truncated) */
.rc-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.rc-summary-item {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
  color: #111827;
  /* Truncate logic */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rc-summary-item:last-child {
  margin-bottom: 0;
}

.rc-summary-item::before {
  content: "•";
  color: #9ca3af;
  margin-right: 0.5rem;
  font-size: 1.2em;
  line-height: 1;
  vertical-align: middle;
}

/* Mobile Optimization (< 768px) */
@media (max-width: 768px) {
  .rc-summary-card {
    flex-direction: column;
    max-width: 100%;
  }

  /* Cover on Mobile */
  .rc-summary-cover {
    width: 100%;
    padding: 1.5rem 1.5rem 0;
    /* Add top spacing */
    background: #fff;
    justify-content: center;
  }

  .rc-summary-cover img {
    width: auto;
    max-width: 200px;
    /* Limit size */
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .rc-summary-content {
    width: 100%;
    padding: 1.5rem;
  }

  .rc-summary-btn {
    width: 100%;
    align-self: stretch;
    padding: 12px;
    /* Bigger touch target */
    margin-bottom: 1.5rem;
  }

  .rc-summary-item {
    font-size: 14px;
  }
}