/* ===========================================================
   Corofy — inner page layouts
   =========================================================== */

/* ---------------- Page hero band ---------------- */

.page-hero {
  position: relative;
  background: var(--ink-950);
  padding-block: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem) clamp(1.75rem, 1.25rem + 2vw, 2.5rem);
  overflow: hidden;
  isolation: isolate;
}

/* Translucent photo behind the band. Sits below the grid + orbs so the depth
   treatment from the rest of the site still reads on top of it. */
.page-hero__bg { position: absolute; inset: 0; z-index: -3; }
.page-hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 45%;
  opacity: 0.26;
  filter: saturate(0.85);
}
.page-hero__bg::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(6,10,29,0.94) 0%, rgba(6,10,29,0.82) 46%, rgba(6,10,29,0.62) 100%),
    linear-gradient(to bottom, rgba(6,10,29,0.55) 0%, rgba(6,10,29,0.30) 45%, rgba(6,10,29,0.88) 100%);
}

.page-hero__grid {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 80% 80% at 20% 10%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 20% 10%, #000 0%, transparent 72%);
}
.page-hero h1 {
  color: #fff;
  max-width: 22ch;
  font-size: clamp(1.85rem, 1.35rem + 1.9vw, 2.75rem);
}
.page-hero__lead {
  color: var(--on-dark-muted);
  font-size: var(--fs-body);
  max-width: 60ch;
  margin-top: var(--s-4);
}
.page-hero .eyebrow { margin-bottom: var(--s-2); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  color: var(--on-dark-faint);
  margin-bottom: var(--s-4);
}
.breadcrumb a { color: var(--on-dark-faint); transition: color var(--dur) var(--ease-out); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb span:last-child { color: var(--on-dark-muted); }

/* ---------------- Article / prose ---------------- */

.prose-content { max-width: 74ch; }
.prose-content > * + * { margin-top: var(--s-5); }
.prose-content h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  margin-top: var(--s-9);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose-content h3 { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.4rem); margin-top: var(--s-7); }
.prose-content h4 { font-size: 1.08rem; margin-top: var(--s-6); }
.prose-content p { color: var(--text-muted); }
.prose-content > *:first-child { margin-top: 0; }

.prose-content .prose-list { display: grid; gap: var(--s-3); padding-left: 0; }
.prose-content .prose-list li {
  position: relative;
  padding-left: var(--s-6);
  color: var(--text-muted);
  line-height: 1.7;
}
.prose-content .prose-list li::before {
  content: '';
  position: absolute;
  left: 2px; top: 0.66em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: linear-gradient(140deg, var(--brand-500), var(--accent-500));
}
.prose-content ol.prose-list { counter-reset: n; }
.prose-content ol.prose-list li::before {
  counter-increment: n;
  content: counter(n);
  width: auto; height: auto;
  top: 0;
  left: 0;
  background: none;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--brand-600);
}

/* Small source icons (42–68px) render at natural size in a tinted tile —
   never stretched to the text column width. */
.prose-icons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-block: var(--s-6) var(--s-4);
}
.prose-icon {
  width: 52px;
  height: 52px;
  padding: 10px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: linear-gradient(140deg, var(--brand-50), var(--brand-100));
  border: 1px solid var(--brand-100);
  box-shadow: none;
}
/* an icon immediately followed by its heading should sit tight to it */
.prose-icons + h2, .prose-icons + h3 { margin-top: var(--s-3); }

/* A single inline image: capped so it illustrates rather than dominates. */
.prose-figure { margin-block: var(--s-7); }
.prose-figure img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

/* Runs of consecutive images collapse into one compact gallery. */
.prose-gallery {
  display: grid;
  gap: var(--s-3);
  margin-block: var(--s-7);
}
.prose-gallery figure { margin: 0; }
.prose-gallery img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.prose-gallery figure:hover img { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.prose-gallery[data-cols='2'] { grid-template-columns: repeat(2, 1fr); }
.prose-gallery[data-cols='3'] { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px) {
  .prose-gallery[data-cols='3'] { grid-template-columns: repeat(2, 1fr); }
  .prose-gallery img { aspect-ratio: 1 / 1; }
}

.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
.prose-content table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 460px; }
.prose-content th, .prose-content td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.prose-content th {
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--heading);
}
.prose-content td { color: var(--text-muted); }
.prose-content tr:last-child td { border-bottom: 0; }

/* ---------------- Article layout with sidebar ---------------- */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: clamp(2.5rem, 1rem + 4vw, 4.5rem);
  align-items: start;
}
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } }

.sidebar { position: sticky; top: calc(var(--header-h) + var(--s-5)); display: grid; gap: var(--s-5); }
@media (max-width: 980px) { .sidebar { position: static; } }

.side-card {
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
}
.side-card h3 { font-size: 1.05rem; margin-bottom: var(--s-4); }
.side-card p { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--s-5); }
.side-card--dark {
  background: linear-gradient(150deg, var(--ink-900), var(--ink-800));
  border-color: transparent;
  color: var(--on-dark-muted);
}
.side-card--dark h3 { color: #fff; }
.side-card--dark p { color: var(--on-dark-muted); }

.side-list { display: grid; gap: var(--s-1); }
.side-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-xs);
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text);
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.side-list a:hover { background: var(--brand-50); color: var(--brand-700); }
.side-list a[aria-current='page'] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.side-list svg { width: 12px; height: 12px; opacity: 0.5; }

/* ---------------- Post meta ---------------- */

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  color: var(--on-dark-faint);
  margin-top: var(--s-5);
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }

.post-hero-img {
  margin-top: calc(var(--s-9) * -1);
  margin-bottom: var(--s-9);
  position: relative;
  z-index: 2;
}
.post-hero-img img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
}
@media (max-width: 700px) { .post-hero-img img { aspect-ratio: 16 / 10; } }

/* ---------------- Products catalog: category tabs + card grid ---------------- */

.v5-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s-5);
}
.v5-tab {
  padding: 0.58rem 1.05rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.v5-tab:hover { border-color: var(--brand-600); color: var(--brand-600); transform: translateY(-1px); }
.v5-tab.is-active {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(24,48,208,0.55);
}

.v5-panel { display: none; }
.v5-panel.is-active { display: block; }

.v5-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: var(--s-3);
}
.v5-item {
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-400);
  border-radius: var(--r-sm);
  background: var(--paper);
  transition: border-left-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
}
.v5-item:hover {
  border-left-color: var(--accent-500);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}
.v5-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--heading);
  font-weight: 600;
  line-height: 1.35;
}
.v5-item span {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.55;
}
/* products the source lists by name only still need a consistent card height */
.v5-item:not(:has(span)) strong { padding-block: 2px; }

/* ---------------- Products catalog (legacy accordion) ---------------- */

.catalog { display: grid; gap: var(--s-5); }

.cat-group {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.cat-group.is-open { box-shadow: var(--shadow-lg); border-color: var(--brand-200); }

.cat-group__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-6);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.cat-group__icon {
  width: 46px; height: 46px;
  flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(140deg, var(--brand-50), var(--brand-100));
  border: 1px solid var(--brand-100);
  color: var(--brand-600);
}
.cat-group__icon svg { width: 21px; height: 21px; }
.cat-group__title { flex: 1; }
.cat-group__title h2 {
  font-size: 1.2rem;
  margin-bottom: 3px;
  transition: color var(--dur) var(--ease-out);
}
.cat-group__title span { font-size: var(--fs-xs); color: var(--text-faint); }
.cat-group__head:hover h2 { color: var(--brand-600); }
.cat-group__chev {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--brand-600);
  transition: transform var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.cat-group__chev svg { width: 13px; height: 13px; }
.cat-group.is-open .cat-group__chev {
  transform: rotate(180deg);
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

.cat-group__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 420ms var(--ease-out); }
.cat-group__panel > div { overflow: hidden; min-height: 0; }
.cat-group.is-open .cat-group__panel { grid-template-rows: 1fr; }
.cat-group__inner { padding: 0 var(--s-6) var(--s-6); border-top: 1px solid var(--line); padding-top: var(--s-6); }

.cat-sub + .cat-sub { margin-top: var(--s-6); }
.cat-sub h3 {
  font-size: 0.95rem;
  margin-bottom: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.cat-sub h3::before {
  content: '';
  width: 16px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
}
.cat-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-2);
}
.cat-items li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: 0.55rem 0.7rem;
  border-radius: var(--r-xs);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.cat-items li:hover { background: var(--surface); color: var(--text); }
.cat-items li::before {
  content: '';
  flex: none;
  width: 5px; height: 5px;
  margin-top: 0.55em;
  border-radius: 1px;
  background: var(--brand-300);
}

/* catalog search */
.catalog-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
  margin-bottom: var(--s-7);
}
.catalog-search { position: relative; flex: 1; min-width: 260px; }
.catalog-search input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  background: var(--paper);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.catalog-search input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(24,48,208,0.12);
}
.catalog-search svg {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}
.catalog-count { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.cat-empty {
  padding: var(--s-8);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
mark { background: rgba(24,48,208,0.14); color: var(--brand-700); border-radius: 3px; padding: 0 2px; }

/* ---------------- Forms ---------------- */

.form-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2.5rem, 1rem + 4vw, 4.5rem);
  align-items: start;
}
@media (max-width: 900px) { .form-layout { grid-template-columns: 1fr; } }

.form-card {
  padding: clamp(1.75rem, 1rem + 2vw, 2.75rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.form-note { font-size: var(--fs-xs); color: var(--text-faint); margin-top: var(--s-4); }

.contact-cards { display: grid; gap: var(--s-4); }
.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.contact-card:hover { border-color: var(--brand-200); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.contact-card .icon-box { width: 44px; height: 44px; }
.contact-card .icon-box svg { width: 20px; height: 20px; }
.contact-card h3 { font-size: 0.95rem; margin-bottom: 4px; }
.contact-card p, .contact-card a { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.6; }
.contact-card a:hover { color: var(--brand-600); }

/* ---------------- Industry / product index cards ---------------- */

.index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-5); }

.index-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--paper);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.index-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.index-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.index-card__body { padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.index-card h3 { font-size: 1.15rem; }
.index-card p { font-size: var(--fs-sm); color: var(--text-muted); }
.index-card .link-arrow { margin-top: auto; padding-top: var(--s-2); }
.index-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
.index-card:hover .index-card__media img { transform: scale(1.06); }

/* pill list of products on an industry page */
.chip-list { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.chip-list a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.5rem 0.95rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  color: var(--text);
  transition: border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.chip-list a:hover { border-color: var(--brand-600); color: var(--brand-600); background: var(--brand-50); }

/* ---------------- Spec strip on product pages ---------------- */

.spec-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}
.spec-tile {
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.spec-tile dt {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.spec-tile dd {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading);
  margin: 0;
}

/* ---------------- 404 ---------------- */

.notfound { text-align: center; padding-block: clamp(4rem, 2rem + 8vw, 8rem); }
.notfound__code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 3rem + 12vw, 11rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(140deg, var(--brand-600), var(--accent-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
