/* ==========================================================================
   Southland Polymers — Site Stylesheet
   Brand: #0d4d86 blue / #ae231a red | Font: Rubik | WCAG AA compliant
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

:root {
  --brand-blue: #0d4d86;
  --brand-blue-dark: #09375f;
  --brand-blue-light: #e8f1f9;
  --brand-red: #ae231a;
  --text: #292929;
  --text-light: #555;
  --border: #d5dde5;
  --bg: #ffffff;
  --bg-alt: #f4f7fa;
  --focus-ring: #e06a00;
  --max-width: 1160px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font: 400 1.0625rem/1.7 "Rubik", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-blue); text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--brand-red); }

/* Focus: visible outline for keyboard users (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Skip link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 6px;
  z-index: 1000;
  background: var(--brand-blue);
  color: #fff;
  padding: 0.65rem 1.2rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 6px; outline: 3px solid var(--focus-ring); }

/* Screen reader only */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  background: #fff;
  border-bottom: 3px solid var(--brand-blue);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  gap: 1.5rem;
}

.logo { flex-shrink: 0; }
.logo img { max-height: 54px; width: auto; }

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex: 1;
}

.lang-switch {
  font-size: 0.875rem;
  display: flex; gap: 0.5rem;
  align-items: center;
}
.lang-switch a { font-weight: 500; }
.lang-switch .current {
  font-weight: 700; color: var(--text); text-decoration: none;
}

.site-nav { width: 100%; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: flex-end;
  gap: 0.25rem 1.6rem;
}
.site-nav a {
  display: inline-block; padding: 0.35rem 0;
  font-weight: 500; font-size: 1rem;
  color: var(--text); text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.site-nav a:hover { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }
.site-nav a[aria-current="page"] {
  color: var(--brand-blue); border-bottom-color: var(--brand-blue); font-weight: 600;
}

/* Mobile nav toggle (hamburger) */
.nav-toggle {
  display: none;
  background: none; border: 2px solid var(--brand-blue);
  border-radius: 4px; padding: 0.45rem 0.55rem; cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle-bar {
  display: block; width: 22px; height: 3px;
  background: var(--brand-blue); margin: 3px 0;
  border-radius: 1px;
}

/* ==========================================================================
   Hero (Homepage)
   ========================================================================== */

.hero {
  background-color: var(--brand-blue-dark);
  background-image: linear-gradient(rgba(9, 55, 95, 0.38), rgba(9, 55, 95, 0.45)), url("../images/hero-home.jpg");
  background-size: cover; background-position: center;
  color: #fff; padding: 5rem 0;
}
.hero-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem;
}
.hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.15; font-weight: 700; letter-spacing: -0.01em;
}
.hero p {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  max-width: 44rem; margin: 0 0 1.75rem;
  color: #d4e3f5; line-height: 1.6;
}

/* ==========================================================================
   Page Title Band (inner pages)
   ========================================================================== */

.page-title {
  background-color: var(--brand-blue-dark);
  background-size: cover; background-position: center;
  color: #fff; padding: 2.5rem 0;
  position: relative;
}
/* Optional hero image per page — set via inline style or class */
.page-title.has-hero {
  background-image: var(--hero-bg);
}
.page-title.has-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(9, 55, 95, 0.38);
}
.page-title.has-hero .container { position: relative; z-index: 1; }

.page-title h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 700; letter-spacing: -0.01em;
}
.page-title .crumb {
  color: #cfe0f0; font-size: 0.9375rem; margin-top: 0.45rem;
}
.page-title .crumb a { color: #cfe0f0; text-decoration: underline; }
.page-title .crumb a:hover { color: #fff; }

/* HDLine decorative divider (matches original brand style) */
.hdline {
  height: 21px; max-width: 680px;
  margin: 15px 0 0 -25px; padding-top: 10px;
  border-right: 1px solid rgba(255,255,255,0.35);
  border-left: 1px solid rgba(255,255,255,0.35);
}
.hdline hr {
  padding: 0; border: none;
  border-top: 1px solid rgba(255,255,255,0.35);
  margin: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  background: var(--brand-blue);
  color: #fff; padding: 0.72rem 1.5rem;
  border-radius: 4px; font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 2px solid var(--brand-blue);
  cursor: pointer; text-align: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover, .btn:focus-visible {
  background: var(--brand-blue-dark); border-color: var(--brand-blue-dark);
  color: #fff; text-decoration: none;
}
.btn-outline {
  background: transparent; color: #fff; border-color: #fff;
}
.btn-outline:hover, .btn-outline:focus-visible {
  background: #fff; color: var(--brand-blue-dark); border-color: #fff;
}
.btn-accent { background: var(--brand-red); border-color: var(--brand-red); }
.btn-accent:hover { background: #8f1c14; border-color: #8f1c14; }
.btn.sm { padding: 0.5rem 1rem; font-size: 0.9375rem; }

/* ==========================================================================
   Sections & Layout
   ========================================================================== */

.container {
  width: 100%; max-width: var(--max-width);
  margin: 0 auto; padding: 0 1.25rem;
}

.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  color: var(--brand-blue); margin: 0 0 1.25rem;
  font-weight: 700; letter-spacing: -0.01em;
}
.section .lead {
  font-size: 1.125rem; color: var(--text-light);
  max-width: 52rem; line-height: 1.7;
}

/* Homepage 3 boxes */
.boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.75rem; margin-top: 1rem;
}
.box {
  background: #fff; border: 1px solid var(--border);
  border-top: 4px solid var(--brand-blue);
  border-radius: 8px; padding: 1.75rem;
  display: flex; flex-direction: column;
}
.box h3 { margin: 0 0 0.75rem; font-size: 1.25rem; color: var(--brand-blue); font-weight: 600; }
.box p  { flex: 1; margin: 0 0 1.25rem; color: var(--text-light); }
.box .btn { align-self: flex-start; }

/* Partner logos — auto-scrolling carousel */
.partners-carousel {
  overflow: hidden;
  padding: 0.5rem 0;
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
.partners-track {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  width: max-content;
  animation: scroll-partners 40s linear infinite;
}
.partners-track img {
  max-height: 50px; width: auto;
  flex-shrink: 0;
}
@keyframes scroll-partners {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
/* Pause on hover */
.partners-carousel:hover .partners-track {
  animation-play-state: paused;
}

/* ==========================================================================
   Product Listing — Cards
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 1.25rem;
}

.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 1.5rem;
  text-decoration: none; color: var(--text); display: block;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--brand-blue);
  box-shadow: 0 4px 14px rgba(13, 77, 134, 0.1);
}
.card h3 { margin: 0 0 0.35rem; font-size: 1.15rem; color: var(--brand-blue); font-weight: 600; }
.card p  { margin: 0; font-size: 0.9375rem; color: var(--text-light); }

/* ==========================================================================
   Product Detail — Vendor / Grade Tables
   ========================================================================== */

.vendor-block { margin: 2.5rem 0 0; }
.vendor-block:first-child { margin-top: 0.5rem; }

.vendor-block h2 {
  font-size: 1.4rem; color: var(--brand-blue); font-weight: 600;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.55rem; margin: 0 0 1rem;
}

table.grades {
  width: 100%; border-collapse: collapse;
  margin: 0 0 1.5rem; font-size: 1rem;
}
table.grades caption {
  text-align: left; font-weight: 600;
  padding: 0.5rem 0; color: var(--brand-blue);
}
table.grades th, table.grades td {
  border: 1px solid var(--border);
  padding: 0.7rem 0.85rem; text-align: left; vertical-align: top;
}
table.grades thead th {
  background: var(--brand-blue);
  color: #fff; font-weight: 600;
  border-color: var(--brand-blue);
}
table.grades thead th:first-child { border-radius: 4px 0 0 0; }
table.grades thead th:last-child  { border-radius: 0 4px 0 0; }

table.grades tbody tr:nth-child(even) { background: #fafcfe; }
table.grades tbody tr:hover { background: #eef4fa; }

table.grades .grade-name { font-weight: 600; white-space: nowrap; color: var(--brand-blue-dark); }
table.grades .grade-desc { min-width: 200px; }

.doc-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.doc-links a {
  display: inline-block;
  background: var(--brand-blue-light); color: var(--brand-blue);
  padding: 0.25rem 0.65rem; border-radius: 3px;
  font-size: 0.875rem; font-weight: 500; text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.doc-links a:hover { background: var(--brand-blue); color: #fff; text-decoration: none; }

/* Disclaimer / Notes */
.notes {
  background: #fff8e6; border-left: 4px solid #d9a400;
  padding: 1rem 1.2rem; border-radius: 0 6px 6px 0;
  font-size: 0.9375rem; color: #6b5900; margin-top: 2rem;
  line-height: 1.6;
}

/* ==========================================================================
   Content Pages (About / Solutions / Legal)
   ========================================================================== */

.content-page { max-width: 52rem; }
.content-page h2 { color: var(--brand-blue); margin-top: 2rem; font-weight: 600; }
.content-page h3 { color: var(--brand-blue-dark); margin-top: 1.75rem; font-weight: 600; }
.content-page h4 { color: var(--text); margin-top: 1.5rem; font-weight: 600; }
.content-page p { margin: 0 0 1.15rem; }
.content-page ul, .content-page ol {
  padding-left: 1.5rem; margin-bottom: 1.15rem;
}
.content-page li { margin: 0.35rem 0; }

.content-page blockquote {
  margin: 1.5rem 0; padding: 1rem 1.5rem;
  border-left: 4px solid var(--brand-blue);
  background: var(--bg-alt); color: var(--text-light);
}

/* Legal pages — slightly smaller text, more headings */
.legal { font-size: 0.98rem; }
.legal h2 { font-size: 1.35rem; margin-top: 2.25rem; }
.legal h3 { font-size: 1.1rem; margin-top: 1.75rem; }
.legal h4 { font-size: 1rem; margin-top: 1.5rem; }
.legal p, .legal ul, .legal ol { margin-bottom: 1rem; }

/* ==========================================================================
   Solutions menu (like original WordPress nav menus on solutions page)
   ========================================================================== */

.solutions-menu ul, .products-menu ul {
  list-style: none; padding: 0; margin: 1.5rem 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.solutions-menu a, .products-menu a {
  display: inline-block;
  background: var(--brand-blue-light); color: var(--brand-blue);
  padding: 0.6rem 1.2rem; border-radius: 6px;
  font-weight: 500; text-decoration: none;
  transition: background 0.2s;
}
.solutions-menu a:hover, .products-menu a:hover {
  background: var(--brand-blue); color: #fff; text-decoration: none;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem; margin-top: 1.5rem;
}

.contact-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 1.75rem;
}
.contact-card h3 { margin: 0 0 0.85rem; color: var(--brand-blue); font-size: 1.2rem; font-weight: 600; }
.contact-card p  { margin: 0.35rem 0; }
.contact-card address { font-style: normal; line-height: 1.7; }
.contact-card .btn { margin-top: 0.85rem; }

/* Google Maps embed */
.map-embed {
  margin-top: 2rem; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
}
.map-embed iframe {
  width: 100%; height: 360px; border: 0; display: block;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--brand-blue-dark);
  color: #cfe0f0; margin-top: 3rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding: 2.75rem 1.25rem 2rem;
  max-width: var(--max-width); margin: 0 auto;
}

.footer-col h2 {
  color: #fff; font-size: 1rem; text-transform: uppercase;
  letter-spacing: 0.08em; margin: 0 0 0.85rem;
  font-weight: 600;
}

/* Footer HDLine divider */
.footer-col .hdline {
  max-width: 200px; margin: 0 0 1.25rem 0; padding-top: 8px;
  border-right: 1px solid rgba(255,255,255,0.22);
  border-left: 1px solid rgba(255,255,255,0.22);
  height: 12px;
}
.footer-col .hdline hr { border-top: 1px solid rgba(255,255,255,0.22); }

.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0.4rem 0; }
.footer-col a {
  color: #cfe0f0; text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-col address { font-style: normal; margin: 0; line-height: 1.7; }
.footer-col address strong { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.1rem 1.25rem; text-align: center;
  font-size: 0.875rem; color: #9db8d1;
}
.footer-bottom a { color: #cfe0f0; }
.footer-bottom a:hover { color: #fff; }

/* Back to top */
.back-to-top {
  display: inline-block; margin-bottom: 0.5rem;
  color: var(--brand-blue-light); font-size: 0.875rem; cursor: pointer;
  text-decoration: none;
}
.back-to-top:hover { color: #fff; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .header-right { flex-direction: row; align-items: center; flex-wrap: wrap; }

  .nav-toggle { display: block; order: 2; }
  .lang-switch { order: 1; }

  .site-nav { display: none; width: 100%; order: 3; }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column; gap: 0;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem; margin-top: 0.25rem;
  }
  .site-nav a { padding: 0.55rem 0; font-size: 1.05rem; }

  .hero { padding: 3.5rem 0; }
  .section { padding: 2.5rem 0; }

  table.grades { font-size: 0.9375rem; }
  table.grades .grade-name { white-space: normal; }
  .doc-links a { font-size: 0.8125rem; padding: 0.2rem 0.5rem; }
}

@media (max-width: 500px) {
  .header-inner { padding: 0.5rem 1rem; }
  .logo img { max-height: 44px; }
  .hero { padding: 2.5rem 0; }
  .page-title { padding: 1.75rem 0; }

  table.grades, table.grades thead, table.grades tbody,
  table.grades th, table.grades td, table.grades tr {
    display: block;
  }
  table.grades thead { display: none; }
  table.grades tr {
    border: 1px solid var(--border); margin-bottom: 0.75rem;
    border-radius: 6px; padding: 0.6rem;
    background: #fff;
  }
  table.grades td {
    border: none; padding: 0.3rem 0.6rem;
    display: flex; gap: 0.5rem;
  }
  table.grades td::before {
    content: attr(data-label);
    font-weight: 700; color: var(--brand-blue-dark);
    min-width: 100px; flex-shrink: 0;
    font-size: 0.85rem;
  }
  table.grades .grade-name { font-size: 1rem; font-weight: 700; }
  table.grades .grade-desc { font-size: 0.9375rem; }

  .card-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; }
}
