/* ---- Page header and period filter ---- */
.news-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin: 2.25rem 0 1.75rem;
  text-align: center;
}

.news-hero-text h1 {
  margin: 0;
  color: #253b2e;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.01em;
}

.news-hero-text p {
  margin: .35rem 0 0;
  color: #5d685f;
  font-size: 1.05rem;
}

.news-filter {
  margin: 0;
}

.news-filter-period {
  margin: 0;
  padding: 0;
  border: 0;
}

.news-segmented {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  max-width: 100%;
  padding: .3rem;
  overflow-x: auto;
  border: 1px solid #e0dacb;
  border-radius: 999px;
  background: #ece8dd;
  box-shadow: inset 0 1px 2px rgba(29, 37, 32, .06);
  scrollbar-width: none;
}

.news-segmented::-webkit-scrollbar {
  display: none;
}

.news-chip-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.news-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .5rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #425448;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.news-chip:hover {
  background: rgba(255, 255, 255, .6);
  color: #253b2e;
}

.news-chip.is-active,
.news-chip-input:checked + .news-chip {
  background: #2f6b46;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(47, 107, 70, .35);
}

.news-chip-input:focus-visible + .news-chip,
.news-chip:focus-visible {
  outline: 3px solid rgba(47, 107, 70, .35);
  outline-offset: 2px;
}

.news-chip-icon {
  flex: 0 0 auto;
  opacity: .85;
}

.news-filter-range-option {
  padding-top: .35rem;
  padding-bottom: .35rem;
}

.news-filter-range-input {
  /* Width is set from the text by news.js; field-sizing covers browsers that support it. */
  field-sizing: content;
  min-width: 0;
  min-height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.news-filter-range-input::placeholder {
  color: inherit;
  opacity: .85;
}

.news-filter-range-input:focus {
  outline: 0;
  box-shadow: none;
}

/* ---- Admin editor ---- */
.news-editor {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid #e0dacb;
  border-radius: 16px;
  background: #fffaf2;
  box-shadow: 0 6px 20px rgba(29, 37, 32, .06);
}

.news-editor h2,
.news-list h2 {
  color: #253b2e;
}

.news-form-actions,
.news-card-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Feed ---- */
.news-list {
  margin-bottom: 2.5rem;
}

.news-grid {
  display: grid;
  gap: 1.25rem;
  max-width: 820px;
  margin: 0 auto;
}

.news-load-sentinel {
  min-height: 1px;
}

.news-card {
  overflow: hidden;
  border: 1px solid #e6e0d2;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(29, 37, 32, .05), 0 10px 28px rgba(29, 37, 32, .06);
  transition: box-shadow .25s ease, transform .25s ease;
}

.news-card:hover {
  box-shadow: 0 4px 10px rgba(29, 37, 32, .07), 0 16px 36px rgba(29, 37, 32, .1);
  transform: translateY(-2px);
}

.news-card-body {
  display: grid;
  gap: 1rem;
  padding: 1.4rem 1.5rem 1.5rem;
}

.news-card-header {
  display: grid;
  gap: .6rem;
  justify-items: start;
}

.news-card-header h3 {
  margin: 0;
  color: #1d2f24;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.news-card-date {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: #e8f1ea;
  color: #2f6b46;
  font-size: .85rem;
  font-weight: 600;
}

.news-card-time {
  padding-left: .4rem;
  border-left: 1px solid rgba(47, 107, 70, .35);
  font-weight: 500;
  opacity: .85;
}

.news-card-description {
  margin: 0;
  color: #2b3a31;
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.news-card-description p,
.news-card-description ul,
.news-card-description ol {
  margin: 0;
}

.news-card-description ul,
.news-card-description ol {
  padding-left: 1.25rem;
}

.news-card-actions {
  padding-top: .75rem;
  border-top: 1px solid #efeadf;
}

.photo-carousel-news .photo-carousel-track {
  grid-auto-columns: auto;
  gap: .25rem;
}

.photo-carousel-news .photo-carousel-slide {
  width: min(78vw, 640px);
}

.photo-carousel-news .photo-carousel-slide img {
  aspect-ratio: 16 / 9;
}

.photo-carousel-news .photo-carousel-video-slide {
  aspect-ratio: 16 / 9;
  background: #111111;
}

.photo-carousel-news .photo-carousel-slide:hover,
.photo-carousel-editor .photo-carousel-slide:hover {
  z-index: auto;
  box-shadow: none;
  transform: none;
}

.photo-carousel-editor .photo-carousel-track {
  grid-auto-columns: minmax(180px, 240px);
  padding: .75rem;
}

.photo-carousel-editor .photo-carousel-slide img {
  height: 210px;
  aspect-ratio: auto;
}

@media (max-width: 768px) {
  .news-hero {
    margin-top: 1.5rem;
  }

  .news-filter {
    max-width: 100%;
  }

  .news-card-body {
    padding: 1.1rem 1.1rem 1.2rem;
  }

  .photo-carousel-news .photo-carousel-slide,
  .photo-carousel-news .photo-carousel-video-slide {
    width: min(92vw, 520px);
  }
}

@media (max-width: 480px) {
  .news-chip {
    padding: .5rem .8rem;
    font-size: .9rem;
  }

}

/* ---- Date picker (flatpickr) in the site's palette ---- */
.flatpickr-calendar {
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(29, 37, 32, .2);
  font-family: inherit;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  border-color: #2f6b46;
  background: #2f6b46;
}

.flatpickr-day.inRange {
  border-color: #e8f1ea;
  background: #e8f1ea;
  box-shadow: -5px 0 0 #e8f1ea, 5px 0 0 #e8f1ea;
}

.flatpickr-day.today:not(.selected) {
  border-color: #2f6b46;
}

.flatpickr-day:hover:not(.selected):not(.inRange) {
  background: #f0f4f1;
}

/* ---- Images and videos placed inside news text (public cards and the editor) ---- */
.news-card-description {
  display: flow-root;
}

.news-card-description figure.news-img,
.rich-text-content figure.news-img {
  margin: .5rem 0 1rem;
  white-space: normal;
}

.news-card-description figure.news-img img,
.rich-text-content figure.news-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(29, 37, 32, .12);
}

.news-img-left {
  float: left;
  margin-right: 1.25rem !important;
}

.news-img-right {
  float: right;
  margin-left: 1.25rem !important;
}

.news-img-center {
  clear: both;
  margin-right: auto !important;
  margin-left: auto !important;
}

.news-img-size-s {
  width: 25%;
}

.news-img-size-m {
  width: 40%;
}

.news-img-size-l {
  width: 65%;
}

.news-img-size-full {
  float: none;
  clear: both;
  width: 100%;
}

.news-video-embed {
  clear: both;
  position: relative;
  aspect-ratio: 16 / 9;
  margin: .75rem 0 1rem;
  overflow: hidden;
  border-radius: 12px;
  background: #111111;
  box-shadow: 0 4px 14px rgba(29, 37, 32, .15);
}

.news-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.news-emoji-button {
  min-width: 3rem;
  font-size: 1.1rem;
}

@media (max-width: 575.98px) {
  .news-card-description figure.news-img,
  .rich-text-content figure.news-img {
    float: none;
    width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
}

.news-card-description h2,
.news-card-description h3,
.news-card-description h4 {
  margin: 0;
  color: #1d2f24;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
}

.news-card-description h3 { font-size: 1.4rem; }
.news-card-description h4 { font-size: 1.15rem; }

.news-card-content {
  width: 100%;
  color: #2b3a31;
  font-size: 1.05rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.news-card-content > :first-child { margin-top: 0; }
.news-card-content > :last-child { margin-bottom: 0; }
