/* Shared components: boxes, labels, list items, pagination, article parts, dialogs. */

/* ---------- Primitives ---------- */
.box {
  border-radius: var(--r-box);
  box-shadow: var(--shadow-box);
}

.label {
  display: inline;
  padding: 0.2em 0.6em 0.3em;
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1;
  color: var(--c-white);
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--r-pill);
}

a:hover > .label {
  text-decoration: none;
  filter: brightness(0.92);
}

.label-warning { background: var(--c-accent-strong); }
.label-success { background: var(--c-green); }
.label-info { background: var(--c-info); }
.label-primary { background: var(--c-link); }
.label-danger { background: var(--c-danger); }
.label-default { background: var(--c-muted); }

/* Phase 4: min-height makes the tag link a 24 px tall target; the visible pill is unchanged. */
.label-link {
  display: inline-block;
  min-height: 24px;
  margin-bottom: 6px;
}

.rule {
  margin: 10px 0;
  border-bottom: 5px solid var(--c-accent);
  border-radius: 10px;
}

.num {
  color: var(--c-accent-strong);
}

.thumb {
  display: block;
  object-fit: cover;
  border: 1px solid var(--c-page);
  border-radius: var(--r-thumb);
  background: var(--c-white);
}

.avatar {
  border-radius: 50%;
}

/* Phase 4: the row may wrap between items (never inside one), so it reflows at 320 CSS px / 400 % zoom
   instead of scrolling the whole page sideways. At normal widths the row fits and renders as before. */
.meta {
  line-height: 25px;
  color: var(--c-muted);
}

.meta > * {
  white-space: nowrap;
}

.meta .icon {
  vertical-align: -2px;
}

.share-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  margin-left: 2px;
  vertical-align: -4px;
  border: 0;
  border-radius: 4px;
  background: var(--c-share);
  color: var(--c-white);
  font: 700 11px/20px var(--font);
  cursor: pointer;
}

.share-pill .icon {
  width: 12px;
  height: 12px;
}

.share-pill:hover {
  background: var(--c-share-hover);
}

.share-round {
  display: flex;
  justify-content: center;
}

.share-round button {
  width: 32px;
  height: 32px;
  margin: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--c-white);
  cursor: pointer;
  transition: transform var(--t-fast);
}

.share-round button:hover {
  transform: scale(1.08);
}

.share-round .icon {
  width: 16px;
  height: 16px;
}

.share-round .s-share { background: #3a5795; }
.share-round .s-copy { background: var(--c-share-copy); }
.share-round .s-mail { background: #cb2027; }

/* ---------- Compact list item (sidebars) ---------- */
.mini {
  display: flex;
}

.mini + .mini {
  margin-top: 15px;
}

.mini-thumb {
  flex: none;
  width: 78px;
  padding-right: 10px;
}

.mini-thumb img {
  width: 68px;
}

.mini-body {
  flex: 1 1 auto;
  min-width: 0;
}

.mini-title {
  margin: 0;
  font-size: var(--fs-h5);
  line-height: var(--lh-h5);
  font-weight: 500;
}

/* ---------- Home: welcome box and card groups ---------- */
.welcome {
  margin: 0 0 30px;
  padding: 1px 20px 10px;
}

.welcome h1 {
  margin: 20px 0 10px;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: 600;
}

.welcome-grid {
  display: grid;
  grid-template-columns: 168px auto;
}

.welcome-grid img {
  display: block;
}

.lead {
  margin: 0 0 20px;
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  font-weight: 300;
}

.welcome .lead {
  /* reference declares the invalid value justify-all, so Chrome renders start-aligned text */
  text-align: left;
}

.group {
  margin: 0 1px 20px;
  padding: 10px;
}

.card {
  display: flex;
}

.card + .card {
  margin-top: 15px;
}

.card-thumb {
  flex: none;
  width: 128px;
  padding-right: 10px;
}

.card-thumb img {
  width: 118px;
}

.card-body {
  flex: 1 1 auto;
  min-width: 0;
  text-align: justify;
}

.card-title {
  margin: 0 0 5px;
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: 500;
}

.card-excerpt {
  margin: 0;
}

@media (max-width: 767.98px) {
  .card-excerpt {
    display: none;
  }
}

.ad-wrap {
  margin: 0 10px 10px;
  padding-bottom: 20px;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 280px;
  background: var(--c-ad);
  border: 1px dashed #c9c9c9;
  border-radius: 6px;
  color: var(--c-ad-text);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side-title {
  display: table-cell;
  margin: 8px 0 3px;
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
  text-align: center;
}

.side-list {
  padding-top: 15px;
}

.pager {
  text-align: center;
}

.pager ul {
  display: inline-flex;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.pager button {
  display: block;
  min-width: 43px;
  height: 45px;
  margin-left: -1px;
  padding: 10px 16px;
  border: 1px solid var(--c-pager-border);
  background: var(--c-white);
  color: var(--c-link);
  font: 18px/24px var(--font);
  cursor: pointer;
}

.pager li:first-child button {
  margin-left: 0;
  border-radius: 20px 0 0 20px;
}

.pager li:last-child button {
  border-radius: 0 20px 20px 0;
}

.pager button:hover {
  background: #eeeeee;
}

.pager button[aria-current="page"] {
  position: relative;
  z-index: 1;
  background: var(--c-page-active);
  border-color: var(--c-page-active);
  color: var(--c-white);
}

.pager .icon {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
}

.page-status {
  margin: -10px 0 10px;
  color: var(--c-muted);
  font-size: 12px;
}

/* ---------- Dropdown category panel ---------- */
.cat-panel .label {
  font-size: var(--fs-label);
}

/* ---------- Article header ---------- */
.post-header {
  position: relative;
  z-index: 1;
  margin: -20px 1px 20px;
  padding: 30px 10px 10px;
}

.post-header h1 {
  margin: 0 0 10px;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: 600;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px; /* Phase 4: row gap only applies when the row wraps (≤ 320 px); keeps wrapped pills 24 px-spaced */
  min-height: 25px;
  color: var(--c-muted);
}

.post-meta .stat .icon {
  vertical-align: -2px;
}

.rating {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Phase 4: each heart is a 24 × 24 target (WCAG 2.2 SC 2.5.8); the 16 px icon is unchanged. */
.rating button {
  width: 24px;
  height: 24px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--c-rating-off);
  cursor: pointer;
}

.rating button.is-on {
  color: var(--c-accent-strong);
}

.rating .icon {
  width: 16px;
  height: 16px;
}

.btn-report {
  display: inline-block;
  height: 20px;
  margin-bottom: 3px;
  padding: 3px 5px;
  border: 1px solid var(--c-danger-border);
  border-radius: 10px;
  background: var(--c-danger);
  color: var(--c-white);
  font: 700 12px/13px var(--font);
  cursor: pointer;
}

.lead-desc .lead {
  text-align: justify;
}

.read-more {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-link);
  font: 600 var(--fs-lead) / var(--lh-lead) var(--font);
  cursor: pointer;
}

.read-more:hover {
  text-decoration: underline;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
}

.quick-links a {
  display: block;
  width: 25px;
  height: 25px;
  margin: 0 3px 8px 0;
  border-radius: 30px;
}

.quick-links a img {
  display: block;
  width: 25px;
  height: 25px;
}

.quick-links .to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-link);
  border: 1px solid #2e6da4;
  color: var(--c-white);
}

.quick-links .to-top .icon {
  width: 15px;
  height: 15px;
}

.quick-links a:hover {
  transform: translateY(-1px);
}

/* ---------- Article entries ---------- */
.entries {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.entry-box {
  margin: 0 1px 20px;
  padding: 5px 10px 10px;
  border-top: 5px solid var(--c-accent);
  font-size: var(--fs-entry);
  line-height: var(--lh-entry);
  scroll-margin-top: 0;
}

.entry-head {
  display: grid;
  grid-template-columns: 68px auto;
}

.entry-head img {
  display: block;
  width: 60px;
  height: 60px;
}

.entry-title {
  margin: 0 0 1px;
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
}

.vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  margin-bottom: 2px;
  padding: 1px 5px;
  border: 1px solid var(--c-warning-border);
  border-radius: 10px;
  background: var(--c-accent-strong);
  color: var(--c-white);
  font: 700 12px/18px var(--font);
  cursor: pointer;
}

.vote .icon {
  width: 14px;
  height: 14px;
}

.vote .badge {
  min-width: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  background: var(--c-white);
  color: var(--c-accent-strong);
  font-size: 12px;
  line-height: 12px;
}

/* Pressed: darker fill plus an inset ring, so the state does not depend on a small shade change alone. */
.vote[aria-pressed="true"] {
  background: var(--c-accent-strong-hover);
  box-shadow: inset 0 0 0 2px var(--c-white);
}

.entry-text {
  margin-top: 3px;
}

.entry-text p {
  margin: 0 0 28.8px;
}

.entry-text p:last-child {
  margin-bottom: 0;
}

.entry-media {
  padding: 10px 0;
}

.entry-media figure {
  margin: 0;
}

.entry-media + .entry-media {
  min-height: 20px;
}

.zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.entry-media img {
  width: 100%;
  height: auto;
}

.entry-media figcaption {
  font-style: italic;
}

.ad-inline {
  margin: 10px;
  padding-bottom: 20px;
}

.ad-inline .ad-slot {
  height: 247px;
}

/* ---------- Article footer boxes ---------- */
.post-footer {
  margin: 0 1px 20px;
  padding: 10px;
}

.btn-pill {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--r-pill);
  font: 700 14px/20px var(--font);
  color: var(--c-white);
  cursor: pointer;
}

.btn-pill + .btn-pill {
  margin-left: 8px;
}

.btn-share { background: var(--c-fb); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger-border); }

.btn-pill:hover {
  filter: brightness(0.9);
}

.tags {
  line-height: 25px;
}

.comment-form textarea {
  display: block;
  width: 100%;
  height: 53px;
  margin-bottom: 15px;
  padding: 6px 12px;
  border: 1px solid var(--c-input-border);
  border-radius: var(--r-pill);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  font: 14px/20px var(--font);
  color: var(--c-input-text);
  resize: none;
}

.btn-login {
  position: relative;
  padding-left: 44px;
  background: var(--c-fb);
}

.btn-login .icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 100%;
  padding: 9px;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.comments-title {
  margin: 30px 0 10px;
  font-size: var(--fs-h5);
  line-height: var(--lh-h5);
  font-weight: 500;
}

.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list li {
  padding: 8px 0;
  border-top: 1px solid #e3e3e3;
}

.post-banner {
  padding-top: 40px;
}

.post-banner img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--c-page);
  border-radius: var(--r-thumb);
}

/* ---------- Article sidebars ---------- */
.toc-title {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: var(--lh-h5);
  font-weight: 600;
}

.toc {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.toc li {
  margin: 5px 5px 5px 0;
  padding: 5px 0 5px 5px;
  border-radius: 4px 4px 10px 10px;
  background: var(--c-page);
  transition: background-color var(--t-fast);
}

.toc a {
  display: grid;
  grid-template-columns: 30px auto;
  align-items: center;
  min-height: 40px;
}

.toc a > span {
  align-self: start;
}

.toc img {
  width: 20px;
  height: 20px;
}

.toc li.is-active {
  background: var(--c-toc-active);
}

.toc li.is-active a {
  color: var(--c-green);
}

.toc-foot {
  display: grid;
  grid-template-columns: 88px auto;
}

.toc-foot .share-round {
  margin: auto 10px;
}

.related {
  margin-top: 10px;
}

@media (max-width: 1199.98px) {
  .related {
    max-width: var(--content-max);
    margin: 10px auto 0;
  }
}

.related .ad-slot {
  height: 280px;
}

.related-list {
  margin-top: 20px;
  padding: 0 10px;
}

@media (max-width: 767.98px) {
  .related-list {
    padding: 0 10px;
  }
}

/* ---------- Mobile bottom navigator (article, <1200) ---------- */
.bottom-nav {
  display: none;
}

@media (max-width: 1199.98px) {
  /* keep the last footer line clear of the fixed bottom navigator (reference leaves ~15 px under it) */
  .page-article .footer-legal {
    margin-bottom: 90px;
  }

  /* Keyboard focus never lands underneath the fixed navigator (scrolling only; no layout change). */
  :root:has(> body.page-article) {
    scroll-padding-bottom: 85px;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: grid;
    grid-template-columns: 60px 30px minmax(0, 1fr);
    align-items: center;
    height: 75px;
    padding: 5px 5px 10px 10px;
    background: var(--c-page);
  }
}

/* Phase 4: while the mobile menu is open it partly covered the fixed navigator, leaving slivers of its links
   clickable underneath. The navigator steps aside until the menu closes (Escape / outside tap / link). */
body:has(.main-nav.is-open) .bottom-nav {
  visibility: hidden;
}

/* Phase 4: in very short viewports (≈ 400 % zoom, 320 × 256 CSS px) the fixed header + navigator covered more
   than half of the screen. There the navigator joins the page flow before the footer, and its panel opens
   above it and scrolls with the page. */
@media (max-width: 1199.98px) and (max-height: 320px) {
  .bottom-nav {
    position: relative;
  }

  .bottom-panel {
    position: absolute;
    bottom: 100%;
    max-height: none;
  }

  .page-article .footer-legal {
    margin-bottom: 60px;
  }

  :root:has(> body.page-article) {
    scroll-padding-bottom: 0;
  }
}

.bottom-toggle {
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.bottom-toggle img {
  display: block;
}

.bottom-current-img {
  width: 30px;
  height: 30px;
  margin-left: 6px;
}

.bottom-current-text {
  margin-left: 10px;
  overflow: hidden;
  font-size: 20px;
  line-height: 28.6px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--c-text);
}

.bottom-panel {
  position: fixed;
  left: 10px;
  bottom: 72px;
  z-index: 1001;
  width: 368px;
  max-width: calc(100vw - 20px);
  max-height: min(568px, calc(100vh - 140px));
  overflow: auto;
  padding: 5px 0 15px;
  background: var(--c-white);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--r-box);
  box-shadow: var(--shadow-menu);
}

.bottom-panel[hidden] {
  display: none;
}

.bottom-panel .toc-title {
  margin: 10px;
}

.bottom-panel ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bottom-panel a {
  display: grid;
  grid-template-columns: 30px auto;
  padding: 5px 15px;
}

.bottom-panel a img {
  width: 20px;
  height: 20px;
}

.bottom-panel a[aria-current="true"] {
  color: var(--c-green);
}

/* ---------- Search results ---------- */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1002;
  width: max(100%, 340px);
  margin-top: 4px;
  padding: 6px 0;
  background: var(--c-white);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  box-shadow: var(--shadow-menu);
}

.search-results[hidden] {
  display: none;
}

.search-results p {
  margin: 4px 12px;
  color: var(--c-muted);
  font-size: 12px;
}

.search-results ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-results a {
  display: block;
  padding: 6px 12px;
  line-height: 18px;
}

.search-results a:hover,
.search-results a:focus {
  background: var(--c-page);
  text-decoration: none;
}

@media (max-width: 767.98px) {
  .search-results {
    position: fixed;
    top: 51px;
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* ---------- Tooltip, dialogs, toast ---------- */
.tip {
  position: absolute;
  z-index: 1060;
  max-width: 276px;
  padding: 9px 14px;
  background: var(--c-white);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  font: 14px/20px var(--font);
  color: var(--c-text);
  pointer-events: none;
}

.tip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  margin-left: -10px;
  border: 10px solid transparent;
  border-bottom: 0;
  border-top-color: var(--c-white);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
}

dialog {
  color: var(--c-text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.demo-dialog {
  max-width: min(440px, calc(100vw - 32px));
  padding: 20px 22px;
  border: 0;
  border-radius: var(--r-box);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.demo-dialog h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 24px;
}

.demo-dialog p {
  margin: 0 0 16px;
  line-height: 21px;
}

.demo-dialog .btn-pill {
  background: var(--c-link);
}

.lightbox {
  width: 90vw;
  max-width: 1282px;
  margin-top: 30px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid #e5e5e5;
}

.lightbox-head button {
  border: 0;
  background: transparent;
  font: 700 21px/1 var(--font);
  color: var(--c-muted);
  cursor: pointer;
}

.lightbox-head button:hover {
  color: var(--c-text);
}

.lightbox-body {
  padding: 15px;
}

.lightbox-body img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  cursor: zoom-out;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 2000;
  max-width: calc(100vw - 32px);
  padding: 9px 16px;
  border-radius: var(--r-pill);
  background: rgba(34, 34, 34, 0.92);
  color: var(--c-white);
  transform: translateX(-50%);
  transition: opacity var(--t-fast);
}

.toast[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Phase 2: optional entry modules (rendered by assets/js/article-render.js) ---------- */
.entry-list,
.entry-attrs,
.entry-price,
.entry-contact,
.entry-table,
.entry-actions-lg {
  margin-top: 28.8px;
}

.entry-list-label,
.entry-contact-title {
  margin: 0;
}

.entry-list ul {
  margin: 0;
  padding-left: 26px;
}

.entry-list-pros li::marker {
  color: var(--c-green);
}

.entry-list-cons li::marker {
  color: var(--c-danger);
}

.entry-note {
  color: var(--c-muted);
  font-size: 15px;
  font-style: italic;
}

p.entry-note {
  margin: 0;
}

.entry-attrs,
.entry-contact dl {
  margin-bottom: 0;
}

.entry-attrs > div,
.entry-contact dl > div {
  display: block;
}

.entry-attrs dt,
.entry-contact dt {
  display: inline;
  font-weight: 700;
}

.entry-attrs dd,
.entry-contact dd {
  display: inline;
  margin: 0 0 0 4px;
  overflow-wrap: anywhere;
}

.entry-contact dd ul {
  margin: 0;
  padding-left: 26px;
}

.entry-contact-title {
  font-weight: 700;
  text-decoration: underline;
  text-transform: uppercase;
}

.entry-price {
  margin-bottom: 0;
}

.entry-table {
  overflow-x: auto;
  font-size: 15px;
  line-height: 22px;
}

.entry-table:focus-visible {
  outline-offset: 4px;
}

.entry-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.entry-table caption {
  margin-bottom: 6px;
  color: var(--c-muted);
  font-style: italic;
  text-align: left;
}

.entry-table th,
.entry-table td {
  padding: 8px 10px;
  border: 1px solid var(--c-table-border);
  text-align: left;
  vertical-align: top;
}

.entry-table thead th {
  background: var(--c-navbar);
}

.entry-table tbody tr:nth-child(even) {
  background: var(--c-row-alt);
}

.entry-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 4px;
  vertical-align: top;
}

.entry-actions-lg {
  display: flex;
  margin-left: 0;
  gap: 10px;
}

.act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  color: var(--c-white);
  font-family: var(--font);
  font-weight: 700;
  white-space: nowrap;
}

.act:hover {
  color: var(--c-white);
  text-decoration: none;
  filter: brightness(0.92);
}

.act-warning {
  background: var(--c-accent-strong);
  border-color: var(--c-warning-border);
}

.act-success {
  background: var(--c-green);
  border-color: var(--c-green-hover);
}

.act-sm {
  height: 21px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
}

.act-sm .icon {
  width: 12px;
  height: 12px;
}

.act-lg {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  line-height: 20px;
}

.entry-unranked .entry-box {
  border-top-color: #8a96a3;
}

.bottom-actions {
  position: absolute;
  left: 110px;
  right: 5px;
  top: 6px;
  display: flex;
  gap: 4px;
  overflow: hidden;
}

/* Phase 4: bottom-bar actions are 24 px tall targets (WCAG 2.2 SC 2.5.8); the bar height is unchanged. */
.bottom-actions .act {
  min-height: 24px;
}

.bottom-actions[hidden] {
  display: none;
}

.bottom-nav.has-actions .bottom-current-text {
  align-self: end;
  font-size: 18px;
}

/* ---------- Phase 4: rating state by shape, not colour alone ----------
   Selected hearts are filled; unselected hearts are outlines (also visible under forced colours). */
.rating button:not(.is-on) .icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4px;
}

/* ---------- Phase 4: Windows High Contrast / forced colours ----------
   Forced colours drop backgrounds and box-shadows, which carried several states and boundaries here.
   These rules only apply in forced-colours mode and use system colours (no forced-color-adjust: none). */
@media (forced-colors: active) {
  /* Selected / current states that were background-only. */
  .rating button.is-on {
    color: Highlight;
  }

  .vote[aria-pressed="true"] {
    background: Highlight;
    color: HighlightText;
  }

  .toc li.is-active,
  .bottom-panel a[aria-current="true"],
  .pager button[aria-current="page"] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  /* Borderless buttons get a visible boundary (outline: no size change); focus keeps its own ring. */
  .share-pill:not(:focus-visible),
  .share-round button:not(:focus-visible),
  .bottom-toggle:not(:focus-visible),
  .lightbox-head button:not(:focus-visible) {
    outline: 1px solid ButtonText;
    outline-offset: -1px;
  }
}

/* ---------- Phase 5: v2 document blocks (public prototype pages and editor preview) ----------
   Blocks render inside the existing .entry-text column, in authored order. */
.entry-figure img {
  width: 100%;
  height: auto;
}

.entry-text .entry-subheading {
  margin: 8px 0 14px;
  font-size: 21px;
  line-height: 26px;
  font-weight: 700;
}

.entry-text p a {
  text-decoration: underline;
}

.entry-quote {
  margin: 0 0 28.8px;
  padding: 10px 18px;
  border-left: 4px solid var(--c-accent-strong);
  border-radius: 0 12px 12px 0;
  background: var(--c-navbar);
}

.entry-quote blockquote {
  margin: 0;
}

.entry-quote blockquote p {
  margin: 0 0 10px;
}

.entry-quote blockquote p:last-child {
  margin-bottom: 0;
}

.entry-quote.is-verse blockquote p {
  font-style: italic;
}

.entry-quote figcaption {
  margin-top: 6px;
  color: var(--c-muted);
  font-size: 15px;
}

.entry-figure {
  margin: 0 0 28.8px;
}

.entry-figure figcaption {
  font-size: 15px;
  line-height: 22px;
  font-style: italic;
}

.media-credit {
  display: block;
  color: var(--c-muted);
  font-style: normal;
  font-size: 14px;
}

.media-credit a {
  text-decoration: underline;
}

.entry-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28.8px;
}

.entry-gallery .entry-figure {
  margin: 0;
}

.v2-block .entry-list,
.v2-block .entry-attrs,
.v2-block .entry-price,
.v2-block .entry-contact,
.v2-block .entry-table,
.v2-block .entry-actions-lg {
  margin-bottom: 28.8px;
}

@media (max-width: 767.98px) {
  .entry-gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- P05-R2: Blog / News and Gallery article types (contract v4) ----------
   One article body instead of ranked entries; same box, type scale and figure styles as toplist entries. */
.v3-article-body {
  margin: 0 1px 20px;
  padding: 14px 18px 18px;
  border-top: 5px solid var(--c-link);
  font-size: var(--fs-entry);
  line-height: var(--lh-entry);
}

.v3-article-body p {
  margin: 0 0 28.8px;
}

.v3-article-body .v2-block:last-child > :last-child,
.v3-article-body .v2-block:last-child p:last-child {
  margin-bottom: 0;
}

.v3-article-body p a {
  text-decoration: underline;
}

.v3-article-body .article-heading {
  margin: 10px 0 14px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  scroll-margin-top: 70px;
}

.v3-article-body .article-heading.is-sub {
  font-size: 20px;
  line-height: 26px;
}

.v3-article-body .v2-block .entry-list ol {
  margin: 0;
  padding-left: 26px;
}

.v3-article-body .v2-block .entry-list,
.v3-article-body .v2-block .entry-table {
  margin-bottom: 28.8px;
}

.toc-plain li {
  padding: 5px 8px;
}

.toc-plain a {
  display: block;
  min-height: 0;
  padding: 6px 0;
  line-height: 20px;
}

/* Gallery: ordered grid of zoomable figures (no ranks, no votes). */
.v3-gallery {
  margin: 0 1px 20px;
  padding: 14px 18px 18px;
  border-top: 5px solid var(--c-green);
}

.v3-gallery-title {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 30px;
}

.v3-gallery-count {
  color: var(--c-muted);
  font-size: 16px;
  font-weight: 400;
}

.v3-gallery-hint {
  margin: 0 0 14px;
  color: var(--c-muted);
}

.v3-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.v3-gallery-item .entry-figure {
  margin: 0;
}

.v3-gallery-item .zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  overflow: hidden;
  cursor: zoom-in;
}

.v3-gallery-item .zoom img {
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--t-fast);
}

.v3-gallery-item .zoom:hover img {
  transform: scale(1.03);
}

.v3-gallery-item figcaption {
  margin-top: 6px;
  font-size: 15px;
  line-height: 21px;
}

@media (max-width: 1023.98px) {
  .v3-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479.98px) {
  .v3-gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .v3-article-body,
  .v3-gallery {
    padding: 12px 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v3-gallery-item .zoom img {
    transition: none;
  }
}

/* ---------- P05-R3: article reference list (authored citation sources) ---------- */
.v3-sources {
  margin: 0 1px 20px;
  padding: 14px 18px 18px;
  border-top: 5px solid var(--c-muted);
}

.v3-sources-title {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 28px;
}

.v3-sources-hint {
  margin: 0 0 10px;
  color: var(--c-muted);
}

.v3-sources-list {
  margin: 0;
  padding-left: 26px;
}

.v3-sources-list li {
  margin: 6px 0;
  overflow-wrap: anywhere;
  scroll-margin-top: 70px;
}

.v3-sources-list a {
  text-decoration: underline;
}

.source-meta {
  color: var(--c-muted);
}

.source-refs {
  margin: -16px 0 22px;
  color: var(--c-muted);
  font-size: 15px;
}

.source-ref {
  display: inline-block;
  min-width: 24px;
  min-height: 24px;
  text-align: center;
  text-decoration: underline;
}
