/* ==========================================================================
   PT. PRATAMA TEKNIK INTI PRIMA
   Custom CSS — Machine Spec Table & Tender Portfolio
   Design tokens match 01-design-system.md
   ========================================================================== */

:root {
  --ptip-navy: #0B1E33;
  --ptip-navy-soft: #16324f;
  --ptip-charcoal: #2E333A;
  --ptip-gold: #F5A623;
  --ptip-gold-hover: #e0961a;
  --ptip-surface: #F7F8FA;
  --ptip-border: #E4E7EB;
  --ptip-text-muted: #5B6470;
  --ptip-success-bg: #ECFDF3;
  --ptip-success-text: #067647;
  --font-heading: "Archivo", "Montserrat", sans-serif;
  --font-body: "Inter", "Plus Jakarta Sans", sans-serif;
}

/* ==========================================================================
   1. MACHINE SPEC TABLE
   Targets the markup in single-industrial_machine.php (.ptip-machine-single)
   ========================================================================== */

.ptip-machine-single table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: #fff;
}

.ptip-machine-single table thead th {
  background: var(--ptip-navy);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.85rem 1.25rem;
}

.ptip-machine-single table tbody tr {
  border-bottom: 1px solid var(--ptip-border);
  transition: background-color 0.15s ease;
}

.ptip-machine-single table tbody tr:last-child {
  border-bottom: none;
}

.ptip-machine-single table tbody tr:nth-child(odd) {
  background: var(--ptip-surface);
}

.ptip-machine-single table tbody tr:hover {
  background: #EFF3F8;
}

.ptip-machine-single table td {
  padding: 0.85rem 1.25rem;
  vertical-align: top;
}

.ptip-machine-single table td:first-child {
  width: 34%;
  font-weight: 600;
  color: var(--ptip-text-muted);
  border-right: 1px solid var(--ptip-border);
}

.ptip-machine-single table td:last-child {
  color: var(--ptip-navy);
  font-weight: 500;
}

/* Table wrapper — rounded card with shadow, scrolls on narrow screens */
.ptip-machine-single table {
  min-width: 480px; /* forces horizontal scroll on mobile instead of crushing columns */
}

.ptip-machine-single .table-responsive,
.ptip-machine-single table {
  border: 1px solid var(--ptip-border);
  border-radius: 10px;
  overflow: hidden;
}

/* TKDN certified pill inside spec rows, if used inline in a cell */
.ptip-spec-tkdn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ptip-success-bg);
  color: var(--ptip-success-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.ptip-spec-tkdn-pill::before {
  content: "✓";
  font-weight: 700;
}

/* Highlight row for the most conversion-critical spec (optional data-attr hook) */
.ptip-machine-single table tr[data-highlight="true"] td {
  background: #FFF8EC;
  border-left: 3px solid var(--ptip-gold);
}

/* Sticky first column on very wide spec tables (many-column comparison view) */
@media (min-width: 768px) {
  .ptip-machine-single table.compare-table td:first-child,
  .ptip-machine-single table.compare-table th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
  }
}

/* ==========================================================================
   2. TENDER PORTFOLIO — ARCHIVE GRID (archive-tender_portfolio.php)
   ========================================================================== */

.ptip-portfolio-archive {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.ptip-portfolio-archive__header {
  margin-bottom: 2.5rem;
  text-align: left;
}

.ptip-portfolio-archive__header h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--ptip-navy);
  margin: 0 0 0.5rem;
}

.ptip-portfolio-archive__header p {
  color: var(--ptip-text-muted);
  font-family: var(--font-body);
  max-width: 640px;
}

.ptip-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

/* Card */
.ptip-portfolio-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ptip-charcoal);
  aspect-ratio: 4 / 5;
  text-decoration: none;
  display: block;
  isolation: isolate;
}

.ptip-portfolio-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ptip-portfolio-card:hover img {
  transform: scale(1.06);
}

/* Gradient scrim for legible text over photo */
.ptip-portfolio-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,30,51,0) 35%, rgba(11,30,51,0.92) 100%);
  z-index: 1;
}

.ptip-portfolio-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.25rem;
  color: #fff;
}

.ptip-portfolio-card__client {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ptip-gold);
  margin-bottom: 0.4rem;
}

.ptip-portfolio-card__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.ptip-portfolio-card__meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
}

.ptip-portfolio-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Status badge (e.g. "Selesai" / "FAT Passed") */
.ptip-portfolio-card__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  background: rgba(255,255,255,0.95);
  color: var(--ptip-navy);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

/* ==========================================================================
   3. TENDER PORTFOLIO — SINGLE CASE STUDY (single-tender_portfolio.php)
   ========================================================================== */

.ptip-portfolio-single {
  max-width: 1024px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.ptip-portfolio-single__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ptip-gold);
}

.ptip-portfolio-single h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  color: var(--ptip-navy);
  margin: 0.5rem 0 1.25rem;
}

/* Quick facts strip: client, sector, completion date, scope */
.ptip-portfolio-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  background: var(--ptip-surface);
  border: 1px solid var(--ptip-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.ptip-portfolio-facts dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ptip-text-muted);
  margin-bottom: 0.25rem;
}

.ptip-portfolio-facts dd {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ptip-navy);
  font-size: 0.95rem;
}

/* FAT (Factory Acceptance Test) photo gallery */
.ptip-fat-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 2rem 0;
}

.ptip-fat-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
}

.ptip-fat-gallery figure {
  margin: 0;
  grid-column: span 1;
}

.ptip-fat-gallery figure:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.ptip-fat-gallery figure:first-child img {
  aspect-ratio: 1 / 1;
  height: 100%;
}

/* Client reference letter — styled blockquote/card */
.ptip-reference-letter {
  border-left: 4px solid var(--ptip-gold);
  background: var(--ptip-surface);
  border-radius: 0 10px 10px 0;
  padding: 1.5rem 1.75rem;
  margin: 2.5rem 0;
}

.ptip-reference-letter blockquote {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ptip-navy);
  font-size: 1rem;
  line-height: 1.6;
}

.ptip-reference-letter cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ptip-text-muted);
}

.ptip-reference-letter cite::before {
  content: "— ";
}

/* Download reference letter PDF button */
.ptip-reference-letter__download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ptip-navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ptip-reference-letter__download:hover {
  color: var(--ptip-gold-hover);
}

/* ==========================================================================
   4. RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 767px) {
  .ptip-portfolio-grid {
    grid-template-columns: 1fr;
  }

  .ptip-fat-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .ptip-fat-gallery figure:first-child {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 16 / 10;
  }

  .ptip-fat-gallery figure:first-child img {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .ptip-machine-single table td:first-child {
    width: 42%;
  }
}

@media (max-width: 480px) {
  .ptip-portfolio-facts {
    grid-template-columns: repeat(2, 1fr);
  }
}
