/* ═══════════════════════════════════════════════════════════════
   Page Base — Shared hero, section, container, button styles.
   Replaces duplicate patterns across 12+ page-specific CSS files.
   ═══════════════════════════════════════════════════════════════ */

/* ── Page wrapper ── */
.page-wrap {
  color: var(--color-text);
  font-family: var(--font-primary);
  line-height: var(--leading-normal);
}

/* ── Container ── */
.pg-container {
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 0 var(--space-container);
}

.pg-container-wide {
  max-width: var(--max-w-wide);
  width: 80%;
}

/* ── Section ── */
.pg-section {
  padding: var(--space-section) 0;
}

.pg-section-header {
  text-align: center;
  margin-bottom: 40px;
}

.pg-section-header h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text-dark);
  margin: 0 0 12px;
}

.pg-section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-light);
  margin-top: 12px;
}

/* ── Hero Banner (reusable) ── */
.pg-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  overflow: hidden;
  background: var(--color-bg-dark);
}

.pg-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pg-hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pg-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pg-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4));
  z-index: 1;
}

.pg-hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w-hero);
  padding: 60px var(--space-container);
  color: #fff;
}

.pg-hero-content h1 {
  font-size: var(--text-5xl);
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.15;
  color: #fff;
}

.pg-hero-subtitle {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 24px;
}

/* ── Hero Modifiers ── */
.pg-hero--product {
  min-height: 50vh;
}

.pg-hero--product .pg-hero-content {
  max-width: 800px;
  padding: 48px 24px;
}

.pg-hero--tall {
  min-height: 70vh;
}

.pg-hero--compact {
  min-height: auto;
  padding: 80px 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.pg-hero--compact .pg-hero-content h1 {
  font-size: 3.5rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.pg-hero--blog {
  min-height: 70vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.pg-hero--blog .pg-hero-content h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  text-wrap: balance;
  max-width: 900px;
}

.pg-hero--minimal {
  min-height: 160px;
  background: #0c1220;
}

.pg-hero--grid-bg {
  background: #1b222d url('../assets/images/half-grid-overlay.png') center / cover no-repeat;
}

.pg-hero--fixed {
  min-height: 700px;
}

/* Logo in hero (replaces h1 for branded product pages) */
.pg-hero-logo {
  margin: 0 auto 20px;
  max-width: 300px;
  width: 90%;
}

.pg-hero-logo svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Divider */
.pg-hero-divider {
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  margin: 1.5rem auto;
}

/* ── Primary Button ── */
.pg-btn-primary {
  display: inline-block;
  background: var(--color-primary-dark);
  color: var(--color-white) !important;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 40px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-btn);
  transition: background var(--transition-normal), transform var(--transition-fast);
}

.pg-btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ── Overview icon ── */
.pg-overview-icon {
  max-width: 80px;
  margin: 0 auto 20px;
}

.pg-overview-icon svg {
  width: 100%;
  height: auto;
}

/* ── Overview body (with subtitle, left-aligned) ── */
.pg-overview-body {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  text-align: left;
}

.pg-overview-subtitle {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  color: #333;
}

.pg-overview-subtitle:first-child {
  margin-top: 0;
}

.pg-overview-body p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text-light);
  margin-bottom: 15px;
}

.pg-overview-body table,
.pg-center-text table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.6;
}

.pg-overview-body thead td,
.pg-center-text thead td {
  background: #1a1a2e;
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  width: 25%;
}

.pg-overview-body tbody td,
.pg-center-text tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
  color: var(--color-text-light);
  text-align: left;
}

.pg-overview-body table ul,
.pg-center-text table ul {
  padding-left: 18px;
  margin: 0;
}

.pg-overview-body table ul li,
.pg-center-text table ul li {
  margin-bottom: 4px;
}

.pg-overview-body {
  overflow-x: auto;
}

/* ── Centered text block ── */
.pg-center-text {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  text-align: center;
}

.pg-center-text p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text-light);
  margin-bottom: 15px;
}

/* ── Workflow (alternating image+text) ── */
.pg-workflow {
  display: flex;
  gap: 40px;
  align-items: center;
  margin-bottom: 50px;
}

.pg-workflow-reverse {
  flex-direction: row-reverse;
}

.pg-workflow-media {
  flex: 1;
  min-width: 0;
}

.pg-workflow-media img {
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.pg-workflow-text {
  flex: 1;
  min-width: 0;
}

.pg-workflow-text h3 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0 0 16px;
  line-height: 1.2;
}

.pg-workflow-text p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-body);
  margin: 0;
}

.pg-workflow-text a {
  color: var(--color-primary);
}

/* ── Sub-items (3-col bordered cards inside a workflow block) ── */
.pg-feature-block {
  margin-bottom: 64px;
}

.pg-feature-block:last-child {
  margin-bottom: 0;
}

.pg-subitems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.pg-subitems-grid--1 {
  grid-template-columns: 1fr;
}

.pg-subitems-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.pg-subitem-link--block {
  display: block;
  margin-top: 6px;
}

.pg-subitem-link--block:first-child {
  margin-top: 0;
}

.pg-subitem-card {
  border: 1.5px solid #dde3ec;
  border-radius: 6px;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
}

.pg-subitem-card h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0 0 10px;
}

.pg-subitem-card p {
  font-size: var(--text-sm);
  color: var(--color-text-body);
  line-height: 1.6;
  margin: 0 0 14px;
  flex: 1;
}

/* legacy list-style (keep for other pages) */
.pg-subitems {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pg-subitem {
  border: 1.5px solid #dde3ec;
  border-radius: 6px;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
}

.pg-subitem h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0 0 10px;
}

.pg-subitem p {
  font-size: var(--text-sm);
  color: var(--color-text-body);
  line-height: 1.6;
  margin: 0 0 14px;
  flex: 1;
}

.pg-subitem-link,
.pg-subitem-links a {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Divider ── */
.pg-divider-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
}

.pg-divider-red {
  width: 60px;
  height: 3px;
  background: var(--color-primary);
}

.pg-divider-gray {
  width: 200px;
  height: 1px;
  background: var(--color-border);
}

/* ── Line pixels decoration ── */
.pg-line-pixels {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  opacity: 0.5;
  z-index: 2;
  pointer-events: none;
}

.pg-line-pixels img {
  width: 100%;
  display: block;
}

/* Portrait screens — cap hero height so it doesn't fill the tall viewport */
@media (orientation: portrait) and (min-width: 768px) {
  .pg-hero {
    min-height: auto;
    padding: 10rem 0 6rem;
  }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .pg-container-wide {
    width: 90%;
  }

  .pg-subitems {
    grid-template-columns: repeat(2, 1fr);
  }

  .pg-subitems-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pg-section {
    padding: var(--space-section-mobile) 0;
  }

  .pg-container-wide {
    width: 92%;
  }

  .pg-hero {
    min-height: 50vh;
  }

  .pg-hero-content h1 {
    font-size: 2rem;
  }

  .pg-section-header h2 {
    font-size: 24px;
  }

  .pg-workflow {
    flex-direction: column !important;
    gap: 24px;
  }

  .pg-subitems {
    grid-template-columns: 1fr;
  }

  .pg-subitems-grid {
    grid-template-columns: 1fr;
  }

  .pg-workflow-text h3 {
    font-size: var(--text-2xl);
  }

  .pg-hero--compact {
    padding: 50px 0;
  }

  .pg-hero--compact .pg-hero-content h1 {
    font-size: 2rem;
  }

  .pg-hero--tall {
    min-height: 50vh;
  }

  .pg-hero--fixed {
    min-height: 400px;
  }

  .pg-hero--blog {
    min-height: 50vh;
  }

  .pg-hero--minimal {
    min-height: 160px;
  }

  .pg-hero--product .pg-hero-logo {
    max-width: 220px;
  }
}

@media (max-width: 480px) {
  .pg-hero-content h1 {
    font-size: 1.6rem;
  }

  .pg-hero-content {
    padding: 40px 16px;
  }
}