/*
 * Plumbing 4 London — Guides & Updates Archive Stylesheet (/updates/ & Category Archives)
 * 100% scoped under .p4l-upd-page so Header (#625) and Footer (#624) stay untouched.
 * Reuses the exact Homepage .p4l-blog-card visual design from theme.css.
 */

.p4l-upd-page {
  --upd-navy-deep: var(--p4l-navy-deep, #0b1220);
  --upd-navy: var(--p4l-navy, #0f1a2e);
  --upd-navy-raised: var(--p4l-navy-raised, #16233b);
  --upd-navy-line: rgba(238, 240, 245, 0.11);
  --upd-accent: var(--p4l-accent, #de2627);
  --upd-accent-hover: var(--p4l-accent-hover, #b81c1d);
  --upd-accent-soft: #fca5a5;
  --upd-bg: var(--p4l-bg, #f5f7fa);
  --upd-white: var(--p4l-white, #ffffff);
  --upd-ink: var(--p4l-ink, #111827);
  --upd-secondary: var(--p4l-secondary, #4b5565);
  --upd-border: var(--p4l-border, rgba(17, 24, 39, 0.09));
  --upd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --upd-font-head: var(--p4l-font-head, 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  --upd-font-body: var(--p4l-font-body, 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);

  font-family: var(--upd-font-body);
  color: var(--upd-ink);
  background: var(--upd-bg);
  overflow-x: clip;
}

.p4l-upd-page *,
.p4l-upd-page *::before,
.p4l-upd-page *::after {
  box-sizing: border-box;
}

.p4l-upd-num {
  font-variant-numeric: tabular-nums;
}

.p4l-upd-wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: clamp(18px, 3vw, 36px);
}

.p4l-upd-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--upd-accent);
  flex-shrink: 0;
}

/* S1: RIGHT-FRAMED FADE HERO + HERO-BOTTOM CATEGORY FILTER LINE */
.p4l-upd-hero {
  position: relative;
  background: var(--upd-navy-deep);
  color: #ffffff;
  overflow: hidden;
  min-height: clamp(340px, 26vw, 430px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.p4l-upd-hero__bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(70%, 1340px);
  z-index: 1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.22) 22%, rgba(0, 0, 0, 0.78) 48%, #000000 72%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.22) 22%, rgba(0, 0, 0, 0.78) 48%, #000000 72%);
}
.p4l-upd-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
.p4l-upd-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #0b1220 0%, rgba(11, 18, 32, 0.88) 18%, rgba(11, 18, 32, 0.4) 44%, rgba(11, 18, 32, 0.08) 70%, rgba(11, 18, 32, 0) 100%),
    linear-gradient(180deg, rgba(11, 18, 32, 0.22) 0%, rgba(11, 18, 32, 0) 18%, rgba(11, 18, 32, 0) 70%, rgba(11, 18, 32, 0.86) 100%);
}
.p4l-upd-hero__inner {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(36px, 3.4vw, 52px);
  padding-bottom: clamp(28px, 2.8vw, 40px);
}
.p4l-upd-hero__copy {
  max-width: 650px;
}

.p4l-upd-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(238, 242, 247, 0.68);
  margin-bottom: 14px;
}
.p4l-upd-crumb a {
  color: rgba(238, 242, 247, 0.78);
  text-decoration: none;
}
.p4l-upd-crumb a:hover { color: #ffffff; }
.p4l-upd-crumb .is-current { color: #ffffff; font-weight: 600; }

.p4l-upd-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--upd-font-head);
  font-size: 12.5px;
  font-weight: 600;
  color: #d1d7e3;
  margin-bottom: 14px;
}

.p4l-upd-hero__title {
  font-family: var(--upd-font-head);
  font-size: clamp(32px, 3.4vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.024em;
  color: #ffffff !important;
  margin: 0 0 16px;
}
.p4l-upd-hero__lead {
  font-size: clamp(15.5px, 1.25vw, 17px);
  color: rgba(238, 242, 247, 0.86);
  line-height: 1.62;
  max-width: 580px;
  margin: 0 0 22px;
}
.p4l-upd-hero__stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(238, 242, 247, 0.78);
}
.p4l-upd-hero__stats strong { color: #ffffff; font-weight: 700; }
.p4l-upd-sep { opacity: 0.45; }

/* HERO BOTTOM LINE — INTERACTIVE CATEGORY FILTER BAR */
.p4l-upd-hero-bar {
  position: relative;
  z-index: 3;
  background: rgba(11, 18, 32, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.p4l-upd-hero-bar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 14px;
}
.p4l-upd-hero-bar__lbl {
  font-family: var(--upd-font-head);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(238, 242, 247, 0.62);
  white-space: nowrap;
  flex-shrink: 0;
}
.p4l-upd-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-block: 2px;
}
.p4l-upd-filters::-webkit-scrollbar { display: none; }

.p4l-upd-filter {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 242, 247, 0.88);
  font-family: var(--upd-font-head);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 160ms var(--upd-ease), border-color 160ms var(--upd-ease), color 160ms var(--upd-ease), transform 140ms var(--upd-ease);
}
.p4l-upd-filter:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.34);
  color: #ffffff;
}
.p4l-upd-filter.is-active {
  background: var(--upd-accent);
  border-color: var(--upd-accent);
  color: #ffffff;
}
.p4l-upd-filter__cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11.5px;
  font-weight: 700;
}
.p4l-upd-filter.is-active .p4l-upd-filter__cnt {
  background: rgba(11, 18, 32, 0.28);
  color: #ffffff;
}

.p4l-upd-hero-bar__meta {
  font-size: 13px;
  color: rgba(238, 242, 247, 0.72);
  white-space: nowrap;
  flex-shrink: 0;
}
.p4l-upd-hero-bar__meta strong {
  color: #ffffff;
  font-weight: 700;
}

/* S2: COMPACT HORIZONTAL LATEST POSTS CAROUSEL (~270px total height) */
.p4l-upd-latest {
  background: var(--upd-white);
  padding-block: clamp(24px, 2.6vw, 34px);
  border-bottom: 1px solid var(--upd-border);
}
.p4l-upd-latest__blog {
  margin: 0;
  padding: 0;
}
.p4l-upd-latest__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.p4l-upd-latest__titles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.p4l-upd-latest__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #fef2f2;
  border: 1px solid rgba(222, 38, 39, 0.2);
  font-family: var(--upd-font-head);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--upd-accent);
}
.p4l-upd-latest__title {
  font-family: var(--upd-font-head);
  font-size: clamp(19px, 1.9vw, 23px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--upd-ink);
  margin: 0;
}
.p4l-upd-latest__controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.p4l-upd-latest__cnt {
  margin-right: 4px;
  font-size: 13px;
}
.p4l-upd-latest__nav {
  width: 36px !important;
  height: 36px !important;
}

.p4l-upd-latest__track {
  gap: 16px !important;
  padding: 4px 2px 8px !important;
}
.p4l-upd-mini-card {
  flex: 0 0 412px;
  min-width: 0;
  display: flex;
}
.p4l-upd-mini-card__link,
a.p4l-upd-mini-card__link,
a.p4l-upd-mini-card__link:visited {
  position: relative;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  background: var(--upd-bg);
  border: 1px solid var(--upd-border);
  border-left: 3px solid var(--upd-accent);
  border-radius: 13px;
  overflow: hidden;
  color: var(--upd-ink) !important;
  text-decoration: none !important;
  transition: transform 200ms var(--upd-ease), border-color 200ms var(--upd-ease), background-color 200ms var(--upd-ease), box-shadow 200ms var(--upd-ease);
}
.p4l-upd-mini-card__link:hover,
a.p4l-upd-mini-card__link:hover {
  transform: translateY(-2px);
  background: var(--upd-white);
  border-color: rgba(222, 38, 39, 0.4);
  box-shadow: 0 12px 24px -18px rgba(11, 18, 32, 0.25);
}
.p4l-upd-mini-card__media {
  position: relative;
  background: var(--upd-navy-deep);
  min-height: 118px;
  overflow: hidden;
}
.p4l-upd-mini-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 360ms var(--upd-ease);
}
.p4l-upd-mini-card__link:hover .p4l-upd-mini-card__media img {
  transform: scale(1.05);
}
.p4l-upd-mini-card__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.p4l-upd-mini-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.p4l-upd-mini-card__cat {
  font-family: var(--upd-font-head);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--upd-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p4l-upd-mini-card__date {
  font-size: 11px;
  color: #6b768a;
  white-space: nowrap;
  flex-shrink: 0;
}
.p4l-upd-mini-card__title {
  margin: 0;
  font-family: var(--upd-font-head);
  font-size: 14.8px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--upd-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p4l-upd-mini-card__read {
  font-family: var(--upd-font-head);
  font-size: 12.2px;
  font-weight: 700;
  color: var(--upd-navy);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.p4l-upd-mini-card__link:hover .p4l-upd-mini-card__read {
  color: var(--upd-accent);
}
.p4l-upd-latest__foot {
  margin-top: 12px !important;
}
@media (max-width: 720px) {
  .p4l-upd-mini-card {
    flex: 0 0 min(322px, 86vw);
  }
  .p4l-upd-mini-card__link,
  a.p4l-upd-mini-card__link {
    grid-template-columns: 104px minmax(0, 1fr);
  }
  .p4l-upd-mini-card__media {
    min-height: 106px;
  }
  .p4l-upd-mini-card__title {
    font-size: 13.8px;
  }
  .p4l-upd-latest__head {
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
}

/* S3: ARTICLES GRID USING EXACT HOMEPAGE .p4l-blog-card */
.p4l-upd-sec {
  padding-block: clamp(44px, 4.8vw, 68px);
}
.p4l-upd-sec--bg {
  background: var(--upd-bg);
}
.p4l-upd-grid-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 28px;
}
.p4l-upd-eyebrow--light {
  color: var(--upd-accent);
}
.p4l-upd-grid-head__title {
  font-family: var(--upd-font-head);
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: var(--upd-ink);
  margin: 0;
}
.p4l-upd-grid-head__count {
  font-size: 13.5px;
  color: var(--upd-secondary);
  background: var(--upd-white);
  border: 1px solid var(--upd-border);
  padding: 7px 14px;
  border-radius: 999px;
}
.p4l-upd-grid-head__count strong {
  color: var(--upd-ink);
}

.p4l-upd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Override only carousel flex-basis so Homepage .p4l-blog-card fills grid cells identically */
.p4l-upd-grid .p4l-blog-card {
  flex: none;
  width: 100%;
  min-width: 0;
}
.p4l-upd-card.is-upd-hidden {
  display: none !important;
}
.p4l-upd-card.is-upd-reveal {
  animation: p4lUpdCardIn 320ms var(--upd-ease) both;
}
@keyframes p4lUpdCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.p4l-upd-empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--upd-secondary);
  font-size: 16px;
}

/* Load More Button (exact Homepage / Hub pill style) */
.p4l-upd-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}
.p4l-upd-more-wrap[hidden] {
  display: none !important;
}
.p4l-upd-more-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1.5px solid rgba(15, 26, 46, 0.16);
  background: var(--upd-white);
  color: var(--upd-navy);
  font-family: var(--upd-font-head);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 26, 46, 0.05);
  transition: background-color 180ms var(--upd-ease), color 180ms var(--upd-ease), border-color 180ms var(--upd-ease), transform 180ms var(--upd-ease);
}
.p4l-upd-more-btn:hover {
  background: var(--upd-navy);
  border-color: var(--upd-navy);
  color: #ffffff;
  transform: translateY(-2px);
}
.p4l-upd-more-btn__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(222, 38, 39, 0.1);
  color: var(--upd-accent);
  font-size: 0.76rem;
  font-weight: 700;
  transition: background-color 180ms var(--upd-ease), color 180ms var(--upd-ease);
}
.p4l-upd-more-btn:hover .p4l-upd-more-btn__count {
  background: var(--upd-accent);
  color: #ffffff;
}

/* S3: FORM-FREE CONVERSION BAND */
.p4l-upd-cta {
  background: radial-gradient(circle at 84% 18%, rgba(222, 38, 39, 0.13) 0%, rgba(11, 18, 32, 0) 48%), var(--upd-navy-deep);
  color: #eef2f7;
  padding-block: clamp(48px, 5vw, 68px);
}
.p4l-upd-cta__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: center;
}
.p4l-upd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--upd-font-head);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--upd-accent-soft);
  margin-bottom: 10px;
}
.p4l-upd-eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--upd-accent);
  border-radius: 2px;
}
.p4l-upd-cta__title {
  font-family: var(--upd-font-head);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.022em;
  color: #ffffff !important;
  margin: 0 0 12px;
}
.p4l-upd-cta__sub {
  font-size: 15.5px;
  color: rgba(238, 242, 247, 0.8);
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 560px;
}
.p4l-upd-cta__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.p4l-upd-btn,
a.p4l-upd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 8px;
  font-family: var(--upd-font-head);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms var(--upd-ease), transform 120ms var(--upd-ease);
}
.p4l-upd-btn--red,
a.p4l-upd-btn--red {
  background: var(--upd-accent);
  color: #ffffff !important;
}
.p4l-upd-btn--red:hover { background: var(--upd-accent-hover); }
.p4l-upd-btn--white,
a.p4l-upd-btn--white {
  background: #ffffff;
  color: var(--upd-navy-deep) !important;
}
.p4l-upd-btn--white:hover { background: #eef2f7; }

.p4l-upd-pillars {
  display: grid;
  gap: 12px;
}
.p4l-upd-pillar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--upd-navy-raised);
  border: 1px solid var(--upd-navy-line);
  color: #ffffff !important;
  text-decoration: none !important;
  transition: border-color 160ms var(--upd-ease), transform 160ms var(--upd-ease);
}
.p4l-upd-pillar-link:hover {
  border-color: var(--upd-accent);
  transform: translateX(3px);
}
.p4l-upd-pillar-link strong {
  display: block;
  font-family: var(--upd-font-head);
  font-size: 16px;
  color: #ffffff;
  margin-bottom: 2px;
}
.p4l-upd-pillar-link span {
  font-size: 13.5px;
  color: rgba(238, 242, 247, 0.72);
}
.p4l-upd-pillar-link > span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--upd-accent-soft);
}

/* TABLET (721px – 1080px) */
@media (max-width: 1080px) {
  .p4l-upd-hero__bg::after {
    background:
      linear-gradient(90deg, #0b1220 0%, rgba(11, 18, 32, 0.92) 34%, rgba(11, 18, 32, 0.68) 64%, rgba(11, 18, 32, 0.25) 100%),
      linear-gradient(180deg, rgba(11, 18, 32, 0.26) 0%, rgba(11, 18, 32, 0.14) 55%, rgba(11, 18, 32, 0.86) 100%);
  }
  .p4l-upd-hero-bar__in {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
  .p4l-upd-hero-bar__lbl { display: none; }
  .p4l-upd-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
  }
  .p4l-upd-cta__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* MOBILE (<= 720px) */
@media (max-width: 720px) {
  .p4l-upd-hero {
    min-height: 0;
  }
  .p4l-upd-hero__bg {
    width: 100%;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .p4l-upd-hero__bg::after {
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.84) 0%, rgba(11, 18, 32, 0.94) 100%);
  }
  .p4l-upd-hero-bar__in {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-block: 12px;
  }
  .p4l-upd-hero-bar__meta {
    font-size: 12px;
  }
  .p4l-upd-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .p4l-upd-cta__btns .p4l-upd-btn {
    width: 100%;
  }
}
