/* ==========================================================================
   Calendario interactivo [dae_calendario]
   ========================================================================== */
.dae-cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(16px, 2.6vw, 28px); margin: 0 0 2em; scroll-margin-top: 110px; }
.dae-cal__toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.dae-cal__nav { display: flex; align-items: center; gap: 8px; }
.dae-cal__nav .icon-btn { width: 40px; height: 40px; }
.dae-cal .flip { transform: scaleX(-1); }
.dae-cal__title { margin: 0 !important; font-size: clamp(1.25rem, 2.2vw, 1.6rem); flex: 1; min-width: 180px; }
.dae-cal__views { display: flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--pill); }
.dae-cal__views button { border: 0; background: none; font: 600 14px var(--font); color: var(--muted); padding: 8px 18px; border-radius: var(--pill); cursor: pointer; transition: background .2s, color .2s; }
.dae-cal__views button:hover { color: var(--brand); }
.dae-cal__views button[aria-selected="true"] { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(11, 58, 122, .2); }
.dae-cal__legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dae-cal__cat { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--pill); padding: 5px 12px; font: 500 13px var(--font); color: var(--muted); cursor: pointer; transition: all .2s; }
.dae-cal__cat i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); opacity: .35; transition: opacity .2s; }
.dae-cal__cat.is-on { color: var(--ink); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); background: color-mix(in srgb, var(--c) 7%, #fff); }
.dae-cal__cat.is-on i { opacity: 1; }

/* Mes */
.cal-month { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cal-month__head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg); border-bottom: 1px solid var(--line); }
.cal-month__head span { padding: 10px 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cal-month__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day { min-height: 112px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; display: flex; flex-direction: column; gap: 4px; min-width: 0; outline-offset: -3px; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-month__grid .cal-day:nth-last-child(-n+7) { border-bottom: 0; }
.cal-day:hover { background: #f9fbfe; }
.cal-day.is-weekend { background: #fcfcfe; }
.cal-day.is-out { background: var(--bg); cursor: default; }
.cal-day.is-out .cal-day__n { color: #b3bacb; }
.cal-day__n { font-size: 13.5px; font-weight: 600; color: var(--ink); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; }
.cal-day.is-today .cal-day__n { background: var(--brand); color: #fff; }
.cal-day__evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; font: 600 11.5px/1.3 var(--font); color: color-mix(in srgb, var(--c) 80%, #000); background: color-mix(in srgb, var(--c) 13%, #fff); border-left: 3px solid var(--c); border-radius: 6px; padding: 3px 6px; min-width: 0; }
.cal-chip span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { background: color-mix(in srgb, var(--c) 22%, #fff); }
.cal-chip.is-multi { border-radius: 0; border-left-width: 0; margin: 0 -8px; width: calc(100% + 16px); padding-left: 8px; }
.cal-chip.is-multi.is-start { border-left-width: 3px; border-radius: 6px 0 0 6px; margin-left: 0; width: calc(100% + 8px); }
.cal-chip.is-multi.is-end { border-radius: 0 6px 6px 0; margin-right: 0; width: calc(100% + 8px); }
.cal-chip.is-multi.is-start.is-end { border-radius: 6px; width: 100%; margin: 0; }
.cal-chip.is-multi:not(.is-start) span { visibility: hidden; }
.cal-more { font-size: 11.5px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.cal-day__dots { display: none; gap: 3px; justify-content: center; }
.cal-day__dots i { width: 6px; height: 6px; border-radius: 50%; }

/* Lista del mes */
.cal-list { margin-top: 28px; }
.cal-list__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal-list__head h3 { margin: 0 !important; font-size: 1.25rem; }
.cal-list__items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cal-item { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px 14px 18px; position: relative; overflow: hidden; transition: box-shadow .2s, transform .2s var(--ease); }
.cal-item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.cal-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cal-item__date { flex-shrink: 0; width: 54px; height: 58px; border-radius: 14px; background: color-mix(in srgb, var(--c) 10%, #fff); color: color-mix(in srgb, var(--c) 85%, #000); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.cal-item__date strong { font-size: 22px; font-weight: 800; }
.cal-item__date span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.cal-item__body { min-width: 0; }
.cal-item__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.cal-item__meta .sep { opacity: .5; }
.cal-item__meta em { font-style: normal; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.cal-item h4 { margin: 0 !important; font-size: 15.5px; line-height: 1.4; }
.cal-item p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.cal-empty { color: var(--muted); background: var(--bg); border-radius: var(--r-md); padding: 22px; text-align: center; margin: 0; }

/* Semana */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-week__col { background: var(--bg); border-radius: var(--r-md); padding: 8px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cal-week__col.is-today { background: var(--brand-soft); }
.cal-week__head { background: var(--surface); border-radius: var(--r-sm); padding: 8px; display: flex; flex-direction: column; align-items: center; cursor: pointer; font-family: var(--font); color: var(--ink); border: 1px solid var(--line); }
.cal-week__head span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.cal-week__head strong { font-size: 22px; line-height: 1.2; }
.cal-week__col.is-today .cal-week__head { background: var(--brand); border-color: var(--brand); }
.cal-week__col.is-today .cal-week__head span, .cal-week__col.is-today .cal-week__head strong { color: #fff; }
.cal-week__evs { display: flex; flex-direction: column; gap: 6px; }
.cal-wcard { text-align: left; border: 0; cursor: pointer; font-family: var(--font); background: var(--surface); border-radius: 10px; padding: 8px 10px; border-left: 3px solid var(--c); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-wcard small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c); }
.cal-wcard span { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.cal-wcard em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.cal-wcard:hover { box-shadow: var(--shadow); }
.cal-week__band { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px 8px; margin-bottom: 10px; padding: 12px; background: var(--bg); border-radius: var(--r-md); }
.cal-week__band-label { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cal-band { grid-column: var(--from) / var(--to); text-align: left; border: 0; cursor: pointer; font-family: var(--font); background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 3px solid var(--c); border-radius: 8px; padding: 7px 10px; display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.cal-band span { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-band em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; margin-left: auto; }
.cal-week__none { font-size: 12.5px; color: #a3abbd; text-align: center; padding: 10px 0; }

/* Día */
.cal-dayview { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: start; }
.cal-dayview__date { background: var(--brand-soft); border-radius: var(--r-lg); padding: 22px 12px; display: flex; flex-direction: column; align-items: center; color: var(--brand); position: sticky; top: 100px; }
.cal-dayview__date.is-today { background: var(--brand); color: #fff; }
.cal-dayview__date span { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.cal-dayview__date strong { font-size: 56px; font-weight: 800; line-height: 1.05; letter-spacing: -.04em; }
.cal-dayview__date em { font-style: normal; font-size: 15px; font-weight: 600; }
.cal-dayview__list { display: flex; flex-direction: column; gap: 12px; }
.cal-next { margin: 18px 0 2px !important; font-size: 1rem; color: var(--muted); }

@media (max-width: 960px) {
	.cal-week { grid-template-columns: 1fr; }
	.cal-week__band { grid-template-columns: 1fr; }
	.cal-band { grid-column: 1 / -1; flex-direction: column; gap: 2px; }
	.cal-band span { white-space: normal; }
	.cal-band em { margin-left: 0; }
	.cal-week__col { min-height: 0; flex-direction: row; align-items: flex-start; }
	.cal-week__head { width: 64px; flex-shrink: 0; }
	.cal-week__evs { flex: 1; min-width: 0; }
	.cal-week__none { text-align: left; padding: 14px 4px; }
	.cal-list__items { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.dae-cal__toolbar { gap: 10px; }
	.dae-cal__title { order: -1; flex-basis: 100%; }
	.dae-cal__views { margin-left: auto; }
	.dae-cal__views button { padding: 7px 12px; }
	.cal-month__head span { padding: 8px 0; text-align: center; font-size: 11px; }
	.cal-day { min-height: 54px; padding: 4px 2px; align-items: center; }
	.cal-day__evs, .cal-more { display: none; }
	.cal-day__dots { display: flex; }
	.cal-day__n { width: 26px; height: 26px; font-size: 13px; }
	.cal-dayview { grid-template-columns: 1fr; }
	.cal-dayview__date { position: static; flex-direction: row; gap: 10px; justify-content: center; padding: 14px; }
	.cal-dayview__date strong { font-size: 32px; }
}

/* Año: lista de todas las actividades separadas por mes */
.cal-year__index { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cal-year__index a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: var(--pill); background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; font-weight: 600; text-transform: capitalize; text-decoration: none; }
.cal-year__index a small { font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-year__index a:hover { border-color: var(--p-navy, #213b75); color: var(--p-navy, #213b75); }
.cal-year__index a.is-empty { opacity: .45; pointer-events: none; }
.cal-year__index a.is-now { background: var(--p-navy, #213b75); border-color: var(--p-navy, #213b75); color: #fff; }
.cal-year__index a.is-now small { color: rgba(255, 255, 255, .75); }
.cal-year__total { color: var(--muted); font-size: 14px; margin: 6px 0 18px; }
.cal-year__month { scroll-margin-top: 110px; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--line); }
.cal-year__month:first-of-type { border-top: 0; padding-top: 0; }
.cal-year__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-year__head h3 { margin: 0 !important; font-size: 1.3rem; }
.cal-year__open { margin-left: auto; border: 0; background: none; font: 600 13.5px var(--font); color: #c2540f; cursor: pointer; }
.cal-year__open:hover { text-decoration: underline; text-underline-offset: 3px; }
.cal-year__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 960px) { .cal-year__list { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .dae-cal__views button { padding: 7px 10px; } }
