/* =============================================================================
   guardados.v3.css — "Mis guardados": cabecera con selector mes/año + grid de 5
   Sin recuadro blanco; integrado con el diario. Fecha = cuándo lo guardó el user.
   ============================================================================= */

.guardados-main {
  background: #f4f4f1;
  padding: 32px 20px 64px;
  min-height: calc(100vh - 80px);
}
.guardados-wrap {
  max-width: 1320px;
  margin: 0 auto;
}

/* ---- Cabecera: título a la izquierda, selector mes/año a la derecha ---- */
.guardados-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.guardados-head-left { min-width: 0; }
.guardados-eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: #1f3828;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.guardados-head h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: #1a1f23;
  letter-spacing: -0.018em;
  line-height: 1.05;
  margin: 0 0 10px;
}
.guardados-lede {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1rem;
  color: #565d62;
  font-style: italic;
  margin: 0 0 14px;
}
.guardados-rule { height: 3px; width: 56px; background: #1f3828; }

/* ---- Toolbar: buscador (izquierda) + selector mes/año (derecha), misma fila ---- */
.guardados-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0 8px;
}
.g-search { position: relative; flex: 1 1 320px; max-width: 460px; }
.g-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: #8a9094; pointer-events: none;
}
.g-search input {
  width: 100%; box-sizing: border-box;
  height: 42px;                       /* misma altura que el selector */
  padding: 0 14px 0 40px;
  border: 1px solid #d8d8d2; background: #ffffff;
  font-family: "Inter", sans-serif; font-size: 0.92rem; color: #1a1f23;
}
.g-search input::placeholder { color: #a2a8ac; }
.g-search input:focus { outline: none; border-color: #1f3828; }

/* ---- Selector mes/año (en el toolbar, misma altura que el buscador) ---- */
.guardados-monthsel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.msel-group {
  display: inline-flex;
  align-items: stretch;
  height: 42px;                       /* misma altura */
  box-sizing: border-box;
  border: 1px solid #d8d8d2;
  background: #ffffff;
}
.msel-group button {
  width: 32px;
  border: 0;
  background: #ffffff;
  color: #1f3828;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}
.msel-group button:hover { background: #1f3828; color: #ffffff; }
.msel-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  min-width: 118px;
  font-family: "Inter", sans-serif;
  font-weight: 800;
  font-size: 0.84rem;
  color: #1a1f23;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.msel-all {
  height: 42px;                       /* misma altura */
  box-sizing: border-box;
  padding: 0 16px;
  border: 1px solid #d8d8d2;
  background: #ffffff;
  color: #1f3828;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.msel-all.is-active { background: #1f3828; color: #ffffff; border-color: #1f3828; }
.msel-all:hover { border-color: #1f3828; }

/* ---- Cuadrícula de noticias (5 por fila en desktop) ---- */
.guardados-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px 24px;
  margin-top: 22px;
}
.g-loading {
  grid-column: 1 / -1;
  text-align: center;
  font-family: "Source Serif 4", Georgia, serif;
  color: #8a9094;
  font-style: italic;
  padding: 32px 0;
}

/* ---- Tarjeta vertical ---- */
.g-card {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}
.g-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #e9e9e4;
  overflow: hidden;
  margin-bottom: 11px;
}
.g-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.g-card:hover .g-card-img img { transform: scale(1.05); }

.g-card-cat {
  font-family: "Inter", sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  color: #1f3828;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.g-card-cat a { color: inherit; text-decoration: none; }
.g-card-cat a:hover { text-decoration: underline; }
.g-card-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.02rem;
  font-weight: 800;
  color: #1a1f23;
  line-height: 1.28;
  letter-spacing: -0.005em;
  margin: 0 0 9px;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.g-card-title a { color: inherit; text-decoration: none; }
.g-card-title a:hover { color: #1f3828; }
.g-card-meta {
  font-family: "Inter", sans-serif;
  font-size: 0.74rem;
  color: #1f3828;
  font-weight: 600;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid #e2e2dc;
}

/* Botón quitar: círculo discreto sobre la imagen, aparece al hover */
.g-card-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  color: #1a1f23;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.g-card:hover .g-card-remove,
.g-card-remove:focus-visible { opacity: 1; }
.g-card-remove:hover { background: #8a0e2c; color: #ffffff; }

/* ---- Estados vacíos ---- */
.g-empty {
  grid-column: 1 / -1;
  padding: 44px 24px;
  text-align: center;
  background: #ffffff;
  border: 1px dashed #d8d8d2;
}
.g-empty h2 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.25rem; font-weight: 800; color: #1a1f23; margin: 0 0 10px;
}
.g-empty p {
  font-family: "Source Serif 4", Georgia, serif;
  color: #565d62; margin: 0 0 18px; line-height: 1.5;
}
.g-empty a, .g-empty button {
  display: inline-block;
  padding: 10px 22px;
  background: #1f3828; color: #ffffff; border: 0; cursor: pointer;
  font-family: "Inter", sans-serif; font-weight: 700; font-size: 0.88rem;
  text-decoration: none; letter-spacing: 0.02em;
}
.g-empty a:hover, .g-empty button:hover { background: #2a4a35; }

/* ---- Responsive ---- */
@media (max-width: 1180px) { .guardados-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  {
  .guardados-grid { grid-template-columns: repeat(2, 1fr); }
  .guardados-head { align-items: flex-start; }
}
@media (max-width: 520px)  {
  .guardados-grid { grid-template-columns: 1fr; gap: 22px; }
  .guardados-head h1 { font-size: 1.9rem; }
  .guardados-monthsel { width: 100%; }
  .g-card-remove { opacity: 1; }  /* en táctil siempre visible */
}
