/*
 * Editorial policy page (resources/views/pages/editorial-policy.blade.php).
 * Builds on about.css: the hero, buttons, wrap and colour tokens come from there.
 */
html {
  scroll-behavior: smooth;
}
.policy-hero {
  padding-bottom: 4.5rem;
}
.policy-hero h1 {
  max-width: 22ch;
}

.policy-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding-top: 3rem;
  padding-bottom: 4.5rem;
}

/* Contents, which stays in view while reading */
.policy-toc {
  position: sticky;
  /* Below the site menu bar, which stays at the top of the screen. */
  top: calc(var(--policy-nav, 68px) + 1.25rem);
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-radius: 16px;
  padding: 1.1rem 1.1rem 0.9rem;
  max-height: calc(100vh - var(--policy-nav, 68px) - 2.5rem);
  overflow-y: auto;
}
.policy-toc__title {
  font-size: 0.72rem !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ab-muted) !important;
  margin-bottom: 0.6rem !important;
}
.about .policy-toc ol {
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 0.1rem;
}
.about .policy-toc li {
  counter-increment: toc;
}
.about .policy-toc a {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--ab-ink);
}
.about .policy-toc a::before {
  content: counter(toc);
  color: var(--ab-muted);
  font-variant-numeric: tabular-nums;
}
.about .policy-toc a {
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.about .policy-toc a:hover {
  background: #f6eeee;
  color: var(--ab-maroon);
}
/* The section being read: gold bar, tint and bold. */
.about .policy-toc a.is-current {
  background: var(--ab-gold-soft);
  color: var(--ab-maroon);
  font-weight: 700;
}
.about .policy-toc a.is-current::before {
  color: var(--ab-maroon);
}
.about .policy-toc a.is-current::after {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--ab-gold);
}

/* Reading column */
.policy-body {
  display: grid;
  gap: 2.75rem;
  max-width: 46rem;
  min-width: 0;
}
.policy-body p,
.policy-body li,
.policy-body dd {
  font-size: 1rem;
  line-height: 1.75;
  color: #3a2a2d;
}
.policy-body p + p {
  margin-top: 1rem;
}
.policy-section {
  scroll-margin-top: calc(var(--policy-nav, 68px) + 1.25rem);
}
.policy-section h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.policy-section h2 span {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: var(--ab-gold-soft);
  color: var(--ab-maroon);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.policy-section h3 {
  font-size: 1.1rem;
  margin: 1.6rem 0 0.5rem;
}
/* Links inside the policy text, not the buttons. */
.policy-body a:not(.about-btn) {
  color: var(--ab-maroon) !important;
  text-decoration: underline;
}

/* At a glance */
.policy-glance {
  background: var(--ab-maroon);
  background-image: radial-gradient(ellipse at 100% 0%, rgba(224, 165, 38, 0.22), transparent 60%);
  color: #ffffff;
  border-radius: 20px;
  padding: 1.6rem 1.8rem;
}
.policy-glance h2 {
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
  color: var(--ab-gold);
}
.about .policy-glance ul {
  display: grid;
  gap: 0.6rem;
}
.about .policy-glance li {
  position: relative;
  padding-left: 1.6rem;
  color: #f1dede;
  font-size: 0.97rem;
  line-height: 1.55;
}
.about .policy-glance li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--ab-gold);
}
.policy-glance b {
  color: #ffffff;
}

/* Numbered lists */
.about .policy-list {
  list-style: none;
  counter-reset: item;
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}
.about .policy-list li {
  counter-increment: item;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.6rem;
  line-height: 1.65;
}
.about .policy-list li::before {
  content: counter(item);
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: #f6eeee;
  color: var(--ab-maroon);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* The review steps */
.about .policy-steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.about .policy-steps li {
  counter-increment: step;
  display: grid;
  gap: 0.25rem;
  align-content: start;
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-top: 3px solid var(--ab-gold);
  border-radius: 12px;
  padding: 0.8rem;
}
.about .policy-steps li::before {
  content: "Step " counter(step);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ab-muted);
}
.policy-steps b {
  font-size: 0.9rem;
  line-height: 1.3;
}
.about .policy-steps span {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ab-muted);
}

/* Cards and definition lists */
.policy-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.policy-cards > div {
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-radius: 14px;
  padding: 1.1rem;
}
.policy-cards h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--ab-maroon);
}
.policy-cards p {
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
}
.policy-terms {
  margin: 1.2rem 0 0;
  border-top: 1px solid var(--ab-line);
}
.policy-terms dt {
  font-weight: 700;
  padding-top: 1rem;
  color: var(--ab-ink);
}
.policy-terms dd {
  margin: 0.25rem 0 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ab-line);
}

/* Roles, as expandable panels */
.policy-role {
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-radius: 14px;
  margin-top: 0.7rem;
}
.policy-role summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 3rem 1rem 1.2rem;
  font-weight: 700;
  position: relative;
}
.policy-role summary::-webkit-details-marker {
  display: none;
}
.policy-role summary::after {
  content: "+";
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--ab-maroon);
}
.policy-role[open] summary::after {
  content: "−";
}
.policy-role summary:focus-visible {
  outline: 3px solid var(--ab-gold);
  outline-offset: 2px;
  border-radius: 14px;
}
.about .policy-role .policy-list {
  margin: 0;
  padding: 0 1.2rem 1.2rem;
}

.policy-cta {
  margin-top: 0.5rem;
}

@media (max-width: 1024px) {
  .policy-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .policy-toc {
    position: static;
    max-height: none;
  }
  .about .policy-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .policy-body {
    max-width: none;
  }
  .about .policy-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .policy-layout {
    padding-top: 2rem;
  }
  .about .policy-toc ol {
    grid-template-columns: minmax(0, 1fr);
  }
  .about .policy-steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .policy-glance {
    padding: 1.3rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
