/* Sugabi Clinic — Surgery Guide module styles.
   Loads AFTER /assets/css/site.css; module components only (sg- prefix).
   Palette and type come from the shared site system (Poppins, #3D0E9E). */

/* ---------- shared tokens (mirrors site.css values) ---------- */
:root{
  --sg-purple:#3D0E9E;
  --sg-purple-soft:#f6f3fb;
  --sg-ink:#231f33;
  --sg-muted:#5c5670;
  --sg-border:rgba(61,14,158,.14);
  --sg-radius:1rem;
}

/* ---------- hero band ---------- */
.sg-hero{background:var(--sg-purple-soft);padding:2.5rem 0 2rem;margin-bottom:2.25rem;}
.sg-hero h1{font-weight:800;color:var(--sg-ink);font-size:clamp(1.7rem,3.5vw,2.4rem);max-width:46rem;text-wrap:balance;}
.sg-lead{color:var(--sg-muted);max-width:44rem;font-size:1.06rem;margin:.75rem 0 0;text-wrap:pretty;}
.sg-hero-links{margin:.9rem 0 0;font-size:.95rem;}
.sg-hero-links a{color:var(--sg-purple);font-weight:600;}
.sg-alt-names{color:var(--sg-muted);font-size:.97rem;margin:.5rem 0 0;}
.sg-reviewer-line{margin:.75rem 0 0;font-size:.92rem;color:var(--sg-ink);}

/* ---------- language switcher ---------- */
.sg-lang-switch{display:inline-flex;border:1.5px solid var(--sg-border);border-radius:999px;overflow:hidden;margin-bottom:1rem;font-size:.88rem;background:#fff;}
.sg-lang-switch a,.sg-lang-switch .sg-lang-current{padding:.35rem 1rem;text-decoration:none;}
.sg-lang-switch .sg-lang-current{background:var(--sg-purple);color:#fff;font-weight:600;}
.sg-lang-switch a{color:var(--sg-purple);font-weight:600;}
.sg-lang-switch a:hover{background:var(--sg-purple-soft);}
/* Sinhala pages */
html[lang="si"] body{font-family:'Noto Sans Sinhala','Poppins',sans-serif;}
html[lang="si"] h1,html[lang="si"] h2,html[lang="si"] h3{font-family:'Noto Sans Sinhala','Poppins',sans-serif;font-weight:700;}
html[lang="si"] p,html[lang="si"] li{line-height:1.85;}
.sg-lang-note{font-size:.85rem;color:var(--sg-muted);font-weight:400;}

/* ---------- breadcrumb ---------- */
.sg-breadcrumb{font-size:.88rem;color:var(--sg-muted);margin-bottom:1rem;display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;}
.sg-breadcrumb a{color:var(--sg-purple);text-decoration:none;}
.sg-breadcrumb a:hover{text-decoration:underline;}

/* ---------- status chip ---------- */
.sg-status{display:inline-block;border-radius:999px;padding:.15rem .7rem;font-size:.8rem;font-weight:600;white-space:nowrap;}
.sg-status-draft{background:#fff3cd;color:#664d03;border:1px solid #ffe69c;}
.sg-status-reviewed{background:#e6efe0;color:#3d5226;border:1px solid #c6d8b5;}

/* ---------- index: search + cards ---------- */
.sg-index-layout{max-width:52rem;}
.sg-search-block{margin-bottom:2.5rem;}
.sg-search-label{font-weight:600;display:block;margin-bottom:.5rem;}
.sg-search-row{display:flex;gap:.5rem;}
.sg-search-row input{flex:1;border:1.5px solid var(--sg-border);border-radius:999px;padding:.65rem 1.2rem;font-size:1rem;min-height:48px;}
.sg-search-row input:focus{outline:2px solid var(--sg-purple);outline-offset:1px;border-color:var(--sg-purple);}
.sg-search-row button{border:0;background:var(--sg-purple);color:#fff;border-radius:999px;min-width:48px;min-height:48px;font-size:1.05rem;cursor:pointer;}
.sg-search-row button:hover{background:#2d0a77;}
.sg-no-match{margin:1rem 0 0;padding:.8rem 1.1rem;background:var(--sg-purple-soft);border-radius:.75rem;color:var(--sg-ink);}
.sg-cats{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:1.25rem;}
.sg-cat-link{display:inline-block;border:1.5px solid var(--sg-purple);color:var(--sg-purple);font-weight:600;font-size:.92rem;border-radius:999px;padding:.4rem 1.1rem;text-decoration:none;}
.sg-cat-link:hover{background:var(--sg-purple);color:#fff;}
.sg-cat-section{margin-bottom:2.5rem;}
.sg-cat-section h2{font-weight:700;font-size:1.35rem;margin-bottom:1.1rem;}
.sg-card-list{list-style:none;margin:0;padding:0;display:grid;gap:1rem;}
.sg-procedure-card{border:1px solid var(--sg-border);border-radius:var(--sg-radius);padding:1.35rem 1.5rem;background:#fff;box-shadow:0 2px 10px rgba(35,31,51,.05);}
.sg-procedure-card h3{font-size:1.15rem;font-weight:700;margin:0 0 .3rem;}
.sg-procedure-card h3 a{color:var(--sg-ink);text-decoration:none;}
.sg-procedure-card h3 a:hover{color:var(--sg-purple);}
.sg-procedure-card .sg-alt-names{margin:0 0 .6rem;font-size:.88rem;}
.sg-procedure-card p{margin:0 0 .75rem;color:var(--sg-muted);}
.sg-card-more{font-weight:600;color:var(--sg-purple);text-decoration:none;font-size:.95rem;}
.sg-card-more:hover{text-decoration:underline;}
.sg-callout{border:1.5px solid var(--sg-border);background:var(--sg-purple-soft);border-radius:var(--sg-radius);padding:1.2rem 1.4rem;margin-bottom:3rem;}
.sg-callout p{margin:0;color:var(--sg-ink);}

/* ---------- prose pages ---------- */
.sg-prose{max-width:46rem;padding-bottom:3rem;}
.sg-prose h2{font-weight:700;font-size:1.35rem;margin:2.2rem 0 .8rem;scroll-margin-top:6rem;}
.sg-prose p,.sg-prose li{color:var(--sg-ink);line-height:1.65;text-wrap:pretty;}
.sg-prose a{color:var(--sg-purple);}
.sg-muted{color:var(--sg-muted);font-size:.95rem;}

/* ---------- consent boundary note ---------- */
.sg-consent-note{border-left:4px solid var(--sg-purple);background:var(--sg-purple-soft);padding:.9rem 1.2rem;border-radius:0 .75rem .75rem 0;}

/* ---------- glossary ---------- */
.sg-glossary{margin:0 0 1.5rem;}
.sg-glossary dt{font-weight:700;margin-top:1.4rem;scroll-margin-top:6rem;}
.sg-glossary dd{margin:.3rem 0 0;color:var(--sg-ink);line-height:1.6;}

/* ---------- procedure page layout ---------- */
.sg-proc-layout{display:grid;grid-template-columns:16rem minmax(0,46rem);gap:3rem;padding-bottom:3rem;}
.sg-toc{position:sticky;top:6rem;align-self:start;max-height:calc(100vh - 7rem);overflow-y:auto;}
.sg-toc-title{font-size:.85rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--sg-muted);margin-bottom:.6rem;}
.sg-toc ol{list-style:none;margin:0;padding:0;border-left:2px solid var(--sg-border);}
.sg-toc li a{display:block;padding:.32rem .9rem;font-size:.9rem;color:var(--sg-muted);text-decoration:none;border-left:2px solid transparent;margin-left:-2px;}
.sg-toc li a:hover{color:var(--sg-purple);}
.sg-toc li a.is-active{color:var(--sg-purple);font-weight:600;border-left-color:var(--sg-purple);}
@media (max-width: 991px){
  .sg-proc-layout{display:block;}
  .sg-toc{position:static;max-height:none;margin-bottom:2rem;}
}
.sg-section{scroll-margin-top:6rem;}
.sg-placeholder{color:var(--sg-muted);font-style:italic;background:repeating-linear-gradient(45deg,transparent,transparent 10px,rgba(61,14,158,.03) 10px,rgba(61,14,158,.03) 20px);padding:.6rem .9rem;border-radius:.5rem;border:1px dashed var(--sg-border);}
.sg-urgent{border:1.5px solid #d9534f;background:#fdf3f2;border-radius:.75rem;padding:1rem 1.2rem;margin-top:1rem;}
.sg-urgent p{margin:0;}

/* ---------- consent checklist (print-oriented) ---------- */
.sg-checklist{border:1px solid var(--sg-border);border-radius:var(--sg-radius);padding:1.25rem 1.4rem;margin-top:1rem;background:#fff;}
.sg-checklist-note{font-size:.9rem;color:var(--sg-muted);}
.sg-checklist-items{list-style:none;margin:0;padding:0;}
.sg-checklist-items li{display:flex;gap:.7rem;align-items:flex-start;padding:.55rem 0;border-bottom:1px dashed var(--sg-border);}
.sg-checklist-items li:last-child{border-bottom:0;}
.sg-checkbox{flex:0 0 auto;width:1.1rem;height:1.1rem;border:2px solid var(--sg-ink);border-radius:.25rem;margin-top:.2rem;}
.sg-writein{display:inline-block;min-width:12rem;border-bottom:1.5px solid var(--sg-ink);height:1.2rem;vertical-align:bottom;}

/* ---------- references + governance ---------- */
.sg-references{padding-left:1.2rem;}
.sg-references li{margin-bottom:.5rem;font-size:.95rem;}
.sg-placeholder-item{font-style:italic;color:var(--sg-muted);}
.sg-governance{margin-top:2.5rem;border-top:2px solid var(--sg-border);padding-top:1.25rem;}
.sg-gov-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));gap:.9rem 1.5rem;margin:0;}
.sg-gov-grid dt{font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--sg-muted);}
.sg-gov-grid dd{margin:0;font-size:.95rem;color:var(--sg-ink);}

/* ---------- related reading ---------- */
.sg-related{margin-top:2.5rem;background:var(--sg-purple-soft);border-radius:var(--sg-radius);padding:1.3rem 1.5rem;}
.sg-related h2{margin-top:0;font-size:1.15rem;}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .sg-hero *,.sg-prose *,.sg-toc *{transition:none !important;animation:none !important;}
  html{scroll-behavior:auto !important;}
}

/* ---------- print ---------- */
.sg-gov-grid .sg-status{white-space:normal;}
@media print{
  .site-header,.site-footer,.to-top,.award-float,.skip-link,.sg-lang-switch,.sg-search-block,.sg-toc,.sg-hero-links,.sg-breadcrumb,.header-search{display:none !important;}
  .sg-hero{background:none;padding:0;margin-bottom:1rem;border-bottom:2pt solid #000;}
  body{background:#fff;color:#000;font-size:11pt;}
  .sg-proc-layout{display:block;}
  .sg-prose,.sg-index-layout{max-width:none;}
  .sg-prose p,.sg-prose li{color:#000;line-height:1.5;}
  .sg-section{break-inside:auto;}
  .sg-section h2{break-after:avoid;}
  .sg-consent-note{border:1.5pt solid #000;background:none;border-radius:0;font-weight:600;}
  .sg-urgent{border:1.5pt solid #000;background:none;}
  .sg-checklist{break-inside:avoid;border:1pt solid #000;}
  .sg-checkbox{border-color:#000;}
  .sg-writein{border-bottom-color:#000;}
  .sg-placeholder{background:none;border:1pt dashed #666;}
  .sg-gov-grid .sg-status{white-space:normal;}
  .sg-status-draft{border:1pt solid #000;background:none;color:#000;}
  .sg-status-reviewed{border:1pt solid #000;background:none;color:#000;}
  .sg-related{background:none;border:1pt solid #000;}
  .sg-prose a{color:#000;text-decoration:none;}
  .sg-prose a[href^="/"]::after{content:" (sugabi.lk)";font-size:.85em;}
  .sg-references a[href]::after{content:none;}
}
