/* ══════════════════════════════════════════
   SigloVeinte — Edición Impresa — Calendario
   ══════════════════════════════════════════ */

.sv-ei {
  max-width: 620px;
  margin: 0 auto;
  font-family: inherit;
}

.sv-ei__title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.4rem;
  color: #1a1a1a;
  border-left: 4px solid #cc0000;
  padding-left: .65rem;
}

.sv-ei__notice {
  padding: .85rem 1rem;
  background: #f5f5f5;
  border-radius: 4px;
  color: #555;
}

.sv-ei__notice--error { background: #fdecea; color: #c0392b; }

/* ── Contenedor del calendario ── */
#sv-ei-cal {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  overflow: hidden;
}

/* ── Header: flechas + mes/año + botón Hoy ── */
.sv-ei-cal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  background: #1a1a1a;
  color: #fff;
  gap: .5rem;
}

.sv-ei-cal__title-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .35rem;
  flex: 1;
  justify-content: center;
}

/* ── Botones de mes y año en el header ── */
.sv-ei-cal__month-btn,
.sv-ei-cal__year-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  padding: .25rem .45rem;
  border-radius: 5px;
  transition: background .15s;
  line-height: 1.3;
}

.sv-ei-cal__month-btn:hover,
.sv-ei-cal__year-btn:hover {
  background: rgba(255,255,255,.18);
}

.sv-ei-cal__month-btn[aria-expanded="true"],
.sv-ei-cal__year-btn[aria-expanded="true"] {
  background: rgba(255,255,255,.22);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sv-ei-cal__today-btn {
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .65rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 20px;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  transition: background .15s, color .15s;
  line-height: 1.6;
}

.sv-ei-cal__today-btn:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

.sv-ei-cal__nav {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: .2rem .5rem;
  border-radius: 6px;
  transition: background .15s;
  flex-shrink: 0;
}

.sv-ei-cal__nav:hover:not(.is-disabled) {
  background: rgba(255,255,255,.15);
}

.sv-ei-cal__nav.is-disabled {
  opacity: .25;
  cursor: default;
}

/* ── Pickers (selector de mes y año) ── */
.sv-ei-cal__picker {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  background: #fff;
}

.sv-ei-cal__picker.is-open {
  max-height: 260px;
  border-bottom: 1px solid #e8e8e8;
}

.sv-ei-picker__grid {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 8px;
  padding: .75rem 1rem;
  justify-content: center;
}

.sv-ei-picker__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: #f7f7f7;
  color: #aaa;
  transition: background .15s, color .15s;
}

.sv-ei-picker__cell--active {
  background: #fff5f5;
  color: #cc0000;
  font-weight: 600;
}

.sv-ei-picker__cell--active:hover {
  background: #cc0000;
  color: #fff;
}

.sv-ei-picker__cell--empty {
  background: #f5f5f5;
  color: #ccc;
  cursor: default;
  pointer-events: none;
}

.sv-ei-picker__cell--current {
  background: #cc0000 !important;
  color: #fff !important;
  font-weight: 700;
}

.sv-ei-picker__cell--current:hover {
  background: #aa0000 !important;
}

/* ── Días de la semana ── */
.sv-ei-cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f7f7f7;
  border-bottom: 1px solid #e8e8e8;
}

.sv-ei-cal__wday {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .55rem 0;
  color: #888;
}

.sv-ei-cal__wday--sun {
  color: #cc0000;
}

/* ── Grid de días ── */
.sv-ei-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: .75rem;
  background: #fff;
}

/* ── Celda base ── */
.sv-ei-cal__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  font-size: .95rem;
  color: #333;
  background: #fff;
  justify-self: center;
  user-select: none;
}

.sv-ei-cal__cell--empty {
  background: transparent;
}

/* Domingo con edición disponible */
.sv-ei-cal__cell--has-edition {
  background: #cc0000;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
}

.sv-ei-cal__cell--has-edition:hover {
  background: #aa0000;
  transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(204,0,0,.35);
}

.sv-ei-cal__cell--has-edition:active {
  transform: scale(1.02);
}

/* Domingo seleccionado */
.sv-ei-cal__cell--selected {
  background: #880000 !important;
  box-shadow: 0 0 0 3px #000, 0 3px 10px rgba(0,0,0,.3) !important;
  transform: scale(1.08);
}

/* Domingo sin edición */
.sv-ei-cal__cell--sun-empty {
  background: #f0f0f0;
  color: #bbb;
}

/* ── Panel de edición ── */
.sv-ei-cal__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s cubic-bezier(.4, 0, .2, 1);
  background: #fafafa;
  border-top: 1px solid transparent;
}

.sv-ei-cal__panel.is-open {
  max-height: 900px;
  border-top-color: #e0e0e0;
}

.sv-ei-panel__inner {
  padding: 1.1rem 1.1rem 1.3rem;
}

.sv-ei-panel__hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .9rem;
}

.sv-ei-panel__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
}

.sv-ei-panel__close {
  background: #e0e0e0;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #555;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.sv-ei-panel__close:hover {
  background: #cc0000;
  color: #fff;
}

.sv-ei-panel__actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* ── Botones del panel ── */
.sv-ei-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem 1rem;
  border-radius: 5px;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}

.sv-ei-btn:hover   { opacity: .88; transform: translateY(-1px); }
.sv-ei-btn:active  { transform: translateY(0); }

.sv-ei-btn--dl   { background: #cc0000; color: #fff; }
.sv-ei-btn--view { background: #2980b9; color: #fff; }

/* ── Visor iframe ── */
.sv-ei-panel__viewer {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #ddd;
  background: #f0f0f0;
}

.sv-ei-panel__viewer iframe {
  display: block;
  width: 100%;
  height: 95vh;
  min-height: 660px;
  border: 0;
}

/* ══ MOBILE ══════════════════════════════ */
@media (max-width: 520px) {
  .sv-ei-cal__month-btn,
  .sv-ei-cal__year-btn { font-size: 1rem; padding: .2rem .35rem; }

  .sv-ei-picker__grid { gap: 6px; padding: .5rem .75rem; }
  .sv-ei-picker__cell { height: 36px; font-size: .82rem; }

  .sv-ei-cal__grid { gap: 3px; padding: .5rem; }

  .sv-ei-cal__cell {
    width: 40px;
    height: 40px;
    font-size: .82rem;
    border-radius: 6px;
  }

  .sv-ei-cal__wday { font-size: .65rem; padding: .4rem 0; }

  .sv-ei-cal__panel.is-open { max-height: 760px; }

  .sv-ei-panel__viewer iframe { height: 90vh; min-height: 550px; }

  .sv-ei-btn { font-size: .8rem; padding: .42rem .8rem; }
}

/* ── Indicación visual mejorada: botones de mes y año ── */
.sv-ei-cal__month-btn,
.sv-ei-cal__year-btn {
    border-bottom: 2px solid rgba(255,255,255,0.6);
    padding-bottom: 2px;
    border-radius: 0;
}

.sv-ei-cal__month-btn:hover,
.sv-ei-cal__year-btn:hover {
    background: transparent;
    border-bottom-color: #ffffff;
    text-shadow: 0 0 12px rgba(255,255,255,0.9),
                 0 0 20px rgba(255,255,255,0.5);
}

.sv-ei-cal__month-btn[aria-expanded=true],
.sv-ei-cal__year-btn[aria-expanded=true] {
    background: transparent;
    text-decoration: none;
    border-bottom-color: #CC0000;
    text-shadow: 0 0 12px rgba(204,0,0,0.9);
}
