/*
Theme Name: 3D Polymer Print
Theme URI: https://3dpolymerprint.com
Author: MK Meridian LLC
Description: Production ASA 3D printing services. Built around a material-datasheet aesthetic for buyers who care about specifications, tolerances, and lead times.
Version: 1.2.1
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: polymerprint
*/

/* ============================================================
   TOKENS
   Palette derives from the material: sun-exposed surfaces vs.
   protected ones. Amber is UV, slate is the shaded side.
   ============================================================ */

:root {
  /* Surfaces */
  --paper:        #F2F3F1;   /* cool industrial grey, not cream */
  --paper-deep:   #E4E7E4;
  --surface:      #FFFFFF;

  /* Ink */
  --graphite:     #1E262B;   /* deep blue-graphite */
  --graphite-mid: #46545C;
  --graphite-dim: #7A8890;
  --rule:         #C9D0CE;

  /* Signal */
  --uv:           #D98A21;   /* sun / UV exposure */
  --uv-deep:      #A5610F;
  --shade:        #2C5F66;   /* protected side */
  --shade-deep:   #1C4147;
  --alert:        #A6362E;

  /* Type */
  --font-ui: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-spec: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Scale — 1.25 minor third off 17px */
  --t-xs:   0.75rem;
  --t-sm:   0.875rem;
  --t-base: 1.0625rem;
  --t-md:   1.3rem;
  --t-lg:   1.65rem;
  --t-xl:   2.1rem;
  --t-2xl:  2.9rem;
  --t-3xl:  4rem;

  /* Rhythm */
  --sp-1: 0.5rem;
  --sp-2: 0.875rem;
  --sp-3: 1.375rem;
  --sp-4: 2.25rem;
  --sp-5: 3.5rem;
  --sp-6: 5.5rem;
  --sp-7: 8rem;

  --wrap: 1180px;
  --prose: 66ch;
}

/* ============================================================
   RESET
   ============================================================ */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
}

h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); letter-spacing: -0.012em; }
h4 { font-size: var(--t-base); letter-spacing: 0; }

p { margin: 0 0 var(--sp-3); max-width: var(--prose); }

a { color: var(--shade-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--uv-deep); }

:focus-visible {
  outline: 3px solid var(--uv);
  outline-offset: 2px;
}

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--graphite); color: #fff;
  padding: var(--sp-2) var(--sp-3); z-index: 999;
}
.skip-link:focus { left: 0; }

/* ============================================================
   LAYOUT
   ============================================================ */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-3);
}

.band { padding-block: var(--sp-6); }
.band--tight { padding-block: var(--sp-5); }
.band--dark { background: var(--graphite); color: var(--paper); }
.band--dark h2, .band--dark h3 { color: #fff; }
.band--dark a { color: var(--uv); }
.band--sunk { background: var(--paper-deep); }

/* ============================================================
   HEADER
   ============================================================ */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
}

.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  min-height: 74px;
}

.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: var(--graphite);
}
.brand__mark { flex: none; }
.brand__name {
  font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.02em; line-height: 1.1;
}
.brand__sub {
  display: block;
  font-family: var(--font-spec);
  font-size: 0.66rem;
  color: var(--graphite-dim);
  letter-spacing: 0.04em;
  font-weight: 400;
}

.nav__list {
  list-style: none; display: flex; gap: var(--sp-3);
  margin: 0; padding: 0; align-items: center;
}
.nav__list a {
  text-decoration: none; color: var(--graphite-mid);
  font-size: var(--t-sm); font-weight: 600;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
.nav__list a:hover,
.nav__list .current-menu-item > a {
  color: var(--graphite); border-bottom-color: var(--uv);
}

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule);
  padding: 0.55rem 0.7rem; cursor: pointer; border-radius: 2px;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--graphite); margin: 4px 0;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: var(--sp-3);
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list li { border-bottom: 1px solid var(--rule); }
  .nav__list a { display: block; padding: var(--sp-2) 0; }
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.5rem;
  border-radius: 2px;
  border: 2px solid var(--graphite);
  background: var(--graphite);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--shade-deep); border-color: var(--shade-deep); color: #fff; }

.btn--uv { background: var(--uv); border-color: var(--uv); color: var(--graphite); }
.btn--uv:hover { background: var(--uv-deep); border-color: var(--uv-deep); color: #fff; }

.btn--ghost { background: transparent; color: var(--graphite); }
.btn--ghost:hover { background: var(--graphite); color: #fff; }

.band--dark .btn--ghost { color: var(--paper); border-color: var(--paper); }
.band--dark .btn--ghost:hover { background: var(--paper); color: var(--graphite); }

/* ============================================================
   HERO — the datasheet is the hero
   ============================================================ */

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding-block: var(--sp-6) var(--sp-6);
  position: relative;
  overflow: hidden;
}

/* A single sun-angle rule sweeping the hero: the UV story, once. */
.hero::before {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 55%; height: 180%;
  background: linear-gradient(163deg, rgba(217,138,33,0.12) 0%, rgba(217,138,33,0) 62%);
  transform: rotate(-4deg);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--sp-5);
  align-items: start;
}

.hero h1 {
  font-size: var(--t-3xl);
  margin-bottom: var(--sp-3);
}

.hero__lede {
  font-size: var(--t-md);
  line-height: 1.45;
  color: var(--graphite-mid);
  max-width: 40ch;
  margin-bottom: var(--sp-4);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  .hero h1 { font-size: var(--t-2xl); }
}

/* ============================================================
   DATASHEET — the signature component
   ============================================================ */

.datasheet {
  background: var(--graphite);
  color: var(--paper);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--rule);
}

.datasheet__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--shade-deep);
  border-bottom: 2px solid var(--uv);
}
.datasheet__title {
  font-weight: 700; font-size: var(--t-sm); color: #fff; margin: 0;
}
.datasheet__rev {
  font-family: var(--font-spec); font-size: var(--t-xs);
  color: rgba(255,255,255,0.65);
}

.datasheet__rows { margin: 0; padding: var(--sp-2) var(--sp-3) var(--sp-3); }

.spec-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: var(--sp-2);
  padding-block: 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.spec-row:last-child { border-bottom: 0; }

.spec-row dt {
  font-family: var(--font-spec);
  font-size: var(--t-xs);
  color: var(--graphite-dim);
  line-height: 1.5;
}
.spec-row dd {
  margin: 0;
  font-size: var(--t-sm);
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
}
.spec-row dd .unit {
  font-family: var(--font-spec);
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  font-size: var(--t-xs);
}

/* Light variant used on project pages */
.datasheet--light { background: var(--surface); color: var(--graphite); border: 1px solid var(--rule); }
.datasheet--light .datasheet__head { background: var(--paper-deep); border-bottom-color: var(--uv); }
.datasheet--light .datasheet__title { color: var(--graphite); }
.datasheet--light .datasheet__rev { color: var(--graphite-dim); }
.datasheet--light .spec-row { border-bottom-color: var(--rule); }
.datasheet--light .spec-row dt { color: var(--graphite-dim); }
.datasheet--light .spec-row dd { color: var(--graphite); }
.datasheet--light .spec-row dd .unit { color: var(--graphite-dim); }

/* ============================================================
   SECTION HEADING
   ============================================================ */

.section-head { margin-bottom: var(--sp-4); max-width: var(--prose); }
.section-head p { color: var(--graphite-mid); margin-bottom: 0; }
.band--dark .section-head p { color: rgba(255,255,255,0.72); }

/* ============================================================
   APPLICATIONS — asymmetric, not a card grid
   ============================================================ */

.apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--rule); }

.app {
  padding: var(--sp-4) var(--sp-4) var(--sp-4) 0;
  border-bottom: 1px solid var(--rule);
}
.app:nth-child(odd) { border-right: 1px solid var(--rule); padding-right: var(--sp-4); }
.app:nth-child(even) { padding-left: var(--sp-4); }

.app h3 { margin-bottom: var(--sp-1); }
.app p { color: var(--graphite-mid); font-size: var(--t-sm); margin-bottom: 0; }

.app__parts {
  font-family: var(--font-spec);
  font-size: var(--t-xs);
  color: var(--shade);
  margin-top: var(--sp-2);
  line-height: 1.7;
}

@media (max-width: 720px) {
  .apps { grid-template-columns: 1fr; }
  .app, .app:nth-child(odd), .app:nth-child(even) {
    padding: var(--sp-3) 0; border-right: 0; padding-left: 0; padding-right: 0;
  }
}

/* ============================================================
   PROCESS — genuinely a sequence, so numbered
   ============================================================ */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); counter-reset: step; }

.step { counter-increment: step; padding-top: var(--sp-3); border-top: 2px solid var(--uv); }
.step::before {
  content: counter(step);
  display: block;
  font-family: var(--font-spec);
  font-size: var(--t-sm);
  color: var(--uv);
  margin-bottom: var(--sp-1);
}
.step h3 { font-size: var(--t-base); margin-bottom: var(--sp-1); }
.step p { font-size: var(--t-sm); color: rgba(255,255,255,0.72); margin: 0; }

@media (max-width: 820px) { .steps { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* ============================================================
   PROJECT CARDS
   ============================================================ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: var(--sp-4);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.project-card__media {
  aspect-ratio: 4 / 3;
  background: var(--paper-deep);
  overflow: hidden;
}
.project-card__media img { width: 100%; height: 100%; object-fit: cover; }

.project-card__placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--graphite-dim);
  font-family: var(--font-spec);
  font-size: var(--t-xs);
}

.project-card__body { padding: var(--sp-3); display: flex; flex-direction: column; flex: 1; }

.project-card__meta {
  font-family: var(--font-spec);
  font-size: var(--t-xs);
  color: var(--shade);
  margin-bottom: var(--sp-1);
}

.project-card h3 { font-size: var(--t-base); margin-bottom: var(--sp-1); }
.project-card h3 a { color: var(--graphite); text-decoration: none; }
.project-card h3 a:hover { color: var(--uv-deep); text-decoration: underline; }

.project-card p { font-size: var(--t-sm); color: var(--graphite-mid); margin-bottom: var(--sp-2); }

.project-card__foot {
  margin-top: auto;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--rule);
  font-family: var(--font-spec);
  font-size: var(--t-xs);
  color: var(--graphite-dim);
  display: flex; justify-content: space-between; gap: var(--sp-2);
}

/* ============================================================
   FILTERS
   ============================================================ */

.filters { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.filters a {
  font-size: var(--t-xs);
  font-family: var(--font-spec);
  text-decoration: none;
  color: var(--graphite-mid);
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 0.35rem 0.7rem;
  border-radius: 2px;
}
.filters a:hover, .filters a.is-active {
  border-color: var(--graphite); color: var(--graphite); background: var(--paper-deep);
}

/* ============================================================
   PROJECT SINGLE
   ============================================================ */

.project-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: var(--sp-5);
  align-items: start;
}
@media (max-width: 900px) { .project-layout { grid-template-columns: 1fr; } }

.project-hero-img {
  border: 1px solid var(--rule);
  border-radius: 3px;
  margin-bottom: var(--sp-4);
  background: var(--surface);
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.project-gallery img { border: 1px solid var(--rule); border-radius: 3px; }

.callout {
  border-left: 3px solid var(--uv);
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-3);
  margin-block: var(--sp-4);
  background: linear-gradient(90deg, rgba(217,138,33,0.06), transparent 70%);
}
.callout h4 { margin-bottom: var(--sp-1); }
.callout p:last-child { margin-bottom: 0; }

/* ============================================================
   PRICING
   ============================================================ */

.price-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); }
.price-table caption { text-align: left; font-size: var(--t-sm); color: var(--graphite-mid); padding-bottom: var(--sp-2); }
.price-table th, .price-table td { padding: var(--sp-2) var(--sp-3); text-align: left; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.price-table th { font-weight: 700; background: var(--paper-deep); }
.price-table td:last-child { font-family: var(--font-spec); white-space: nowrap; }
.price-table tr:last-child td { border-bottom: 0; }

.minimum-note {
  border: 2px solid var(--graphite);
  background: var(--surface);
  padding: var(--sp-3);
  border-radius: 3px;
  margin-top: var(--sp-4);
}
.minimum-note strong { font-size: var(--t-md); display: block; margin-bottom: var(--sp-1); }
.minimum-note p { margin-bottom: 0; font-size: var(--t-sm); color: var(--graphite-mid); }

/* ============================================================
   QUOTE FORM
   ============================================================ */

.quote-form { max-width: 640px; }

.field { margin-bottom: var(--sp-3); }
.field label { display: block; font-weight: 700; font-size: var(--t-sm); margin-bottom: 0.35rem; }
.field .hint { display: block; font-weight: 400; color: var(--graphite-mid); font-size: var(--t-xs); margin-top: 0.15rem; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-ui);
  font-size: var(--t-base);
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--graphite-dim);
  border-radius: 2px;
  background: var(--surface);
  color: var(--graphite);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--shade); }

.form-notice {
  padding: var(--sp-2) var(--sp-3);
  border-radius: 2px;
  margin-bottom: var(--sp-3);
  font-size: var(--t-sm);
}
.form-notice--ok { background: #E7F1EC; border-left: 3px solid var(--shade); }
.form-notice--err { background: #F7E9E7; border-left: 3px solid var(--alert); }

.honeypot { position: absolute; left: -9999px; }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer { background: var(--graphite); color: rgba(255,255,255,0.75); padding-block: var(--sp-5) var(--sp-4); }
.site-footer a { color: var(--paper); }
.site-footer h4 { color: #fff; font-size: var(--t-sm); margin-bottom: var(--sp-2); }

.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.4rem; font-size: var(--t-sm); }

.footer-contact { font-family: var(--font-spec); font-size: var(--t-sm); line-height: 1.9; }

.colophon {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding-top: var(--sp-3);
  font-size: var(--t-xs);
  color: rgba(255,255,255,0.5);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2);
}

/* ============================================================
   POSTS / PAGES
   ============================================================ */

.entry { max-width: var(--prose); }
.entry img { border-radius: 3px; margin-block: var(--sp-3); }
.entry ul, .entry ol { max-width: var(--prose); padding-left: 1.3rem; }
.entry li { margin-bottom: 0.4rem; }
.entry blockquote {
  margin: var(--sp-4) 0; padding-left: var(--sp-3);
  border-left: 3px solid var(--uv); color: var(--graphite-mid);
}
.entry table { width: 100%; border-collapse: collapse; margin-block: var(--sp-3); }
.entry th, .entry td { border: 1px solid var(--rule); padding: var(--sp-2); text-align: left; font-size: var(--t-sm); }

.entry-meta { font-family: var(--font-spec); font-size: var(--t-xs); color: var(--graphite-dim); margin-bottom: var(--sp-3); }

.pagination { display: flex; gap: var(--sp-1); margin-top: var(--sp-5); flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 0.45rem 0.8rem; border: 1px solid var(--rule);
  background: var(--surface); text-decoration: none; border-radius: 2px;
  font-size: var(--t-sm);
}
.pagination .page-numbers.current { background: var(--graphite); color: #fff; border-color: var(--graphite); }

/* Alignment classes WordPress expects */
.alignleft { float: left; margin: 0 var(--sp-3) var(--sp-2) 0; }
.alignright { float: right; margin: 0 0 var(--sp-2) var(--sp-3); }
.aligncenter { margin-inline: auto; }
.alignwide, .alignfull { max-width: none; }
.wp-caption-text, figcaption { font-size: var(--t-xs); color: var(--graphite-dim); }

/* ============================================================
   CTA STRIP
   ============================================================ */

.cta-strip {
  background: var(--uv);
  color: var(--graphite);
  padding-block: var(--sp-5);
}
.cta-strip h2 { color: var(--graphite); margin-bottom: var(--sp-2); }
.cta-strip p { color: rgba(30,38,43,0.82); margin-bottom: var(--sp-3); }
.cta-strip .btn { border-color: var(--graphite); background: var(--graphite); color: #fff; }
.cta-strip .btn:hover { background: #000; border-color: #000; }

/* ============================================================
   ESTIMATOR
   ============================================================ */

.estimator__drop {
  border: 2px dashed var(--graphite-dim);
  border-radius: 3px;
  background: var(--surface);
  padding: var(--sp-5) var(--sp-3);
  text-align: center;
  cursor: pointer;
  color: var(--graphite-mid);
  display: grid;
  justify-items: center;
  gap: var(--sp-1);
  transition: border-color 120ms ease, background 120ms ease;
}
.estimator__drop:hover,
.estimator__drop:focus-visible,
.estimator__drop.is-over {
  border-color: var(--uv);
  background: #FFFCF6;
  color: var(--graphite);
}
.estimator__drop strong { font-size: var(--t-md); color: var(--graphite); }
.estimator__drop span { font-size: var(--t-sm); }
.estimator__drop svg { color: var(--graphite-dim); margin-bottom: var(--sp-1); }

.estimator__status {
  font-family: var(--font-spec);
  font-size: var(--t-xs);
  min-height: 1.4em;
  margin: var(--sp-2) 0 var(--sp-2);
  color: var(--graphite-mid);
}
.estimator__status.is-ok { color: var(--shade-deep); }
.estimator__status.is-err { color: var(--alert); }

.estimator__manual { margin-bottom: var(--sp-3); }

.estimator__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--rule);
  margin-bottom: var(--sp-4);
}
.estimator__controls .field { margin-bottom: 0; }

.estimator__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--graphite);
  color: #fff;
}
.estimator__total span { font-size: var(--t-sm); color: rgba(255,255,255,0.72); }
.estimator__total strong {
  font-size: var(--t-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--uv);
}

.estimator__caveat {
  font-size: var(--t-sm);
  color: var(--graphite-mid);
  margin-top: var(--sp-3);
  max-width: 58ch;
}
