/* article-blocks.css: moved out of src/components/ArticleBlocks.astro on 2026-10-27, so a style fix is a single file upload. */
/* The wrapper adds no box: the blocks lay out as children of the article section. */
.blocks {
  display: contents;
}

@scope (.blocks) to (.tour-card > *, .inquiry > *, .map > *, .climate > *, .profile > *) {
  p,
  h3,
  .list {
    max-width: 68ch;
  }
  /* The last paragraph keeps its margin too (the base rule p:last-child sets 0). */
  p,
  p:last-child {
    margin-bottom: 1.15em;
  }
  h3 {
    margin: 1.7em 0 0.5em;
    font-size: 1.28rem;
  }
  /* Lists: a small stepped diamond as the bullet, slab numerals for the steps. */
  .list {
    display: grid;
    gap: 0.6em;
    margin: 0 0 1.4em;
  }
  .list li {
    position: relative;
    padding-left: 1.7em;
  }
  ul.list li::before {
    content: '';
    position: absolute;
    left: 0.3em;
    top: 0.62em;
    width: 0.5em;
    height: 0.5em;
    background: var(--accent);
    transform: rotate(45deg);
  }
  .steps {
    counter-reset: step;
  }
  .steps li {
    counter-increment: step;
    padding-left: 2.3em;
  }
  .steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.08em;
    display: grid;
    place-items: center;
    width: 1.55em;
    height: 1.55em;
    border: 1px solid var(--line);
    border-radius: 50%;
    font: 600 0.82em/1 var(--title);
    color: var(--ink-soft);
  }

  /* Comparison table: plain rows split by hairlines, no fills. */
  .table {
    margin: 1.8em 0 2em;
  }
  table {
    width: 100%;
    /* Separate borders: with collapsed ones the rounded corners are not drawn. */
    border-collapse: separate;
    border-spacing: 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.94rem;
    line-height: 1.4;
  }
  thead th {
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--ink);
    color: var(--ink-soft);
    font: 700 0.72rem/1.25 var(--head);
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
    vertical-align: bottom;
  }
  tbody th,
  tbody td {
    padding: 14px 12px;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
  }
  tbody th {
    width: 22%;
    font: 700 0.98rem/1.3 var(--title);
  }
  tbody td {
    color: var(--ink-soft);
  }
  tbody tr:first-child :is(th, td) {
    border-top: 0;
  }
  :is(thead, tbody) :is(th, td):first-child {
    padding-left: 0;
  }
  .table-note {
    max-width: none;
    margin: 12px 2px 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--ink-soft);
  }

  /* Large figures on one line, hairlines between them. */
  .figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 1.8em 0;
    border-block: 1px solid var(--line);
  }
  .figures div {
    padding: 20px 14px 18px 0;
  }
  .figures div + div {
    padding-left: clamp(12px, 2vw, 22px);
    border-left: 1px solid var(--line);
  }
  .figures dt {
    font: 600 clamp(1.2rem, 2.1vw, 1.5rem) / 1.1 var(--title);
    white-space: nowrap;
  }
  .figures dd {
    margin: 8px 0 0;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--ink-soft);
  }

  /* Guide tip: the voice of the author. Note: a neutral warning. Both are set off by a thin rule only. */
  .tip,
  .note {
    max-width: 68ch;
    margin: 1.8em 0;
    padding: 2px 0 2px clamp(16px, 2.4vw, 22px);
    border-left: 2px solid var(--accent);
  }
  .note {
    border-left-color: var(--ink);
  }
  .tip p,
  .note p {
    max-width: none;
    margin-bottom: 0.7em;
  }
  .tip p:last-child,
  .note p:last-child {
    margin-bottom: 0;
  }
  .tip-who {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
  }
  .tip-who img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--card);
  }
  .tip-who span {
    display: grid;
    gap: 3px;
    font-size: 0.88rem;
    color: var(--ink-soft);
  }
  .tip-who b {
    font: 700 0.7rem/1 var(--head);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .aside-title {
    font: 700 1.1rem/1.25 var(--title);
  }
  .aside-title svg {
    display: none;
  }

  .photo {
    margin: 2em 0;
  }
  .photo img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: var(--radius);
  }
  /* Maps and panels keep their own proportions instead of the 3:2 crop. */
  .photo.wide img {
    aspect-ratio: auto;
    height: auto;
    object-fit: contain;
  }
  .photo.wide a {
    display: block;
    cursor: zoom-in;
  }
  .photo figcaption {
    margin-top: 10px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--ink-soft);
  }

  /* Route: stops joined by a dotted line. */
  .route {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2.4vw, 28px);
    margin: 1.9em 0 2em;
  }
  .route li {
    position: relative;
    display: grid;
    gap: 6px;
    align-content: start;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ink-soft);
  }
  .route b {
    font: 700 1.04rem/1.25 var(--title);
    color: var(--ink);
  }
  .route-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
  }
  .route li + li::before {
    content: '';
    position: absolute;
    top: 27px;
    right: 100%;
    width: calc(100% - 54px + clamp(14px, 2.4vw, 28px));
    border-top: 1px dashed var(--ink-soft);
  }

  /* Chooser: one panel, six cells. */
  .chooser {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 1.9em 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    overflow: hidden;
  }
  .chooser li {
    position: relative;
    padding: 22px clamp(18px, 2.6vw, 26px) 24px;
    border-top: 1px solid var(--line);
    transition: background 0.18s;
  }
  .chooser li:nth-child(-n + 2) {
    border-top: 0;
  }
  .chooser li:nth-child(even) {
    border-left: 1px solid var(--line);
  }
  .chooser li:hover {
    background: var(--card);
  }
  .who {
    display: block;
    margin-bottom: 8px;
    font: 700 0.72rem/1.3 var(--head);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .chooser h3 {
    margin: 0 0 6px;
    font-size: 1.14rem;
  }
  .chooser a {
    text-decoration: none;
  }
  .chooser a::after {
    content: '';
    position: absolute;
    inset: 0;
  }
  .chooser p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink-soft);
  }

  /* Trips: compact rows inside the text, not the large cards. */
  .trips {
    margin: 2em 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    overflow: hidden;
  }
  .trips-title {
    max-width: none;
    margin: 0;
    padding: 14px 18px 12px;
    font: 700 0.74rem/1 var(--head);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .trips li {
    position: relative;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px 18px 12px 12px;
    border-top: 1px solid var(--line);
    transition: background 0.18s;
  }
  .trips li:hover {
    background: var(--card);
  }
  .trips img {
    width: 88px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
  }
  .trips div {
    display: grid;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--ink-soft);
  }
  .trips a {
    font: 700 1.08rem/1.25 var(--title);
    color: var(--ink);
    text-decoration: none;
  }
  .trips a::after {
    content: '';
    position: absolute;
    inset: 0;
  }
  .price {
    font-size: 0.9rem;
    white-space: nowrap;
  }
  .price b {
    font: 800 1.2rem/1 var(--head);
  }

  @media (max-width: 720px) {
    /* Tables of up to three columns fit a phone as they are. In wider ones every row becomes a card:
     the first cell is its title, the rest sit two to a line. */
    .cards table,
    .cards tbody,
    .cards tbody th,
    .cards tbody td {
      display: block;
      width: auto;
    }
    .cards tr {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
    .cards table {
      border: 0;
      border-radius: 0;
      overflow: visible;
    }
    .cards thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
    }
    .cards tr {
      margin-bottom: 12px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--white);
      overflow: hidden;
    }
    .cards tbody tr:nth-child(even) {
      background: var(--white);
    }
    .cards tbody th {
      grid-column: 1 / -1;
      padding: 13px 16px 11px;
      border-top: 0;
      font-size: 1.06rem;
    }
    .cards tbody td {
      padding: 10px 16px 12px;
      color: var(--ink);
    }
    /* Undo the two desktop rules that strip the first row and the first column. */
    .cards tbody tr:first-child td {
      border-top: 1px solid var(--line);
    }
    .cards tbody tr th:first-child {
      padding-left: 16px;
    }
    .cards tbody td:nth-of-type(even) {
      border-left: 1px solid var(--line);
    }
    /* An odd cell left alone on the last line takes the full width. */
    .cards tbody td:last-child:nth-of-type(odd) {
      grid-column: 1 / -1;
    }
    /* Narrow tables stay tables: slightly tighter cells. Long compound words
     (Swedish, Dutch, Finnish...) are hyphenated so a column never pushes the page wider. */
    .table:not(.cards) :is(th, td) {
      padding-right: 8px;
      hyphens: auto;
      overflow-wrap: anywhere;
    }
    .table:not(.cards) :is(th, td):not(:first-child) {
      padding-left: 8px;
    }
    .table:not(.cards) tbody th {
      width: auto;
      font-size: 0.94rem;
    }
    .cards tbody td::before {
      content: attr(data-label);
      display: block;
      margin-bottom: 3px;
      font: 700 0.68rem/1.5 var(--head);
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--ink-soft);
    }
    .figures {
      grid-template-columns: 1fr 1fr;
    }
    /* `div + div` again so this rule outranks the desktop one. */
    .figures div + div:nth-child(odd) {
      padding-left: 0;
      border-left: 0;
    }
    .figures div:nth-child(n + 3) {
      border-top: 1px solid var(--line);
    }
    .route {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }
    .route li {
      grid-template-columns: 54px minmax(0, 1fr);
      column-gap: 16px;
      padding-bottom: 22px;
    }
    .route-icon {
      grid-row: span 2;
      margin: 0;
    }
    .route b {
      align-self: end;
    }
    /* The line runs down from each icon to the next one. */
    .route li + li::before {
      display: none;
    }
    .route li:not(:last-child)::after {
      content: '';
      position: absolute;
      left: 26px;
      top: 54px;
      bottom: 0;
      border-left: 1px dashed var(--ink-soft);
    }
    .chooser {
      grid-template-columns: minmax(0, 1fr);
    }
    .chooser li:nth-child(even) {
      border-left: 0;
    }
    .chooser li:nth-child(2) {
      border-top: 1px solid var(--line);
    }
    .trips li {
      grid-template-columns: 72px minmax(0, 1fr);
    }
    .trips img {
      width: 72px;
      height: 54px;
    }
    .price {
      grid-column: 2;
      margin-top: -8px;
    }
  }
}
