/* The plans page. Only in a build with paid plans. Three plans side by side on a wide screen, stacked on a
   phone. Each plan is a press sheet: a heavy ink rule on top, the price set large; the visitor's own plan
   gets the badge's double rule all round. Above them, the switch between paying monthly and yearly. */

/* a short page head, so the plans show on the first screen: the headline about half the size of other pages', less
   room above it, and one lede */
.pl-page .phead { padding-bottom: clamp(12px, 2vh, 22px); }
.pl-page .phead .label { margin-top: clamp(10px, 2vh, 22px); }
.pl-page .phead h1 { font-size: clamp(1.7rem, 3.2vw, 2.7rem); line-height: 1.16; max-width: 24em; margin: .25em 0 .35em; }   /* a sentence of three lines on a phone: looser than a name, so the raised edge of one line clears the next */
.pl-page .phead .lede { font-size: clamp(1.02rem, 1.3vw, 1.2rem); max-width: 46em; }
/* the visitor's own count, under the plan cards */
.pl-status { margin-top: 26px; font-weight: 700; max-width: 36em; min-height: 1.6em; padding-left: 14px; border-left: 3px solid var(--teal); }
.pl-status:empty { border-color: transparent; }

.pl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.6vw, 34px); margin-top: clamp(8px, 2vw, 22px); }
.pl-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;   /* the list grows, so every button sits on the card's foot */
  padding: clamp(20px, 2.4vw, 30px) clamp(18px, 2.2vw, 28px) clamp(20px, 2.4vw, 28px);
  background: var(--stock-2); border-top: 6px solid var(--ink); border-radius: 0 0 16px 16px;
  box-shadow: 0 0 0 1px var(--line-2), 9px 9px 0 var(--offset);
}
.pl-card.is-mine { border: 3px solid var(--ink); border-top-width: 6px; box-shadow: 9px 9px 0 var(--offset); }
.pl-card.is-mine::after { content: ""; position: absolute; inset: 4px; border: 1.5px solid var(--ink); border-radius: 0 0 11px 11px; pointer-events: none; }
.pl-mine { position: absolute; top: 0; right: clamp(16px, 2vw, 24px); transform: translateY(-50%); background: var(--teal); color: var(--carbon); padding: 6px 10px; border-radius: 99px; font-size: .62rem; }
/* Monthly or yearly: a tray of paper stock with an ink plate that slides under the chosen word, pressed like the
   site's buttons. Two real radios in a fieldset do the work (arrow keys, Tab, touch, screen readers); the plate and
   the prices follow the checked one in CSS, so it works with JavaScript off. */
.pl-period { margin: clamp(4px, 1vw, 10px) 0 clamp(28px, 3.4vw, 40px); padding: 0; border: 0; min-width: 0; }
.pl-period__track {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 480px); padding: 5px;
  background: var(--stock-3); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--btn-shade-2);
}
.pl-period__in { position: absolute; top: 50%; left: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.pl-period__opt {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px;
  min-height: 50px; padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: center;
  font: 800 .78rem/1.1 var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--ink-2);
  transition: color .16s var(--ease); -webkit-tap-highlight-color: transparent; user-select: none;
}
.pl-period__opt:hover { color: var(--ink); }
.pl-period__in:checked + .pl-period__opt { color: var(--stock); }
.pl-period__in:focus-visible + .pl-period__opt { outline: 2px solid var(--focus); outline-offset: 2px; }
.pl-period__thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 10px;
  background: var(--ink); box-shadow: 3px 3px 0 var(--btn-shade); transition: transform .16s var(--ease);
}
#pl-per-year:checked ~ .pl-period__thumb { transform: translateX(100%); }
.pl-save {
  display: inline-block; padding: 5px 8px 4px; border-radius: 99px; background: var(--teal); color: var(--carbon);
  font: 800 .62rem/1 var(--sans); letter-spacing: .12em; white-space: nowrap;
}

.pl-name { font: 700 clamp(1.5rem, 2.2vw, 1.9rem)/1.1 var(--display); }
/* both prices sit in the same cell, so the card keeps the height of the taller and nothing moves when they swap */
.pl-cost { display: grid; margin-top: .45em; }
.pl-cost__one { grid-area: 1 / 1; min-width: 0; }
#pl-plans:has(#pl-per-year:checked) .pl-cost__month, #pl-plans:has(#pl-per-month:checked) .pl-cost__year { visibility: hidden; }
.pl-bill { margin-top: 8px; font-size: .86rem; font-weight: 600; line-height: 1.45; color: var(--ink-2); }
.pl-price { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 4px 10px; }
.pl-price b { font: 700 clamp(2.4rem, 3.6vw, 3.4rem)/1 var(--display); white-space: nowrap; letter-spacing: -.02em; }
.pl-price span { white-space: nowrap; font: 800 .7rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.pl-line { margin-top: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font: 800 .78rem/1.35 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.pl-gets { flex: 1 0 auto; align-content: start; margin: 16px 0 22px !important; display: grid; gap: 9px; color: var(--ink-2); font-size: .95rem; line-height: 1.45; }
.pl-gets li { position: relative; padding-left: 20px; }
.pl-gets li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.pl-go { width: 100%; min-height: 50px; }
.pl-card .note { margin-top: 12px; }
.pl-card .note:empty { display: none; }
.pl-fine { margin-top: 22px; color: var(--ink-3); font-size: .86rem; }
/* what a choice charges, shown under its button before Stripe's page opens (plans.js) */
.pl-confirm { margin-top: 14px; padding: 16px 16px 18px; border: 2px solid var(--ink); border-radius: 12px; background: var(--stock); }
.pl-confirm:focus { outline: 2px solid var(--focus); outline-offset: 3px; }
.pl-confirm__what { font: 800 .95rem/1.35 var(--sans); }
.pl-confirm__total { margin-top: 6px; font-size: 1rem; line-height: 1.45; }
.pl-confirm__fine { margin-top: 10px; font-size: .88rem; line-height: 1.45; color: var(--ink-2); }
.pl-confirm__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pl-confirm__acts .btn { min-height: 48px; flex: 1 1 auto; }
/* "Billing help", on the pricing page and in "Your plan" on the account page */
.pl-help, .ac-help { margin-top: 10px; font-size: .95rem; }
.pl-help a, .ac-help a { overflow-wrap: anywhere; }
.ac-plan__policy { margin-top: 16px; max-width: 40em; color: var(--ink-2); font-size: .92rem; line-height: 1.5; }

.pl-faq { padding: 0; }
.pl-faq h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); line-height: 1.06; margin: .3em 0 .6em; }

/* "Your plan" on the account page (which links this file only in a build with plans), above what is saved */
.ac-plan { padding-bottom: clamp(30px, 4vw, 46px); margin-bottom: clamp(30px, 4vw, 46px); border-bottom: 1px solid var(--line-2); }
.ac-plan h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.08; margin: .3em 0 .35em; }
.ac-plan__use { color: var(--ink-2); max-width: 34em; }
.ac-plan .ac-acts { margin-top: 20px; }
.ac-plan .note { margin-top: 12px; }
.ac-plan .note:empty { display: none; }

@media (max-width: 900px) {
  .pl-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; gap: 30px; }
  .pl-period__track { width: min(100%, 520px); }
}
/* on a phone the saving sits under "Yearly", so neither half is ever squeezed */
@media (max-width: 520px) {
  .pl-period__opt { flex-direction: column; gap: 6px; min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-period__thumb, .pl-period__opt { transition: none; }
}
/* a browser without :has() shows both ways to pay, one under the other; the switch still chooses which is paid */
@supports not selector(:has(*)) {
  .pl-cost__one { grid-area: auto; }
  .pl-cost__month { margin-top: 14px; }
}
