/* News, photo reports and the report card of the events section. Loaded by the pages that
   show them, after school-day.css; built on the tokens and the ruled rows of base.css. */

/* The margin holds the date; the year sits under day and month. */
.news-date {
  padding-top: calc(var(--cell) / 2 + 2px);
}

.news-year {
  display: block;
  color: var(--pencil);
}

/* News list: one ruled entry per post, the cover beside the text from 600px. */
.news-item-body {
  display: grid;
  gap: calc(var(--cell) / 2);
  padding: calc(var(--cell) / 2) 0;
}

.news-item-cover {
  display: block;
  width: 100%;
  max-width: calc(var(--cell) * 14);
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--table-line);
  background: var(--label);
}

.news-item-title {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1.059rem;
  line-height: inherit;
}

.news-item-excerpt {
  margin: calc(var(--cell) / 6) 0 0;
  font-size: var(--size-note);
}

@media (min-width: 600px) {
  .news-item-body {
    grid-template-columns: calc(var(--cell) * 8) minmax(0, 1fr);
    align-items: start;
  }

  .news-item-cover {
    max-width: none;
  }
}

.news-pages .ruled-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--cell);
  margin-top: var(--cell);
}

/* One post: its text at a readable length, its photos as wide as the page. */
.news-event {
  margin: calc(var(--cell) / 6) 0 0;
}

.news-body {
  margin-top: var(--cell);
}

.news-body p {
  margin: 0 0 var(--cell);
}

/* An address typed in the text may be longer than a phone screen. */
.news-body a {
  overflow-wrap: anywhere;
}

.news-photos-row .ruled-body {
  margin-top: var(--cell);
  padding-top: var(--cell);
  border-top: 1px solid var(--ink);
}

.news-photos {
  display: grid;
  gap: var(--cell);
  max-width: none;
  margin: var(--cell) 0;
  padding: 0;
  list-style: none;
}

.news-photos li {
  max-width: none;
}

.news-photos img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--table-line);
  background: var(--label);
}

/* Two photos side by side from 600px, so a tall photo never fills more than a screen. */
@media (min-width: 600px) {
  .news-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* Videos one under another, as wide as the text column; a portrait video stays within the
   screen's height so its controls are always visible. */
.news-videos-row .ruled-body {
  margin-top: var(--cell);
  padding-top: var(--cell);
  border-top: 1px solid var(--ink);
}

.news-videos {
  display: grid;
  gap: var(--cell);
  max-width: none;
  margin: var(--cell) 0;
  padding: 0;
  list-style: none;
}

.news-videos li {
  max-width: none;
}

.news-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  border: 1px solid var(--table-line);
  background: var(--ink);
}

/* Home page: the newest photo report as a white index card beside the coming events.
   Square corners and no shadow (DESIGN.md §4); the slight turn is the approved mockup's. */
.events-columns {
  display: grid;
}

.report-row {
  padding: var(--cell) 0;
}

.report-card {
  max-width: calc(var(--cell) * 20);
  padding: calc(var(--cell) / 2);
  border: 1px solid var(--table-line);
  background: var(--label);
  transform: rotate(1deg);
}

.report-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--grid);
}

.report-label {
  margin: calc(var(--cell) / 2) 0 0;
  color: var(--pencil);
  font-size: var(--size-small);
}

.report-title {
  margin: 0;
  font-size: 1.059rem;
  line-height: 1.4444;
}

.report-meta {
  margin: calc(var(--cell) / 12) 0 0;
  color: var(--pencil);
  font-size: var(--size-note);
}

.report-links {
  margin: 0;
}

@media (min-width: 960px) {
  .events-columns {
    grid-template-columns: minmax(0, 3fr) minmax(calc(var(--cell) * 12), 1fr);
    column-gap: var(--cell);
    align-items: start;
  }

  /* Beside the list the card leaves the ruled grid: no margin column of its own. */
  .events-columns > .report-row {
    display: block;
    margin-left: 0;
    padding: calc(var(--cell) / 2) 0 var(--cell);
  }
}

html[data-a11y-theme="contrast"] .report-card {
  transform: none;
}

/* The staff preview of a post: a pencilled note above it, like the demo ribbon. */
.preview-note {
  max-width: none;
  margin: 0 0 var(--cell);
  padding: calc(var(--cell) / 3) calc(var(--cell) / 2);
  background: var(--ribbon);
  color: var(--ink);
  font-weight: 700;
}
