/* PlebWare editorial landing pages.
   Scoped to the new Home and Everyday landing pages; article layouts stay readable. */

.page-home main,
.page-everyday main {
  width: min(100%, 1240px);
  max-width: 1240px;
  margin-inline: auto;
}

.page-home main,
.page-everyday main { padding-inline: clamp(0.25rem, 2vw, 1.25rem); }

.pw-home {
  --pw-ink: #172b35;
  --pw-muted: #52636b;
  --pw-accent: #176b63;
  --pw-accent-dark: #104c47;
  --pw-paper: #ffffff;
  --pw-soft: #edf4f1;
  --pw-line: #d9e4df;
  color: var(--pw-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  width: 100%;
}

body.dark-theme .pw-home {
  --pw-ink: #e5f0ec;
  --pw-muted: #b2c5be;
  --pw-accent: #8ed8c4;
  --pw-accent-dark: #b5eddd;
  --pw-paper: #101b1a;
  --pw-soft: #172725;
  --pw-line: #2c4640;
}

.pw-home *,
.pw-home *::before,
.pw-home *::after { box-sizing: border-box; }

.pw-home a { color: inherit; }
.pw-home p,
.pw-home li { font-size: 1rem !important; line-height: 1.6 !important; }
.pw-home h1,
.pw-home h2,
.pw-home h3 { font-family: inherit; line-height: 1.12; letter-spacing: -0.035em; }
.pw-home h1 { font-size: clamp(2.35rem, 6vw, 5.1rem); font-weight: 850; }
.pw-home h2 { font-size: clamp(1.7rem, 3.2vw, 2.65rem) !important; line-height: 1.12 !important; }
.pw-home h3 { font-size: 1.2rem; font-weight: 760; }
.pw-home img { display: block; max-width: 100%; height: auto; }

.pw-eyebrow {
  color: var(--pw-accent);
  font-size: 0.76rem !important;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3 !important;
  text-transform: uppercase;
}

.pw-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  overflow: hidden;
  margin: 0.5rem 0 3rem;
  padding: clamp(1.35rem, 4vw, 3.5rem);
  border: 1px solid var(--pw-line);
  border-radius: 28px;
  background: var(--pw-soft);
}

.pw-hero-copy { max-width: 650px; }
.pw-hero h1 { margin: 0.7rem 0 1rem; color: var(--pw-ink); }
.pw-hero-lead {
  max-width: 52ch;
  margin: 0 0 1.4rem;
  color: var(--pw-muted);
  font-size: clamp(1.05rem, 1.5vw, 1.24rem) !important;
}

.pw-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pw-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border: 2px solid var(--pw-accent);
  border-radius: 999px;
  background: var(--pw-accent);
  color: #fff !important;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.pw-button:hover { transform: translateY(-2px); background: var(--pw-accent-dark); box-shadow: 0 8px 20px rgba(20, 75, 65, 0.18); }
.pw-button-secondary { background: transparent; color: var(--pw-accent) !important; }
.pw-button-secondary:hover { color: #fff !important; }

.pw-section { margin: 3.25rem 0; }
.pw-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.pw-section-head h2 { margin: 0.35rem 0 0; color: var(--pw-ink); }
.pw-section-intro { max-width: 62ch; margin: 0.65rem 0 1.35rem; color: var(--pw-muted); }
.pw-text-link { color: var(--pw-accent) !important; font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.pw-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.pw-feature {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--pw-line);
  border-radius: 20px;
  background: var(--pw-paper);
  text-decoration: none !important;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.pw-feature:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20, 45, 38, 0.1); }
.pw-feature-copy { padding: 1.1rem 1.15rem 1.25rem; }
.pw-feature-copy h3 { margin: 0 0 0.4rem; color: var(--pw-ink); }
.pw-feature-copy p { margin: 0; color: var(--pw-muted); }

.pw-mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.pw-mode-card {
  display: flex;
  min-width: 0;
  min-height: 112px;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--pw-line);
  border-radius: 16px;
  background: var(--pw-paper);
  text-decoration: none !important;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.pw-mode-card:hover { border-color: var(--pw-accent); transform: translateY(-2px); background: var(--pw-soft); }
.pw-mode-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 14px;
  background: var(--pw-soft);
  font-size: 1.55rem;
}
.pw-mode-card strong { display: block; color: var(--pw-ink); font-size: 0.98rem; line-height: 1.25; }
.pw-mode-card small { display: block; margin-top: 0.22rem; color: var(--pw-muted); font-size: 0.78rem; line-height: 1.35; }

.pw-article-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.pw-article-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.15rem;
  border: 1px solid var(--pw-line);
  border-radius: 18px;
  background: var(--pw-paper);
}
.pw-article-card .pw-article-mode { color: var(--pw-accent); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.pw-article-card h3 { margin: 0.55rem 0; }
.pw-article-card h3 a { color: var(--pw-ink); text-decoration: none; }
.pw-article-card h3 a:hover { color: var(--pw-accent); }
.pw-article-card time { color: var(--pw-muted); font-size: 0.8rem; }
.pw-article-card p { margin: 0.6rem 0 0.9rem; color: var(--pw-muted); font-size: 0.9rem !important; }
.pw-article-card .pw-read-link { margin-top: auto; color: var(--pw-accent); font-weight: 800; text-decoration: none; }

.pw-stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.4rem;
  border-radius: 20px;
  background: var(--pw-soft);
}
.pw-stat { text-align: center; }
.pw-stat strong { display: block; color: var(--pw-accent); font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.1; }
.pw-stat span { color: var(--pw-muted); font-size: 0.88rem; font-weight: 700; }

.pw-bottom-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 22px;
  background: var(--pw-ink);
  color: var(--pw-paper);
}
.pw-bottom-cta h2 { margin: 0 0 0.4rem; color: inherit; }
.pw-bottom-cta p { max-width: 55ch; margin: 0; color: inherit; opacity: 0.8; }
.pw-bottom-cta .pw-button { flex: 0 0 auto; border-color: #fff; background: #fff; color: #173a35 !important; }

.pw-note { color: var(--pw-muted); font-size: 0.85rem !important; }
.pw-home hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--pw-line); }

@media (max-width: 900px) {
  .pw-mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pw-article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pw-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pw-hero { grid-template-columns: 1fr 0.8fr; }
}

@media (max-width: 640px) {
  .page-home main,
  .page-everyday main { padding-inline: 0; }
  .pw-home { font-size: 1rem; }
  .pw-hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 0.15rem 0 2.25rem;
    padding: 1.15rem;
    border-radius: 20px;
  }
  .pw-hero h1 { font-size: clamp(2.45rem, 12vw, 3.65rem); }
  .pw-hero-lead { font-size: 1.05rem !important; }
  .pw-actions { display: grid; grid-template-columns: 1fr; }
  .pw-button { width: 100%; min-height: 52px; }
  .pw-section { margin: 2.4rem 0; }
  .pw-section-head { align-items: start; flex-direction: column; }
  .pw-feature-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .pw-feature-copy { padding: 0.9rem; }
  .pw-feature-copy h3 { font-size: 1.05rem; }
  .pw-feature-copy p { font-size: 0.88rem !important; }
  .pw-mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .pw-mode-card { min-height: 94px; gap: 0.55rem; padding: 0.7rem; border-radius: 13px; }
  .pw-mode-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; font-size: 1.25rem; }
  .pw-mode-card strong { font-size: 0.88rem; }
  .pw-mode-card small { font-size: 0.7rem; }
  .pw-article-grid { grid-template-columns: 1fr; gap: 0.7rem; }
  .pw-article-card { padding: 1rem; }
  .pw-stat-strip { padding: 1rem 0.7rem; gap: 0.5rem; }
  .pw-stat span { font-size: 0.76rem; }
  .pw-bottom-cta { align-items: stretch; flex-direction: column; }
}

@media (max-width: 370px) {
  .pw-mode-grid { grid-template-columns: 1fr; }
  .pw-mode-card { min-height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .pw-home *, .pw-home *::before, .pw-home *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.pw-home a:focus-visible,
.pw-home button:focus-visible {
  outline: 3px solid var(--pw-accent);
  outline-offset: 4px;
}


/* Compact, accessible shared navigation for phone-first browsing. */
.top-nav .nav-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}
.top-nav .nav-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}
.top-nav .nav-brand a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.25rem !important;
  font-weight: 850;
  white-space: nowrap;
}
.top-nav .nav-primary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.top-nav .nav-primary-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  color: var(--nav-text);
  font-size: 0.95rem;
  font-weight: 750;
  text-decoration: none;
}
.top-nav .nav-primary-actions a:hover,
.top-nav .nav-primary-actions a:focus-visible {
  background: var(--secondary-nav-bg);
  color: var(--brand);
}
.top-nav .mode-nav-toggle,
.top-nav .secondary-nav-toggle {
  display: flex !important;
  width: 100% !important;
  min-height: 48px;
  align-items: center;
  justify-content: flex-start;
  padding: 0.7rem 0.9rem !important;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--secondary-nav-bg);
  color: var(--nav-text);
  font: inherit;
  font-size: 1rem !important;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.top-nav .mode-nav-toggle:hover,
.top-nav .secondary-nav-toggle:hover {
  border-color: var(--brand);
}
.top-nav .mode-navigation-panel,
.top-nav .secondary-navigation-panel {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--nav-bg);
}
.top-nav .mode-navigation-panel[hidden],
.top-nav .secondary-navigation-panel[hidden] {
  display: none !important;
}
.top-nav .mode-navigation-panel .modes-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  width: 100% !important;
  max-width: none !important;
  gap: 0.35rem !important;
  margin: 0 !important;
  padding: 0 !important;
}
.top-nav .mode-navigation-panel .modes-list li a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0.5rem !important;
  border: 1px solid var(--border);
  border-radius: 9px;
  white-space: normal;
  font-size: 0.9rem !important;
  line-height: 1.25 !important;
}
.top-nav .systems-menu {
  width: 100%;
  color: var(--nav-text);
  font-size: 0.9rem;
}
.top-nav .systems-menu summary {
  min-height: 42px;
  padding: 0.55rem 0.25rem;
  cursor: pointer;
  font-weight: 700;
}
.top-nav .systems-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  padding: 0.25rem 0.25rem 0.65rem;
  list-style: none;
}
.top-nav .systems-links a { color: var(--link); }

@media (max-width: 640px) {
  .top-nav .nav-topline { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  .top-nav .nav-primary-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; width: 100%; gap: 0.3rem; }
  .top-nav .nav-primary-actions a { min-width: 0; padding: 0.4rem 0.25rem; font-size: 0.85rem; }
  .top-nav .nav-primary-actions .theme-toggle { min-width: 44px; min-height: 44px; }
  .top-nav .mode-navigation-panel .modes-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.35rem !important;
  }
  .top-nav .mode-navigation-panel .modes-list li a {
    min-height: 46px;
    font-size: 0.92rem !important;
  }
}


/* ------------------------------------------------------------
   Shared image containment for landing pages and articles.
   Each component has one sizing rule; the image never sets its own frame.
   ------------------------------------------------------------ */
main,
main * {
  min-width: 0;
}
main img,
main picture,
main video,
main svg {
  max-width: 100%;
}
main img {
  height: auto;
}
main > img,
main article img,
main .post-content img,
main .article-content img,
main .post-body img,
main .content img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 72vh;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

/* Landing-page hero artwork. */
.pw-hero-media {
  display: flex;
  width: 80%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-inline: auto;
  border-radius: 1.25rem;
  background: var(--pw-paper);
}
.pw-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
  box-shadow: none;
}

/* Feature artwork: consistent cards with complete images visible. */
.pw-feature {
  display: block;
  min-width: 0;
}
.pw-feature img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--pw-soft);
}

/* Reusable image frames for galleries and future landing pages. */
.pw-image-frame {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--pw-soft);
}
.pw-image-frame img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}
.pw-image-landscape { aspect-ratio: 16 / 9; }
.pw-image-card { aspect-ratio: 4 / 3; }
.pw-image-square { aspect-ratio: 1 / 1; }
.pw-image-portrait { aspect-ratio: 3 / 4; }
.pw-image-original { height: auto; aspect-ratio: auto; }

/* Preview pages replace the legacy banner with their own hero. */

@media (max-width: 640px) {
  main > img,
  main article img,
  main .post-content img,
  main .article-content img,
  main .post-body img,
  main .content img {
    max-height: 68vh;
  }
  .pw-hero-media {
    aspect-ratio: 16 / 9;
    max-height: none;
    border-radius: 1rem;
  }
  .pw-hero-media img {
    max-height: 100%;
    border-radius: inherit;
  }
  .pw-feature-grid {
    grid-template-columns: 1fr;
  }
  .pw-feature img {
    max-height: 100%;
    aspect-ratio: 16 / 9;
  }
  .pw-image-frame {
    max-width: 100%;
  }
}

/* Single-image featured-topic carousel.
   The stage owns the dimensions; the image can never enlarge the stage. */
.pw-topic-carousel {
  width: min(70%, 56vh);
  max-width: 100%;
  margin: 1.5rem auto 0;
  overflow: hidden;
  border: 1px solid var(--pw-line);
  border-radius: 1.375rem;
  background: var(--pw-paper);
}
.pw-topic-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--pw-soft);
  touch-action: pan-y;
}
.pw-topic-image-link {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pw-topic-stage img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.pw-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  min-width: 3.25rem;
  min-height: 3.25rem;
  place-items: center;
  transform: translateY(-50%);
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: rgba(16, 31, 29, .9);
  color: #fff;
  font: inherit;
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.3);
  -webkit-tap-highlight-color: transparent;
}
.pw-carousel-arrow:hover { background: var(--pw-accent); }
.pw-carousel-arrow:active { transform: translateY(-50%) scale(.94); }
.pw-carousel-prev { left: 2%; }
.pw-carousel-next { right: 2%; }
.pw-topic-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(.9rem, 2.5vw, 1.4rem);
}
.pw-topic-caption h3 { margin: .25rem 0; }
.pw-topic-caption h3 a { color: var(--pw-ink); text-decoration: none; }
.pw-topic-caption h3 a:hover { color: var(--pw-accent); }
.pw-topic-caption p { margin: .25rem 0 0; color: var(--pw-muted); }
.pw-topic-hint { color: var(--pw-muted); font-size: .82rem; white-space: nowrap; }
.pw-carousel-progress { height: 4px; background: var(--pw-soft); }
.pw-carousel-progress span {
  display: block;
  width: 8.333%;
  height: 100%;
  background: var(--pw-accent);
  transition: width 180ms ease;
}
.pw-ecosystem-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .8rem;
}
.pw-ecosystem-links a {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem;
  border: 1px solid var(--pw-line);
  border-radius: 14px;
  text-decoration: none;
}
.pw-ecosystem-links a strong { color: var(--pw-accent); }
.pw-ecosystem-links a span { color: var(--pw-muted); font-size: .9rem; line-height: 1.45; }
.pw-topic-image-link:focus-visible,
.pw-carousel-arrow:focus-visible,
.pw-topic-caption a:focus-visible { outline: 3px solid var(--pw-accent); outline-offset: 3px; }

@media (max-width: 640px) {
  .pw-topic-carousel {
    max-width: 100%;
    border-radius: 1rem;
  }
  .pw-topic-stage {
    height: auto;
    aspect-ratio: 4 / 5;
  }
  .pw-carousel-arrow {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    min-height: 3rem;
    font-size: 2.2rem;
  }
  .pw-topic-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: .35rem;
    padding: .85rem 1rem;
  }
  .pw-topic-caption .pw-eyebrow {
    font-size: clamp(.68rem, 2.6vw, .78rem) !important;
  }
  .pw-topic-caption h3 { font-size: clamp(1rem, 4vw, 1.2rem); }
  .pw-topic-caption p {
    font-size: clamp(.84rem, 3.2vw, 1rem) !important;
    line-height: 1.4 !important;
  }
  .pw-topic-hint { font-size: .76rem; white-space: normal; }
  .pw-ecosystem-links { grid-template-columns: 1fr; }
}


/* Navigation dropdowns: explicit surfaces and readable links in both themes.
   These selectors intentionally override the legacy .top-nav * reset. */
.top-nav .mode-navigation-panel,
.top-nav .secondary-navigation-panel {
  background-color: var(--nav-bg) !important;
  color: var(--nav-text) !important;
  border-color: var(--border) !important;
}
.top-nav .mode-navigation-panel .modes-list,
.top-nav .secondary-navigation-panel .secondary-nav {
  background-color: var(--secondary-nav-bg) !important;
  border-color: var(--border) !important;
}
.top-nav .mode-navigation-panel .modes-list li a,
.top-nav .secondary-navigation-panel .secondary-nav li a {
  color: var(--link) !important;
  background-color: transparent !important;
  border-color: var(--border) !important;
}
.top-nav .mode-navigation-panel .modes-list li a:hover,
.top-nav .mode-navigation-panel .modes-list li a:focus-visible,
.top-nav .secondary-navigation-panel .secondary-nav li a:hover,
.top-nav .secondary-navigation-panel .secondary-nav li a:focus-visible {
  color: var(--link-hover) !important;
  background-color: var(--nav-bg) !important;
  outline-offset: 2px;
}
.top-nav .secondary-navigation-panel .secondary-nav-title {
  color: var(--link) !important;
}
.top-nav .secondary-navigation-panel .secondary-nav-description,
.top-nav .secondary-navigation-panel .secondary-nav-empty {
  color: var(--nav-text) !important;
}



/* Shared editorial directory: preview version of the theme component. */
.pw-category-directory {
  --pw-directory-paper: var(--pw-paper, #fff);
  --pw-directory-ink: var(--pw-ink, #172b35);
  --pw-directory-muted: var(--pw-muted, #52636b);
  --pw-directory-line: var(--pw-line, #d9e4df);
  --pw-directory-accent: var(--pw-accent, #176b63);
  width: 100%;
  margin: 1.5rem 0 2rem;
}
.pw-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.pw-category-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--pw-directory-line);
  border-radius: 18px;
  background: var(--pw-directory-paper);
  color: var(--pw-directory-ink);
  box-shadow: 0 4px 16px rgba(20, 40, 35, 0.045);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.pw-category-card:hover {
  transform: translateY(-3px);
  border-color: var(--pw-directory-accent);
  box-shadow: 0 10px 24px rgba(20, 40, 35, 0.09);
}
.pw-category-title {
  margin: 0 0 0.9rem !important;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--pw-directory-line);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem) !important;
  line-height: 1.25 !important;
  letter-spacing: -0.02em;
}
.pw-category-title a {
  color: var(--pw-directory-ink) !important;
  text-decoration: none;
}
.pw-category-title a:hover { color: var(--pw-directory-accent) !important; }
.pw-category-articles {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  list-style: none !important;
}
.pw-category-articles li {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.18rem;
  margin: 0 !important;
  padding: 0 0 0.55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--pw-directory-line) 70%, transparent);
  font-size: 0.9rem !important;
  line-height: 1.4 !important;
}
.pw-category-articles li:last-child { border-bottom: 0; }
.pw-category-articles a {
  color: var(--pw-directory-ink) !important;
  font-weight: 700;
  text-decoration: none;
}
.pw-category-articles a:hover {
  color: var(--pw-directory-accent) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pw-category-articles time {
  color: var(--pw-directory-muted);
  font-size: 0.76rem;
}
.pw-category-empty {
  margin: 0 0 1rem;
  color: var(--pw-directory-muted);
  font-size: 0.9rem !important;
  font-style: italic;
}
.pw-category-browse {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.55rem;
  color: var(--pw-directory-accent) !important;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}
.pw-category-browse:hover { text-decoration: underline; text-underline-offset: 3px; }
.pw-category-directory a:focus-visible {
  outline: 3px solid var(--pw-directory-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
@media (max-width: 900px) {
  .pw-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pw-category-directory { margin: 1rem 0 1.5rem; }
  .pw-category-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .pw-category-card { padding: 1rem; border-radius: 15px; }
  .pw-category-title { margin-bottom: 0.7rem !important; }
  .pw-category-articles { gap: 0.55rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pw-category-card { transition: none; }
}


/* Shared layout rules for the eleven additional mode previews.
   Keep the shared page banner visible; Ecco styling must not suppress it. */
.page-mode main {
  width: min(100%, 1240px);
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(0.25rem, 2vw, 1.25rem);
}
@media (max-width: 640px) {
  .page-mode main { padding-inline: 0; }
}

/* Monthly Spotlight: percentage-based sizing adapts to every viewport. */
.pw-monthly-spotlight .pw-image-frame {
  width: 90%;
  max-width: 100%;
  margin-inline: auto;
  border-radius: 1.25rem;
}
.pw-monthly-spotlight .pw-image-frame img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
@media (max-width: 640px) {
  .pw-monthly-spotlight .pw-image-frame {
    width: 96%;
    border-radius: 1rem;
  }
}
