/*
 * Home "What's new" Spotlight deck (app/views/home/_section_whats_new +
 * _whats_new_card, whats-new-deck Stimulus controller). Design reference:
 * output/whats-new-design/spotlight-mixed.html.
 *
 * Colours are the app's Tailwind tokens, not the preview's: light uses
 * white / gray-200 / gray-500 / gray-900 with emerald-50 / emerald-700, and
 * dark is the true-black remap (#000 card, #262626 hairlines, #141414 media
 * panel, emerald-400 accents, emerald glow) -- no brand-tinted surfaces.
 *
 * Everything is scoped under .home-whats-new; no tag selectors leak out.
 */

.home-whats-new {
  --wn-paper: #ffffff;
  --wn-ink: #111827;
  --wn-muted: #6b7280;
  --wn-line: #e5e7eb;
  --wn-green: #047857;
  --wn-panel: #ecfdf5;
  --wn-mark: #ecfdf5;
  --wn-glow: none;
}

@media (prefers-color-scheme: dark) {
  .home-whats-new {
    --wn-paper: #000000;
    --wn-ink: #f5f5f5;
    --wn-muted: #a3a3a3;
    --wn-line: #262626;
    --wn-green: #34d399;
    --wn-panel: #141414;
    --wn-mark: rgb(2 44 34 / 0.6);
    --wn-glow: 0 8px 32px 0 rgb(16 185 129 / 0.15);
  }
}

/* Inactive slides and the pre-Stimulus controls must stay hidden even where
   a flex/grid rule below sets display. */
.home-whats-new [hidden] {
  display: none !important;
}

.home-whats-new__slides {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --- Card ------------------------------------------------------------- */

.home-whats-new__card {
  display: grid;
  grid-template-columns: minmax(170px, 40%) minmax(0, 1fr);
  min-height: 285px;
  overflow: hidden;
  border: 1px solid var(--wn-line);
  border-radius: 18px;
  background: var(--wn-paper);
  box-shadow: var(--wn-glow);
  color: var(--wn-ink);
}

/* --- Media panel: photo over a type fallback --------------------------- */

.home-whats-new__media {
  position: relative;
  display: grid;
  grid-template: "stack" minmax(0, 1fr) / minmax(0, 1fr);
  min-width: 0;
  background: var(--wn-panel);
  color: var(--wn-green);
}

.home-whats-new__fallback {
  grid-area: stack;
  padding: 24px 22px 56px;
}

/* Out of flow so a photo's own proportions never size the card; it covers
   the fallback (whose mark is positioned, hence the explicit layers).
   Photos are 16:9 and the side panel is taller than that, so the whole
   photo shows, centred on the panel colour, instead of being cropped. */
.home-whats-new__image {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-whats-new__category {
  position: relative;
  z-index: 2;
  grid-area: stack;
  align-self: end;
  justify-self: start;
  margin: 0 0 22px 22px;
  font-size: 12px;
  line-height: 1.4;
}

/* A contained photo leaves panel showing around it; the fallback underneath
   must not peek out there. */
.home-whats-new__media:has(.home-whats-new__image:not([hidden])) .home-whats-new__fallback {
  visibility: hidden;
}

/* On a photo the label needs its own ground to stay legible. */
.home-whats-new__media:has(.home-whats-new__image:not([hidden])) .home-whats-new__category {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--wn-paper);
  font-weight: 700;
}

.home-whats-new__date {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* --- Organization mark: logo over initials ----------------------------- */

.home-whats-new__mark {
  position: relative;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--wn-mark);
  color: var(--wn-green);
  font-weight: 700;
  line-height: 1;
}

.home-whats-new__logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--wn-paper);
}

.home-whats-new__mark--inline {
  width: 25px;
  height: 25px;
  font-size: 9px;
}

/* The panel shows bare, large initials (the preview's type symbol); a logo
   sits in a rounded square instead. */
.home-whats-new__mark--panel {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: transparent;
  font-size: 40px;
  letter-spacing: -2px;
  justify-items: start;
}

/* --- Content ----------------------------------------------------------- */

.home-whats-new__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 26px;
}

.home-whats-new__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--wn-muted);
}

.home-whats-new__meta time {
  flex-shrink: 0;
}

.home-whats-new__new {
  color: var(--wn-green);
  font-weight: 700;
}

.home-whats-new__title {
  margin: 6px 0 18px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}

.home-whats-new__title--long {
  font-size: 20px;
  line-height: 1.3;
}

.home-whats-new__org {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--wn-muted);
}

.home-whats-new__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--wn-line);
  font-size: 13px;
}

/* Right-aligned whether or not a date shares the row. */
.home-whats-new__cta {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  margin-left: auto;
  min-height: 44px;
  color: var(--wn-green);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.home-whats-new__cta:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-whats-new__cta:focus-visible,
.home-whats-new__arrow:focus-visible {
  outline: 2px solid var(--wn-green);
  outline-offset: 2px;
  border-radius: 8px;
}

/* --- Pagination -------------------------------------------------------- */

.home-whats-new__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--wn-muted);
}

.home-whats-new__status {
  flex-shrink: 0;
}

.home-whats-new__progress {
  flex: 1;
  max-width: 170px;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--wn-line);
}

.home-whats-new__progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--wn-green);
  transition: width 0.2s ease;
}

.home-whats-new__arrows {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.home-whats-new__arrow {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--wn-line);
  border-radius: 12px;
  background: var(--wn-paper);
  color: var(--wn-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.home-whats-new__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .home-whats-new__progress > span {
    transition: none;
  }
}

/* --- Phone: media panel above the text --------------------------------- */

@media (max-width: 480px) {
  /* One shared floor so the arrows don't jump between ordinary cards. */
  .home-whats-new__card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 380px;
  }

  .home-whats-new__media {
    min-height: 150px;
  }

  /* Above the text the panel takes the photo's own 16:9, so it fills
     edge to edge with nothing cropped. */
  .home-whats-new__media:has(.home-whats-new__image:not([hidden])) {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .home-whats-new__image {
    object-fit: cover;
  }

  .home-whats-new__fallback {
    display: flex;
    align-items: center;
    padding: 28px 110px 20px 20px;
  }

  .home-whats-new__category {
    align-self: start;
    justify-self: end;
    margin: 12px 16px 0 0;
    font-size: 11px;
  }

  .home-whats-new__date {
    font-size: 22px;
  }

  .home-whats-new__content {
    padding: 20px;
  }

  .home-whats-new__title {
    font-size: 24px;
  }

  .home-whats-new__title--long {
    font-size: 19px;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
