/* =========================================================
   HFDXARC Compact Spacing + Natural Typography v1.4.3
   Final public-theme override.

   - Keeps the tighter site-wide spacing introduced in v1.4.1.
   - Preserves the capitalisation entered in WordPress posts and pages.
   - Displays only the main menu in lowercase.
   - Keeps the club identity and callsigns uppercase.
   - Brightens site, post and widget headings on the dark theme.
   ========================================================= */

:root {
  --hfdxarc-page-gap-top: clamp(8px, 0.8vw, 14px);
  --hfdxarc-page-gap-bottom: clamp(16px, 1.5vw, 28px);
  --hfdxarc-heading-white: #f8fbff;
  --hfdxarc-heading-gold: #ffe36b;
  --hfdxarc-header-gold: #ffe45c;
}

/* Compact the global gap below the menu and above the footer. */
body #wrap,
body #wrap.container {
  padding-top: var(--hfdxarc-page-gap-top) !important;
  padding-bottom: var(--hfdxarc-page-gap-bottom) !important;
}

body #content,
body #content.primary,
body #content.fullwidth {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body #content > article,
body #content > .post,
body #content > .page,
body #content > .type-page,
body #content > .type-post {
  margin-top: 0 !important;
  margin-bottom: clamp(10px, 1vw, 18px) !important;
}

body #footer-wrap {
  margin-top: 0 !important;
}

body #footer {
  padding-top: clamp(12px, 1.1vw, 20px) !important;
  padding-bottom: clamp(12px, 1.1vw, 20px) !important;
}

/* Reduce the desktop site header without changing its three-column layout. */
@media (min-width: 981px) {
  body .hfdxarc-site-identity {
    min-height: 88px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    gap: clamp(12px, 1.7vw, 30px) !important;
  }

  body .hfdxarc-rsgb-affiliation-logo {
    width: 50px !important;
    max-width: 50px !important;
  }

  body .hfdxarc-rsgb-affiliation-copy {
    font-size: 13px !important;
  }

  body .hfdxarc-club-header-logo {
    width: 72px !important;
    max-width: 72px !important;
    height: 72px !important;
  }

  body #logo .site-title.hfdxarc-brand-title,
  body .hfdxarc-brand-title {
    font-size: clamp(22px, 1.72vw, 30px) !important;
  }

  body .hfdxarc-brand-callsigns {
    font-size: clamp(18px, 1.28vw, 24px) !important;
  }

  body #logo .site-description.hfdxarc-brand-meta,
  body .hfdxarc-brand-meta {
    font-size: clamp(10px, 0.72vw, 13px) !important;
  }

  body #mainnav,
  body #mainnav-menu,
  body #mainnav-menu > li > a {
    min-height: 42px !important;
  }

  body #mainnav-menu > li > a {
    padding-left: clamp(13px, 1.15vw, 19px) !important;
    padding-right: clamp(13px, 1.15vw, 19px) !important;
    font-size: 13px !important;
  }
}

/* Keep the compact spacing on tablets and phones. */
@media (max-width: 980px) {
  body .hfdxarc-site-identity {
    min-height: 70px !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }

  body #mainnav {
    min-height: 42px !important;
    padding-bottom: 7px !important;
  }

  body #mainnav-icon {
    min-height: 40px !important;
  }
}

/* =========================================================
   NATURAL CAPITALISATION
   Do not rewrite the case of post, page, widget, form or plugin text.
   The browser now displays the content exactly as entered in WordPress.
   ========================================================= */

html body #content,
html body #content *,
html body #sidebar,
html body #sidebar *,
html body #footer-wrap,
html body #footer-wrap *,
html body dialog,
html body dialog *,
html body [role="dialog"],
html body [role="dialog"] *,
html body [role="alert"],
html body [role="status"],
html body [class*="modal"],
html body [class*="modal"] *,
html body [class*="popup"],
html body [class*="popup"] *,
html body button,
html body input,
html body select,
html body option,
html body optgroup,
html body textarea,
html body label,
html body legend,
html body table,
html body caption,
html body th,
html body td,
html body svg text,
html body svg tspan {
  text-transform: none !important;
}

html body input::placeholder,
html body textarea::placeholder {
  text-transform: none !important;
}

/* The menu remains lowercase, as requested. */
html body #mainnav-menu a,
html body #mainnav-icon,
html body #mainnav .hfdxarc-submenu-toggle {
  text-transform: lowercase !important;
}

/* Club identity remains conventional uppercase. */
html body .hfdxarc-rsgb-affiliation-copy,
html body #logo .site-title.hfdxarc-brand-title,
html body .hfdxarc-brand-title,
html body .hfdxarc-brand-callsigns,
html body #logo .site-description.hfdxarc-brand-meta,
html body .hfdxarc-brand-meta,
html body .hfdxarc-footer-callsigns {
  text-transform: uppercase !important;
}

/* Callsign-like elements elsewhere are no longer forced either way. */
html body .hfdx-callsign,
html body [class*="callsign"] {
  text-transform: none !important;
}

/* The dedicated header callsign must override the generic callsign rule above. */
html body .hfdxarc-brand-callsigns {
  text-transform: uppercase !important;
}

/* =========================================================
   HEADER AND TITLE CONTRAST
   Fix dark text appearing against dark navy post and widget panels.
   ========================================================= */

html body #logo .site-title.hfdxarc-brand-title,
html body .hfdxarc-brand-title,
html body .hfdxarc-brand-link,
html body .hfdxarc-rsgb-affiliation,
html body .hfdxarc-rsgb-affiliation-copy {
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.92) !important;
}

html body .hfdxarc-brand-callsigns {
  color: var(--hfdxarc-header-gold) !important;
  opacity: 1 !important;
  text-shadow:
    0 0 14px rgba(255, 228, 92, 0.25),
    0 2px 9px rgba(0, 0, 0, 0.92) !important;
}

html body #logo .site-description.hfdxarc-brand-meta,
html body .hfdxarc-brand-meta {
  color: #f3f8ff !important;
  opacity: 1 !important;
}

/* Post and page title wrappers, spans and links all need the same bright colour. */
html body .entry-title,
html body .entry-title span,
html body .entry-title a,
html body .page-title,
html body .page-title span,
html body .page-title a,
html body .post-title,
html body .post-title span,
html body .post-title a,
html body .archive-title,
html body .archive-title span,
html body .archive-title a,
html body .search-title,
html body .search-title span,
html body .search-title a {
  color: var(--hfdxarc-heading-white) !important;
  opacity: 1 !important;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.72) !important;
}

html body .post-title a:hover,
html body .entry-title a:hover,
html body .page-title a:hover {
  color: #ffffff !important;
}

/* Preserve entered case and improve contrast for normal article headings. */
html body #content h1,
html body #content h1 *,
html body #content h2,
html body #content h2 *,
html body #content h3,
html body #content h3 *,
html body #content h4,
html body #content h4 *,
html body #content h5,
html body #content h5 *,
html body #content h6,
html body #content h6 * {
  text-transform: none !important;
  opacity: 1 !important;
}

html body #content h1,
html body #content h1 * {
  color: var(--hfdxarc-heading-white) !important;
}

html body #content h2,
html body #content h2 *,
html body #content h3,
html body #content h3 * {
  color: var(--hfdxarc-heading-gold) !important;
}

html body #content h4,
html body #content h4 *,
html body #content h5,
html body #content h5 *,
html body #content h6,
html body #content h6 * {
  color: #edf5ff !important;
}

/* Sidebar headers were also too subdued on the navy cards. */
html body #sidebar .widget-title,
html body #sidebar .widgettitle,
html body .sidebar .widget-title,
html body .sidebar .widgettitle,
html body #sidebar .widget-title *,
html body #sidebar .widgettitle * {
  color: #ffffff !important;
  opacity: 1 !important;
  text-transform: none !important;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.68) !important;
}

/* Page titles were oversized in the earlier global unifier. */
body .entry-title,
body .page-title,
body .post-title,
body #content h1 {
  font-size: clamp(1.65rem, 2.35vw, 3.25rem) !important;
  line-height: 1.04 !important;
  margin-bottom: clamp(10px, 0.9vw, 14px) !important;
}

body #content h2 {
  font-size: clamp(1.35rem, 1.65vw, 2.15rem) !important;
}

body #content h3 {
  font-size: clamp(1.08rem, 1.2vw, 1.45rem) !important;
}

/* Footer metadata for the theme release. */
body .hfdxarc-footer-version {
  display: block !important;
  margin-top: 4px !important;
  color: rgba(227, 237, 248, 0.68) !important;
  font-size: 0.74rem !important;
  line-height: 1.35 !important;
  text-align: center !important;
  text-transform: none !important;
}
