/* Author Services plan builder. Loaded only by plan.html, on top of css/site.css (same palette and type). */

.plan-page .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plan-section { padding-top: clamp(40px, 5vw, 72px); }
.plan-intro { max-width: 760px; margin: 0 0 clamp(32px, 4vw, 52px); }
.plan-lede { font-family: var(--serif); font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--heading-cream); margin: 0 0 .9rem; }
.plan-aside { font-size: .94rem; color: var(--on-cream); margin: 0; }
.plan-aside a { color: var(--gold-dark); font-weight: 700; }
.plan-noscript { padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: rgba(201, 154, 74, .12); margin-bottom: 24px; }

/* Layout: main column + sticky "Your Plan" panel */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 1100px) { .plan-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; } .plan-layout.is-done { grid-template-columns: minmax(0, 1fr); } }
.plan-main { min-width: 0; }

/* Steps */
.plan-step { border: 0; margin: 0 0 clamp(36px, 4.5vw, 60px); padding: 0; min-width: 0; }
.plan-step > legend { display: flex; align-items: center; gap: 14px; padding: 0; margin-bottom: 8px; font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.2; color: var(--heading-cream); }
.plan-step-num { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: var(--gold-light); font: 700 1rem var(--sans); }
.plan-step-help { margin: 0 0 18px; color: var(--on-cream); font-size: .96rem; }
.plan-sub { margin: 28px 0 14px; font-size: 1.15rem; color: var(--heading-cream); }
.plan-q { margin: 22px 0 8px; font-weight: 700; color: var(--heading-cream); font-size: .95rem; }
.plan-linkbtn { display: inline-flex; align-items: center; min-height: 44px; background: none; border: 0; padding: 0 2px; font: inherit; font-weight: 700; color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.plan-linkbtn:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 3px; }
.plan-hint-top { margin: -4px 0 14px; }

/* Starting-point banner (the choice is made on the For Authors page) */
.plan-banner { margin: 0 0 clamp(32px, 4vw, 52px); padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line-soft); border-top: 4px solid var(--gold); border-radius: var(--radius-card); background: #fff; box-shadow: 0 16px 36px rgba(6, 21, 34, .1); }
.plan-banner-tag { margin: 0 0 6px; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-dark); }
.plan-banner .plan-banner-name { margin: 0 0 8px; font-family: var(--serif); font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.15; color: var(--heading-cream); }
.plan-banner .plan-banner-blurb { margin: 0 0 10px; font-family: var(--serif); font-style: italic; font-size: 1.08rem; line-height: 1.5; color: var(--heading-cream); max-width: 62ch; }
.plan-banner .plan-banner-note { margin: 0 0 10px; padding: 10px 14px; border-left: 3px solid var(--gold); background: rgba(201, 154, 74, .12); font-size: .88rem; color: var(--heading-cream); max-width: 62ch; }
.plan-banner .plan-banner-help { margin: 0 0 14px; font-size: .92rem; color: var(--on-cream); max-width: 62ch; }
.plan-banner-actions { display: flex; flex-wrap: wrap; gap: 8px 24px; }
/* The builder opens near the top: shorter hero than the content pages */
.plan-page .page-hero--compact { min-height: 0; padding-block: clamp(40px, 5vw, 72px) clamp(28px, 3.6vw, 48px); }
.plan-page .page-hero--compact .lede { margin-bottom: 0; }

/* Checkbox groups */
.plan-checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px 18px; }
.plan-checkgrid--1 { grid-template-columns: 1fr; }
.plan-check { display: flex; align-items: flex-start; gap: 12px; min-height: 36px; padding: 6px 2px; cursor: pointer; color: var(--ink); font-size: .95rem; line-height: 1.4; }
.plan-check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); }
.plan-check--sm { min-height: 30px; font-size: .88rem; padding: 3px 0; }
.plan-two { display: grid; grid-template-columns: 1fr; gap: 8px 40px; }
@media (min-width: 760px) { .plan-two { grid-template-columns: 1fr 1fr; } }
.plan-publisher-note { margin-top: 20px; padding: 14px 18px; border-left: 4px solid var(--gold-dark); background: rgba(255, 255, 255, .75); border-radius: 0 10px 10px 0; }
.plan-publisher-note p { margin: 0; font-size: .92rem; }

/* Catalog */
.plan-catnav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; }
.plan-catnav a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--heading-cream); text-decoration: none; background: rgba(255, 255, 255, .6); }
.plan-catnav a:hover { border-color: var(--gold-dark); background: #fff; }
.plan-catnav a:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.plan-cat { margin-bottom: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius-card); background: rgba(255, 255, 255, .5); scroll-margin-top: 100px; }
.plan-cat > summary { display: grid; gap: 2px; padding: 16px 52px 16px 20px; cursor: pointer; list-style: none; position: relative; }
.plan-cat > summary::-webkit-details-marker { display: none; }
.plan-cat > summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--gold-dark); border-bottom: 2px solid var(--gold-dark); transform: rotate(45deg); transition: transform .2s ease; }
.plan-cat[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.plan-cat > summary:focus-visible { outline: 3px solid var(--navy); outline-offset: -3px; border-radius: var(--radius-card); }
.plan-cat-name { font-family: var(--serif); font-size: 1.3rem; color: var(--heading-cream); }
.plan-cat-blurb { font-size: .88rem; color: var(--on-cream); }
.plan-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; list-style: none; margin: 0; padding: 4px 20px 20px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 12px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.plan-card.is-selected { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy), 0 12px 26px rgba(6, 21, 34, .1); }
.plan-card h4 { margin: 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.3; color: var(--heading-cream); }
.plan-card p { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--on-cream); }
.plan-badges { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.plan-badges:empty { display: none; }
.plan-badge { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(201, 154, 74, .12); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dark); }
.plan-badge--rec { background: var(--navy); border-color: var(--navy); color: var(--gold-light); }
.plan-badge--add { background: #fff; }
.plan-badge--have { background: #eef0f2; border-color: #cfd5da; color: #44505a; }
.plan-card-actions { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.plan-add.is-on { color: var(--white); }
.plan-learn { background: none; border: 0; min-height: 44px; padding: 6px 4px; font: inherit; font-size: .88rem; font-weight: 700; color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.plan-learn:focus-visible, .plan-add:focus-visible, .plan-remove:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.plan-collateral { margin: 4px 0 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.plan-collateral legend { padding: 0 6px; font-size: .76rem; font-weight: 800; color: var(--gold-dark); }
.plan-collateral { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.plan-collateral legend { grid-column: 1 / -1; }

/* Form polish (field styles come from site.css) */
.plan-form .field input, .plan-form .field select, .plan-form .field textarea { width: 100%; padding: 12px 14px; border: 1px solid rgba(6, 21, 34, .35); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
.plan-form .field select { appearance: auto; min-height: 48px; }
.plan-form .field input:focus, .plan-form .field select:focus, .plan-form .field textarea:focus { border-color: var(--navy); outline: 3px solid var(--navy); outline-offset: 1px; }
.plan-form .field [aria-invalid="true"] { border-color: #9b2c22; border-width: 2px; }
.plan-form { --error: #9b2c22; }
.plan-form .btn--block { width: 100%; margin-top: 10px; min-height: 56px; }
.plan-form .form-alert { margin-bottom: 26px; }
.plan-form .btn[disabled] { opacity: .65; cursor: progress; }

/* Dialog */
.plan-dialog { width: min(680px, calc(100% - 24px)); max-height: min(88vh, 900px); padding: 0; border: 1px solid var(--gold); border-radius: var(--radius-card); background: var(--cream); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); overflow: auto; }
.plan-dialog::backdrop { background: rgba(6, 21, 34, .72); }
.plan-dialog-inner { position: relative; padding: clamp(24px, 4vw, 40px); }
.plan-dialog h2 { margin: 0 0 6px; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--heading-cream); }
.plan-dialog .eyebrow { color: var(--gold-dark); margin: 0 0 6px; }
.plan-dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--heading-cream); cursor: pointer; }
.plan-dialog-close:hover { background: rgba(6, 21, 34, .08); }
.plan-dialog-close:focus-visible { outline: 3px solid var(--navy); }
.plan-dialog-close .icon { width: 24px; height: 24px; }
.plan-dsec h3 { margin: 22px 0 6px; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); font-family: var(--sans); }
.plan-dsec p, .plan-dsec li { font-size: .98rem; line-height: 1.6; color: var(--on-cream); margin: 0; }
.plan-dsec ul { margin: 0; padding-left: 1.2rem; list-style: disc; display: grid; gap: 4px; }
.plan-dnote { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: .86rem; font-style: italic; color: var(--on-cream); }
.plan-dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.plan-lock { overflow: hidden; }

/* Your Plan summary */
.plan-summary { background: var(--navy); color: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: 0 20px 44px rgba(6, 21, 34, .25); }
.plan-summary[hidden] { display: none; }
.plan-summary-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 20px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: default; }
.plan-summary .plan-summary-title { font-family: var(--serif); font-size: 1.35rem; }
.plan-summary .plan-count-short { margin-left: auto; font-size: .82rem; color: var(--gold-light); font-weight: 700; }
.plan-chevron { display: none; width: 18px; height: 18px; transform: rotate(-90deg); transition: transform .2s ease; }
.plan-summary-body { padding: 0 20px 20px; display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.plan-summary-body > .plan-list#plan-list { flex: 1 1 auto; }
.plan-summary .plan-template { margin: 0 0 4px; font-size: .86rem; color: var(--gold-light); font-weight: 700; }
.plan-summary .plan-count { margin: 0 0 12px; font-size: .92rem; color: var(--on-dark); }
.plan-list { list-style: none; margin: 0 0 14px; padding: 0; overflow: auto; display: grid; gap: 2px; align-content: start; min-height: 0; flex: 0 1 auto; }
.plan-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); font-size: .88rem; line-height: 1.35; }
.plan-list--removed li { color: var(--on-dark); }
.plan-remove { flex: none; background: none; border: 0; min-height: 36px; padding: 4px 6px; color: var(--gold-light); font: inherit; font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.plan-summary :focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.plan-summary .plan-removed-title { margin: 14px 0 6px; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light); font-family: var(--sans); }
.plan-summary .plan-note { margin: 0 0 14px; font-size: .8rem; color: var(--on-dark); }
.plan-summary-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.plan-summary .btn--outline { color: var(--white); }
@media (min-width: 1100px) {
  .plan-summary { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); display: flex; flex-direction: column; overflow: hidden; }
}
@media (max-width: 1099.98px) {
  .plan-summary { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; border-radius: 16px 16px 0 0; border-bottom: 0; max-height: 78vh; overflow: hidden; display: none; flex-direction: column; }
  body.has-plan .plan-summary:not([hidden]) { display: flex; }
  .plan-summary-toggle { cursor: pointer; padding: 14px 18px; }
  .plan-chevron { display: block; }
  .plan-summary.is-open .plan-chevron { transform: rotate(90deg); }
  .plan-summary-body { display: none; padding-inline: 18px; }
  .plan-summary.is-open .plan-summary-body { display: flex; }
  body.has-plan.plan-page { padding-bottom: 64px; }
}

/* Confirmation */
.plan-confirmation { max-width: 680px; margin: 0 auto; padding: clamp(28px, 5vw, 56px); text-align: center; border: 1px solid var(--line); border-radius: var(--radius-card); background: #fff; box-shadow: 0 20px 44px rgba(6, 21, 34, .1); }
.plan-confirmation[hidden] { display: none; }
.plan-confirmation:focus { outline: none; }
.plan-confirmation h2 { color: var(--heading-cream); }
.plan-confirmation .btn-row { justify-content: center; margin-top: 22px; }
.plan-confirm-ref { font-size: .88rem; font-weight: 700; color: var(--gold-dark); }

@media (max-width: 599.98px) {
  .plan-collateral { grid-template-columns: 1fr; }
  .plan-card-grid { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .plan-card, .plan-cat > summary::after, .plan-chevron { transition: none; }
}

/* Service pages: two CTAs inside the note card */
.note-card .btn + .btn { margin-left: 0; }

/* Keep focused fields clear of the sticky plan bar */
html { scroll-padding-bottom: 88px; }
