/* BASSCOM Research · Report Page Styles
   Report-specific layout, typography, and component styles.
   See tokens.css for shared design system variables. */

body { background: var(--bg-page); font-family: var(--font-display); font-size: 17px; line-height: 1.7; color: var(--ink-1); }

/* === LAYOUT === */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  max-width: 1320px;
  margin: 0 auto;
}
aside.toc {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  padding: 36px 24px 36px 32px;
  border-right: 1px solid var(--border-1);
  background: linear-gradient(180deg, white 0%, var(--bg-soft) 100%);
  overflow-y: auto;
  font-family: var(--font-sans);
}
aside.toc::-webkit-scrollbar { width: 6px; }
aside.toc::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
aside.toc .brand { display: flex; align-items: center; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--border-1); }
aside.toc .brand picture, aside.toc .brand img { height: 38px; display: block; width: auto; }
aside.toc .doc-info { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--bass-teal); font-weight: 700; margin-bottom: 6px; }
aside.toc .doc-meta { font-size: 0.78rem; color: var(--ink-3); margin-bottom: 18px; }
aside.toc h4 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin: 22px 0 10px;
  font-weight: 700;
}
aside.toc ol { list-style: none; padding: 0; margin: 0; }
aside.toc ol li { margin: 1px 0; }
aside.toc ol li > a {
  text-decoration: none;
  color: var(--ink-1);
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.35;
  transition: all 0.15s;
}
aside.toc ol li > a.lvl-1 {
  font-weight: 700;
  color: var(--bass-teal-dark);
  font-size: 0.88rem;
  padding-left: 10px;
  margin-top: 6px;
}
aside.toc ol li > a.lvl-2 {
  padding-left: 22px;
  color: var(--ink-1);
  font-weight: 500;
}
aside.toc ol li > a.lvl-3 {
  padding-left: 34px;
  font-size: 0.8rem;
  color: #4a5658;
  font-weight: 400;
}
aside.toc ol li > a:hover { background: var(--bass-teal-bg); color: var(--bass-teal-dark); }
aside.toc ol li > a.active {
  background: var(--bass-teal-bg);
  color: var(--bass-teal-dark);
  font-weight: 600;
}
aside.toc .links-out {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border-1);
}
aside.toc .links-out a {
  display: block;
  padding: 5px 0;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.82rem;
}
aside.toc .links-out a:hover { color: var(--bass-teal); }

main.content {
  max-width: 880px;
  padding: 48px 56px 96px;
  position: relative;
}

/* === COVER PAGE === */
.cover {
  min-height: 80vh;
  padding: 64px 56px 56px;
  margin: -48px -56px 88px;
  border-bottom: 3px solid var(--bass-teal);
  position: relative;
  background: linear-gradient(180deg, var(--bass-teal-bg) 0%, transparent 70%);
  overflow: hidden;
}
.cover::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='400' height='400' viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%231a7a7a' stroke-width='1'%3E%3Ccircle cx='50' cy='50' r='4'/%3E%3Ccircle cx='150' cy='80' r='3'/%3E%3Ccircle cx='250' cy='40' r='5'/%3E%3Ccircle cx='350' cy='70' r='3'/%3E%3Ccircle cx='100' cy='150' r='4'/%3E%3Ccircle cx='200' cy='130' r='3'/%3E%3Ccircle cx='300' cy='160' r='4'/%3E%3Ccircle cx='50' cy='250' r='3'/%3E%3Ccircle cx='150' cy='220' r='5'/%3E%3Ccircle cx='250' cy='260' r='3'/%3E%3Ccircle cx='350' cy='230' r='4'/%3E%3Cline x1='50' y1='50' x2='150' y2='80'/%3E%3Cline x1='150' y1='80' x2='250' y2='40'/%3E%3Cline x1='250' y1='40' x2='350' y2='70'/%3E%3Cline x1='50' y1='50' x2='100' y2='150'/%3E%3Cline x1='150' y1='80' x2='200' y2='130'/%3E%3Cline x1='250' y1='40' x2='300' y2='160'/%3E%3Cline x1='350' y1='70' x2='300' y2='160'/%3E%3Cline x1='100' y1='150' x2='200' y2='130'/%3E%3Cline x1='200' y1='130' x2='300' y2='160'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 400px 400px;
}
.cover > * { position: relative; z-index: 1; }
.cover .doc-tag {
  display: inline-block;
  padding: 8px 18px;
  background: var(--bass-teal-bg);
  color: var(--bass-teal-dark);
  border: 1px solid var(--bass-teal-border);
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 32px;
}
.cover h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.0;
  color: var(--bass-teal-dark);
  letter-spacing: -0.025em;
  font-weight: 600;
  margin-bottom: 24px;
  max-width: 760px;
}
.cover h1 em { color: var(--bass-teal); font-style: italic; }
.cover .deck {
  font-size: 1.35rem;
  color: var(--ink-2);
  line-height: 1.45;
  max-width: 680px;
  margin-bottom: 36px;
}
.cover .deck strong { color: var(--bass-teal-dark); font-weight: 600; }
.cover .authors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border-1);
}
.cover .authors > div { font-family: var(--font-sans); }
.cover .authors .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 6px;
  font-weight: 600;
}
.cover .authors .who { color: var(--ink-1); font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.cover .authors .sub { font-size: 0.8rem; color: var(--ink-3); margin-top: 3px; }
.cover .preamble {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px dashed var(--border-2);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-3);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
}
.cover .preamble .lbl { font-weight: 700; color: var(--bass-teal); text-transform: uppercase; letter-spacing: 0.08em; }

/* === SECTION === */
section.chap { margin-bottom: 80px; scroll-margin-top: 24px; }
section.sub { margin-bottom: 48px; scroll-margin-top: 24px; }

.chap-meta {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--bass-teal);
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.chap-meta::before {
  content: "";
  width: 48px;
  height: 2px;
  background: var(--bass-teal);
}

h2.chap-h {
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  color: var(--bass-teal-dark);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 32px;
  font-weight: 600;
}
h3.sec-h {
  font-size: 1.7rem;
  color: var(--bass-teal-dark);
  margin: 40px 0 16px;
  line-height: 1.25;
  font-weight: 600;
}
h4.sub-h {
  font-size: 1.2rem;
  color: var(--bass-teal-dark);
  margin: 28px 0 12px;
  line-height: 1.3;
  font-style: italic;
  font-weight: 500;
}
h5.mini-h {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bass-teal);
  margin: 22px 0 10px;
  font-weight: 700;
}

main.content p { margin-bottom: 18px; color: var(--ink-1); }
main.content p.lede {
  font-size: 1.22rem;
  line-height: 1.55;
  color: var(--ink-1);
  margin-bottom: 32px;
  padding-left: 22px;
  border-left: 3px solid var(--bass-teal);
  font-family: var(--font-display);
}
main.content ul, main.content ol {
  padding-left: 26px;
  margin: 16px 0 22px;
}
main.content ul li, main.content ol li {
  margin-bottom: 9px;
  color: var(--ink-1);
  line-height: 1.6;
}
main.content ul li::marker { color: var(--bass-teal); }
main.content strong { color: var(--bass-teal-dark); font-weight: 600; }
main.content em { color: var(--ink-1); font-style: italic; }

/* === CALLOUTS === */
.callout {
  background: var(--bass-teal-bg);
  border-left: 4px solid var(--bass-teal);
  border-radius: 0 var(--r-3) var(--r-3) 0;
  padding: 22px 26px;
  margin: 28px 0;
  font-size: 0.96rem;
}
.callout h5 {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bass-teal);
  margin-bottom: 8px;
  font-weight: 700;
}
.callout p { margin: 0; }
.callout.warn { background: var(--bass-accent-bg); border-color: var(--bass-accent); }
.callout.warn h5 { color: var(--bass-accent-dark); }
.callout.good {
  background: linear-gradient(180deg, rgba(26, 122, 122, 0.06) 0%, white 100%);
  border-color: var(--bass-teal);
}
.callout.good h5 { color: var(--bass-teal-dark); }

.pullquote {
  margin: 32px 0;
  padding: 28px 32px;
  background: var(--bass-teal-dark);
  color: white;
  border-radius: var(--r-4);
  position: relative;
  overflow: hidden;
}
.pullquote::before {
  content: "„"; position: absolute; top: -8px; left: 24px;
  font-family: var(--font-display);
  font-size: 6rem; line-height: 1;
  color: rgba(255,255,255,0.18);
}
.pullquote blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
  margin: 0;
  position: relative;
  z-index: 1;
}
.pullquote .src {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  margin-top: 14px;
}

/* === DEFINITION LIST === */
dl.def {
  margin: 22px 0;
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  overflow: hidden;
}
dl.def > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 1px solid var(--border-1);
}
dl.def > div:last-child { border-bottom: 0; }
dl.def dt {
  background: var(--bg-soft);
  padding: 14px 18px;
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--bass-teal-dark);
  font-size: 0.92rem;
  border-right: 1px solid var(--border-1);
}
dl.def dd { padding: 14px 18px; margin: 0; font-size: 0.95rem; color: var(--ink-1); }

/* === STATS BLOCKS === */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 28px 0;
}
.stats-row .stat {
  background: white;
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  padding: 20px 18px;
}
.stats-row .n {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--bass-teal-dark);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stats-row .n .unit { font-size: 1.1rem; color: var(--bass-teal); }
.stats-row .lab {
  font-size: 0.76rem;
  color: var(--ink-3);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-family: var(--font-sans);
}

/* === FIGURE === */
.figure {
  margin: 32px 0;
  background: white;
  border: 1px solid var(--border-1);
  border-radius: var(--r-3);
  padding: 28px 28px 22px;
}
.figure .fig-id {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bass-teal);
  font-weight: 700;
  margin-bottom: 16px;
}
.figure .fig-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--bass-teal-dark);
  margin-bottom: 18px;
}
.figure .caption {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-3);
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-1);
  font-family: var(--font-sans);
}
.figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* === BAR CHART === */
.bar-chart { margin: 16px 0; }
.bar-chart .row {
  display: grid;
  grid-template-columns: 200px 1fr 70px;
  gap: 14px;
  align-items: center;
  padding: 7px 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}
.bar-chart .row .lab { color: var(--ink-2); }
.bar-chart .bar {
  height: 18px;
  background: var(--bg-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.bar-chart .bar > span {
  display: block; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bass-teal), var(--bass-teal-light));
}
.bar-chart .bar.warn > span { background: linear-gradient(90deg, var(--bass-accent-dark), var(--bass-accent)); }
.bar-chart .bar.amber > span { background: linear-gradient(90deg, #f59e0b, var(--bass-warm)); }
.bar-chart .m {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--bass-teal-dark);
  text-align: right;
}
.bar-chart .m.warn { color: var(--bass-accent-dark); }

/* === TABLES === */
table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border-radius: var(--r-3);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
table.data th {
  background: var(--bass-teal-dark);
  color: white;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
  background: white;
  vertical-align: top;
}
table.data tbody tr:hover td { background: var(--bg-soft); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .lab-cell {
  font-weight: 700;
  color: var(--bass-teal-dark);
  white-space: nowrap;
}

/* === LEVEL TABLE (3 colored cols) === */
.level-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 24px 0;
  border-radius: var(--r-3);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.level-table .col {
  padding: 22px 22px;
  background: white;
  border-right: 1px solid var(--border-1);
}
.level-table .col:last-child { border-right: 0; }
.level-table .col.base { border-top: 4px solid var(--bass-accent); }
.level-table .col.functional { border-top: 4px solid var(--bass-warm); }
.level-table .col.integrated { border-top: 4px solid var(--bass-teal); }
.level-table .lev-name {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 12px;
}
.level-table .col.base .lev-name { color: var(--bass-accent-dark); }
.level-table .col.functional .lev-name { color: #92400E; }
.level-table .col.integrated .lev-name { color: var(--bass-teal-dark); }
.level-table .col p { font-size: 0.88rem; line-height: 1.55; color: var(--ink-1); margin: 0; }

/* === BACK TO TOP === */
a.back {
  display: inline-block;
  margin-top: 48px;
  padding: 10px 18px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  color: var(--bass-teal);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  font-family: var(--font-sans);
  transition: all 0.2s;
}
a.back:hover { background: var(--bass-teal); color: white; border-color: var(--bass-teal); }

hr.div {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
  margin: 56px 0;
}

/* TOC collapse toggle — hidden on desktop, sticky bar on mobile */
.toc-collapse-bar {
  display: none;
  position: sticky;
  top: 56px;
  z-index: 20;
  background: rgba(255, 253, 247, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-1);
  padding: 10px 24px;
}
.toc-collapse-bar button {
  width: 100%;
  background: var(--bass-teal-bg);
  border: 1px solid var(--bass-teal-border);
  color: var(--bass-teal-dark);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.toc-collapse-bar button .ico { font-size: 1rem; transition: transform 0.2s; }
.toc-collapse-bar.open button .ico { transform: rotate(180deg); }

/* === MOBILE === */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .toc-collapse-bar { display: block; }
  aside.toc {
    position: static;
    height: auto;
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    border-right: 0;
    border-bottom: 0;
    transition: max-height 0.3s ease, padding 0.3s ease, border-bottom-color 0.3s ease;
  }
  aside.toc.open {
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px 24px 28px;
    border-bottom: 1px solid var(--border-1);
  }
  main.content { padding: 32px 24px; overflow-x: hidden; }
  .cover {
    padding: 36px 24px 32px;
    margin: -32px -24px 56px;
    min-height: 0;
  }
  .cover h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .cover .deck { font-size: 1.05rem; }
  .cover .doc-tag { font-size: 0.7rem; padding: 6px 14px; margin-bottom: 22px; }
  .cover .authors { grid-template-columns: 1fr; gap: 18px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .level-table { grid-template-columns: 1fr; }
  .level-table .col { border-right: 0; border-bottom: 1px solid var(--border-1); }
}
@media (max-width: 768px) {
  main.content { padding: 24px 18px; }
  .cover { padding: 32px 18px 28px; margin: -24px -18px 48px; }
  .cover h1 { font-size: clamp(1.5rem, 7.5vw, 2rem); }
}
