/* =================================================================
   index.css — Estilos propios de la portada
   ================================================================= */

main > .header-main { display: flex; justify-content: space-between; margin-bottom: 3rem; flex-wrap: wrap; gap: 1rem; align-items: center;}
main > .header-main > h1 {color: var(--red-text); position: relative; display: block; max-width: fit-content;}
main > .header-main > h1::after  { content: ''; display: block; width: 3rem; height: 3px; background-color: currentColor; position: absolute; bottom: -5px; left: 0;}
main > .header-main > img{ height: 50px;}

@media (max-width: 450px) {
  main > .header-main { flex-wrap: wrap;}
}

main > .hero-section > article > .image,
main > .hero-section > aside > article > .image,
main > section > .grid > article > .image {
	position: relative;
	width: 100%;
	overflow: hidden;
}

/* --- HERO + SIDEBAR --- */
main > .hero-section {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 40px;
  margin-bottom: 60px;
}

main > .hero-section > article {
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

main > .hero-section > article:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

main > .hero-section > article > .image {
  height: 0;
  padding-top: 62.5%;
}

/*main > .hero-section > article > .image > a:first-child */
main > .hero-section > article > .image > figure:first-child {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

main > .hero-section > article > .image > figure > img,
main > .hero-section > aside > article > .image > figure > img,
main > section > .grid > article > .image >  figure > img
 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

main > .hero-section > article > .image > .tag {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
}

main > .hero-section > article > .content {
  padding: 30px;
}

main > .hero-section > article > .content > h2 { margin: 0 0 15px 0; font-size: 2.2rem; line-height: 1.2;}

main > .hero-section > article > .content > time {
  margin-bottom: 15px;
  display: block;
}

main > .hero-section > article > .content > p {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 20px;
}

main > .hero-section > article > .content > a:last-child {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

main > .hero-section > article > .content > a:last-child:hover {
  color: var(--accent-color);
}

main > .hero-section > article > .content > a:last-child::after {
  content: "→";
  font-size: 1.2rem;
  margin-left: 8px;
  transition: margin-left 0.3s ease;
}

main > .hero-section > article > .content > a:last-child:hover::after {
  margin-left: 12px;
}

/* --- SIDEBAR ACTUALIDAD --- */
main > .hero-section > aside {
  display: flex;
  flex-direction: column;
}

main > .hero-section > aside > * {
  margin-bottom: 20px;
}

main > .hero-section > aside > *:last-child {
  margin-bottom: 0;
}

main > .hero-section > aside > h2 {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  letter-spacing: 1px;
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 10px;
  margin: 0 0 10px 0;
  font-family: 'Georgia', serif;
}

main > .hero-section > aside > article {
  padding: 20px;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

main > .hero-section > aside > article:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateX(5px);
}

main > .hero-section > aside > article > .image {
  border-radius: 3px;
  margin-bottom: 12px;
}

main > .hero-section > aside > article > .image > a:first-child {
  display: block;
  height: 200px;
}

main > .hero-section > aside > article > .image > a:first-child > figure > img {
  display: block;
}

main > .hero-section > aside > article > .image > .tag,
main > section > .grid > article > .image > .tag {
  position: absolute;
  top: 15px;
  left: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

main > .hero-section > aside > article > .content > h3 {
  font-size: 1rem;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

main article.contenEnlace {
    cursor: pointer;
}

/* --- TÍTULO DE SECCIÓN --- */
main > section > h2 {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 60px 0 30px 0;
  padding-bottom: 15px;
  border-bottom: 4px solid var(--primary-color);
  font-family: 'Georgia', serif;
}

/* --- GRID DE NOTICIAS --- */
main > section > .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

main > section > .grid > article {
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

main > section > .grid > article:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

main > section > .grid > article > .image {
  height: 220px;
}

main > section > .grid > article > .image > a:first-child {
  display: block;
  height: 100%;
}

main > section > .grid > article > .content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

main > section > .grid > article > .content > h3 {
  font-size: 1.2rem;
  margin: 0 0 12px 0;
  line-height: 1.4;
  flex: 1;
}

/* --- BOTÓN "BUSCAR MÁS NOTICIAS" --- */
main > section > .section-more {
  text-align: center;
  margin-top: 30px;
}
 
main > section > .section-more > .btn-more {
  display: inline-block;
  background: var(--primary-color);
  color: White;
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 36px;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
main > section > .section-more > .btn-more:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}

/* --- LISTADO COMPACTO Y LISTADO HEMEROTECA--- */
.category-list > article {
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--gray-medium);
  gap: 30px;
  padding: 25px 0;
}

.category-list > article {
  grid-template-columns: 150px 1fr auto;
}

.category-list > article.no-photo::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
}

.category-list > article.no-photo > div {
  grid-column: 2;
  grid-row: 1;
}

.category-list > article.no-photo > time {
  grid-column: 3;
  grid-row: 1;
}

.category-list > article:last-child {
  border-bottom: none;
}

.category-list > article > div > h2,
.category-list > article > div > h3 {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.category-list > article > time {
  white-space: nowrap;
}

.category-list {
  display: flex;
  flex-direction: column;
  padding: 0 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.category-list > article > figure > img {
  width: 150px;
  height: 100px;
  object-fit: cover;
  object-position: center;
  border-radius: 3px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .category-list {
    padding: 0 15px;
  }
  .category-list > article {
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
  }

  .category-list > article > figure > img {
    width: 120px;
  }
  
  .category-list > article.no-photo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .category-list > article {
    grid-template-columns: 1fr;
    gap: 15px;
    align-items: flex-start;
  }
  .category-list > article > figure > img {
    width: 100%;
    height: 180px;
  }
  .category-list > article > time {
    grid-column: 1;
    margin-top: 0;
  }
}

/* --- RESPONSIVE --- */
@media (max-width: 1100px) {
  main > .hero-section {
    grid-template-columns: 1fr;
  }
  main > .hero-section > aside {
    overflow-x: auto;
    padding-bottom: 20px;
  }
  main > .hero-section > aside > article {
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  main > .hero-section > article > .image {
    height: 420px;
    padding-top: 0;
  }
  main > section > .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 425px) {
  main > .hero-section > article > .image {
    height: 260px;
    padding-top: 0;
  }
}


/* =================================================================
   news.css — Estilos propios de la página de noticia
   ================================================================= */

/* --- BARRA DE PROGRESO DE LECTURA --- */
.progress-container {
  position: fixed;
  top: 0;
  z-index: 1001;
  width: 100%;
  height: 4px;
  background: transparent;
}

.progress-container > .progress-bar {
  height: 4px;
  background: var(--primary-color);
  width: 0%;
  transition: width 0.1s ease-out;
}

/* --- CONTENIDO (COLUMNA ÚNICA) --- */

body .article-container {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: #ffffff;
  color: #374151;
}

.article-container > article {
  text-align: justify;
  margin: 1em auto;
  width:90%;
}

.article-container > article > header > .tag {
  margin: 0 0 10px 0;
}

.article-container > article > header > div {
  font-size: 1.6em;
}

.article-container > article > header > time {
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: 1px;
  margin: 15px 0 0 0;
  display: block;
}

/* --- IMAGEN DESTACADA --- */
/*.article-container > article > figure:has(img.principal) {*/
.article-container > article > figure {
  float: right;
  width: 45%;
  margin: 10px 30px;
}

/* --- Elemento separador: limpia SIEMPRE antes de una nueva imagen --- */
.article-container > article > .img-clear {
  clear: both;
  display: block;
  height: 0;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.article-container > article > figure > img {
  width: 100%;
  height: auto;
  display: block;
}	

.article-container > article > figure > figcaption {
  font-size: 0.9rem;
  margin-top: 10px;
  color: #666;
  font-style: italic;
  border-left: 3px solid #ccc;
  padding-left: 10px;
}

.article-container > article::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 600px) {
  .article-container > article > figure {
    float: none;
    width: 100%;
    margin: 0 20px;
  }
}

/* --- SECCIONES --- */
.article-container > article > section {
  margin: 20px;
}

.article-container > article > section > h2 {
  font-size: 1.8rem;
  color: #1f2937;
  margin-top: 40px;
  margin-bottom: 20px;
  font-family: 'Georgia', serif;
}

.article-container > article > section > p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

.article-container > article > section > p:last-child {
  margin-bottom: 0;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
	.article-container > article > figure > img {
		height: 260px;
		width: 100%;
	}
}

@media (max-width: 600px) {
  .article-container > article {
    text-align: left;
  }
  .article-container > article > section > p {
    font-size: 1rem;
  }
}


/* =================================================================
   category.css — Estilos propios de la página de categoría
   ================================================================= */

/* --- TÍTULO DE LA CATEGORÍA --- */
main > .category-title {
  font-family: 'Georgia', serif;
  color: var(--primary-color);
  padding-bottom: 10px;
  position: relative;
  display: block;
}

main > .category-title::after  { content: ''; display: block; width: 3rem; height: 3px; background-color: currentColor; position: absolute; bottom: -5px; left: 0;}

.results { 
    border: 3px solid var(--accent-color); 
    padding: 2.5%; 
    border-radius: 3px; 
}

/* --- BUSCADOR --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

main .search-box {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px;
  background: white;
  padding: 24px 30px;
  border-radius: 3px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
}

.search-box > label {
  display: flex;
  flex-direction: column;
  flex: 0 1 240px;
  min-width: 0;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-box > label > .filter-select {
  margin-top: 8px;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-color);
  padding: 11px 40px 11px 14px;
  border: 1px solid var(--gray-medium);
  border-radius: 3px;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23003366' d='M6 8L0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box > label > .filter-select:hover {
  border-color: var(--accent-color);
}

.search-box > label > .filter-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 90, 158, 0.15);
  outline: none;
}

.search-box > input[type="submit"] {
  flex: 0 0 auto;
  align-self: flex-end;
  margin-left: auto;
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  background: var(--primary-color);
  border: none;
  border-radius: 3px;
  padding: 12px 28px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-box > input[type="submit"]:hover {
  background: var(--accent-color);
}

main .search-box .search-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: Arial, sans-serif;
  color: var(--text-color);
  background: white;
  border: 2px solid var(--gray-medium);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

main .search-box .search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 2px 12px rgba(0, 51, 102, 0.15);
}

main .search-box .search-input::placeholder {
  color: var(--text-secondary);
}

.category-list > .no-results {
  text-align: center;
  color: var(--text-secondary);
  font-family: Arial, sans-serif;
  padding: 30px 0;
  margin: 0;
}

/* --- BUSCADOR RESPONSIVE --- */
@media (max-width: 600px) {
  main .search-box {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }
  main .search-box > label {
    flex: 1 1 auto;
  }
  main .search-box > input[type="submit"] {
    width: 100%;
  }
}