/* Project2 final visual/contrast normalization — 2026-10-27 */
:root{
  --p2v-ink:#172033;
  --p2v-text:#334155;
  --p2v-muted:#64748b;
  --p2v-blue:#0f6db5;
  --p2v-line:#dfe6ee;
  --p2v-soft:#f6f9fc;
  --p2v-softblue:#eef6fb;
  --p2v-white:#ffffff;
}

/* Base readability */
html body{background:#fff!important;color:var(--p2v-ink)!important}
.section{color:var(--p2v-ink)}
.section.alt{background:#f8fafc!important}
.section h1,.section h2,.section h3,.section h4,.section h5,.section h6,
.container h1,.container h2,.container h3,.container h4,.container h5,.container h6{
  color:var(--p2v-ink);
}
.section p,.section li,.section td,.container p,.container li,.container td{color:var(--p2v-text)}
.section .lead,.container .lead{color:var(--p2v-muted)!important}
.section a:not(.btn):not(.p2-service-link),.container a:not(.btn):not(.p2-service-link){color:var(--p2v-blue)}

/* Legacy cards/tables: always readable on the light content canvas */
.card,.svc,.p2-dir-card,.p2-depth-card,.p2-tech-fact,.p2-related-card,.p2-cover-card,.p2-question-group{
  background:#fff!important;
  color:var(--p2v-ink)!important;
  border-color:var(--p2v-line)!important;
}
.card h1,.card h2,.card h3,.card h4,.card b,.card strong,
.svc h1,.svc h2,.svc h3,.svc h4,.svc b,.svc strong{
  color:var(--p2v-ink)!important;
}
.card p,.card li,.svc p,.svc li{color:var(--p2v-muted)!important}
.card a,.svc a{color:var(--p2v-blue)!important}
table{background:#fff!important;color:var(--p2v-ink)!important}
th{background:#f4f8fc!important;color:#0b5f9a!important}
td{background:#fff!important;color:var(--p2v-text)!important}

/* Later-added knowledge blocks: one coherent light theme */
.p2-depth-section,.p2-tech-body,.p2-related,.p2-cover-section,
.p2-intent-section,.p2-taxonomy-section,.p2-directory-hub{
  color:var(--p2v-ink)!important;
}
.p2-intent-section,.p2-taxonomy-section{
  background:linear-gradient(180deg,#f8fbfe 0%,#eef5fa 100%)!important;
  border:1px solid #d7e3ed!important;
  box-shadow:0 12px 34px rgba(15,23,42,.06)!important;
}
.p2-intent-section h2,.p2-taxonomy-section h2,
.p2-intent-card h3,.p2-taxonomy-card h3{
  color:#0f172a!important;
}
.p2-intent-lead,.p2-taxonomy-lead,
.p2-intent-card p,.p2-taxonomy-card p,.p2-taxonomy-card li{
  color:#526071!important;
  opacity:1!important;
}
.p2-intent-card,.p2-taxonomy-card{
  background:#fff!important;
  border:1px solid #dfe7ef!important;
  color:#172033!important;
  box-shadow:0 5px 18px rgba(15,23,42,.035)!important;
}
.p2-taxonomy-card a{color:#0f6db5!important}

/* Technical explanation/recommendation blocks */
.p2-tech-body-head h2,.p2-related-head h2,.p2-depth-head h2,.p2-cover-head h2,
.p2-tech-fact h3,.p2-tech-process h3,.p2-search-phrases h3,
.p2-related-card b,.p2-cover-card h3,.p2-question-group h3{
  color:#0f172a!important;
}
.p2-tech-body-head p,.p2-related-head p,.p2-depth-head p,.p2-cover-head p,
.p2-tech-fact p,.p2-related-card span,.p2-cover-card p,.p2-question-group li{
  color:#526071!important;
  opacity:1!important;
}
.p2-tech-fact,.p2-tech-process,.p2-search-phrases,.p2-related-card{
  background:#fff!important;
  border-color:#dfe7ef!important;
}
.p2-search-phrases li,.p2-depth-tag,.p2-cover-tags a,.p2-cover-tags span{
  background:#f4f8fb!important;
  color:#334155!important;
  border-color:#dfe7ef!important;
}
.p2-tech-extra-note,.p2-depth-note,.p2-cover-note{
  background:#f1f7fb!important;
  color:#42566a!important;
  border-color:#d7e5ef!important;
}
.p2-related-card:hover,.p2-cover-tags a:hover{
  background:#f6fbff!important;
  border-color:#a9c7df!important;
}

/* Directory/tag areas */
.p2-dir-card h2,.p2-dir-card h3{color:#111827!important}
.p2-dir-card p{color:#5b6777!important}
.p2-dir-links a,.p2-dir-links span{
  background:#f7fafc!important;
  color:#334155!important;
  border-color:#dfe7ef!important;
}
.p2-dir-links a:hover{background:#edf6fc!important;color:#0b67a8!important}

/* Generic pills / anchors in light sections */
.anchor-nav a,.pill-list span{
  background:#f7fafc!important;
  color:#42566a!important;
  border-color:#dfe7ef!important;
}

/* Explicit dark areas: force high-contrast text and links */
.hero,.home-hero,.tax-panel.dark,.device-card{
  color:#fff!important;
}
.hero h1,.hero h2,.hero h3,.home-hero h1,.home-hero h2,.home-hero h3,
.tax-panel.dark h1,.tax-panel.dark h2,.tax-panel.dark h3,.tax-panel.dark strong,
.device-card h1,.device-card h2,.device-card h3,.device-card b,.device-card strong{
  color:#fff!important;
  -webkit-text-fill-color:initial;
}
.hero p,.hero li,.home-hero p,.home-hero li,.tax-panel.dark p,.tax-panel.dark li,.device-card p,.device-card li{
  color:#cbd5e1!important;
}
.home-hero .hero-copy,.home-hero .panel-note,.device-card p{color:#c5d1dc!important}
.tax-panel.dark .tax-links a,.device-card .card-tags span{
  color:#e5eef5!important;
  background:rgba(255,255,255,.08)!important;
  border-color:rgba(255,255,255,.18)!important;
}
.tax-panel.dark .tax-title a,.device-card small,.hero-eyebrow{color:#9edcf6!important}
.home-hero .hero-actions a{color:#f4f9fc!important}
.home-hero .hero-actions a.primary{color:#071525!important;background:#fff!important}

/* Make muted/footer copy legible */
.p2-footer,.footer{background:#f7f9fc!important;color:#596779!important}
.p2-footer h4,.footer h4{color:#172033!important}
.p2-footer p,.p2-footer a,.footer p,.footer a{color:#596779!important}

/* Contrast-safe focus/hover */
a:focus-visible,button:focus-visible{outline:3px solid rgba(15,109,181,.28)!important;outline-offset:2px}

@media(max-width:760px){
  .p2-intent-section,.p2-taxonomy-section{padding:18px 15px!important}
  .card,.svc,.p2-dir-card,.p2-depth-card,.p2-cover-card,.p2-question-group{padding-left:17px!important;padding-right:17px!important}
}

/* P2 layout hardening v2 — 2026-10-27
   Final visual-axis fallback for legacy templates and later-added modules. */
html,body{max-width:100%;overflow-x:hidden}
body{margin:0}

/* One shared visual axis for legacy section content. */
.section{width:100%;min-width:0}
.section>.container{
  width:min(1180px,calc(100% - 40px))!important;
  max-width:1180px!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
/* Some legacy pages placed the heading/lead directly under .section. */
.section>h1,.section>h2,.section>h3,.section>p,.section>.lead,.section>.label{
  width:min(1180px,calc(100% - 40px));
  max-width:1180px;
  margin-left:auto!important;
  margin-right:auto!important;
}
.section>h1,.section>h2,.section>h3,.section>.label{text-align:left}

/* Never let nested content establish a second drifting width. */
.container>.container,
.card>.container,
.svc>.container{
  width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* Legacy grids: consistent widths, rows and rhythm. */
.grid2,.grid3,.grid4,.cols,
.p2-dir-grid,.p2-depth-grid,.p2-tech-fact-grid,.p2-related-grid,
.p2-cover-grid,.p2-question-matrix,.p2-intent-grid,.p2-taxonomy-grid{
  width:100%!important;
  max-width:100%!important;
  margin-left:auto!important;
  margin-right:auto!important;
  align-items:stretch!important;
}
.grid2,.cols{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.grid3{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.grid4{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.grid2>*,.grid3>*,.grid4>*,.cols>*,
.p2-dir-grid>*,.p2-depth-grid>*,.p2-tech-fact-grid>*,.p2-related-grid>*,
.p2-cover-grid>*,.p2-question-matrix>*,.p2-intent-grid>*,.p2-taxonomy-grid>*{
  min-width:0!important;
  max-width:100%!important;
}

/* Keep all later-added knowledge sections on exactly the same axis. */
.p2-tech-body,.p2-related,.p2-depth-section,.p2-cover-section,
.p2-intent-section,.p2-taxonomy-section{
  box-sizing:border-box!important;
  width:min(1180px,calc(100% - 40px))!important;
  max-width:1180px!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
.p2-directory-hub{width:100%!important;max-width:100%!important}

/* Long technical content must wrap instead of pushing a page sideways. */
.section img,.container img,.p2-tech-body img,.p2-related img{max-width:100%!important;height:auto}
pre,code{max-width:100%}
pre{overflow:auto}
table{width:100%!important;max-width:100%!important;border-collapse:collapse}
.table-wrap,.table-responsive{width:100%;max-width:100%;overflow-x:auto}
.card,.svc,.p2-dir-card,.p2-depth-card,.p2-tech-fact,.p2-related-card,
.p2-cover-card,.p2-question-group,.p2-intent-card,.p2-taxonomy-card{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}

/* Tablet: reduce dense 3/4-column layouts before they become visually cramped. */
@media(max-width:1020px){
  .grid4,.grid3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .p2-related-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* Mobile: one clean centered column everywhere. */
@media(max-width:760px){
  .section>.container,
  .section>h1,.section>h2,.section>h3,.section>p,.section>.lead,.section>.label,
  .p2-tech-body,.p2-related,.p2-depth-section,.p2-cover-section,
  .p2-intent-section,.p2-taxonomy-section{
    width:calc(100% - 28px)!important;
    max-width:calc(100% - 28px)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .grid2,.grid3,.grid4,.cols,
  .p2-dir-grid,.p2-depth-grid,.p2-tech-fact-grid,.p2-related-grid,
  .p2-cover-grid,.p2-question-matrix,.p2-intent-grid,.p2-taxonomy-grid{
    grid-template-columns:1fr!important;
  }
  .section{padding-left:0!important;padding-right:0!important}
}
