/*
 * Styles for REAL WordPress content (the_content()) rendered through the
 * standard Gutenberg block classes (wp-block-paragraph, wp-block-heading,
 * wp-block-list, etc.) and a couple of template-level wrapper elements
 * (.page-banner, .prose) that don't exist in alpinrubber.com's original
 * styles.css because that theme never rendered real post_content — it
 * printed bundled static arrays instead. Every color/spacing value below
 * reuses the --tokens already defined in styles.css, nothing new invented.
 */

.page-banner {
  background: var(--graphite);
  color: var(--paper-on-graphite);
  padding: 64px 40px 56px;
}
.page-banner-inner {
  max-width: 1240px;
  margin: 0 auto;
}
.page-banner h1 {
  font-size: 40px;
  line-height: 1.1;
  margin: 14px 0 0;
}
.page-banner .eyebrow.on-graphite { color: var(--gold); }

.prose {
  max-width: 760px;
}
.prose > :first-child { margin-top: 0; }

.prose h2, .wp-block-heading {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 1.15;
  color: var(--ink);
  margin: 44px 0 16px;
}
.prose h3 { font-size: 22px; margin: 32px 0 12px; }
.prose p, .wp-block-paragraph {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol, .wp-block-list {
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}
.prose li { margin-bottom: 8px; }
.prose a { color: var(--red); text-decoration: underline; text-decoration-color: var(--red-tint); }
.prose a:hover { color: var(--red-hover); }
.prose img, .wp-block-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  margin: 12px 0 28px;
}
.prose figcaption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: -16px;
  margin-bottom: 28px;
}
.prose table, .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 28px;
  font-size: 14.5px;
}
.prose table th, .prose table td,
.wp-block-table table th, .wp-block-table table td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
}
.prose table th { background: var(--steel); font-weight: 600; }
.prose blockquote {
  border-left: 3px solid var(--gold);
  background: var(--gold-tint);
  padding: 14px 18px;
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--ink);
}
.prose iframe { max-width: 100%; border-radius: var(--radius-m); }

/* Contact page: Google Maps embeds + Contact Form 7 inside the real content */
.prose .wp-block-paragraph:has(+ iframe),
.prose p:has(+ iframe) { margin-bottom: 8px; }
.wpcf7 { margin-top: 24px; }
.wpcf7 form.wpcf7-form p { margin-bottom: 14px; }
.wpcf7 input[type=text], .wpcf7 input[type=email], .wpcf7 input[type=tel], .wpcf7 textarea {
  width: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
}
.wpcf7 input[type=submit] {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  padding: 12px 26px;
  border-radius: 4px;
  border: none;
  background: var(--red);
  color: #fff;
  cursor: pointer;
}
.wpcf7 input[type=submit]:hover { background: var(--red-hover); }

/* Blog archive cards reuse .sector-card but need a thumbnail slot */
.blog-card-thumb { margin: -28px -28px 4px; border-radius: var(--radius-m) var(--radius-m) 0 0; overflow: hidden; }
.blog-card-thumb img { width: 100%; height: 160px; object-fit: cover; display: block; }
.blog-grid .sector-card { text-decoration: none; }

.single-thumb { margin-bottom: 28px; border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-card); }
.single-thumb img { width: 100%; height: auto; display: block; }

/* RTL (Arabic) adjustments */
html[dir="rtl"] .prose { direction: rtl; text-align: right; }
html[dir="rtl"] .prose ul, html[dir="rtl"] .prose ol { padding-left: 0; padding-right: 22px; }
html[dir="rtl"] .nav-links { direction: rtl; }
html[dir="rtl"] .footer-grid { direction: rtl; }

/* Language switcher dropdown (header + footer use alpinrubber.com's own
 * .lang-switch/.lang-menu classes, carried over from styles.css, but that
 * file never defined them either — alpinrubber's header used a simpler
 * two-language toggle. Defined here for the six-language case. */
.lang-switch { position: relative; }
.lang-switch summary { list-style: none; cursor: pointer; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 6px;
  min-width: 170px;
  list-style: none;
  z-index: 60;
}
html[dir="rtl"] .lang-menu { right: auto; left: 0; }
.lang-menu li a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-s);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.lang-menu li a:hover { background: var(--steel); color: var(--ink); }
.lang-menu li a.active { color: var(--red); font-weight: 600; }
.lang-menu .lm-code { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-faint); }

/* Dropdown submenus. wp_nav_menu() prints a real nested menu — every top
 * level item with children gets a `<ul class="sub-menu">` — but
 * alpinrubber.com's original nav was a flat list of links with no children,
 * so styles.css never defined anything for `.sub-menu` at all. Left
 * undefined it just renders as a normal block list, always visible, right
 * in the document flow: every dropdown open at once, stacked on top of the
 * hero/trust-strip/blog sections below. This closes that gap with the same
 * tokens (surface/line/shadow-card) the rest of the header already uses. */
.nav-links .menu-item-has-children { position: relative; }
.nav-links .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  z-index: 50;
}
/* Long sector/production lists (6+ items) wrap into two columns instead of
 * one very tall dropdown. */
.nav-links .sub-menu:has(li:nth-child(6)) {
  width: 460px;
  min-width: 0;
  columns: 2;
  column-gap: 4px;
}
.nav-links .menu-item-has-children:hover > .sub-menu,
.nav-links .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear 0s;
}
.nav-links .sub-menu li { margin: 0; break-inside: avoid; }
.nav-links .sub-menu a {
  display: block;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-s);
  white-space: nowrap;
}
.nav-links .sub-menu a::after { display: none; }
.nav-links .sub-menu a:hover { background: var(--steel); color: var(--ink); }

/* Mobile nav */
@media (max-width: 860px) {
  .site-header { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: none; background: none; cursor: pointer; }
  .site-header.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 16px 20px 24px;
    gap: 4px;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    z-index: 55;
  }
  .site-header.nav-open .nav-links a { padding: 10px 0; }
  /* On touch there's no hover: children are always shown, indented, under
   * their parent inside the slide-down panel. */
  .nav-links .sub-menu {
    position: static;
    width: auto;
    columns: 1;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin: 0 0 4px;
    padding: 0 0 0 16px;
  }
  .nav-links .sub-menu a { padding: 8px 0; font-size: 14px; }
  .trust-row { grid-template-columns: repeat(2, 1fr); }
  .trust-item { border-left: none; border-top: 1px solid var(--line); }
  .sector-grid, .cap-grid, .cert-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
}
