/* Rhino Industrial Forklifts: site UI layer */
:root {
  --rh-navy: #03081e;
  --rh-blue: #315fb5;
  --rh-orange: #e27013;
  --rh-wa: #1f9d55;
  --rh-bg: #ffffff;
  --rh-ink: #03081e;
  --rh-muted: #4a5166;
  --rh-line: rgba(3, 8, 30, 0.14);
  --rh-surface: #ffffff;
  --rh-shadow: 0 8px 24px rgba(3, 8, 30, 0.16);
  --rh-cookie-h: 0px;
}
html[data-theme="dark"] {
  --rh-bg: #000000;
  --rh-ink: #eceef3;
  --rh-muted: #b4bac8;
  --rh-line: rgba(236, 238, 243, 0.2);
  --rh-surface: #11141b;
  --rh-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- Focus and buttons (hover states everywhere) ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--rh-orange);
  outline-offset: 2px;
}
:where(.wp-element-button, .wp-block-button__link, button, input[type="submit"], input[type="button"], .wp-block-search__button) {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}
.wp-block-button__link:hover,
.wp-element-button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(3, 8, 30, 0.2);
}
.wp-block-button__link:active,
.wp-element-button:active,
input[type="submit"]:active,
input[type="button"]:active {
  transform: translateY(0);
  box-shadow: none;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
  background-color: var(--rh-navy);
  border-color: var(--rh-navy);
  color: #ffffff;
}
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
  transition: opacity .2s ease, transform .2s ease;
}
.wp-block-navigation__responsive-container-open:hover,
.wp-block-navigation__responsive-container-close:hover {
  opacity: .7;
  transform: scale(1.08);
}
.wp-block-navigation .wp-block-navigation-item__content {
  text-decoration: none;
  text-underline-offset: 7px;
  text-decoration-thickness: 2px;
}
.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
  text-decoration: underline;
  text-decoration-color: var(--rh-orange);
}

/* ---------- Sticky header ---------- */
.wp-site-blocks > header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--rh-bg);
  transition: box-shadow .25s ease;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) {
  .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; }
}
.wp-site-blocks > header .is-style-header-fixed {
  position: relative !important;
  width: auto !important;
  transition: padding .25s ease;
}
.wp-site-blocks > header.is-scrolled { box-shadow: 0 2px 14px rgba(3, 8, 30, 0.12); }
.wp-site-blocks > header.is-scrolled .is-style-header-fixed {
  padding-top: .6rem !important;
  padding-bottom: .6rem !important;
}
.wp-site-blocks > header .wp-block-site-logo img { transition: max-width .25s ease; }
.wp-site-blocks > header.is-scrolled .wp-block-site-logo img { max-width: 170px; height: auto; }

/* Header tools: search + theme toggle */
.rh-header-right { gap: .75rem; align-items: center; }
.rh-header-search.wp-block-search { margin: 0; }
.rh-header-search .wp-block-search__button,
.rh-theme-toggle {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--rh-line);
  background: transparent;
  color: var(--rh-ink);
  cursor: pointer;
  margin-left: 0;
}
.rh-header-search .wp-block-search__button svg { fill: currentColor; width: 22px; height: 22px; min-width: 22px; }
.rh-header-search .wp-block-search__button:hover,
.rh-theme-toggle:hover {
  background: var(--rh-navy);
  border-color: var(--rh-navy);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}
.rh-header-search .wp-block-search__input {
  border: 1px solid var(--rh-line);
  border-radius: 999px;
  padding: .5rem 1rem;
  background: var(--rh-bg);
  color: var(--rh-ink);
}
.rh-header-search .wp-block-search__inside-wrapper { border: 0; padding: 0; gap: .4rem; }
.rh-theme-toggle .rh-icon-sun { display: none; }
html[data-theme="dark"] .rh-theme-toggle .rh-icon-sun { display: block; }
html[data-theme="dark"] .rh-theme-toggle .rh-icon-moon { display: none; }
@media (max-width: 781px) {
  .rh-header-right { gap: .5rem; }
  .rh-header-search .wp-block-search__input { width: 58vw !important; }
}

/* ---------- Mobile menu ---------- */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
  padding-top: 1.5rem;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  gap: 1.25rem;
  font-size: 1.35rem;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  padding: .25rem 0;
}
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg { width: 30px; height: 30px; }

/* ---------- Scroll progress ---------- */
.rh-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}
.admin-bar .rh-progress { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .rh-progress { top: 0; } }
.rh-progress span {
  display: block;
  height: 100%;
  background: var(--rh-orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Floating buttons ---------- */
.rh-wa,
.rh-to-top {
  position: fixed;
  right: 20px;
  z-index: 90;
  box-shadow: var(--rh-shadow);
  transition: transform .2s ease, opacity .2s ease, visibility .2s ease, background-color .2s ease, bottom .2s ease;
}
.rh-wa {
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.1rem;
  border-radius: 999px;
  background: var(--rh-wa);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
}
.rh-wa:hover, .rh-wa:focus-visible { background: #17803f; color: #ffffff; transform: translateY(-2px); }
.rh-wa svg { width: 22px; height: 22px; flex: 0 0 22px; }
.rh-to-top {
  bottom: 86px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--rh-line);
  background: var(--rh-surface);
  color: var(--rh-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}
.rh-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.rh-to-top:hover { background: var(--rh-navy); color: #ffffff; border-color: var(--rh-navy); }
@media (max-width: 600px) {
  .rh-wa { padding: .85rem; }
  .rh-wa .rh-wa-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rh-to-top { bottom: 84px; }
  html.rh-cookie-open .rh-wa { bottom: calc(20px + var(--rh-cookie-h)); }
  html.rh-cookie-open .rh-to-top { bottom: calc(84px + var(--rh-cookie-h)); }
}

/* ---------- Cookie banner ---------- */
.rh-cookie {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 95;
  max-width: 380px;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--rh-line);
  background: var(--rh-surface);
  color: var(--rh-ink);
  box-shadow: var(--rh-shadow);
  font-size: .92rem;
  line-height: 1.45;
}
.rh-cookie[hidden] { display: none; }
.rh-cookie p { margin: 0 0 .75rem; }
.rh-cookie a { color: inherit; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.rh-cookie a:hover { color: var(--rh-orange); }
.rh-nl-consent a { color: inherit; text-decoration: underline; }
.rh-cookie button {
  padding: .55rem 1.2rem;
  border-radius: 6px;
  border: 0;
  background: var(--rh-navy);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.rh-cookie button:hover { background: var(--rh-orange); }
html[data-theme="dark"] .rh-cookie button { background: #eceef3; color: #03081e; }
html[data-theme="dark"] .rh-cookie button:hover { background: var(--rh-orange); color: #ffffff; }
@media (max-width: 600px) {
  .rh-cookie { left: 0; right: 0; bottom: 0; max-width: none; border-radius: 12px 12px 0 0; }
}

/* ---------- Loading animations (only when JS runs, never with reduced motion) ---------- */
html.rh-js .rh-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
html.rh-js .rh-reveal.is-revealed { opacity: 1; transform: none; }
@keyframes rh-spin { to { transform: rotate(360deg); } }

/* Components below sit inside the page body, which is colour-inverted in dark mode,
   so they use fixed light-mode colours rather than the theme variables. */
/* ---------- FAQ ---------- */
.rh-faq { padding: 3.5rem 1.25rem; }
.rh-faq h2 { margin-bottom: 1.75rem; }
.rh-faq .wp-block-details {
  border: 1px solid rgba(3, 8, 30, 0.14);
  border-radius: 8px;
  margin: 0 0 .75rem;
  background: #ffffff;
}
.rh-faq .wp-block-details summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 3rem 1rem 1.25rem;
  font-weight: 600;
  position: relative;
  transition: color .2s ease, background-color .2s ease;
  border-radius: 8px;
}
.rh-faq .wp-block-details summary::-webkit-details-marker { display: none; }
.rh-faq .wp-block-details summary::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.rh-faq .wp-block-details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.rh-faq .wp-block-details summary:hover { color: var(--rh-orange); }
.rh-faq .wp-block-details > :not(summary) { margin: 0; padding: 0 1.25rem 1.1rem; }

/* ---------- Newsletter ---------- */
.rh-newsletter-section { padding: 3rem 1.25rem 2.5rem; border-top: 1px solid rgba(3, 8, 30, 0.14); }
.rh-newsletter-section .rh-nl-title { margin: 0 0 .5rem; }
.rh-newsletter-section .rh-nl-intro { margin: 0 0 1.25rem; }
.rh-newsletter { max-width: 520px; margin: 0 auto; }
.rh-newsletter .rh-nl-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.rh-nl-row { display: flex; gap: .5rem; }
.rh-nl-row input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: .8rem 1rem;
  border: 1px solid rgba(3, 8, 30, 0.3);
  border-radius: 6px;
  font: inherit;
  background: #ffffff;
  color: #03081e;
}
.rh-nl-row input[aria-invalid="true"] { border-color: #c0392b; }
.rh-nl-row button { position: relative; white-space: nowrap; cursor: pointer; }
.rh-newsletter.is-loading .rh-nl-row button { color: transparent !important; pointer-events: none; }
.rh-newsletter.is-loading .rh-nl-row button::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  animation: rh-spin .7s linear infinite;
}
.rh-nl-consent { font-size: .85rem; opacity: .8; margin: .6rem 0 0; text-align: center; }
.rh-nl-msg { margin: .6rem 0 0; text-align: center; font-weight: 600; min-height: 1.2em; }
.rh-nl-msg.is-error { color: #c0392b; }
.rh-nl-success { display: none; text-align: center; }
.rh-nl-success svg { width: 44px; height: 44px; color: var(--rh-wa); }
.rh-nl-success p { margin: .4rem 0 0; font-weight: 600; font-size: 1.1rem; }
.rh-newsletter.is-success .rh-nl-row,
.rh-newsletter.is-success .rh-nl-consent,
.rh-newsletter.is-success .rh-nl-msg { display: none; }
.rh-newsletter.is-success .rh-nl-success { display: block; animation: rh-pop .35s ease; }
@keyframes rh-pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.rh-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 480px) { .rh-nl-row { flex-direction: column; } }

/* ---------- 404 ---------- */
.rh-404 { padding: 4rem 1.25rem 5rem; }
.rh-404-code {
  font-size: clamp(5rem, 18vw, 10rem);
  line-height: 1;
  font-weight: 800;
  margin: 0;
  color: var(--rh-orange);
  letter-spacing: -.04em;
}
.rh-404 h1 { margin: .5rem 0 1rem; }
.rh-404-lead { margin: 0 auto 2rem; max-width: 34rem; }
.rh-404-search { max-width: 520px; margin: 0 auto 2rem; }
.rh-404-actions { gap: .75rem; margin-bottom: 2rem; }
.rh-404-help { font-size: .95rem; opacity: .85; }

/* ---------- Last updated ---------- */
.rh-updated { font-size: .9rem; opacity: .8; margin: 0 0 1.5rem; }

/* ---------- Dark mode ---------- */
/* The page body (everything except the header) is colour-inverted, then photos and
   photo backgrounds are inverted back so they look normal. This keeps every existing
   block readable without re-colouring each one by hand. */
html[data-theme="dark"] body { background: #000000; color: var(--rh-ink); }
html[data-theme="dark"] .wp-site-blocks > :not(header) { filter: invert(1) hue-rotate(180deg); }
html[data-theme="dark"] .wp-site-blocks > :not(header) :is(img, video, iframe, picture) { filter: invert(1) hue-rotate(180deg); }
html[data-theme="dark"] .wp-site-blocks > :not(header) .wp-block-cover:has(> .wp-block-cover__image-background, > .wp-block-cover__video-background) { filter: invert(1) hue-rotate(180deg); }
html[data-theme="dark"] .wp-site-blocks > :not(header) .wp-block-cover:has(> .wp-block-cover__image-background, > .wp-block-cover__video-background) :is(img, video, iframe, picture) { filter: none; }
html[data-theme="dark"] .wp-site-blocks > :not(header) .wp-block-cover:has(> .wp-block-cover__image-background, > .wp-block-cover__video-background) .wp-block-cover { filter: none; }

/* Header in dark mode (styled directly, not inverted, so the mobile menu still works) */
html[data-theme="dark"] .wp-site-blocks > header.wp-block-template-part { background: #000000; }
html[data-theme="dark"] .wp-site-blocks > header .wp-block-navigation,
html[data-theme="dark"] .wp-site-blocks > header .wp-block-navigation a,
html[data-theme="dark"] .wp-site-blocks > header .wp-block-navigation__responsive-container-open,
html[data-theme="dark"] .wp-site-blocks > header .wp-block-navigation__responsive-container-close { color: #eceef3 !important; }
html[data-theme="dark"] .wp-site-blocks > header .wp-block-navigation__responsive-container.is-menu-open {
  background-color: #000000 !important;
  color: #eceef3 !important;
}
html[data-theme="dark"] .wp-site-blocks > header .wp-block-site-logo img {
  background: #ffffff;
  border-radius: 8px;
  padding: 4px;
}
html[data-theme="dark"] .wp-site-blocks > header.is-scrolled { box-shadow: 0 1px 0 rgba(236, 238, 243, 0.15); }

/* ---------- Home service cards: linked headings ---------- */
.home .wp-block-cover h3.wp-block-heading a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 8px;
  text-decoration-thickness: 3px;
}
.home .wp-block-cover h3.wp-block-heading a:hover,
.home .wp-block-cover h3.wp-block-heading a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--rh-orange);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  html.rh-js .rh-reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  @page { margin: 15mm; }
  html, body { background: #ffffff !important; color: #000000 !important; }
  .wp-site-blocks > * { filter: none !important; }
  .wp-site-blocks > * :is(img, video, iframe, picture), .wp-block-cover { filter: none !important; }
  .wp-site-blocks > header.wp-block-template-part { position: static !important; box-shadow: none !important; }
  .rh-progress, .rh-to-top, .rh-wa, .rh-cookie, .rh-theme-toggle, .rh-header-search,
  .wp-block-navigation, .rh-newsletter-section, .skip-link, .wp-block-search,
  .rh-404-actions, video, iframe, .wp-block-buttons { display: none !important; }
  .wp-block-cover { min-height: 0 !important; padding: 1rem 0 !important; background: none !important; }
  .wp-block-cover__image-background, .wp-block-cover__video-background, .wp-block-cover__background { display: none !important; }
  .wp-block-cover, .wp-block-cover * { color: #000000 !important; }
  html.rh-js .rh-reveal { opacity: 1 !important; transform: none !important; }
  h1, h2, h3, h4 { page-break-after: avoid; break-after: avoid; }
  img, figure, .wp-block-details { page-break-inside: avoid; break-inside: avoid; }
  img { max-width: 100% !important; height: auto !important; }
  .rh-faq .wp-block-details { border-color: #999999; }
  a { color: #000000 !important; text-decoration: underline; }
  main a[href^="http"]:not([href*="rhinoindustrialforklifts.co.za"])::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
  body::after {
    content: "Rhino Industrial Forklifts  |  (011) 865 4922  |  rhinoindustrialforklifts.co.za";
    display: block;
    margin-top: 2rem;
    padding-top: .75rem;
    border-top: 1px solid #999999;
    font-size: 10pt;
  }
}
