/*
  NuVida Biosciences nb/ — Mobile-First Overrides
  Load AFTER style.css in head-tag.php:
  <link rel="stylesheet" href="<?= $basepath ?>assets/css/overrides.css">
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --topbar-height: 48px;
  --nav-height: 66px;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1001;
  height: var(--topbar-height);
  background: var(--ink, #10141f);
  border-bottom: 1px solid rgba(76,133,152,0.35);
  display: flex;
  align-items: center;
}
.topbar .container { width: 100%; }
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.topbar__tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}
.topbar__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.topbar__link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  transition: color 0.15s;
  position: relative;
}
.topbar__link:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.15);
}
.topbar__link:hover { color: var(--white); }

/* Nav sits below topbar */
.site-nav {
  top: var(--topbar-height);
}

/* Fix: container inside nav must fill nav height for flex centering to work */
.site-nav .container {
  height: 100%;
}

/* Page body offset: topbar + nav */
.page-body {
  padding-top: calc(var(--topbar-height) + var(--nav-height));
}

@media (max-width: 760px) {
  .topbar__tagline { display: none; }
}
@media (max-width: 600px) {
  .topbar__link--email { display: none; }
  .topbar__link::after { display: none; }
}

/* ============================================================
   ALWAYS-ON OVERRIDES
   Apply at all breakpoints — tone down "AI template" feel
   ============================================================ */

body {
  font-size: 1rem;
  line-height: 1.7;
}

h1, h2, h3, h4 {
  font-weight: 500;
}

/* Nav links slightly lighter */
.nav-links a {
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ============================================================
   CONTACT PAGE LAYOUT
   (moved from inline <style> in contact/index.php)
   ============================================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3.5rem;
  align-items: start;
}
.contact-info-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.contact-info-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}
.contact-info-list li:first-child { border-top: 1px solid var(--border); }
.ci-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--primary-xlight);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.ci-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.ci-value { font-size: 0.9rem; color: var(--text); }
.ci-value a { color: var(--text); }
.ci-value a:hover { color: var(--primary); }
.contact-map { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.contact-map iframe { display: block; width: 100%; height: 200px; border: 0; }
.contact-form-wrap {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}
.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group { margin-bottom: 1.125rem; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.375rem;
}
.form-label .req { color: #dc2626; margin-left: 2px; }
.form-control {
  display: block;
  width: 100%;
  padding: 0.6875rem 0.875rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  min-height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76,133,152,.12);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.btn-contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6875rem 2rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s ease;
}
.btn-contact-submit:hover { background: var(--primary-dark); }
.btn-contact-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.spinner-icon { display: none; width: 16px; height: 16px; animation: spin 0.7s linear infinite; }
.btn-contact-submit.loading .spinner-icon { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-privacy { margin-top: 0.875rem; font-size: 0.8125rem; color: var(--text-muted); }
.form-privacy a { color: var(--primary); text-decoration: underline; }
.form-respond-note { margin-top: 0.375rem; font-size: 0.8125rem; color: var(--text-muted); }
#form-success {
  display: none;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  color: #065f46;
  margin-bottom: 1.25rem;
  font-weight: 500;
}
#form-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  color: #991b1b;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 560px) {
  .contact-form-wrap { padding: 1.5rem; }
  .form-row-split { grid-template-columns: 1fr; }
}

/* Nav */
.site-nav {
  height: 66px;
}

/* Atlas|CD nav link — teal text, stands out from regular links */
.nav-atlascd {
  color: var(--primary) !important;
  font-weight: 600 !important;
}

/* Header logo — block removes inline baseline gap */
.site-nav__logo img {
  display: block;
  vertical-align: middle;
}

/* Footer logo size */
.site-footer__logo {
  height: 52px;
  width: auto;
  display: block;
}
.site-footer__logo-link {
  display: inline-block;
  margin-bottom: 1rem;
}
/* Also target the CSS-defined footer-brand__logo img in case both apply */
.footer-brand__logo img {
  height: 52px;
}

/* Smooth transitions only where intentional */
.product-card,
.card,
.pillar,
.btn {
  transition: box-shadow 0.2s ease, color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Prevent horizontal overflow site-wide */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

* {
  box-sizing: border-box;
}

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

/* ============================================================
   BREAKPOINT: 768px — Tablet
   ============================================================ */
@media (max-width: 768px) {

  /* Footer: 2x2 grid instead of collapsing to 1 column */
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  /* Brand column spans full width */
  .site-footer__grid > *:first-child {
    grid-column: 1 / -1;
  }

  /* Products grid: 2 columns on tablet */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Pillars: 2 columns */
  .pillars {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Section padding tighter */
  .section {
    padding: 3rem 0;
  }

  .section--lg {
    padding: 4rem 0;
  }

  /* Hero */
  .hero {
    padding: 2.5rem 0 2.5rem;
  }

  .hero__headline {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  /* Page header tighter */
  .page-header {
    padding: 2rem 0 1.75rem;
  }

  /* Nav links — handled by existing mobile menu; ensure height consistent */
  .site-nav {
    height: var(--nav-height, 66px);
  }
}

/* ============================================================
   BREAKPOINT: 430px — Large Phone
   ============================================================ */
@media (max-width: 430px) {

  /* Products grid: 2 columns (information density) */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Product card: compact image */
  .product-card .card__image,
  .product-card img:not([class]) {
    height: 140px;
    object-fit: contain;
    padding: 1rem;
  }

  /* Pillar cards: single column */
  .pillars {
    grid-template-columns: 1fr;
  }

  /* Pillar: horizontal layout */
  .pillar {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    text-align: left;
  }

  .pillar__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: 0;
  }

  .pillar__body {
    flex: 1;
    min-width: 0;
  }

  /* Hero */
  .hero {
    padding: 2rem 0 2rem;
  }

  .hero__headline {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
    letter-spacing: -0.02em;
  }

  .hero__lead {
    font-size: 0.9rem;
  }

  .hero__cta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
  }

  .hero__cta .btn {
    flex: 0 0 auto;
    font-size: 0.8125rem;
    padding: 0.5625rem 1.125rem;
  }

  /* Footer: 2 columns, tighter */
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 1.5rem;
  }

  .site-footer {
    padding: 2.5rem 0 0;
  }

  /* Footer bottom: stack */
  .site-footer__bottom {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.75rem;
  }

  .site-footer__bottom-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  /* Buttons: 44px touch targets */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Nav */
  .site-nav {
    height: 60px;
  }

  .site-nav__logo img,
  .site-nav__inner .logo img,
  .nav-logo img {
    height: 32px;
    width: auto;
  }

  /* Section */
  .section {
    padding: 2.5rem 0;
  }

  .section-title {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }

  .section-eyebrow {
    font-size: 0.625rem;
  }

  /* CTA banner: stack cleanly */
  .cta-banner,
  .hero-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Contact grid */
  .contact__info {
    margin-bottom: 2rem;
  }

  .contact__form {
    padding: 1.5rem;
  }

  /* Form touch targets */
  .form-control {
    min-height: 44px;
    font-size: 1rem;
  }

  textarea.form-control {
    min-height: 100px;
  }

  select.form-control {
    min-height: 44px;
  }

  /* Product detail */
  .product-detail {
    gap: 2rem;
  }

  .product-image-wrap {
    padding: 1.5rem;
    border-radius: 10px;
  }

  /* Page header */
  .page-header {
    padding: 1.75rem 0 1.5rem;
  }

  .page-header__title,
  .page-header h1 {
    font-size: 1.25rem;
  }

  /* Stats section */
  .stats__grid,
  .stats-grid,
  .stats .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat__value,
  .stats__value {
    font-size: 1.5rem;
  }

  .stat__label,
  .stats__label {
    font-size: 0.6875rem;
  }

  /* Featured products on homepage */
  .featured-products .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   BREAKPOINT: 375px — iPhone Standard
   ============================================================ */
@media (max-width: 375px) {

  body {
    font-size: 0.9rem;
  }

  .hero__headline {
    font-size: clamp(1.25rem, 7vw, 1.6rem);
  }

  .section-title {
    font-size: clamp(1.1rem, 5.5vw, 1.35rem);
  }

  /* 2-column product grid still fits at 375 */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .product-card .card__body {
    padding: 0.875rem;
  }

  .product-card .card__title,
  .product-card h3,
  .product-card h4 {
    font-size: 0.8125rem;
  }

  /* Nav */
  .site-nav {
    height: 56px;
  }

  .site-nav__logo img,
  .site-nav__inner .logo img,
  .nav-logo img {
    height: 28px;
    width: auto;
  }

  /* Pillar: horizontal always */
  .pillar {
    padding: 1rem;
    gap: 0.875rem;
  }

  .pillar__icon {
    width: 36px;
    height: 36px;
  }

  /* Footer */
  .site-footer__grid {
    gap: 1.25rem;
  }
}

/* ============================================================
   BREAKPOINT: 320px — Minimum Supported
   ============================================================ */
@media (max-width: 320px) {

  body {
    font-size: 0.875rem;
  }

  .hero__headline {
    font-size: 1.2rem;
  }

  /* At 320px, fall back to single-column for product cards */
  .products-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }

  /* Footer: 1 column at 320 */
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .btn {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
  }

  .pillar {
    padding: 0.875rem;
    gap: 0.75rem;
  }

  .pillar__icon {
    width: 32px;
    height: 32px;
  }

  .section {
    padding: 2rem 0;
  }
}

/* ============================================================
   PRIVACY POLICY PAGE
   ============================================================ */
.privacy-hero {
  background: linear-gradient(135deg, var(--navy, #0a1628) 0%, var(--navy-mid, #0f2040) 100%);
  padding: 3rem 0 2.5rem;
}

@media (max-width: 430px) {
  .privacy-hero {
    padding: 2rem 0 2rem;
  }

  .privacy-content {
    padding-block: 2.5rem;
  }

  .privacy-toc {
    margin-bottom: 2rem;
  }

  .privacy-section {
    margin-bottom: 2rem;
  }

  .privacy-section h2 {
    font-size: 1.1rem;
  }

  .privacy-section p,
  .privacy-section li {
    font-size: 0.9rem;
    line-height: 1.7;
  }
}
