/* =============================================================
   SkiAllDay — compare pages (/compare, /compare/<a>-vs-<b>)
   Loaded after resort.css and only by these pages. It adds the
   pieces a comparison needs and redefines no token or typeface.
   Resorts are told apart by column and by name: blue, red and
   black stay piste difficulty here too.
   ============================================================= */

/* The comparison's column heads stick under the top bar, and under the section
   bar as well where that is showing. */
:root { --cmp-stick: 49px; }
@media (max-width: 1039px) { :root { --cmp-stick: 91px; } }

/* ---------- hero: what is being compared ---------- */

.cmp-slots { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; font-family: var(--sans); }
.cmp-slots:empty { display: none; }
.cmp-slot { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--ink); background: var(--paper); }
.resort .cmp-slot-name {
  padding: 8px 13px; background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--ink);
  text-decoration: none; overflow-wrap: anywhere;
}
.cmp-slot-name:hover { background: var(--paper-sunk); }
.cmp-slot-x { width: 34px; padding: 0; cursor: pointer; background: none; border: 0; border-left: 1px solid var(--rule); color: var(--ink-soft); }
.cmp-slot-x:hover { color: var(--ink); background: var(--paper-sunk); }
.cmp-slot-x svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.cmp-slot--add { border-style: dashed; border-color: var(--rule-strong); background: none; }
.cmp-slot--add button {
  padding: 8px 14px; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--ink-mid);
}
.cmp-slot--add button::before { content: '+'; margin-right: 7px; color: var(--ink-soft); }
.cmp-slot--add:hover { border-color: var(--ink); }
.cmp-slot--add:hover button { color: var(--ink); }
/* The names people search the pair under, where they are not the guides'. */
.cmp-aka { margin: 12px 0 0; font-family: var(--sans); font-size: 0.875rem; font-weight: 500; color: var(--ink-mid); max-width: var(--measure); }
.cmp-aka:empty { display: none; }
.cmp-aka:not(:empty) + .idx-lede { margin-top: 12px; }
.cmp-status { margin: 12px 0 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-soft); }
.cmp-status:empty { display: none; }

/* ---------- nothing chosen yet ---------- */

/* /compare with fewer than two areas is a picker and a directory: no rail, no
   section bar, and the comparison's own sections stay hidden. Once there is a
   comparison the two starting sections go instead. */
html[data-cmp-empty] .rail, html[data-cmp-empty] .secnav { display: none; }
@media (min-width: 1040px) { html[data-cmp-empty] .shell { grid-template-columns: minmax(0, 1fr); gap: 0; } }
html:not([data-cmp-empty]) [data-cmp-start] { display: none; }
/* The directory of pair pages: one pair to a line, in as many columns as fit.
   A link per line with no separators keeps 438 of them at 438 elements. */
.cmp-dir + .cmp-dir { margin-top: 30px; }
.cmp-dir .more-guides-h { padding-bottom: 8px; border-bottom: 1px solid var(--rule-strong); }
.cmp-dir-list { margin: 0; columns: 3 300px; column-gap: 36px; font-family: var(--serif); font-size: 1rem; line-height: 1.35; }
.resort .cmp-dir-list a { display: block; padding: 5px 0; break-inside: avoid; color: var(--ink); text-decoration: none; overflow-wrap: break-word; }
.resort .cmp-dir-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the networks at one scale ---------- */

.cmp-nets {
  display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule);
}
.cmp-net { margin: 0; min-width: 0; display: flex; flex-direction: column; background: var(--paper-raised); }
/* Margin, not padding: the scale bar's width is a percentage of this box, and
   it has to be a percentage of the drawing. */
.cmp-net-box { position: relative; margin: 16px; }
.cmp-net-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.cmp-l { fill: none; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cmp-l--lift { stroke: var(--ink-soft); stroke-width: 0.7; opacity: .8; }
.cmp-l--route { stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 2 2; }
.cmp-l--blue { stroke: var(--piste-blue); }
.cmp-l--red { stroke: var(--piste-red); }
.cmp-l--black { stroke: var(--piste-black); }
.cmp-net figcaption {
  margin-top: auto; padding: 11px 16px 13px; border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--sans); font-size: 0.8125rem; line-height: 1.45; color: var(--ink-soft);
  overflow-wrap: break-word;
}
.resort .cmp-net figcaption a { font-family: var(--serif); font-size: 1.0625rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.resort .cmp-net figcaption a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-net-flag { margin-top: 4px; padding-left: 9px; border-left: 2px solid var(--rule-strong); color: var(--ink-mid); }
.cmp-net-none { margin: 0; padding: 28px 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-soft); }

.cmp-scalebar { position: absolute; left: 0; bottom: -4px; height: 5px; border: 1px solid var(--ink); border-top: 0; }
.cmp-scalebar span {
  position: absolute; left: 100%; bottom: -4px; margin-left: 7px; white-space: nowrap;
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; color: var(--ink-mid);
}

.cmp-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 12px; padding: 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-mid); }
.cmp-key { display: inline-block; width: 18px; height: 0; margin-right: 7px; vertical-align: middle; border-top: 2px solid; }
.cmp-key--blue { border-color: var(--piste-blue); }
.cmp-key--red { border-color: var(--piste-red); }
.cmp-key--black { border-color: var(--piste-black); }
.cmp-key--route { border-color: var(--rule-strong); border-top-style: dashed; }
.cmp-key--lift { border-color: var(--ink-soft); border-top-width: 1px; }

/* ---------- the comparison table ---------- */

.cmp-lede { font-size: clamp(1.1rem, 2vw, 1.3rem); }

.cmp-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 22px 0 12px; font-family: var(--sans); }
.cmp-table th, .cmp-table td { padding: 13px 16px 13px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.cmp-table th:last-child, .cmp-table td:last-child { padding-right: 0; }
.cmp-table thead th {
  position: sticky; top: var(--cmp-stick); z-index: 5; vertical-align: bottom;
  background: var(--paper); border-bottom: 1px solid var(--rule-strong);
  font-size: 0.8125rem; font-weight: 600; line-height: 1.3; overflow-wrap: break-word;
}
.resort .cmp-table thead a { color: var(--ink); text-decoration: none; }
.resort .cmp-table thead a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-corner { width: 31%; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-soft); }
.cmp-table tbody th { font-size: 0.8125rem; font-weight: 500; line-height: 1.4; color: var(--ink-mid); overflow-wrap: break-word; }
.cmp-row-note { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 400; color: var(--ink-soft); }
.cmp-table td { font-family: var(--serif); font-size: 1.3125rem; line-height: 1.2; letter-spacing: -0.012em; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.cmp-table td .alt-unit { display: block; margin: 3px 0 0; font-size: 0.75rem; letter-spacing: 0; }
.cmp-meter { display: block; height: 3px; max-width: 240px; margin-top: 9px; background: var(--rule); }
.cmp-meter i { display: block; height: 100%; background: var(--ink); opacity: .72; }
.cmp-none { font-family: var(--sans); font-size: 0.8125rem; letter-spacing: 0; color: var(--ink-soft); }
.cmp-text { font-size: 1.0625rem; letter-spacing: 0; }
.cmp-cur { font-family: var(--sans); font-size: 0.62em; font-weight: 500; letter-spacing: 0.03em; color: var(--ink-soft); }
.cmp-cell-note { display: block; margin-top: 6px; font-family: var(--sans); font-size: 0.78125rem; line-height: 1.5; letter-spacing: 0; color: var(--ink-mid); }
.cmp-cell-note em { color: var(--ink-soft); }
.cmp-basis {
  display: block; margin-top: 5px; cursor: help;
  font-family: var(--sans); font-size: 0.5625rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft);
}

/* Bars on one scale: the gradient and altitude tables. */
.cmp-table--bars { margin-top: 14px; }
.cmp-table--bars .cmp-corner { width: 128px; }
.cmp-table--bars th, .cmp-table--bars td { padding-top: 7px; padding-bottom: 7px; vertical-align: middle; }
.cmp-table--bars thead th { padding-bottom: 9px; }
.cmp-table--bars tbody th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cmp-table--bars td { font-family: var(--sans); font-size: 0.8125rem; letter-spacing: 0; }
/* The bar is a share of the cell less the room its label needs, so a full bar
   and its number still fit. */
.cmp-bar { display: block; padding-right: 62px; white-space: nowrap; }
.cmp-bar i { display: inline-block; height: 14px; min-width: 1px; vertical-align: middle; background: var(--ink); opacity: .82; }
.cmp-bar b { margin-left: 8px; vertical-align: middle; font-weight: 600; color: var(--ink-mid); }
.cmp-bar--none b { margin-left: 0; font-weight: 400; color: var(--ink-soft); }

/* Ratings, with the guide's own sentence under each. */
.cmp-table--suits td { font-family: var(--sans); font-size: 0.875rem; letter-spacing: 0; }

/* ---------- terrain ---------- */

.cmp-ribbons { display: grid; gap: 22px; margin: 6px 0 14px; }
.cmp-ribbon-name { margin: 0 0 8px; font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; }
.cmp-ribbon-none { margin: 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-soft); }
.cmp-ribbon-row .ribbon { height: 22px; }
.cmp-ribbon-row .ribbon-legend { margin-top: 9px; gap: 4px 24px; }

.cmp-roses { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 26px; margin: 10px 0 16px; }
.cmp-rose { margin: 0; min-width: 0; }
.cmp-rose svg { display: block; width: 100%; max-width: 236px; height: auto; overflow: visible; }
.cmp-rose-ring, .cmp-rose-axis { fill: none; stroke: var(--rule); stroke-width: 1; }
.cmp-rose-wedge { fill: var(--ink); opacity: .82; }
.cmp-rose-pt { font-family: var(--sans); font-size: 10px; font-weight: 600; fill: var(--ink-soft); }
.cmp-rose figcaption { margin-top: 12px; max-width: 32ch; font-family: var(--sans); font-size: 0.8125rem; line-height: 1.5; color: var(--ink-soft); overflow-wrap: break-word; }
.cmp-rose figcaption strong { display: block; color: var(--ink); }

/* ---------- prose in columns: verdicts and tips ---------- */

.cmp-cols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0 40px; }
.cmp-col { min-width: 0; }
.cmp-col-name { margin: 0 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong); font-family: var(--serif); font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: break-word; }
.resort .cmp-col-name a { color: var(--ink); text-decoration: none; }
.resort .cmp-col-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-col > .micro { margin: 18px 0 10px; }
.cmp-col .tick-list { font-size: 0.9375rem; }
.cmp-cols--tips .tip .micro { margin: 0 0 5px; }
.cmp-cols--tips .tip-line { font-size: 1rem; }
.cmp-tip-src { margin: 6px 0 0; font-family: var(--sans); font-size: 0.75rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.cmp-cols--tips .block-link { margin-top: 14px; }

/* ---------- the picker ---------- */

.cmp-picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cmp-picker-tools .idx-filter { flex: 1 1 240px; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.cmp-picker-tools .cmp-chips { margin-top: 0; }
.cmp-picker-count { margin: 14px 0 6px; font-family: var(--sans); font-size: 0.75rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cmp-picker-none { margin: 0; padding: 22px 0; font-family: var(--sans); font-size: 0.875rem; color: var(--ink-mid); }
.cmp-list { list-style: none; margin: 0; padding: 0; max-height: min(58vh, 540px); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cmp-pickrow {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 16px;
  width: 100%; padding: 10px 10px 11px 6px; cursor: pointer; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--rule); color: var(--ink); font-family: var(--sans);
}
.cmp-list li:last-child .cmp-pickrow { border-bottom: 0; }
.cmp-pickrow:hover, .cmp-pickrow:focus-visible { background: var(--paper-sunk); }
.cmp-pickrow[disabled] { cursor: default; background: none; }
.cmp-pickrow[disabled] > :not(.cmp-pickrow-km) { opacity: .45; }
.cmp-pickrow-name { grid-column: 1; font-family: var(--serif); font-size: 1.0625rem; font-weight: 600; overflow-wrap: break-word; }
.cmp-pickrow-where { grid-column: 1; font-size: 0.75rem; color: var(--ink-soft); }
.cmp-pickrow-km { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.cmp-pickrow-km em { display: block; font-style: normal; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.cmp-pickrow-bar { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--ink); opacity: .5; }

.cmp-picker--inline { margin-top: 22px; }
.cmp-picker-more { margin-top: 14px; cursor: pointer; background: none; }

.cmp-dialog { position: fixed; inset: 0; z-index: 300; display: flex; justify-content: center; align-items: flex-start; }
.cmp-dialog[hidden] { display: none; }
.cmp-dialog-backdrop { position: absolute; inset: 0; background: rgba(8, 11, 16, .55); backdrop-filter: blur(6px); }
.cmp-dialog-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(720px, 100% - 2 * var(--gutter)); margin-top: min(8vh, 80px);
  max-height: calc(100vh - min(8vh, 80px) - 24px); max-height: calc(100dvh - min(8vh, 80px) - 24px);
  padding: 16px 18px 0; background: var(--paper); border: 1px solid var(--rule-strong);
}
.cmp-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cmp-dialog-head h2 { margin: 0; font-family: var(--serif); font-size: 1.375rem; font-weight: 400; letter-spacing: -0.015em; overflow-wrap: break-word; min-width: 0; }
.cmp-dialog .cmp-picker { display: flex; flex-direction: column; min-height: 0; }
.cmp-dialog .cmp-list { flex: 1; max-height: none; border-bottom: 0; }

/* ---------- narrow screens ---------- */

@media (max-width: 760px) {
  .cmp-cols { grid-template-columns: minmax(0, 1fr); gap: 34px 0; }
  /* Three networks side by side are 100px each on a phone. Stacked, each is
     the full width and the scale is still shared. */
  .cmp-nets[style*='--n:3'] { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .cmp-table th, .cmp-table td { padding-right: 10px; }
  .cmp-corner { width: 30%; }
  .cmp-table td { font-size: 1.0625rem; }
  .cmp-text { font-size: 0.9375rem; }
  .cmp-table--bars .cmp-corner { width: 96px; }
  .cmp-table--bars tbody th { font-size: 0.6875rem; }
  .cmp-table--bars td { font-size: 0.75rem; }
  /* The number goes over its bar: beside it, three columns leave the bar
     30px to say anything in. */
  .cmp-bar { display: flex; flex-direction: column-reverse; gap: 3px; padding-right: 6px; }
  .cmp-bar i { display: block; height: 9px; }
  .cmp-bar b { margin-left: 0; }
  .cmp-roses { gap: 16px; }
  .cmp-roses[style*='--n:3'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-net-box { margin: 12px; }
  .cmp-net figcaption { padding: 10px 12px 12px; }

  /* A rating with a sentence under it does not fit three to a row. Each row
     becomes a block: the skier, then one area after another, named. */
  .cmp-table--stack thead { display: none; }
  .cmp-table--stack, .cmp-table--stack tbody, .cmp-table--stack tr, .cmp-table--stack th, .cmp-table--stack td { display: block; }
  .cmp-table--stack tr { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .cmp-table--stack th, .cmp-table--stack td { padding: 0; border: 0; }
  .cmp-table--stack tbody th { margin-bottom: 4px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-soft); }
  .cmp-table--stack td { margin-top: 12px; }
  .cmp-table--stack td::before { content: attr(data-n); display: block; margin-bottom: 5px; font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--ink); }

  .cmp-dialog-panel { width: 100%; margin-top: 0; max-height: 100vh; max-height: 100dvh; height: 100dvh; border: 0; padding: 12px var(--gutter) 0; }
  .cmp-dialog-head kbd { display: none; }
}

@media print {
  .cmp-slots, .cmp-dialog { display: none; }
  .cmp-table thead th { position: static; }
}
