/* HybridPost rich-text body (Trix editor output) */
.trix-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #2a2a2a;
}

.trix-content > *:first-child {
  margin-top: 0;
}

.trix-content h1,
.trix-content h2,
.trix-content h3,
.trix-content h4 {
  margin: 1.4em 0 0.5em;
  line-height: 1.25;
  color: #1a1a1a;
}

.trix-content p {
  margin: 0 0 1em;
}

.trix-content ul,
.trix-content ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.trix-content li {
  margin-bottom: 0.35em;
}

.trix-content blockquote {
  margin: 1em 0;
  padding: 0.25em 0 0.25em 1em;
  border-left: 3px solid #8b1e1e;
  color: #555;
}

.trix-content hr {
  margin: 1.75em 0;
  border: 0;
  border-top: 1px solid #ddd;
}

.trix-content a {
  color: #8b1e1e;
  text-decoration: underline;
}

.trix-content img,
.trix-content .hp-trix-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em auto;
}

/* HybridPost gallery: 3 columns */
.trix-content .hp-trix-gallery,
.hp-trix-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5em 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.trix-content .hp-trix-gallery__item,
.hp-trix-gallery__item {
  margin: 0 !important;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 3px;
  background: #e8e4dc;
  position: relative;
}

.trix-content .hp-trix-gallery__image,
.trix-content .hp-trix-gallery img,
.hp-trix-gallery__image {
  position: absolute;
  inset: 0;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  margin: 0 !important;
  display: block !important;
}

.trix-content figure.attachment,
.trix-content figure.attachment--content {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  margin: 1.25em 0;
  overflow: hidden;
  box-sizing: border-box;
}

.trix-content figure.attachment > .hp-trix-gallery {
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .trix-content .hp-trix-gallery,
  .hp-trix-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .trix-content .hp-trix-gallery,
  .hp-trix-gallery {
    grid-template-columns: 1fr;
  }
}

.trix-content .hp-trix-figure {
  margin: 1.25em 0;
}

.trix-content .hp-trix-figure figcaption,
.trix-content figcaption {
  margin-top: 0.4em;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

.trix-content .hp-button-block {
  margin: 1.25em 0;
}

.trix-content a.hp-button,
.hp-button {
  display: inline-block;
  padding: 0.65em 1.25em;
  background: #8b1e1e;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 3px;
  font-weight: 600;
}

.trix-content a.hp-button:hover,
.hp-button:hover {
  background: #6e1717;
  color: #fff !important;
}

/* Article / event detail chrome */
.hp-article .hp-back {
  margin-bottom: 1rem;
}

.hp-article .hp-meta {
  margin: -0.5rem 0 1.25rem;
  color: #666;
}

.hp-featured {
  margin: 0 0 1.5rem;
}

.hp-featured__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: none;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
}

.hp-featured figcaption {
  margin-top: 0.4em;
  font-size: 0.9rem;
  color: #666;
}

.hp-event-meta {
  margin: 0 0 1.25rem;
}

.hp-event-meta p {
  margin: 0 0 0.4rem;
}

.hp-event-actions {
  margin: 0 0 1.5rem;
}

.hp-event-actions .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Home agenda items as links */
.home-agenda__link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.home-agenda__item:has(.home-agenda__link:hover) .home-agenda__body h3 {
  color: #8b1e1e;
}
