/* ==========================================================================
   Header, footer and long-form furniture.
   Values mirror the React components this theme replaces, so the rebuilt
   pages line up with the design that is live today.
   ========================================================================== */

.rd-container,
.rd-header__inner,
.rd-footer__inner {
  max-width: var(--rd-max);
  margin-inline: auto;
  padding-inline: var(--rd-gutter);
}

/* --- Header -------------------------------------------------------------- */

.rd-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--rd-border);
}

@supports (backdrop-filter: blur(8px)) {
  .rd-header { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px); }
}

.rd-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.rd-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--rd-font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.rd-logo:hover { text-decoration: none; }
.rd-logo__a { color: var(--rd-navy); }
.rd-logo__b { color: var(--rd-blue); }
.rd-logo--dark .rd-logo__a { color: #fff; }
.rd-logo--dark .rd-logo__b { color: var(--rd-sky); }

.rd-header__actions { display: flex; align-items: center; gap: 8px; }

/* --- Desktop nav: dropdowns are hover plus focus-within, no JavaScript --- */

.rd-nav__list,
.rd-nav__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rd-nav__list { display: flex; align-items: center; gap: 4px; }
.rd-nav__item { position: relative; }

.rd-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 68px;
  padding-inline: 12px;
  font-family: var(--rd-font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--rd-navy);
  text-decoration: none;
}
.rd-nav__link:hover { color: var(--rd-blue); text-decoration: none; }

.rd-nav__chevron { transition: transform 0.15s ease; }
.rd-nav__item--has-panel:hover .rd-nav__chevron,
.rd-nav__item--has-panel:focus-within .rd-nav__chevron { transform: rotate(180deg); }

.rd-nav__panel {
  position: absolute;
  left: 0;
  top: 68px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.rd-nav__item--has-panel:hover .rd-nav__panel,
.rd-nav__item--has-panel:focus-within .rd-nav__panel { visibility: visible; opacity: 1; }

.rd-nav__sub {
  width: 260px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--rd-border);
  border-radius: var(--rd-radius-card);
  box-shadow: var(--rd-shadow-card);
}

/* The wider panel is the one whose items carry a description line. */
.rd-nav__sub:has(.rd-nav__subdesc) { width: 360px; }

.rd-nav__sublink {
  display: block;
  padding: 12px;
  border-radius: var(--rd-radius);
  text-decoration: none;
}
.rd-nav__sublink:hover { background: var(--rd-mist); text-decoration: none; }

.rd-nav__sublabel {
  display: block;
  font-family: var(--rd-font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--rd-navy);
}
.rd-nav__subdesc {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--rd-muted);
}

/* --- Burger and mobile panel -------------------------------------------- */

.rd-burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--rd-border);
  border-radius: var(--rd-radius);
  cursor: pointer;
}
.rd-burger__bars { display: block; width: 18px; }
.rd-burger__bars span {
  display: block;
  height: 2px;
  background: var(--rd-navy);
  border-radius: 2px;
}
.rd-burger__bars span + span { margin-top: 4px; }

.rd-mobile {
  border-top: 1px solid var(--rd-border);
  background: #fff;
  padding: 16px var(--rd-gutter) 24px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
}
.rd-mobile__list, .rd-mobile__sub { list-style: none; margin: 0; padding: 0; }
.rd-mobile__item a {
  display: block;
  padding: 12px 0;
  font-family: var(--rd-font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--rd-navy);
  text-decoration: none;
  border-bottom: 1px solid var(--rd-border);
}
.rd-mobile__sub a {
  padding-left: 16px;
  font-family: var(--rd-font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--rd-text);
}
.rd-mobile__cta { width: 100%; margin-top: 20px; }

@media (max-width: 1023px) {
  .rd-nav, .rd-header__cta { display: none; }
  .rd-burger { display: inline-flex; }
}

/* --- Mobile sticky CTA bar, DESIGN.md section 5 ------------------------- */

.rd-cta-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  display: none;
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid var(--rd-border);
}
.rd-cta-bar .rd-btn { width: 100%; }

@media (max-width: 1023px) {
  .rd-cta-bar { display: block; }
  /* Leave room so the bar never covers the end of the page. */
  body { padding-bottom: 84px; }
}

/* --- Footer -------------------------------------------------------------- */

.rd-footer {
  background: var(--rd-navy);
  color: rgba(255, 255, 255, 0.8);
  padding-block: 96px 64px;
}

.rd-footer__grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 768px)  { .rd-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .rd-footer__grid { grid-template-columns: repeat(5, 1fr); gap: 32px; } }

.rd-footer__blurb {
  margin-top: 16px;
  max-width: 20rem;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

.rd-footer__social {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}
.rd-footer__social a {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--rd-radius);
}
.rd-footer__social a:hover { background: rgba(255, 255, 255, 0.1); }

.rd-footer__heading {
  margin: 0 0 16px;
  font-family: var(--rd-font-heading);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}

.rd-footer__links { list-style: none; margin: 0; padding: 0; }
.rd-footer__links li + li { margin-top: 10px; }
.rd-footer__links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}
.rd-footer__links a:hover { color: #fff; text-decoration: underline; }

.rd-footer__legal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}
.rd-footer__legal p { margin: 0; }
.rd-footer__legal a { color: inherit; }
.rd-footer__legal a:hover { color: #fff; }

@media (min-width: 768px) {
  .rd-footer__legal { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* --- Long-form page shell ---------------------------------------------- */

.site-main {
  max-width: var(--rd-max);
  margin-inline: auto;
  padding: 48px var(--rd-gutter) 96px;
}

.site-main .page-header { margin-bottom: 24px; }
.site-main .entry-title { margin: 0; }

/* Body copy is held to 68ch; the furniture around it may run wider. */
.rd-prose { max-width: 68ch; }

/* --- Breadcrumbs -------------------------------------------------------- */

.rd-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  font-size: 14px;
  color: var(--rd-muted);
}
.rd-breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--rd-border); }
.rd-breadcrumbs a { color: var(--rd-muted); }
.rd-breadcrumbs a:hover { color: var(--rd-blue); }
.rd-breadcrumbs [aria-current="page"] { color: var(--rd-navy); font-weight: 500; }

/* --- Table of contents -------------------------------------------------- */

.rd-toc {
  margin: 32px 0;
  padding: 24px 32px;
  background: var(--rd-mist);
  border-radius: var(--rd-radius-card);
}
.rd-toc__heading {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rd-navy);
  margin: 0 0 12px;
}
.rd-toc__list { margin: 0; padding-left: 20px; }
.rd-toc__list li { margin-bottom: 8px; font-size: 16px; }
.rd-toc__list a { color: var(--rd-blue); }

/* Anchors must clear the sticky header when jumped to. */
:where(h2, h3)[id] { scroll-margin-top: 84px; }

/* --- FAQ, author box, related ------------------------------------------ */

.rd-faq { margin-top: 64px; }
.rd-faq > h2 { margin-bottom: 8px; }

.rd-author { margin-top: 64px; display: flex; gap: 24px; }
.rd-author__kicker {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rd-muted-on-mist);
}
.rd-author__name { margin: 0 0 8px; font-size: 1.25rem; }
.rd-author__bio { margin: 0 0 8px; max-width: 60ch; }
.rd-author__meta { margin: 0; font-size: 14px; }

.rd-related { margin-top: 64px; }
.rd-related h2 { margin-bottom: 24px; }

.rd-grid { display: grid; gap: 24px; list-style: none; margin: 0; padding: 0; }
.rd-grid--2 { grid-template-columns: 1fr; }
.rd-grid--3 { grid-template-columns: 1fr; }

@media (min-width: 640px) { .rd-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .rd-grid--3 { grid-template-columns: repeat(3, 1fr); } }

.rd-related .rd-card h3 { font-size: 1.125rem; }
.rd-related .rd-card p { font-size: 14px; margin: 0; }

/* WordPress's own utility, needed by the screen-reader-only spans above. */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
