/* Westlake Pharmaceutical Services — logo-matched, mobile-first */
:root {
  --brand: #a01828;
  --brand-dark: #7a1220;
  --brand-soft: #f4e6e8;
  --ink: #1c1c1c;
  --text: #2e2e2e;
  --muted: #5a5a5a;
  --rule: #d6d1cc;
  --paper: #f7f5f2;
  --white: #fff;
  --max: 70rem;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 0.25rem;
  --header-h: 3.75rem;
  --focus: 0 0 0 3px rgba(160, 24, 40, 0.35);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
}

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

a {
  color: var(--brand-dark);
  text-underline-offset: 0.15em;
}

a:hover { color: var(--brand); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: var(--focus);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  background: var(--brand);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  z-index: 100;
}
.skip:focus { top: 0.75rem; color: var(--white); }

.wrap {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
  padding-block: 0.45rem;
}

.logo-link {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
}

.logo-link img {
  height: 2.35rem;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.phone-link {
  display: none;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 0.35rem 0.4rem;
}
.phone-link:hover { color: var(--brand); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
}
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--brand-dark);
  border-color: var(--brand);
}
.btn-secondary:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--rule);
  background: var(--white);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--ink);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

.nav {
  display: none;
  border-top: 1px solid var(--rule);
  background: var(--white);
}
.nav.is-open { display: block; }

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0.4rem 1rem 0.85rem;
}
.nav a {
  display: block;
  padding: 0.55rem 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--brand); }

/* Mobile sticky CTA bar */
.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--rule);
}
.mobile-cta .btn { flex: 1 1 0; }

body { padding-bottom: 4.75rem; }

@media (min-width: 800px) {
  body { padding-bottom: 0; }
  .mobile-cta { display: none; }
  .logo-link img { height: 2.75rem; }
  .phone-link { display: inline-flex; }
  .nav-toggle { display: none; }
  .header-inner { gap: 1.25rem; }
  .nav {
    display: block;
    border: 0;
    margin-left: auto;
  }
  .nav ul {
    display: flex;
    gap: 1.25rem;
    padding: 0;
  }
  .nav a { padding: 0.25rem 0; }
  .header-actions { margin-left: 0.25rem; }
}

/* Hero and typography */
.hero {
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--rule);
  padding: 2rem 0 2.25rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
}

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.55rem);
  margin: 0 0 0.85rem;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.45rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--text);
  margin: 0 0 1.25rem;
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-visual {
  display: block;
}

.hero-photo {
  margin: 0;
}

.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 68%;
  border-radius: 0.35rem;
  background: var(--paper);
}

@media (min-width: 900px) {
  .hero { padding: 3rem 0 3.25rem; }
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 2rem;
  }
  .hero-visual { display: block; }
}

/* Chromagram / pulse decoration */
.pulse-art {
  width: 100%;
  height: auto;
  color: var(--brand);
}

/* Sections */
.section {
  padding: 2.5rem 0;
}
.section + .section { padding-top: 0; }
.section-alt {
  background: var(--paper);
  border-block: 1px solid var(--rule);
  padding: 2.5rem 0;
}

.prose { max-width: 44rem; }
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.2rem; }

/* Cards */
.card-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 700px) {
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .card-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
  .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 0.35rem;
  padding: 1.15rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
}
a.card:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(28, 28, 28, 0.06);
  color: inherit;
}
.card h3 { margin-bottom: 0.4rem; }
.card p { margin: 0 0 0.85rem; color: var(--muted); flex: 1; }
.card .more {
  font-weight: 650;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 0.95rem;
}
.card-icon {
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.75rem;
  color: var(--brand);
}

/* Photo slots */
.photo-slot {
  margin: 0;
  border: 1px dashed #b9b3ad;
  background:
    repeating-linear-gradient(
      -45deg,
      var(--paper),
      var(--paper) 8px,
      #f3f0ec 8px,
      #f3f0ec 16px
    );
  border-radius: 0.35rem;
  min-height: 11rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  color: var(--muted);
}
.photo-slot svg {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  color: #8a8380;
}
.photo-slot figcaption {
  font-size: 0.85rem;
  max-width: 22rem;
}

/* FAQ */
.faq {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  color: var(--brand);
  font-weight: 600;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0.6rem 0 0.2rem; color: var(--text); }

/* Contact */
.contact-grid {
  display: grid;
  gap: 1.75rem;
}
@media (min-width: 860px) {
  .contact-grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
}

.address-block {
  font-style: normal;
}
.address-block p { margin: 0 0 0.35rem; }

.form {
  display: grid;
  gap: 0.85rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0.35rem;
  padding: 1.15rem;
}
.form label,
.form .label {
  display: block;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.form .hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}
.req { color: var(--brand); }
.form input,
.form select,
.form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #c8c2bc;
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
}
.form textarea { min-height: 8rem; resize: vertical; }
.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(160, 24, 40, 0.25);
  outline-offset: 0;
}
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  display: none;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  margin: 0;
}
.form-status.is-ok {
  display: block;
  background: #e9f4ea;
  border: 1px solid #b7d7bb;
  color: #1d4a22;
}
.form-status.is-err {
  display: block;
  background: #fbeeee;
  border: 1px solid #e3bcbc;
  color: #6b1616;
}
.form-row-2 {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 600px) {
  .form-row-2 { grid-template-columns: 1fr 1fr; }
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #d8d8d8;
  padding: 2.25rem 0 1.5rem;
  font-size: 0.95rem;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-footer h2 {
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 0.35rem; }
.copyright {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid #3a3a3a;
  color: #b0b0b0;
  font-size: 0.85rem;
}

/* Service section anchors */
.service-block {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.service-block:first-of-type { border-top: 0; }
.service-block h2 { scroll-margin-top: 5rem; }

.page-intro { padding: 2rem 0 0.5rem; }

.in-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.in-page-nav a {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--white);
}
.in-page-nav a:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.cta-band {
  background: var(--brand-dark);
  color: #fff;
  padding: 2rem 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { margin: 0 0 1rem; max-width: 40rem; }
.cta-band .btn-primary {
  background: #fff;
  color: var(--brand-dark);
  border-color: #fff;
}
.cta-band .btn-primary:hover { background: var(--brand-soft); }
.cta-band .btn-secondary {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.cta-band .btn-secondary:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Real photographs */
.page-banner {
  margin: 0;
  background: #1a1a1a;
  line-height: 0;
}

.page-banner img {
  width: 100%;
  height: clamp(14rem, 52vw, 38rem);
  object-fit: cover;
  object-position: 40% 40%;
}

.page-photo {
  margin: 0;
}

.page-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 36rem);
  margin-inline: auto;
  border-radius: 0.35rem;
  background: var(--paper);
}

.photo-strip,
.photo-pair {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.strip-photo,
.photo-pair .page-photo {
  margin: 0;
}

.photo-strip img,
.photo-pair img {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 0.35rem;
}

/* Keep the Peak generator badge in frame when cropped to 4:3 */
.photo-pair .page-photo:first-child img {
  object-position: center 28%;
}

@media (min-width: 600px) {
  .photo-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 700px) {
  .photo-pair { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* Contact page: full-viewport photo with floating cards */
.contact-hero {
  position: relative;
  isolation: isolate;
}

.contact-hero-bg {
  margin: 0;
  background: #1a1a1a;
  line-height: 0;
  overflow: hidden;
  height: clamp(11.5rem, 48vw, 16.5rem);
}

.contact-hero-bg picture {
  display: block;
  width: 100%;
  height: 100%;
}

.contact-hero-bg img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 40% 40%;
}

.contact-hero-cards {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
  padding-block: 1.15rem 1.5rem;
}

#request-form {
  scroll-margin-top: calc(var(--header-h) + 0.6rem);
}

.contact-form-card {
  gap: 0.55rem;
  padding: 1rem 1.1rem 1.05rem;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(28, 28, 28, 0.12);
}

.contact-form-card .form-heading h1 {
  font-size: 1.35rem;
  margin: 0 0 0.3rem;
}

.contact-form-card .form-heading p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--muted);
  max-width: none;
}

.contact-form-card .hint {
  display: inline;
  font-size: 0.8rem;
}

.contact-form-card label {
  margin-bottom: 0.18rem;
  font-size: 0.88rem;
}

.contact-form-card input,
.contact-form-card select,
.contact-form-card textarea {
  padding: 0.4rem 0.55rem;
}

.contact-form-card textarea {
  min-height: 3.5rem;
  height: 3.5rem;
}
.contact-form-card input::placeholder,
.contact-form-card textarea::placeholder {
  color: #8a8580;
  opacity: 1;
}

.contact-form-card .form-row-2 {
  gap: 0.55rem;
}

.contact-info-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 0.35rem;
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: 0 10px 28px rgba(28, 28, 28, 0.1);
}

.contact-info-card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.55rem;
}

.contact-info-card p {
  margin: 0 0 0.4rem;
}

.contact-info-card p:last-child {
  margin-bottom: 0;
}

@media (min-width: 860px) {
  .contact-hero {
    display: flex;
    align-items: center;
    min-height: calc(100vh - var(--header-h) - 1px);
    min-height: calc(100dvh - var(--header-h) - 1px);
  }

  .contact-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    height: auto;
    pointer-events: none;
  }

  .contact-hero-cards {
    display: grid;
    grid-template-columns: minmax(20rem, 34rem) minmax(16rem, 22rem);
    justify-content: space-between;
    align-items: start;
    gap: 1.5rem;
    width: 100%;
    padding-block: 1.75rem 1.25rem;
  }

  .contact-form-card {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 36px rgba(28, 28, 28, 0.22);
  }

  .contact-info-card {
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 12px 36px rgba(28, 28, 28, 0.18);
  }
}

@media (min-width: 860px) and (max-height: 800px) {
  .contact-hero-cards { padding-block: 1rem 0.7rem; }
  .contact-form-card {
    gap: 0.42rem;
    padding: 0.8rem 0.95rem 0.85rem;
  }
  .contact-form-card .form-heading h1 { font-size: 1.2rem; }
  .contact-form-card .form-heading p { font-size: 0.84rem; }
  .contact-form-card textarea {
    min-height: 2.75rem;
    height: 2.75rem;
  }
  .contact-info-card {
    padding: 0.85rem 1rem 0.9rem;
  }
}

/* Nudge contact details card down and in from the top-right corner */
@media (min-width: 860px) {
  .contact-hero-cards { padding-inline: clamp(1rem, 3vw, 2.5rem); }
  .contact-info-card {
    margin-top: clamp(2.5rem, 9vh, 6rem);
    margin-right: clamp(1rem, 5vw, 5rem);
  }
}

/* Form only: center it over the photo */
@media (min-width: 860px) {
  .contact-hero-cards { grid-template-columns: minmax(20rem, 34rem); justify-content: center; }
}

/* Desktop: pin photo to top so the full rainbow arc shows on short windows */
@media (min-width: 860px) {
  .contact-hero-bg { background: #3a3f45 url(/images/westlake-phoenixville-office-800.jpg) center / cover no-repeat; }
  .contact-hero-bg::before { content: ""; position: absolute; inset: 0; backdrop-filter: blur(28px) brightness(0.75); -webkit-backdrop-filter: blur(28px) brightness(0.75); }
  .contact-hero-bg picture { position: relative; z-index: 1; }
  .contact-hero-bg img { object-fit: contain; object-position: center; }
}

/* Form lower on the photo so the rainbow shows above it */
@media (min-width: 860px) {
  .contact-hero { align-items: flex-end; }
  .contact-hero-cards { padding-block: 1rem 1.5rem; }
}

/* Flash missing required fields */
@keyframes fieldFlash {
  0%, 100% { background: #fff; box-shadow: 0 0 0 0 rgba(166, 25, 46, 0); }
  50% { background: #fde2e4; box-shadow: 0 0 0 4px rgba(166, 25, 46, 0.45); }
}
.field-flash {
  border-color: #a6192e !important;
  animation: fieldFlash 0.6s ease-in-out 3;
}
@media (prefers-reduced-motion: reduce) { .field-flash { animation: none; background: #fde2e4; } }

/* Floating note for an unselected dropdown */
.field-missing { border-color: #a6192e !important; }
.field-tip {
  position: absolute; right: 0.6rem; top: -0.35rem; transform: translateY(-100%);
  background: #a6192e; color: #fff; font-size: 0.85rem; font-weight: 600;
  padding: 0.35rem 0.65rem; border-radius: 0.3rem; box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  z-index: 5; pointer-events: none; white-space: nowrap;
}
.field-tip::after {
  content: ""; position: absolute; right: 1rem; bottom: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: #a6192e;
}

/* Larger, centered floating note */
.field-tip {
  left: 50%; right: auto; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.05rem; padding: 0.55rem 1.1rem; border-radius: 0.4rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.field-tip::after { display: none; }
.field-tip.field-tip-above { transform: translate(-50%, -100%); font-size: 0.95rem; padding: 0.4rem 0.85rem; }
.field-tip.field-tip-above::after { display: block; left: 50%; right: auto; margin-left: -6px; }
.field-tip.field-tip-above.field-tip-big { font-size: 1.05rem; padding: 0.55rem 1.1rem; }
sup.reg { font-size:0.55em; vertical-align:super; line-height:0; margin-left:0.05em; }
