/* Article page — "Notebook margin" structure inside the Privacy Notebook world */
.nb-article {
  --margin-red: #f2a9a0;
  --rule: #dfe8f3;
  --font-read: "Literata", Georgia, serif;
}
.nb-article ::selection { background: var(--yellow); color: var(--ink); }
.nb-nav a[aria-current] { border-bottom-color: var(--orange); }

/* crumbs above the page; title sits over the reading column, photo pinned in the right margin */
.ar-crumbs { display: flex; gap: 10px; padding: 18px 0 0 20px; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.ar-crumbs a { text-decoration: none; }
.ar-crumbs a:hover { text-decoration: underline; text-decoration-color: var(--blue-deep); text-underline-offset: 4px; }
.ar-head { grid-column: 2; grid-row: 1; padding: 30px 0 6px; max-width: 720px; }
.ar-head h1 { font-size: clamp(2.2rem, 3.4vw, 3.1rem); line-height: 1.12; max-width: 19ch; text-wrap: balance; }
.ar-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: .92rem; color: var(--ink-soft); }

/* three-part page: margin | column | margin */
.ar-page { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 0 48px; padding: 0 0 48px 20px; }

.ar-margin { grid-column: 1; grid-row: 1 / 3; position: relative; padding: 32px 26px 0 0; border-right: 2px solid var(--margin-red); }
.ar-margin::after { content: ""; position: absolute; top: 0; bottom: 0; right: -7px; border-right: 1px solid var(--margin-red); }
.ar-toc { position: sticky; top: 24px; }
.ar-toc summary {
  list-style: none; cursor: default; font-size: .85rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
.ar-toc summary::-webkit-details-marker { display: none; }
.ar-toc__icon { display: none; width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.ar-toc__icon .v { transition: transform .2s ease; transform-origin: center; }
.ar-toc[open] .ar-toc__icon .v { transform: scaleY(0); }
.ar-toc ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.ar-toc a {
  display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px 6px 0; text-decoration: none; font-size: .95rem; line-height: 1.35;
  border-radius: 6px;
}
.ar-toc a span {
  background: linear-gradient(transparent 62%, var(--yellow) 62% 92%, transparent 92%) no-repeat 0 0 / 0% 100%;
  transition: background-size .35s cubic-bezier(.16, 1, .3, 1);
}
.ar-toc a:hover span, .ar-toc a.is-current span { background-size: 100% 100%; }
.ar-toc a.is-current { font-weight: 600; }
.ar-toc i {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center; margin-top: -1px;
  border: 1.5px solid var(--ink); border-radius: 50%; font-style: normal; font-size: .75rem; font-weight: 600;
  transition: background-color .25s ease;
}
.ar-toc a.is-current i { background: var(--yellow); }
/* reading column: calm, serif, real measure */
.ar-col { grid-column: 2; grid-row: 2; padding-top: 14px; max-width: 720px; }
.ar-lead { font-family: var(--font-read); font-size: 1.3rem; line-height: 1.6; color: var(--ink); margin: 0 0 28px; max-width: 60ch; scroll-margin-top: 24px; }
.ar-page > .ar-hero { grid-column: 3; grid-row: 1; align-self: end; margin: 34px 4px 0; transform: rotate(2deg); }
.ar-hero, .ar-body figure {
  position: relative; padding: 9px; background: #fffefb; border: 1.5px solid #2b2b2b; border-radius: 3px;
  box-shadow: 1px 3px 6px rgba(0,0,0,.1); transform: rotate(-.5deg);
}
.ar-body figure:nth-of-type(even) { transform: rotate(.45deg); }
.ar-hero::before, .ar-hero::after, .ar-body figure::before, .ar-body figure::after {
  content: ""; position: absolute; top: -12px; width: 86px; height: 24px; pointer-events: none;
  background: rgba(248, 236, 151, .78); box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.ar-hero::before, .ar-body figure::before { left: -18px; transform: rotate(-32deg); }
.ar-hero::after, .ar-body figure::after { right: -18px; transform: rotate(32deg); }
.ar-hero img, .ar-body figure img { width: 100%; height: auto; display: block; border-radius: 1px; background: #eef0f4; }
.ar-hero img { aspect-ratio: 1200 / 630; object-fit: cover; }
.ar-body { font-family: var(--font-read); font-size: 1.125rem; line-height: 1.72; color: #242424; max-width: 66ch; overflow-wrap: break-word; text-wrap: pretty; }
.ar-body p { margin: 0 0 1.05em; }
.ar-body :is(b, strong) { font-weight: 600; }
.ar-body h2 {
  font-family: var(--font-hand); font-size: 1.7rem; font-weight: 600; line-height: 1.22; color: var(--ink);
  margin: 2.2em 0 .55em; scroll-margin-top: 24px; text-wrap: balance;
}
.ar-body > :first-child:is(h2), .ar-body > :first-child + h2 { margin-top: 1.4em; }
.ar-body h2::after { content: ""; display: block; width: 64px; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--orange); transform: rotate(-1deg); }
.ar-body ul { margin: 0 0 1.2em; padding-left: 0; list-style: none; }
.ar-body li { position: relative; padding-left: 28px; margin: 0 0 .55em; }
.ar-body li::before {
  content: ""; position: absolute; left: 4px; top: .62em; width: 10px; height: 10px; border-radius: 50%;
  background: var(--yellow); border: 1.5px solid var(--ink);
}
.ar-body figure { margin: 2em 0; }
.ar-body a { color: var(--ink); text-decoration-color: var(--blue-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ar-body a:hover { background: var(--blue); }
.ar-body a[rel~="sponsored"] { text-decoration-color: var(--orange); }

/* right margin: two provider tickets, sticky beside the text — never inside it */
.ar-rail { grid-column: 3; grid-row: 2; padding-top: 30px; }
.ar-rail__in { position: sticky; top: 20px; display: grid; gap: 18px; }
.ar-rail__h { font-size: 1.3rem; }
.ar-tk {
  display: grid; gap: 12px; padding: 16px 16px 14px; background: #fff; border: 1.5px solid var(--ink);
  border-radius: 10px 13px 11px 12px; box-shadow: 0 6px 14px -10px rgba(40, 32, 10, .35);
}
.ar-tk img { height: 34px; width: auto; justify-self: start; mix-blend-mode: multiply; }
.ar-tk .nb-btn { width: 100%; min-height: 44px; font-size: 1rem; justify-content: center; gap: 10px; }
.ar-tk__review { justify-self: center; font-size: .9rem; text-decoration-color: var(--blue-deep); text-underline-offset: 4px; }
.ar-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: .9rem; line-height: 1.4; }
.ar-facts li { display: flex; gap: 8px; }
.ar-facts svg { flex: none; width: 15px; height: 15px; margin-top: 3px; fill: none; stroke: #2f8a2f; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ar-rail__src, .ar-rail .nb-disclosure { margin: 0; font-size: .78rem; line-height: 1.45; color: var(--ink-soft); }
.ar-rail .nb-disclosure { margin-top: -10px; }

/* after the article: the single recommendation block */
.ar-next { margin-top: 56px; padding-top: 28px; border-top: 2px dashed #d9d2bb; }
.ar-next .nb-h2 { font-size: 1.6rem; margin-bottom: 10px; }
.ar-next__intro { margin: 0 0 16px; font-size: .95rem; color: var(--ink-soft); }
.ar-next__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ar-next__cols { gap: 0; }
.ar-pick { display: grid; gap: 10px; align-content: start; padding: 4px 28px 4px 0; }
.ar-pick + .ar-pick { padding: 4px 0 4px 28px; border-left: 1.5px solid #d9d2bb; }
.ar-pick img { height: 46px; width: auto; justify-self: start; mix-blend-mode: multiply; }
.ar-pick .nb-btn { min-height: 44px; font-size: 1rem; }
.nb-btn svg, .nb-card__arrow {
  width: 24px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ar-next .nb-disclosure { margin: 14px 0 0; }

/* related */
.ar-related { padding: 8px 0 44px; }
.ar-related .nb-cards { grid-template-columns: repeat(3, 1fr); }
.ar-related .nb-card__arrow { margin-top: auto; align-self: flex-end; color: var(--ink); }

/* narrower: right margin goes (ar-next after the article stays), photo moves under the title */
@media (max-width: 1180px) {
  .ar-page { grid-template-columns: 220px minmax(0, 1fr); }
  .ar-margin { grid-row: 1 / 4; }
  .ar-page > .ar-hero { grid-column: 2; grid-row: 2; align-self: start; max-width: 720px; margin: 24px 6px 8px; transform: rotate(-.5deg); }
  .ar-col { grid-row: 3; }
  .ar-rail { display: none; }
}
/* phones and tablets: contents becomes a collapsible card under the title */
@media (max-width: 1100px) {
  .ar-page { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
  .ar-crumbs { padding-left: 0; }
  .ar-page > *, .ar-margin, .ar-page > .ar-hero, .ar-col { grid-column: 1; grid-row: auto; }
  .ar-page > .ar-hero { margin: 18px 6px 0; }
  .ar-margin { border-right: 0; padding: 20px 0 0; }
  .ar-margin::after { display: none; }
  .ar-toc { position: static; border: 1.5px solid var(--ink); border-radius: 8px 10px 9px 11px; padding: 12px 14px; background: #fff; }
  .ar-toc summary { cursor: pointer; display: flex; justify-content: space-between; }
  .ar-toc__icon { display: block; }
  .ar-toc summary { align-items: center; }
  .ar-col { max-width: none; padding-top: 24px; }
  .ar-related .nb-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ar-head { padding-top: 22px; }
  .ar-head h1 { font-size: 1.95rem; max-width: none; }
  .ar-lead { font-size: 1.2rem; }
  .ar-body h2 { font-size: 1.45rem; }
  .ar-next__cols { grid-template-columns: 1fr; }
  .ar-pick, .ar-pick + .ar-pick { padding: 18px 0; border-left: 0; }
  .ar-pick + .ar-pick { border-top: 1.5px solid #d9d2bb; }
  .ar-body { font-size: 1.02rem; }
  /* keep the photo tape inside the viewport */
  .ar-hero::before, .ar-body figure::before { left: -8px; }
  .ar-hero::after, .ar-body figure::after { right: -8px; }
  /* touch targets */
  .ar-crumbs a { position: relative; }
  .ar-crumbs a::after { content: ""; position: absolute; inset: -6px -6px; }
  .ar-toc summary { min-height: 44px; margin-block: -12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ar-toc a span, .ar-toc i { transition: none; }
}

/* legacy Summernote markup: style it, never rewrite it */
.ar-body :not(h2, h3)[style] { font-family: inherit !important; font-size: inherit !important; color: inherit !important; background: none !important; line-height: inherit !important; }
/* headings keep their own size; only the pasted font and colour go */
.ar-body :is(h2, h3)[style] { font-family: var(--font-hand) !important; color: var(--ink) !important; background: none !important; }
.ar-body img { max-width: 100%; height: auto; border-radius: 2px; }
.ar-body p > img, .ar-body > img { display: block; margin: 1.4em auto; }
.ar-body iframe, .ar-body video { max-width: 100%; border: 0; }
.ar-body iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.ar-body :is(h2, h3) > br:first-child, .ar-body :is(h2, h3) > br:last-child { display: none; }
/* demo videos are portrait phone recordings */
.ar-body video { display: block; width: auto; height: auto; max-height: min(80vh, 640px); aspect-ratio: 592 / 1280; margin: 1.4em auto; background: #1f2a33; border-radius: 10px; }
.ar-body ol { margin: 0 0 1.2em; padding-left: 1.6em; }
.ar-body ol li { padding-left: 6px; }
.ar-body ol li::before { display: none; }
.ar-body h3 { font-family: var(--font-hand); font-size: 1.2rem; line-height: 1.3; margin: 1.8em 0 .6em; }
.ar-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 1px solid var(--margin-red); font-style: italic; }
.ar-body pre, .ar-body code { font-size: .92em; background: var(--yellow-soft); border-radius: 4px; }
.ar-body pre { padding: 12px 14px; overflow-x: auto; }
.ar-body code { padding: 1px 5px; }
.ar-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.4em 0; }
.ar-body th, .ar-body td { border: 1.5px solid #d9d2bb; padding: 8px 12px; text-align: left; }
.ar-body .btn, .ar-body [class*="btn"] { font-family: var(--font-hand); }
.ar-body > :last-child { margin-bottom: 0; }
