/* ============================================================
   AED · Asociación Española de Directivos
   Identidad basada en la marca oficial (carmesí + blanco),
   reinterpretada con un diseño limpio (Boix Design).
   Demo del gestor de publicaciones compartido.
   ============================================================ */

:root {
  --aed-red:       #C8102E;   /* carmesí corporativo */
  --aed-red-dark:  #A00A22;
  --aed-red-900:   #6E0517;
  --aed-ink:       #1B1B1F;
  --aed-body:      #3F4247;
  --aed-muted:     #7C7F86;
  --aed-line:      #E7E4E4;
  --aed-bg:        #F7F5F5;
  --aed-card:      #FFFFFF;
  --aed-cream:     #FBF3F4;    /* rosado muy suave para acentos */
  --aed-radius:    12px;
  --aed-radius-sm: 8px;
  --aed-shadow:    0 6px 22px rgba(110, 5, 23, .08);
  --aed-shadow-lg: 0 16px 46px rgba(110, 5, 23, .16);
  --aed-maxw:      1140px;
  --aed-serif:     Georgia, "Times New Roman", "Playfair Display", serif;
  --aed-sans:      "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--aed-sans);
  color: var(--aed-body);
  background: var(--aed-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--aed-red); text-decoration: none; }
a:hover { color: var(--aed-red-dark); }
img, video { max-width: 100%; display: block; }

.aed-container { width: 100%; max-width: var(--aed-maxw); margin: 0 auto; padding-left: 22px; padding-right: 22px; }

/* ---------- Cabecera ---------- */
.aed-header {
  background: var(--aed-red);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(110, 5, 23, .25);
}
.aed-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 74px; flex-wrap: wrap;
}
.aed-brand { display: inline-flex; align-items: center; color: #fff; }
.aed-logo { display: inline-flex; flex-direction: column; align-items: flex-start; }
.aed-logo__rule { width: 52px; height: 3px; background: #fff; margin-bottom: 7px; border-radius: 2px; }
.aed-logo__word { font-family: var(--aed-serif); font-weight: 700; font-size: 2rem; letter-spacing: .1em; color: #fff; line-height: .85; }

.aed-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.aed-nav a {
  color: rgba(255,255,255,.92); font-weight: 600; font-size: .95rem;
  padding: 8px 15px; border-radius: 999px; transition: background .18s, color .18s;
}
.aed-nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.aed-nav a.is-active { background: #fff; color: var(--aed-red); }

/* ---------- Hero "Próximamente" ---------- */
.aed-hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(1100px 460px at 12% -20%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(135deg, var(--aed-red-900) 0%, var(--aed-red-dark) 50%, var(--aed-red) 100%);
  padding: 100px 0 108px;
}
.aed-hero::after {
  content: ""; position: absolute; right: -130px; bottom: -150px;
  width: 400px; height: 400px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.14); box-shadow: inset 0 0 0 46px rgba(255,255,255,.05);
}
.aed-kicker { text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; font-weight: 700; color: rgba(255,255,255,.85); margin: 0 0 18px; }
.aed-hero__title { font-family: var(--aed-serif); font-size: clamp(2.7rem, 6vw, 4.6rem); line-height: 1.03; font-weight: 700; margin: 0 0 22px; color: #fff; }
.aed-hero__lead { max-width: 620px; font-size: 1.16rem; color: rgba(255,255,255,.92); margin: 0 0 34px; }
.aed-hero__lead a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.aed-hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Botones ---------- */
.aed-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 30px; border-radius: 999px; font-weight: 700; font-size: .98rem;
  background: #fff; color: var(--aed-red); border: 2px solid #fff;
  transition: transform .15s, background .18s, color .18s;
}
.aed-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.9); color: var(--aed-red-dark); }
.aed-btn--ghost { background: transparent; border-color: rgba(255,255,255,.6); color: #fff; }
.aed-btn--ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }

/* ---------- Secciones ---------- */
.aed-section { padding: 66px 0 86px; }
.aed-h1 { font-family: var(--aed-serif); font-size: clamp(2rem, 4vw, 2.7rem); color: var(--aed-ink); font-weight: 700; margin: 0 0 34px; position: relative; padding-bottom: 16px; }
.aed-h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 4px; border-radius: 2px; background: var(--aed-red); }
.aed-empty { color: var(--aed-muted); font-size: 1.05rem; padding: 40px 0; }

/* ---------- Grid de tarjetas ---------- */
.aed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; }
.aed-card {
  background: var(--aed-card); border: 1px solid var(--aed-line); border-radius: var(--aed-radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--aed-shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s; color: inherit;
}
.aed-card:hover { transform: translateY(-4px); box-shadow: var(--aed-shadow-lg); border-color: #EAD3D7; color: inherit; }
.aed-card__media { aspect-ratio: 16/10; background: var(--aed-cream); overflow: hidden; }
.aed-card__media img, .aed-card__media video { width: 100%; height: 100%; object-fit: cover; }
.aed-card__body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 10px; }
.aed-card__date { color: var(--aed-red); font-size: .82rem; font-weight: 700; margin: 0; text-transform: uppercase; letter-spacing: .05em; }
.aed-card__title { font-family: var(--aed-serif); color: var(--aed-ink); font-size: 1.28rem; font-weight: 700; line-height: 1.28; margin: 0; }
.aed-card__ex { color: var(--aed-body); font-size: .96rem; margin: 0; }

.aed-badge {
  align-self: flex-start; background: var(--aed-red); color: #fff; font-weight: 700;
  font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px;
}
.aed-keys { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.aed-keys span { background: var(--aed-cream); color: var(--aed-red-dark); font-size: .76rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }

/* ---------- Artículo ---------- */
.aed-article { padding: 46px 0 88px; }
.aed-article__inner { max-width: 760px; }
.aed-breadcrumb { color: var(--aed-muted); font-size: .9rem; margin: 0 0 26px; }
.aed-article__meta { color: var(--aed-red); font-weight: 700; font-size: .84rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px; }
.aed-article__title { font-family: var(--aed-serif); font-size: clamp(2rem, 4.4vw, 2.9rem); color: var(--aed-ink); font-weight: 700; line-height: 1.16; margin: 0 0 30px; }
.aed-article__media { border-radius: var(--aed-radius); overflow: hidden; margin: 0 0 34px; box-shadow: var(--aed-shadow); }
.aed-article__media img, .aed-article__media video { width: 100%; }
.aed-article__body { font-size: 1.09rem; color: var(--aed-body); }
.aed-article__body h2 { font-family: var(--aed-serif); color: var(--aed-ink); font-size: 1.55rem; font-weight: 700; margin: 40px 0 14px; }
.aed-article__body p { margin: 0 0 20px; }
.aed-figure { margin: 30px 0; }
.aed-figure img, .aed-figure video { width: 100%; border-radius: var(--aed-radius-sm); }
.aed-figure figcaption { color: var(--aed-muted); font-size: .88rem; margin-top: 8px; text-align: center; }

/* ---------- Adjuntos ---------- */
.aed-adjuntos { margin-top: 44px; padding: 24px 26px; background: #fff; border: 1px solid var(--aed-line); border-left: 4px solid var(--aed-red); border-radius: var(--aed-radius-sm); }
.aed-adjuntos h2 { margin: 0 0 14px; font-size: 1.15rem; color: var(--aed-ink); }
.aed-adjuntos ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.aed-adjuntos a { font-weight: 600; color: var(--aed-red-dark); }
.aed-adjuntos a:hover { color: var(--aed-red); }
.aed-back { display: inline-block; margin-top: 46px; font-weight: 700; color: var(--aed-red); }

/* ---------- Pie ---------- */
.aed-footer { background: var(--aed-red-900); color: rgba(255,255,255,.75); padding: 30px 0; font-size: .86rem; margin-top: 40px; }
.aed-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .aed-header__inner { min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .aed-brand__logo { height: 34px; }
  .aed-hero { padding: 74px 0 80px; }
  .aed-section { padding: 48px 0 62px; }
}

/* ============================================================
   Agenda: una sola columna, entradas apaisadas de punta a punta.
   Destacada grande con foto; el resto, filas compactas.
   ============================================================ */
.aed-agenda { display: flex; flex-direction: column; gap: 14px; }

/* --- Evento destacado (grande, con foto) --- */
.aed-ag-feature {
  display: grid;
  grid-template-columns: 300px 1fr;
  background: var(--aed-card);
  border: 1px solid var(--aed-line);
  border-left: 5px solid var(--aed-red);
  border-radius: var(--aed-radius);
  overflow: hidden;
  box-shadow: var(--aed-shadow);
  color: inherit;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  margin-bottom: 8px;
}
.aed-ag-feature:hover { transform: translateY(-3px); box-shadow: var(--aed-shadow-lg); color: inherit; }
.aed-ag-feature__media { background: var(--aed-cream); overflow: hidden; min-height: 200px; }
.aed-ag-feature__media img, .aed-ag-feature__media video { width: 100%; height: 100%; object-fit: cover; }
.aed-ag-feature__body { padding: 26px 30px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.aed-ag-feature__date { color: var(--aed-red); font-size: .84rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.aed-ag-feature__title { font-family: var(--aed-serif); color: var(--aed-ink); font-size: 1.6rem; line-height: 1.2; font-weight: 700; margin: 0; }
.aed-ag-feature__ex { color: var(--aed-body); font-size: 1rem; margin: 0; }
.aed-ag-feature__more { margin-top: 6px; color: var(--aed-red); font-weight: 700; font-size: .95rem; }

/* --- Fila compacta (evento normal) --- */
.aed-ag-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--aed-card);
  border: 1px solid var(--aed-line);
  border-radius: var(--aed-radius-sm);
  padding: 14px 20px;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.aed-ag-row:hover { border-color: #EAD3D7; box-shadow: var(--aed-shadow); transform: translateX(3px); color: inherit; }
.aed-ag-row__date {
  flex: 0 0 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--aed-cream); border-radius: 8px; padding: 8px 4px; line-height: 1;
}
.aed-ag-row__date strong { font-family: var(--aed-serif); font-size: 1.5rem; color: var(--aed-red); }
.aed-ag-row__date small { font-size: .68rem; font-weight: 700; letter-spacing: .08em; color: var(--aed-red-dark); margin-top: 3px; }
.aed-ag-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.aed-ag-row__title { font-weight: 700; color: var(--aed-ink); font-size: 1.05rem; line-height: 1.3; }
.aed-ag-row__meta { color: var(--aed-muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aed-ag-row__arrow { flex: 0 0 auto; color: var(--aed-red); font-weight: 700; font-size: 1.1rem; opacity: .6; transition: opacity .15s, transform .15s; }
.aed-ag-row:hover .aed-ag-row__arrow { opacity: 1; transform: translateX(3px); }

@media (max-width: 640px) {
  .aed-ag-feature { grid-template-columns: 1fr; }
  .aed-ag-feature__media { min-height: 170px; aspect-ratio: 16/9; }
  .aed-ag-feature__body { padding: 20px; }
  .aed-ag-row__meta { white-space: normal; }
}

/* ===== Buscador + filtros por palabra clave ===== */
.aed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 4px 0 28px;
}
.aed-search-wrap { position: relative; flex: 1 1 260px; max-width: 420px; }
.aed-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--aed-muted); pointer-events: none;
}
.aed-search {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border: 1px solid var(--aed-line);
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--aed-ink);
  background: #fff;
  font-family: var(--aed-sans);
}
.aed-search:focus { outline: none; border-color: var(--aed-red); box-shadow: 0 0 0 3px rgba(200,16,46,.12); }
.aed-filtros { display: flex; flex-wrap: wrap; gap: 8px; }
.aed-chip {
  font-size: 0.85rem; font-weight: 600; color: var(--aed-red-dark);
  background: #fff; border: 1px solid var(--aed-line);
  border-radius: 999px; padding: 0.4rem 0.9rem; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.aed-chip:hover { border-color: var(--aed-red); }
.aed-chip.is-active { background: var(--aed-red); color: #fff; border-color: var(--aed-red); }

[data-blog-item].is-hidden { display: none !important; }
.aed-empty-filtro, .aed-sin-vigentes {
  text-align: center; color: var(--aed-muted); padding: 24px 0; font-size: 1rem;
}

/* ===== Histórico desplegable ===== */
.aed-hist { margin-top: 40px; border-top: 1px solid var(--aed-line); padding-top: 22px; }
.aed-hist__toggle {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--aed-serif); font-weight: 700; font-size: 1.1rem; color: var(--aed-red-900);
  padding: 0.4rem 0;
}
.aed-hist__toggle::-webkit-details-marker { display: none; }
.aed-hist__toggle::before { content: "▸"; font-size: 0.85em; transition: transform .15s ease; }
.aed-hist[open] .aed-hist__toggle::before { transform: rotate(90deg); }
.aed-hist__num { color: var(--aed-muted); font-weight: 600; }
.aed-hist__lista { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--aed-line); }
.aed-hist__item a {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 16px; align-items: baseline;
  padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--aed-line);
  text-decoration: none; color: var(--aed-ink); transition: background-color .12s ease;
}
.aed-hist__item a:hover { background: var(--aed-cream); }
.aed-hist__fecha { color: var(--aed-muted); font-size: 0.9rem; }
.aed-hist__titulo { font-weight: 600; }
.aed-hist__lugar { color: var(--aed-muted); font-size: 0.9rem; text-align: right; }
@media (max-width: 640px) {
  .aed-hist__item a { grid-template-columns: 1fr; gap: 0.15rem; }
  .aed-hist__lugar { text-align: left; }
}
