/* Therapist Search Report: the homepage and the ranked websites page. Loaded only by those two templates so nothing here reaches the rest of Quill. */

/* Homepage */
/* The top block: the paragraph on the left, four figures in a 2x2 grid on the right, each with a colored icon. */
.home-stats { display: flex; gap: 1.4rem; flex-shrink: 0; margin-bottom: .35rem; }
/* The narrative between the bands: no numbers, just the thread from one chart to the next. */
.home-story { margin: 0; padding: 1.1rem 1.5rem 1.4rem; font-size: 1.35rem; line-height: 1.55; color: #343a40; }
.home-story + .home-band { margin-top: 0; }
/* Stacked narrative paragraphs sit close together; the article scope outranks the site's paragraph margin rule. */
.article-content .home-wide > .home-story:not(:last-child) { padding-bottom: 0; margin-bottom: 1.5rem; }
.article-content .home-wide > .home-story + .home-story { padding-top: 0; }
.home-stat { min-width: 0; border-left: 2px solid rgba(0,0,0,.1); padding-left: .6rem; }
.home-stat-value { display: block; font-weight: 700; font-size: 1.25rem; line-height: 1; color: #000; letter-spacing: -.02em; }
.home-stat-domain { font-size: .95rem; line-height: 1.1; padding-top: .15rem; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-stat-label { display: block; font-size: .62rem; color: #6c757d; margin-top: .25rem; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.text-purple { color: var(--quill-purple) !important; }
.text-pink { color: var(--quill-pink) !important; }
.btn-purple { background: var(--quill-purple); border-color: var(--quill-purple); }

/* One band per section. The band's tint and top stripe come from its brand tone, and the white gap between bands keeps them apart. */
.home-band { margin: 1.75rem 0; }
.home-band::before { border-top: 4px solid var(--band-color); background: color-mix(in srgb, var(--band-color) 6%, white); }
.home-band-purple { --band-color: var(--quill-purple); }
.home-band-pink { --band-color: var(--quill-pink); }
.home-band-green { --band-color: var(--quill-green); }
.home-band-orange { --band-color: var(--quill-orange); }
.home-band-yellow { --band-color: var(--quill-yellow); }
.home-band-yellow::before { background: color-mix(in srgb, var(--quill-yellow) 11%, white); }
/* The controls (range buttons, toggles, search) always sit in their own row above the section title, kept to the right; the title and description follow at full width. */
.home-heading { display: flex; flex-direction: column; align-items: stretch; gap: .75rem; margin-bottom: 1.25rem; }
.home-heading > .home-heading-text { order: 1; min-width: 0; display: grid; grid-template-columns: 2.6rem 1fr; column-gap: .9rem; align-items: start; }
.home-heading-text > .home-icon { grid-column: 1; grid-row: 1; margin: -.1rem 0 0; }
.home-heading-text > .home-title, .home-heading-text > .home-desc { grid-column: 2; }
.article-content .home-heading-text > .home-title { margin-top: 0; }
.home-heading > .home-range, .home-heading > .home-controls { order: 0; align-self: flex-end; }
.home-controls { display: flex; align-items: center; gap: .5rem; }
.home-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: color-mix(in srgb, var(--band-color) 72%, black); margin: 0 0 .5rem; }
.home-icon { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; font-size: 2rem; line-height: 1; color: color-mix(in srgb, var(--band-color) 45%, transparent); }
.home-desc { font-size: 1rem; line-height: 1.5; color: #4b5563; max-width: 110ch; margin: 0; }
.home-desc b { color: #1f1a2e; }
.home-band .btn-outline-dark.active { background: var(--band-color); border-color: #212529; color: #fff; }
.home-band-yellow .btn-outline-dark.active { color: #000; }
.home-band .btn-outline-dark { background: #fff; }
.home-band .btn-outline-dark:hover:not(.active) { background: color-mix(in srgb, var(--band-color) 15%, white); color: #000; }
@media (min-width: 992px) {
    .home-wide { position: relative; left: 50%; width: min(1320px, calc(100vw - 4rem)); max-width: none; transform: translateX(-50%); }
}
.home-chart { position: relative; width: 100%; }
.home-chart-hero { height: 640px; }
/* Every band signs off bottom right with the site and the latest edition's date. */
/* The negative bottom margin eats about half of the space the band leaves under the pill; the article scope outranks the site's paragraph margin rule. */
.article-content .home-band-foot { text-align: right; margin: 1rem 0 -.75rem; }
.home-band-foot span { display: inline-block; font-size: .72rem; letter-spacing: .02em; color: rgba(0,0,0,.55); background: rgba(255,255,255,.55); border-radius: .5rem; padding: .25rem .6rem; }

/* The first-page table: one column per website with its name turned upright, one row per position, cells shaded by share. */
.home-heat-card { background: #fff; border-radius: 1rem; box-shadow: 0 4px 14px rgba(36,30,53,.05); overflow: hidden; }
.home-heat-title { background: #f4f4f6; border-bottom: 1px solid #e1e1e6; text-align: center; font-size: 1.05rem; font-weight: 800; color: #1f1a2e; padding: .55rem .75rem; letter-spacing: -.01em; }
.home-heat { border-collapse: separate; border-spacing: 3px; padding: .5rem .75rem .75rem; width: auto; margin: 0 auto; }
/* The article styles give every table a border, gray header cells, uppercase headers and blue links; the heat table opts out of all of it. */
.article-content .home-heat { border: 0; box-shadow: none !important; }
.article-content .home-heat th, .article-content .home-heat td { border: 0; background-color: transparent; }
.home-heat th { font-weight: 600; font-size: .78rem; color: #4b5563; text-transform: none; letter-spacing: 0; }
.article-content .home-heat thead th > span a { color: inherit; }
.home-heat thead th { vertical-align: bottom; padding: 0; text-align: center; }
.home-heat thead th > span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; line-height: 1; padding: .2rem 0; }
.home-heat thead th > span a { color: inherit; text-decoration: underline dotted #adb5bd; text-underline-offset: .2em; }
.home-heat tbody th { text-align: right; padding: 0 .6rem 0 .25rem; white-space: nowrap; font-family: var(--bs-font-monospace); }
.home-heat td { width: 2.4rem; min-width: 2.4rem; height: 2.1rem; text-align: center; font-family: var(--bs-font-monospace); font-size: .6rem; letter-spacing: -.02em; border-radius: .35rem; color: #1f1a2e; }
.home-heat td.dark { color: #fff; }
.home-heat td.zero { color: #c3c3c3; }
.home-mover-head { display: flex; align-items: center; justify-content: space-between; min-height: 46px; margin: 0 0 .4rem; padding: .35rem .9rem; border-radius: .75rem; color: #fff; font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.home-mover-head .bi { font-size: 1.1rem; opacity: .85; }
.home-mover-head-up { background: #146c43; }
.home-mover-head-down { background: #b02a37; }
/* Every row's sparkline spans the same width, from the row's left edge to the figure, so the paths compare. The name sits on top of it on a translucent white backdrop. */
.home-mover { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 46px; background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: .75rem; padding: .35rem .6rem; margin-bottom: .4rem; transition: transform .15s ease, box-shadow .15s ease; }
.home-mover:hover { transform: translateX(4px); box-shadow: 0 6px 16px rgba(36,30,53,.08); }
.home-mover-spark-box { position: absolute; top: 4px; bottom: 4px; left: 6px; right: 4.4rem; }
.home-mover-spark { width: 100% !important; height: 100% !important; }
.home-mover-name { position: relative; z-index: 1; font-size: .9rem; max-width: calc(100% - 4.4rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(255,255,255,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); border-radius: .3rem; padding: .1rem .4rem .1rem .3rem; }
.home-mover-delta { position: relative; z-index: 1; flex: 0 0 3.6rem; text-align: right; font-weight: 700; font-family: var(--bs-font-monospace); white-space: nowrap; }
.home-badge-new { background: #d1e7dd; color: #0f5132; font-weight: 600; font-size: .62rem; vertical-align: 1px; }
.home-badge-gone { background: #dc3545; color: #fff; font-weight: 600; font-size: .62rem; vertical-align: 1px; }
/* Newcomer boxes: one brand tone each, a sparkline, and descriptive tags. */
.home-new { display: block; color: inherit; text-decoration: none; border-radius: 1rem; padding: .9rem 1rem .8rem; height: 100%; background: color-mix(in srgb, var(--tone) 12%, white); border: 1px solid color-mix(in srgb, var(--tone) 35%, white); transition: transform .15s ease, box-shadow .15s ease; }
a.home-new:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(36,30,53,.12); color: inherit; }
.home-new-name { font-weight: 800; font-size: 1rem; color: color-mix(in srgb, var(--tone) 70%, black); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-content a.home-new .home-new-name { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--tone) 50%, white); text-underline-offset: 2px; }
.home-new-meta { display: flex; justify-content: flex-end; align-items: baseline; margin-top: .15rem; }
.home-new-meta b { font-family: var(--bs-font-monospace); font-size: 1.1rem; color: #000; }
.home-new-chart { position: relative; height: 54px; margin-top: .4rem; background: rgba(255,255,255,.55); border-radius: .5rem; }
.home-new-foot { margin-top: .5rem; padding-top: .4rem; border-top: 1px solid color-mix(in srgb, var(--tone) 30%, white); font-size: .74rem; color: color-mix(in srgb, var(--tone) 70%, black); }
.home-donut-pair { display: flex; align-items: center; gap: 1rem; }
.home-donut { position: relative; height: 360px; flex: 0 0 58%; }
.home-donut-caption { min-height: 1.3em; }
.home-donut-legend { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 auto; min-width: 0; }
.home-donut-legend > span { display: flex; justify-content: space-between; gap: .5rem; white-space: nowrap; border-bottom: 1px solid rgba(0,0,0,.06); padding-bottom: .15rem; font-size: .78rem; }
.home-donut-legend > span > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.home-donut-legend > span:last-child { border-bottom: 0; }
.home-donut-legend i { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; vertical-align: -1px; margin-right: .3rem; }
/* Both dates' figures stay in the legend; the one the donut is showing is bold and black, the other faint. */
.home-donut-legend .home-legend-values { font-family: var(--bs-font-monospace); display: inline-flex; gap: .6rem; }
.home-donut-legend .home-legend-values span { color: #adb5bd; transition: color .4s ease, font-weight .4s ease; min-width: 2.4em; text-align: right; }
.home-donut-legend.showing-now .home-legend-now, .home-donut-legend:not(.showing-now) .home-legend-then { color: #000; font-weight: 700; }
@media (max-width: 767.98px) {
    .article-content .home-band-foot { margin-bottom: -.125rem; }
    .home-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem 1rem; margin: 1.25rem 0 .75rem; }
    /* On phones the figures stack under the title with room above them and no rule beneath. */
    .home-wide > hr { display: none; }
    .home-story { font-size: 1.1rem; padding: .8rem 0 1rem; }
    .home-story + .home-band, .home-wide + .home-band { margin-top: 0; }
    .home-stat-domain { font-size: .95rem; }
    .home-band { margin: 1.25rem 0; }
    .home-title { font-size: 1.3rem; }
    .home-heading > .home-heading-text { grid-template-columns: 2rem 1fr; column-gap: .6rem; }
    .home-icon { width: 2rem; height: 2rem; font-size: 1.5rem; }
    .home-desc { font-size: .9rem; }
    .home-range { display: flex; width: 100%; }
    .home-range .btn { flex: 1 1 auto; white-space: nowrap; }
    .home-heading > .home-range, .home-heading > .home-controls { align-self: stretch; }
    /* On phones the toggle fills the row and the View Data button sits beneath it, right-aligned at its own width. */
    .home-controls { flex-wrap: wrap; justify-content: flex-end; } .home-controls .home-range { flex: 1 1 100%; } .home-controls > .btn { flex: 0 0 auto; }
    .home-chart-hero { height: 400px; }
    /* Ten narrow cells fit a phone's width without scrolling. */
    .home-heat thead th > span { max-height: 8rem; overflow: hidden; text-overflow: ellipsis; font-size: .66rem; }
    .home-heat { border-spacing: 2px; padding: .35rem .3rem .45rem; }
    .home-heat td { width: 1.6rem; min-width: 1.6rem; height: 1.7rem; font-size: .5rem; border-radius: .25rem; }
    .home-heat tbody th { font-size: .66rem; padding: 0 .3rem 0 0; }
    .home-heat-title { font-size: .9rem; padding: .45rem .5rem; }
    .home-donut-pair { flex-direction: column; align-items: stretch; }
    .home-donut { height: 260px; flex: 0 0 auto; }
}

/* Every website, ranked */
.rank-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 .75rem; }
.rank-search { flex: 0 0 14rem; margin-left: auto; }
.rank-filter .btn.active { background: var(--quill-purple); border-color: #212529; color: #fff; }
.rank-table { font-size: .82rem; background: #fff; border-radius: 1rem; overflow: hidden; box-shadow: 0 4px 14px rgba(36,30,53,.05); }
.rank-table th { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: #6c757d; white-space: nowrap; border-bottom: 2px solid #212529; }
.rank-table td { white-space: nowrap; vertical-align: middle; padding: .35rem .4rem; }
.rank-table th { padding: .5rem .4rem; }
.rank-table tbody tr { transition: background .15s ease; }
/* Bootstrap paints each cell from --bs-table-bg, so row tints have to go through that variable. */
.rank-table tbody tr:hover { --bs-table-bg: #faf7ff; }
.rank-table tbody tr.rank-fresh { --bs-table-bg: #f1faf4; }
.rank-table tbody tr.rank-fresh:hover { --bs-table-bg: #e6f5eb; }
/* The top ten run through the rainbow, pink to magenta; everyone else sits on a neutral badge so the top of the table stands out. */
.rank-num { display: inline-grid; place-items: center; min-width: 2.1rem; height: 2.1rem; padding: 0 .5rem; border-radius: .7rem; font-weight: 800; font-size: .95rem; color: #495057; background: #e9ecef; }
.rank-num.r1 { background: var(--quill-pink); color: #fff; } .rank-num.r2 { background: var(--quill-orange); color: #fff; } .rank-num.r3 { background: var(--quill-yellow); color: #241e35; }
.rank-num.r4 { background: #6aa84f; color: #fff; } .rank-num.r5 { background: var(--quill-green); color: #fff; } .rank-num.r6 { background: #17a2b8; color: #fff; }
.rank-num.r7 { background: #2a7fb8; color: #fff; } .rank-num.r8 { background: #4b4fb5; color: #fff; } .rank-num.r9 { background: var(--quill-purple); color: #fff; } .rank-num.r10 { background: #b5179e; color: #fff; }
.rank-num.gone { background: #e9ecef; color: #adb5bd; }
.rank-table td.rank-name { font-weight: 600; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
/* A dotted underline marks the websites that have a write-up to open. */
.rank-table td.rank-name a { color: #212529; text-decoration: underline dotted #adb5bd; text-decoration-thickness: 1.5px; text-underline-offset: .22em; }
.rank-table td.rank-name a:hover { text-decoration-color: #495057; }
/* Fixed-ish columns everywhere else so the popularity column takes whatever the page width leaves, and the badge column wraps instead of pushing the table into a scroll. */
.rank-table { table-layout: fixed; width: 100%; }
.rank-table th { white-space: normal; }
.rank-table td { overflow: hidden; text-overflow: ellipsis; }
.rank-table td:first-child { text-overflow: clip; }
.rank-tags { white-space: normal; line-height: 1; }
.rank-spark { position: relative; height: 32px; }
.rank-tags span { font-size: .74rem; font-weight: 600; display: inline-block; vertical-align: middle; margin: .1rem 0; }
.tag-new { color: #0f5132; } .tag-gone { color: #b02a37; }
.rank-score { font-family: var(--bs-font-monospace); font-weight: 700; font-size: .95rem; }
.rank-delta { font-family: var(--bs-font-monospace); font-size: .8rem; }
.rank-delta.u { color: #198754; } .rank-delta.d { color: #dc3545; } .rank-delta.n { color: #adb5bd; }
@media (max-width: 767.98px) {
    .rank-controls { flex-direction: column; align-items: stretch; }
    .rank-filter { display: flex; } .rank-filter .btn { flex: 1; }
    .rank-search { flex: 0 0 auto; }
    .rank-spark { min-width: 90px; }
    /* On phones the table scrolls sideways inside .table-responsive instead of squeezing every column. */
    .rank-table { table-layout: auto; width: max-content; min-width: 100%; }
    .rank-table td { overflow: visible; text-overflow: clip; }
    .rank-table th, .rank-table td.rank-name, .rank-tags { white-space: nowrap; }
    .rank-pop { width: 120px; }
}

/* On especially narrow screens the newcomer boxes go one per row. */
@media (max-width: 479.98px) {
    #newcomers > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
}
