/* =========================================================================
   LobbyBrand — Policy page styles
   -------------------------------------------------------------------------
   SCOPE: every rule below is scoped to `.lb-policy`. Nothing here changes the
   appearance of any other page on the site.

   FILE:   assets/css/policy.css  (standalone; site.css is NOT modified)
   USED BY: templates/page-policy.html only

   Tokens come from the existing theme custom properties declared in
   assets/css/site.css (--lb-ink-*, --lb-stone-*, --lb-graphite-*, --lb-brass-*,
   --lb-border, --lb-container, --lb-wide, --lb-gutter, --lb-mono). No new
   colour system is introduced.
   ========================================================================= */

.lb-policy .lb-policy__masthead {
  padding-block: clamp(32px, 4vw, 56px) clamp(28px, 3.5vw, 44px);
  border-bottom: 1px solid var(--lb-border);
  margin-bottom: clamp(32px, 4vw, 56px);
}

/* A single hairline "brass" rule under the title — the only decoration. */
.lb-policy .lb-policy__masthead::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin-top: clamp(20px, 2.4vw, 28px);
  background: var(--lb-brass-600);
}

/* WordPress renders .wp-block-post-title at 34px by default. On a reading page
   that reads as a weak page title, so the policy title uses the theme's own
   H1 scale instead. It stays below the 76px marketing-page titles on
   /about/ and /contact/, which are not reading pages. */
.lb-policy .lb-policy__title {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(32px, 4.2vw, 54px);
  color: var(--lb-ink-950);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

/* ---------------------------------------------------------------- layout */

.lb-policy .lb-policy__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 3.5vw, 56px);
  align-items: start;
}

@media (min-width: 1024px) {
  .lb-policy .lb-policy__layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------ TOC */

.lb-policy .lb-policy__aside {
  min-width: 0;
}

@media (min-width: 1024px) {
  /* Sits below the 80px sticky site header and never overlaps it. */
  .lb-policy .lb-policy__aside {
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 128px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
  }
}

.lb-policy .lb-policy__toc {
  border: 1px solid var(--lb-border);
  background: #ffffff;
  border-radius: 4px;
}

.lb-policy .lb-policy__toc > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-family: var(--lb-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--lb-graphite-600);
  border-bottom: 1px solid var(--lb-border);
}

.lb-policy .lb-policy__toc > summary::-webkit-details-marker {
  display: none;
}

.lb-policy .lb-policy__toc > summary:hover {
  color: var(--lb-brass-600);
}

/* Disclosure arrow only where collapsing is actually possible (mobile). */
@media (min-width: 1024px) {
  .lb-policy .lb-policy__toc > summary::after {
    content: "";
  }
}

@media (max-width: 1023px) {
  .lb-policy .lb-policy__toc > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
  }

  .lb-policy .lb-policy__toc > summary::after {
    content: "＋";
    font-family: var(--lb-mono);
    color: var(--lb-brass-600);
  }

  .lb-policy .lb-policy__toc[open] > summary::after {
    content: "－";
  }
}

.lb-policy .lb-policy__toc-list {
  margin: 0;
  padding: 6px 0;
  list-style: none;
  counter-reset: lb-policy-toc;
}

.lb-policy .lb-policy__toc-item {
  margin: 0;
}

.lb-policy .lb-policy__toc-link {
  display: block;
  padding: 7px 16px;
  min-height: 36px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--lb-graphite-600);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.lb-policy .lb-policy__toc-link:hover,
.lb-policy .lb-policy__toc-link:focus-visible {
  color: var(--lb-ink-950);
  border-left-color: var(--lb-brass-600);
}

.lb-policy .lb-policy__toc-empty {
  padding: 16px;
  font-size: 14px;
  color: var(--lb-graphite-600);
}

/* --------------------------------------------------------------- content */

/* Reading measure is applied to the prose blocks, not to the column, so that
   wide policy tables (notably the eight-stage cancellation table) can use the
   full available width instead of being squeezed into a 74ch box.

   WordPress wraps post-content in an inner `.wp-block-post-content` element,
   so the measure is set on that wrapper's block children. */
.lb-policy .lb-policy__content {
  min-width: 0;
}

.lb-policy .lb-policy__content .wp-block-post-content > p,
.lb-policy .lb-policy__content .wp-block-post-content > ul,
.lb-policy .lb-policy__content .wp-block-post-content > ol,
.lb-policy .lb-policy__content .wp-block-post-content > h2,
.lb-policy .lb-policy__content .wp-block-post-content > h3,
.lb-policy .lb-policy__content .wp-block-post-content > h4,
.lb-policy .lb-policy__content .wp-block-post-content > .lb-policy__note,
.lb-policy .lb-policy__content .wp-block-post-content > .lb-policy__draft-banner {
  max-width: 74ch;
}

/* Tables keep the full column width. */
.lb-policy .lb-policy__content .wp-block-post-content > .wp-block-table,
.lb-policy .lb-policy__content figure.wp-block-table {
  max-width: none;
}

.lb-policy .lb-policy__content > * {
  margin-block: 0 1.15em;
}

.lb-policy .lb-policy__content h2 {
  font-size: clamp(23px, 2.4vw, 28px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--lb-ink-950);
  margin-top: 2.1em;
  margin-bottom: 0.6em;
  scroll-margin-top: 104px;
  border-top: 1px solid var(--lb-border);
  padding-top: 1.15em;
}

.lb-policy .lb-policy__content h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.lb-policy .lb-policy__content h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 14px;
  background: var(--lb-brass-600);
}

.lb-policy .lb-policy__content h3 {
  font-size: clamp(18px, 1.8vw, 20px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--lb-ink-900);
  margin-top: 1.7em;
  margin-bottom: 0.5em;
  scroll-margin-top: 104px;
}

.lb-policy .lb-policy__content h4 {
  font-family: var(--lb-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lb-graphite-600);
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}

.lb-policy .lb-policy__content p {
  color: var(--lb-ink-800);
  line-height: 1.75;
}

.lb-policy .lb-policy__content strong {
  color: var(--lb-ink-950);
  font-weight: 600;
}

.lb-policy .lb-policy__content a {
  color: var(--lb-ink-950);
  text-decoration: underline;
  text-decoration-color: var(--lb-brass-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.lb-policy .lb-policy__content a:hover {
  color: var(--lb-brass-600);
}

.lb-policy .lb-policy__content ul,
.lb-policy .lb-policy__content ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
  color: var(--lb-ink-800);
  line-height: 1.75;
}

.lb-policy .lb-policy__content li {
  margin-bottom: 0.5em;
}

.lb-policy .lb-policy__content li > ul,
.lb-policy .lb-policy__content li > ol {
  margin-top: 0.5em;
  margin-bottom: 0;
}

.lb-policy .lb-policy__content hr {
  border: 0;
  border-top: 1px solid var(--lb-border);
  margin-block: 2.4em;
}

/* ---------------------------------------------------------- note blocks */
/* Used for the "terms being finalised" note and for quoted policy text. */

.lb-policy .lb-policy__note {
  margin: 0 0 1.6em;
  padding: 16px 18px;
  background: var(--lb-stone-100);
  border: 0;
  border-left: 2px solid var(--lb-brass-600);
  border-radius: 0 3px 3px 0;
}

.lb-policy .lb-policy__note p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--lb-ink-800);
}

.lb-policy .lb-policy__note p + p {
  margin-top: 0.7em;
}

.lb-policy .lb-policy__note strong {
  color: var(--lb-ink-950);
}

/* Last-updated line placed directly under the policy title. */
.lb-policy .lb-policy__stamp {
  font-family: var(--lb-mono);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--lb-graphite-600);
}

/* Internal review banner — drafts only, never rendered on published pages. */
.lb-policy .lb-policy__draft-banner {
  margin: 0 0 1.8em;
  padding: 14px 18px;
  border: 1px dashed var(--lb-brass-600);
  border-radius: 3px;
  background: #fdfaf5;
}

.lb-policy .lb-policy__draft-banner p {
  margin: 0;
  font-family: var(--lb-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lb-brass-600);
  line-height: 1.6;
}

/* --------------------------------------------------------------- tables */

.lb-policy .lb-policy__content table {
  /* Scroll container: keeps wide policy tables inside the viewport on mobile
     without squeezing the columns or dropping any rows. */
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 0 0 1.6em;
  font-size: 15px;
  line-height: 1.6;
}

.lb-policy .lb-policy__content table thead,
.lb-policy .lb-policy__content table tbody,
.lb-policy .lb-policy__content table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.lb-policy .lb-policy__content th,
.lb-policy .lb-policy__content td {
  display: table-cell;
  vertical-align: top;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--lb-border);
}

.lb-policy .lb-policy__content th {
  background: var(--lb-ink-900);
  color: #ffffff;
  font-family: var(--lb-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.lb-policy .lb-policy__content tbody tr:nth-child(even) {
  background: rgba(16, 23, 29, 0.025);
}

.lb-policy .lb-policy__content td {
  color: var(--lb-ink-800);
}

/* Numeric / stage-number column stays narrow. */
.lb-policy .lb-policy__content td:first-child,
.lb-policy .lb-policy__content th:first-child {
  width: 68px;
}

/* Last updated + contact block at the foot of a policy. */
.lb-policy .lb-policy__content .lb-policy__contact {
  margin-top: 2.4em;
  padding-top: 1.4em;
  border-top: 1px solid var(--lb-border);
  font-size: 15px;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1023px) {
  /* the prose measure relaxes on tablet and phone */
  .lb-policy .lb-policy__content .wp-block-post-content > p,
  .lb-policy .lb-policy__content .wp-block-post-content > ul,
  .lb-policy .lb-policy__content .wp-block-post-content > ol,
  .lb-policy .lb-policy__content .wp-block-post-content > .lb-policy__note,
  .lb-policy .lb-policy__content .wp-block-post-content > .lb-policy__draft-banner {
    max-width: none;
  }

  /* Anchor offsets must clear the smaller sticky header on mobile. */
  .lb-policy .lb-policy__content h2,
  .lb-policy .lb-policy__content h3 {
    scroll-margin-top: 84px;
  }

  .lb-policy .lb-policy__content table {
    font-size: 14.5px;
  }

  .lb-policy .lb-policy__content th,
  .lb-policy .lb-policy__content td {
    padding: 10px 12px;
  }
}

/* Mobile card layout for policy tables.
   The eight-stage cancellation and refund tables are four columns wide; as a
   table they squeeze each cell to a few characters on a phone. Below 720px
   each row becomes a stacked card and the column heading is repeated above
   each value via data-label.

   No wording is altered and no row is dropped — the same eight stages are
   present, just reflowed. */

@media (max-width: 720px) {
  .lb-policy .lb-policy__content .wp-block-table {
    margin: 0 0 1.4em;
  }

  .lb-policy .lb-policy__content table,
  .lb-policy .lb-policy__content table tbody,
  .lb-policy .lb-policy__content table tr,
  .lb-policy .lb-policy__content table td {
    display: block;
    width: auto;
    max-width: 100%;
  }

  .lb-policy .lb-policy__content table thead {
    display: none;
  }

  .lb-policy .lb-policy__content table tbody tr {
    border: 1px solid var(--lb-border);
    border-left: 2px solid var(--lb-brass-600);
    border-radius: 0 3px 3px 0;
    background: #ffffff;
    padding: 14px 16px;
    margin-bottom: 12px;
  }

  .lb-policy .lb-policy__content table tbody tr:nth-child(even) {
    background: #ffffff;
  }

  .lb-policy .lb-policy__content table td,
  .lb-policy .lb-policy__content table td:first-child {
    padding: 0;
    border: 0;
  }

  /* Row number badge. */
  .lb-policy .lb-policy__content table td:first-child {
    font-family: var(--lb-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lb-brass-600);
    margin-bottom: 8px;
  }

  .lb-policy .lb-policy__content table td:first-child::before {
    content: none;
  }

  /* Field label above each value. */
  .lb-policy .lb-policy__content table td + td {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--lb-border);
  }

  .lb-policy .lb-policy__content table td + td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--lb-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lb-graphite-600);
    margin-bottom: 5px;
  }
}

@media (max-width: 480px) {
  .lb-policy .lb-policy__masthead {
    padding-block: 32px 24px;
  }

  .lb-policy .lb-policy__content p,
  .lb-policy .lb-policy__content li {
    line-height: 1.7;
  }

  .lb-policy .lb-policy__content th,
  .lb-policy .lb-policy__content td {
    padding: 9px 10px;
  }

  .lb-policy .lb-policy__content table tbody tr {
    padding: 12px 13px;
  }
}

@media print {
  .lb-policy .lb-policy__aside {
    display: none;
  }

  .lb-policy .lb-policy__content {
    max-width: none;
  }
}
