/*
 * RefineX One Page | Front-end styles
 * Neutral working visual system pending approval of final brand assets.
 * The WordPress theme's metadata remains in the root style.css file.
 */

:root {
  color-scheme: light;
  --rx-ink: #1e252c;
  --rx-muted: #49535d;
  --rx-background: #f7f8f9;
  --rx-surface: #ffffff;
  --rx-surface-alt: #eef1f3;
  --rx-border: #cbd2d7;
  --rx-action: #27343f;
  --rx-action-hover: #131d26;
  --rx-focus: #255db1;
  --rx-radius: 0.75rem;
  --rx-shadow: 0 0.75rem 2rem rgb(20 30 40 / 7%);
  --rx-content-width: 72rem;
  --rx-header-offset: 7rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--rx-header-offset);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--rx-background);
  color: var(--rx-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

figure {
  margin-inline: 0;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  max-width: 70ch;
}

a {
  color: var(--rx-action);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--rx-action-hover);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
[role="button"] {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--rx-focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Visually hidden text stays available to assistive technology. */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 1000;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.6rem 0.9rem;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--rx-surface);
  color: var(--rx-ink);
  border: 2px solid var(--rx-focus);
  border-radius: 0.4rem;
}

.section-container,
.site-header__inner,
.site-footer__inner {
  width: min(100% - 2.5rem, var(--rx-content-width));
  margin-inline: auto;
}

/* Shared site header: navigation remains available if JavaScript is off. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(255 255 255 / 96%);
  border-bottom: 1px solid var(--rx-border);
  box-shadow: 0 0.15rem 0.8rem rgb(20 30 40 / 5%);
}

body.admin-bar .site-header {
  top: 32px;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 2rem;
  row-gap: 0.75rem;
  min-height: 5.25rem;
  padding-block: 0.85rem;
}

.site-branding {
  flex: 0 1 auto;
  min-width: 0;
}

.site-title {
  display: inline-block;
  color: var(--rx-ink);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 750;
  line-height: 1.25;
  text-decoration: none;
}

.site-branding .custom-logo-link {
  display: inline-flex;
  align-items: center;
  max-width: 14rem;
}

.site-branding .custom-logo {
  display: block;
  width: auto;
  max-height: 3.5rem;
  object-fit: contain;
}

.site-header__navigation {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.primary-navigation {
  max-width: 100%;
}

.primary-menu,
.footer-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu a {
  display: inline-block;
  padding: 0.5rem 0.55rem;
  border-radius: 0.35rem;
  color: var(--rx-ink);
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
}

.primary-menu a:hover,
.primary-menu a:focus-visible,
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
  background: var(--rx-surface-alt);
  color: var(--rx-action);
}

.menu-toggle {
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--rx-border);
  border-radius: 0.45rem;
  background: var(--rx-surface);
  color: var(--rx-ink);
  font-weight: 650;
}

/* Section layout: individual PHP files own copy and anchor IDs. */
.site-main {
  display: block;
  min-height: 45vh;
}

.site-main--front-page > section {
  padding-block: clamp(3.25rem, 7vw, 6.5rem);
  scroll-margin-top: var(--rx-header-offset);
}

.site-main--front-page > section:nth-of-type(even) {
  background: var(--rx-surface);
}

.site-main--front-page > section:nth-of-type(odd) {
  background: var(--rx-background);
}

.site-main--front-page .section-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.hero-section {
  background: linear-gradient(155deg, #e9edf0 0%, #f8f9fa 78%) !important;
}

.hero-section__inner {
  min-height: clamp(18rem, 52vw, 30rem);
}

.hero-section__content {
  max-width: 48rem;
}

.hero-section__eyebrow {
  margin-bottom: 1rem;
  color: var(--rx-muted);
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-section__title {
  margin-bottom: 1.25rem;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.06em;
}

.hero-section__description {
  max-width: 45ch;
  margin-bottom: 2rem;
  color: var(--rx-muted);
  font-size: clamp(1.12rem, 2vw, 1.35rem);
}

.hero-section__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button,
.hero-section__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--rx-action);
  border-radius: 0.4rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.button--primary {
  background: var(--rx-action);
  color: #ffffff;
}

.button--primary:hover {
  background: var(--rx-action-hover);
  border-color: var(--rx-action-hover);
  color: #ffffff;
}

.button--secondary {
  background: transparent;
  color: var(--rx-action);
}

.button--secondary:hover {
  background: var(--rx-surface);
  color: var(--rx-action-hover);
}

.about-section__content,
.services-section__content,
.materials-section__content,
.process-section__content,
.why-refinex-section__content,
.faq-section__content,
.contact-section__content {
  max-width: 57rem;
}

.about-section__title,
.services-section__title,
.materials-section__title,
.process-section__title,
.why-refinex-section__title,
.faq-section__title,
.contact-section__title {
  margin-bottom: 1.35rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.about-section__description,
.services-section__description,
.materials-section__description,
.process-section__description,
.why-refinex-section__description,
.faq-section__description,
.contact-section__description,
.contact-section__availability {
  color: var(--rx-muted);
  font-size: clamp(1.02rem, 1.8vw, 1.18rem);
}

.about-section__action,
.services-section__action,
.materials-section__action,
.process-section__action,
.why-refinex-section__action,
.faq-section__action,
.contact-section__action {
  margin-top: 1.6rem;
  font-weight: 700;
}

.about-section__action a,
.services-section__action a,
.materials-section__action a,
.process-section__action a,
.why-refinex-section__action a,
.faq-section__action a,
.contact-section__action a {
  display: inline-block;
  padding-block: 0.3rem;
}

/* Native <details> FAQs work with keyboards and without JavaScript. */
.faq-section__items {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.faq-item {
  padding: 0.25rem 1.25rem;
  border: 1px solid var(--rx-border);
  border-radius: var(--rx-radius);
  background: var(--rx-surface);
  box-shadow: 0 0.15rem 0.5rem rgb(20 30 40 / 3%);
}

.faq-item[open] {
  box-shadow: var(--rx-shadow);
}

.faq-item__question {
  padding-block: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.faq-item__question:hover {
  color: var(--rx-action);
}

.faq-item__answer {
  margin: 0;
  padding: 0 0 1.1rem;
  color: var(--rx-muted);
}

/* WordPress-managed supporting pages, fallback archive, and 404 screen. */
.site-main--page,
.site-main--error {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.page-content,
.error-404__inner {
  max-width: 60rem;
}

.page-content__title,
.error-404__title,
.entry-title {
  margin-bottom: 1.25rem;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
}

.page-content__body,
.entry-content {
  overflow-wrap: anywhere;
}

.page-content__body > :where(p, ul, ol, blockquote),
.entry-content > :where(p, ul, ol, blockquote) {
  max-width: 72ch;
}

.page-content__body > * + *,
.entry-content > * + * {
  margin-top: 1rem;
}

.page-content__pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-block: 2rem;
}

.error-404__description,
.no-results {
  color: var(--rx-muted);
  font-size: 1.1rem;
}

.error-404__action {
  margin-top: 2rem;
}

.site-main:not(.site-main--front-page) > .entry-content,
.site-main:not(.site-main--front-page) > .no-results,
.site-main:not(.site-main--front-page) > article,
.site-main:not(.site-main--front-page) > nav {
  width: min(100% - 2.5rem, var(--rx-content-width));
  margin-inline: auto;
}

/* Footer menu may include WordPress-managed privacy and terms pages. */
.site-footer {
  background: #1e252c;
  color: #ffffff;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 1.4rem 3rem;
  padding-block: 2.8rem;
}

.site-footer__identity,
.site-footer__copyright {
  margin: 0;
}

.site-footer a {
  color: #ffffff;
}

.site-footer a:hover {
  color: #dde8f1;
}

.site-footer__identity {
  font-size: 1.15rem;
  font-weight: 750;
}

.footer-menu {
  gap: 0.5rem 1.2rem;
}

.footer-menu a {
  display: inline-block;
  padding-block: 0.25rem;
}

.site-footer__copyright {
  flex-basis: 100%;
  color: #e1e5e8;
  font-size: 0.92rem;
}

/* Preserve natural WordPress editor blocks within policy and article pages. */
.wp-block-image,
.wp-block-gallery,
.wp-block-video {
  max-width: 100%;
}

.wp-block-table {
  max-width: 100%;
  overflow-x: auto;
}

.wp-block-table table {
  border-collapse: collapse;
}

.wp-block-table td,
.wp-block-table th {
  padding: 0.65rem;
  border: 1px solid var(--rx-border);
}

/* WordPress admin toolbar can shift the sticky header. */
@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* Mobile navigation contract for RX-020 assets/js/site.js:
   JS adds .js-nav-enabled on <html>, unhides .menu-toggle, toggles
   aria-expanded, and keeps keyboard/resize behaviour accessible. */
@media (max-width: 800px) {
  :root {
    --rx-header-offset: 7.5rem;
  }

  .site-header__inner {
    gap: 0.65rem 1rem;
  }

  .site-header__navigation {
    flex: 1 1 100%;
    display: block;
  }

  .primary-menu {
    justify-content: flex-start;
    gap: 0.1rem 0.45rem;
  }

  .primary-menu a {
    padding: 0.55rem 0.65rem;
  }

  /* No-JS state: links remain visible as a wrapping list. */
  html.js-nav-enabled .site-header__navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  html.js-nav-enabled .menu-toggle:not([hidden]) {
    display: inline-flex;
  }

  html.js-nav-enabled .primary-navigation {
    display: none;
    flex: 1 1 100%;
    width: 100%;
  }

  html.js-nav-enabled .menu-toggle[aria-expanded="true"] + .primary-navigation {
    display: block;
  }

  html.js-nav-enabled .primary-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-block: 0.6rem;
  }

  html.js-nav-enabled .primary-menu a {
    display: block;
    padding: 0.7rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .section-container,
  .site-header__inner,
  .site-footer__inner {
    width: min(100% - 2rem, var(--rx-content-width));
  }

  .site-main--front-page > section {
    padding-block: 3rem;
  }

  .hero-section__inner {
    min-height: 18rem;
  }

  .hero-section__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-section__actions a {
    width: 100%;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
