/* Juno Childcare Academy - Newsletter page
   A board of alerts, not an editorial feed. Each tile's top rule carries its
   status in colour, the same signal language as the join page's dateline:
   honey asks for action, green is open, pine marks a change, hairline is
   quiet news. The full write-up lives in a dialog so a tile can stay one
   glance long while the write-up runs as long as it needs to. */

/* --- masthead: one slim row, then the tabs --- */

/* short on both ends: the board opens the page and the socials follow close */
.nl-head-inner { padding-top: 2.4rem; padding-bottom: 2.8rem; }

.nl-masthead {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-bottom: 1.4rem;
}

/* scoped down from the site's hero scale: this h1 is a masthead, not a hero */
.nl-masthead h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.05;
}

/* --- toolbar --- */

.nl-toolbar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.9rem 1.6rem;
}

.nl-updated { display: flex; align-items: baseline; gap: 0.7rem; }

.nl-updated em {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--honey-text);
}

.nl-updated span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nl-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.nl-filters button {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  padding: 0.38rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nl-filters button:hover { color: var(--pine-deep); border-color: var(--pine); }

.nl-filters button[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--paper);
}

.nl-alerts-btn {
  margin-left: auto;
  border: 0;
  background: none;
  padding: 0.15rem 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--honey);
  cursor: pointer;
}

.nl-alerts-btn:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; }

/* --- the board --- */

.nl-board {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* the height floor (js) props the board open; without this the grid
     stretches its rows into that space and a lone filtered tile balloons
     to fill the whole board */
  align-content: start;
  gap: 1rem;
}

.nl-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 1.15rem 1.3rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Juno's own items: the butterfly sits in the meta row and the tile takes
   a breath of pine, so ours read as ours at a glance without shouting */
.nl-tile--juno { background: rgb(var(--pine-deep-rgb) / 0.045); }

.nl-tile-mark { width: 19px; height: auto; align-self: center; }

/* status, said in colour on the top rule and in words in the tag */
.nl-tile--act { border-top-color: var(--honey); }
.nl-tile--open { border-top-color: var(--open); }
.nl-tile--changed { border-top-color: var(--pine); }

.nl-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgb(var(--pine-deep-rgb) / 0.08);
}

.nl-tile-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.7rem;
  width: 100%;
}

.nl-status,
.nl-cat {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nl-status { color: var(--pine-deep); }
.nl-tile--act .nl-status, .nl-dialog--act .nl-status { color: var(--honey-text); }
/* --open is graphics-only; for text the site uses the darker chip green
   (see .status.is-open), which holds AA on the pine wash too */
.nl-tile--open .nl-status, .nl-dialog--open .nl-status { color: #2f5f3e; }

.nl-cat { color: var(--muted); font-weight: 600; }

.nl-date {
  margin-left: auto;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
}

.nl-tile h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.22rem;
  line-height: 1.25;
  color: var(--pine-deep);
  margin: 0.2rem 0 0;
}

.nl-tile > p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  /* owner-written teasers can run long; the tile stays one glance */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* the tile is the click target; this is the visible, focusable affordance */
.nl-more {
  margin-top: 0.35rem;
  border: 0;
  background: none;
  padding: 0.15rem 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--honey-text);
  border-bottom: 1px solid var(--honey);
  cursor: pointer;
}

.nl-more:focus-visible,
.nl-filters button:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
}

.nl-board-empty { margin-top: 1.6rem; color: var(--muted); font-size: 0.95rem; }

/* Page chips: numbers only, the current one filled like the active tab. */
.nl-pages {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nl-pages button,
.nl-sort {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  padding: 0.38rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nl-pages button { min-width: 2.3rem; text-align: center; }

.nl-pages button:hover,
.nl-sort:hover { color: var(--pine-deep); border-color: var(--pine); }

.nl-pages button[aria-current] {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--paper);
}

.nl-pages button:focus-visible,
.nl-sort:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; }

/* --- the write-up dialogs --- */

.nl-dialog {
  /* the site's global margin reset also flattens the UA's margin:auto that
     centres a native dialog; put it back */
  margin: auto;
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(84vh, 44rem);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 2px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

.nl-dialog--act { border-left-color: var(--honey); }
.nl-dialog--subscribe { width: min(30rem, calc(100vw - 2rem)); }
.nl-dialog--open { border-left-color: var(--open); }
.nl-dialog--changed { border-left-color: var(--pine); }

.nl-dialog::backdrop { background: rgb(var(--pine-deep-rgb) / 0.55); }

.nl-dialog article { padding: 1.9rem 2.1rem 1.7rem; }

/* an item's optional photograph, shown in the write-up, not on the tile */
.nl-dialog-img {
  width: 100%;
  max-height: 18rem;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 0.9rem;
  display: block;
}

.nl-dialog h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.65rem;
  line-height: 1.2;
  color: var(--pine-deep);
  margin: 0.7rem 0 0.9rem;
}

.nl-dialog p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 0.8rem;
}

.nl-source {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin: 1.3rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.nl-source span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.nl-close { margin-top: 1.4rem; }

@media (prefers-reduced-motion: no-preference) {
  .nl-dialog[open] { animation: nl-dialog-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1); }
  @keyframes nl-dialog-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .nl-tile { transition: none; }
  .nl-tile:hover { transform: none; }
}

/* --- subscribe (inside its dialog) --- */

.nl-form { margin-top: 0.4rem; }

.nl-form-row {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
}

.nl-email { flex: 1; }

.nl-email span {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.nl-email input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.85rem;
}

.nl-email input:focus {
  outline: 2px solid var(--honey);
  outline-offset: 1px;
}

/* --- the socials strip --- */

/* One row, not a grid: each post is a snapshot the width of a hand. Photo
   posts are the photo; text posts are a note in the display italic on the
   honey wash, because a post with no picture still deserves to look like
   something. The corner tag says where it lives; the whole card opens the
   actual post. */
.nl-social-inner { padding-top: 2.6rem; padding-bottom: 3.4rem; }

.nl-social-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}

.nl-social-head .eyebrow { margin: 0; }

.nl-follow { margin-left: auto; font-size: 0.85rem; color: var(--muted); }

.nl-social-row {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.nl-snap {
  /* grid items default min-width to content size; without this a wide
     image or long caption word can push the whole row past the viewport */
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* the newest post wears the arch: one crown, quietly saying "latest" */
.nl-snap:first-child .nl-snap-pic { border-radius: 10rem 10rem 2px 2px; }

.nl-snap--text { background: var(--honey-wash); }

.nl-snap:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgb(var(--pine-deep-rgb) / 0.08);
}

.nl-snap:focus-visible { outline: 2px solid var(--honey); outline-offset: 3px; }

.nl-snap-tag { display: flex; align-items: center; gap: 0.45rem; }

.nl-snap-tag svg { flex: none; width: 14px; height: 14px; fill: var(--pine); }

.nl-snap-tag em {
  margin-left: auto;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--muted);
}

/* The square lives on a wrapper, not the img: a replaced element in a flex
   column derives its automatic size from the photo's natural ratio and wins
   every argument with aspect-ratio. The span has no natural ratio to argue
   with, so the crop is square everywhere; the img just fills it. */
.nl-snap-pic {
  flex-shrink: 0;
  min-height: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  display: block;
}

.nl-snap-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nl-snap-cap {
  flex-shrink: 0;
  color: var(--ink);
  font-size: 0.83rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* the note: a text post carries the tile alone */
.nl-snap-quote {
  margin: auto 0;
  padding: 0.4rem 0.1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--pine-deep);
}

.nl-snap-stats {
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- narrow screens --- */

@media (max-width: 48rem) {
  .nl-board { grid-template-columns: 1fr; }
  .nl-alerts-btn { margin-left: 0; }
  .nl-follow { margin-left: 0; }
  .nl-head-inner { padding-top: 1.8rem; }
  .nl-social-row { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .nl-snap-cap { -webkit-line-clamp: 1; }
}

@media (max-width: 30rem) {
  .nl-form-row { flex-wrap: wrap; }
  .nl-form-row .btn { width: 100%; }

  .nl-dialog article { padding: 1.4rem 1.2rem 1.3rem; }
}
