/*
 * OKC Reef - Reef Guide System
 *
 * Editorial rhythm only. This stylesheet deliberately declares no colours,
 * no font families and no font sizes in absolute units. Everything visual
 * inherits from the active theme, so the approved OKC Reef design stays in
 * charge. Overridable variables are declared on .okcr-guide.
 */

.okcr-guide {
  --okcr-measure: 68ch;
  --okcr-gap: 1.5rem;
  --okcr-gap-lg: 3rem;
  --okcr-rule: color-mix(in srgb, currentColor 15%, transparent);
}

.okcr-guide > * {
  max-width: var(--okcr-measure);
  margin-left: auto;
  margin-right: auto;
}

/* Breadcrumbs */
.okcr-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
  margin: 0 0 var(--okcr-gap);
  padding: 0;
  font-size: 0.875em;
}

.okcr-breadcrumbs li + li::before {
  content: "/";
  opacity: 0.45;
  margin-right: 0.5em;
}

.okcr-breadcrumbs [aria-current="page"] {
  opacity: 0.7;
}

/* Header */
.okcr-guide__header {
  margin-bottom: var(--okcr-gap-lg);
}

.okcr-guide__standfirst {
  font-size: 1.15em;
  line-height: 1.5;
  opacity: 0.85;
  max-width: 60ch;
}

.okcr-guide__verified {
  font-size: 0.8125em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: var(--okcr-gap);
}

/* Hero and inline figures */
.okcr-guide__hero,
.okcr-guide figure {
  margin: var(--okcr-gap-lg) auto;
}

.okcr-guide__hero img,
.okcr-guide figure img {
  display: block;
  width: 100%;
  height: auto;
}

.okcr-guide figcaption {
  font-size: 0.875em;
  opacity: 0.7;
  margin-top: 0.65em;
}

/* Full-bleed figures where the theme container allows it */
.okcr-guide .okcr-figure--wide {
  max-width: min(100%, 1100px);
}

/* Table of contents */
.okcr-toc {
  border-top: 1px solid var(--okcr-rule);
  border-bottom: 1px solid var(--okcr-rule);
  padding: var(--okcr-gap) 0;
  margin-bottom: var(--okcr-gap-lg);
}

.okcr-toc__title {
  font-size: 0.8125em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0 0 0.75em;
}

.okcr-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4em;
}

.okcr-toc__list a[aria-current="true"] {
  font-weight: 600;
}

/* Body */
.okcr-guide__body > * + * {
  margin-top: 1.1em;
}

.okcr-guide__body h2 {
  margin-top: var(--okcr-gap-lg);
  scroll-margin-top: 5rem;
}

.okcr-guide__body h3 {
  margin-top: var(--okcr-gap);
}

.okcr-guide__body ul,
.okcr-guide__body ol {
  padding-left: 1.35em;
}

.okcr-guide__body li + li {
  margin-top: 0.4em;
}

/* Pending internal links keep the prose intact with no hyperlink */
.okcr-link--pending {
  color: inherit;
  text-decoration: none;
}

/* Comparison tables */
.okcr-guide__body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--okcr-gap-lg) 0;
  font-size: 0.9375em;
}

.okcr-guide__body th,
.okcr-guide__body td {
  text-align: left;
  padding: 0.7em 0.85em;
  border-bottom: 1px solid var(--okcr-rule);
  vertical-align: top;
}

.okcr-guide__body thead th {
  border-bottom-width: 2px;
  font-weight: 600;
}

.okcr-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Callouts */
.okcr-callout {
  border-left: 3px solid var(--okcr-rule);
  padding: var(--okcr-gap) 0 var(--okcr-gap) var(--okcr-gap);
  margin: var(--okcr-gap-lg) auto;
}

.okcr-callout__label {
  font-size: 0.75em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0 0 0.5em;
}

.okcr-callout__body > * + * {
  margin-top: 0.8em;
}

/* Service connection */
.okcr-guide__cta {
  margin: var(--okcr-gap-lg) auto;
}

/* Related guides */
.okcr-related {
  border-top: 1px solid var(--okcr-rule);
  padding-top: var(--okcr-gap-lg);
  margin-top: var(--okcr-gap-lg);
}

.okcr-related__title,
.okcr-sources__title {
  font-size: 0.8125em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0 0 var(--okcr-gap);
}

.okcr-related__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9em;
}

.okcr-related__list a {
  display: block;
}

.okcr-related__name {
  display: block;
  font-weight: 600;
}

.okcr-related__desc {
  display: block;
  font-size: 0.9375em;
  opacity: 0.75;
  margin-top: 0.2em;
}

/* Hub variant shows related guides in two columns on wider screens */
.okcr-guide--hub .okcr-related__list {
  gap: 1.2em;
}

@media (min-width: 48em) {
  .okcr-guide--hub .okcr-related__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Sources */
.okcr-sources {
  border-top: 1px solid var(--okcr-rule);
  padding-top: var(--okcr-gap-lg);
  margin-top: var(--okcr-gap-lg);
}

.okcr-sources__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7em;
  font-size: 0.9375em;
}

.okcr-sources__detail {
  display: block;
  opacity: 0.75;
  margin-top: 0.15em;
}

@media (max-width: 47.99em) {
  .okcr-guide {
    --okcr-gap-lg: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Sections -----------------------------------------------------------------
 * Structure only. Column proportions, spacing and colour are supplied by the
 * active theme; without a theme the layout stacks in a readable order.
 */

.okcr-section {
  margin-block: var(--okcr-gap-lg);
}

.okcr-section__text > * + * {
  margin-top: 1.1em;
}

.okcr-section__visual {
  margin: var(--okcr-gap) 0 0;
}

.okcr-section__visual img {
  display: block;
  width: 100%;
  height: auto;
}

/* Diagrams, maps and data visuals keep their own proportions. */
.okcr-section__visual[data-visual-type="diagram"] img,
.okcr-section__visual[data-visual-type="map"] img,
.okcr-section__visual[data-visual-type="data"] img,
.okcr-guide__hero[data-visual-type="diagram"] img,
.okcr-guide__hero[data-visual-type="map"] img,
.okcr-guide__hero[data-visual-type="data"] img {
  object-fit: contain;
  height: auto;
}
