/*
 * RichEditor frontend content styles.
 *
 * This file styles HTML snippets inserted from /wms/rich-editor/templates.
 * Keep it framework-free so every frontend theme can include or override it.
 */

.rich-content,
.event-detail__article {
  --rich-editor-text: #17231f;
  --rich-editor-muted: #66736f;
  --rich-editor-soft: #f5f1e8;
  --rich-editor-panel: #ffffff;
  --rich-editor-border: rgba(23, 35, 31, 0.14);
  --rich-editor-accent: #0d7f77;
  --rich-editor-accent-strong: #0a5f59;
  --rich-editor-warm: #d25a36;
  --rich-editor-shadow: 0 18px 45px rgba(23, 35, 31, 0.08);
}

.rich-template-block {
  box-sizing: border-box;
  color: var(--rich-editor-text, #17231f);
  margin: 2rem 0;
}

.rich-template-block *,
.rich-template-block *::before,
.rich-template-block *::after {
  box-sizing: border-box;
}

.rich-template-block > :first-child {
  margin-top: 0;
}

.rich-template-block > :last-child {
  margin-bottom: 0;
}

.rich-template-block h2,
.rich-template-block h3 {
  color: var(--rich-editor-text, #17231f);
  font-weight: 800;
  line-height: 1.16;
  margin: 0 0 0.85rem;
}

.rich-template-block h2 {
  font-size: clamp(1.75rem, 3vw, 2.65rem);
}

.rich-template-block h3 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.rich-template-block p {
  color: var(--rich-editor-muted, #66736f);
  font-size: 1rem;
  line-height: 1.85;
  margin: 0 0 1rem;
}

.rich-template-kicker {
  color: var(--rich-editor-warm, #d25a36);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.rich-template-placeholder {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(13, 127, 119, 0.12), rgba(210, 90, 54, 0.12)),
    var(--rich-editor-soft, #f5f1e8);
  border: 1px dashed rgba(13, 127, 119, 0.35);
  color: var(--rich-editor-accent-strong, #0a5f59);
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 220px;
  text-align: center;
}

.rich-template-lead {
  background: linear-gradient(135deg, rgba(13, 127, 119, 0.1), rgba(255, 255, 255, 0.9));
  border-left: 6px solid var(--rich-editor-accent, #0d7f77);
  padding: clamp(1.5rem, 3vw, 2.4rem);
}

.rich-template-media {
  align-items: center;
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
}

.rich-template-media__figure {
  margin: 0;
}

.rich-template-media__figure img {
  display: block;
  height: auto;
  max-width: 100%;
}

.rich-template-media__figure figcaption {
  color: var(--rich-editor-muted, #66736f);
  font-size: 0.88rem;
  margin-top: 0.55rem;
}

.rich-template-quote {
  background: var(--rich-editor-panel, #ffffff);
  border: 1px solid var(--rich-editor-border, rgba(23, 35, 31, 0.14));
  border-left: 6px solid var(--rich-editor-warm, #d25a36);
  box-shadow: var(--rich-editor-shadow, 0 18px 45px rgba(23, 35, 31, 0.08));
  padding: clamp(1.4rem, 3vw, 2.3rem);
}

.rich-template-quote p {
  color: var(--rich-editor-text, #17231f);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 750;
  line-height: 1.55;
}

.rich-template-quote cite {
  color: var(--rich-editor-muted, #66736f);
  display: block;
  font-style: normal;
  font-weight: 700;
  margin-top: 1rem;
}

.rich-template-grid,
.rich-template-card-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rich-template-grid article,
.rich-template-card-grid article {
  background: var(--rich-editor-panel, #ffffff);
  border: 1px solid var(--rich-editor-border, rgba(23, 35, 31, 0.14));
  padding: clamp(1.25rem, 2.5vw, 2rem);
}

.rich-template-grid article strong {
  color: var(--rich-editor-text, #17231f);
  display: block;
  font-size: 1.15rem;
  font-weight: 850;
  margin-bottom: 0.65rem;
}

.rich-template-card-grid {
  gap: 1rem;
}

.rich-template-card-grid article {
  border-top: 4px solid var(--rich-editor-accent, #0d7f77);
  box-shadow: var(--rich-editor-shadow, 0 18px 45px rgba(23, 35, 31, 0.08));
}

.rich-template-notice {
  background: linear-gradient(135deg, rgba(210, 90, 54, 0.12), rgba(13, 127, 119, 0.08));
  border: 1px solid rgba(210, 90, 54, 0.22);
  padding: clamp(1.35rem, 3vw, 2.2rem);
}

.rich-template-notice a {
  color: var(--rich-editor-accent-strong, #0a5f59);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.rich-template-list {
  background: var(--rich-editor-panel, #ffffff);
  border: 1px solid var(--rich-editor-border, rgba(23, 35, 31, 0.14));
  padding: clamp(1.35rem, 3vw, 2.2rem);
}

.rich-template-list ul {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}

.rich-template-list li {
  border-left: 4px solid var(--rich-editor-accent, #0d7f77);
  color: var(--rich-editor-muted, #66736f);
  line-height: 1.75;
  padding: 0.25rem 0 0.25rem 1rem;
}

.rich-template-list li strong {
  color: var(--rich-editor-text, #17231f);
}

.rich-template-timeline {
  border-left: 2px solid var(--rich-editor-border, rgba(23, 35, 31, 0.14));
  padding-left: clamp(1.25rem, 3vw, 2rem);
}

.rich-template-timeline ol {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.rich-template-timeline li {
  margin: 0 0 1.5rem;
  padding-left: 1rem;
  position: relative;
}

.rich-template-timeline li::before {
  background: var(--rich-editor-accent, #0d7f77);
  border: 4px solid var(--rich-editor-soft, #f5f1e8);
  border-radius: 999px;
  content: "";
  height: 1rem;
  left: calc(-1.75rem - 1px);
  position: absolute;
  top: 0.3rem;
  width: 1rem;
}

.rich-template-timeline time {
  color: var(--rich-editor-warm, #d25a36);
  display: block;
  font-weight: 850;
  margin-bottom: 0.25rem;
}

.rich-template-timeline strong {
  color: var(--rich-editor-text, #17231f);
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.rich-template-faq {
  display: grid;
  gap: 0.75rem;
}

.rich-template-faq details {
  background: var(--rich-editor-panel, #ffffff);
  border: 1px solid var(--rich-editor-border, rgba(23, 35, 31, 0.14));
  padding: 1rem 1.15rem;
}

.rich-template-faq summary {
  color: var(--rich-editor-text, #17231f);
  cursor: pointer;
  font-weight: 850;
}

.rich-template-faq details p {
  margin: 0.8rem 0 0;
}

.rich-template-tree {
  background: var(--rich-editor-panel, #ffffff);
  border: 1px solid var(--rich-editor-border, rgba(23, 35, 31, 0.14));
  padding: clamp(1.35rem, 3vw, 2.2rem);
}

.rich-template-tree ul {
  list-style: none;
  margin: 1rem 0 0;
  padding-left: 1.1rem;
}

.rich-template-tree li {
  border-left: 2px solid var(--rich-editor-border, rgba(23, 35, 31, 0.14));
  color: var(--rich-editor-muted, #66736f);
  line-height: 1.75;
  margin: 0.65rem 0;
  padding-left: 1rem;
  position: relative;
}

.rich-template-tree li::before {
  background: var(--rich-editor-accent, #0d7f77);
  border-radius: 999px;
  content: "";
  height: 0.45rem;
  left: -0.27rem;
  position: absolute;
  top: 0.7rem;
  width: 0.45rem;
}

.rich-template-tree strong {
  color: var(--rich-editor-text, #17231f);
}

.rich-template-table {
  overflow-x: auto;
}

.rich-template-table table {
  border-collapse: collapse;
  min-width: 640px;
  width: 100%;
}

.rich-template-table th,
.rich-template-table td {
  border: 1px solid var(--rich-editor-border, rgba(23, 35, 31, 0.14));
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: top;
}

.rich-template-table th {
  background: var(--rich-editor-accent, #0d7f77);
  color: #fff;
  font-weight: 850;
}

.rich-template-table td {
  background: var(--rich-editor-panel, #ffffff);
  color: var(--rich-editor-muted, #66736f);
}

@media (max-width: 860px) {
  .rich-template-media,
  .rich-template-grid,
  .rich-template-card-grid {
    grid-template-columns: 1fr;
  }

  .rich-template-block {
    margin: 1.5rem 0;
  }

  .rich-template-placeholder {
    min-height: 180px;
  }
}
