/* Features options on the platform test pages (FeaturesOptions.astro).
   .pfo--a: five step tabs. .pfo--c: three phase tabs. .pfo--d: phase
   accordions with step tabs inside. Shared: underlined tabs, the feature
   card, and quiet text links with an arrow. */

.pfo { --pfo-gap: 20px; }
.pfo .panel-head { margin-bottom: 32px; }
.pfo.pf-feat-section { border-top: 0; }

/* ---- underlined tabs: number and name on one line ---- */
.pfo-tabs {
  display: flex; gap: 24px; margin: 0 0 28px; padding: 0;
  overflow-x: auto; scrollbar-width: none;
}
.pfo-tabs::-webkit-scrollbar { display: none; }
.pfo-tab {
  flex: 0 0 auto; min-width: 160px; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 0 0 8px; border: 0; border-bottom: 1px solid var(--kit-ivory-medium); background: none;
  font: inherit; font-size: var(--type-body); line-height: 1.375; text-align: left; cursor: pointer;
  color: var(--kit-text-medium);
}
.pfo-tab-num { font-weight: var(--font-weight-regular, 400); color: var(--kit-text-subtle); }
.pfo-tab-name { font-weight: var(--type-heading-weight, 500); }
.pfo-tab[aria-selected="true"] { color: var(--kit-teal-shade); border-bottom: 2px solid var(--kit-teal-medium); padding-bottom: 7px; }
.pfo-tab[aria-selected="true"] .pfo-tab-num { color: var(--kit-teal-medium); }
.pfo-tab:hover { color: var(--kit-teal-shade); }
.pfo-tab:focus-visible { outline: 2px solid var(--kit-teal-medium); outline-offset: 4px; border-radius: 2px; }
.pfo-tabs--sub { gap: 16px; margin-bottom: 24px; }
.pfo-tabs--sub .pfo-tab { min-width: 0; padding-right: 24px; }

/* ---- panel lead and the step row (c) ---- */
.pfo-lead { margin: 0 0 12px; font-size: var(--type-intro, 18px); line-height: 1.5; color: var(--kit-text-strong); }
.pfo--a .pfo-lead { margin-bottom: 24px; }
.pfo-steps {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin: 0 0 24px; padding: 0; list-style: none;
  font-family: var(--font-mono); font-size: var(--type-label-s, 12px); line-height: 16px;
  font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--kit-text-medium);
}
.pfo-steps li + li::before { content: "\2192"; margin-right: 10px; color: var(--kit-teal-medium); }

/* ---- cards ---- */
.pfo-cards { display: grid; gap: var(--pfo-gap); margin: 0; padding: 0; list-style: none; }
.pfo-cards > li { display: flex; min-width: 0; }
@media (min-width: 600px) { .pfo-cards--2, .pfo-cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .pfo-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.pfo-card {
  flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 20px;
  background: var(--kit-white); border-radius: 16px; box-shadow: 0 0 0 1px var(--kit-ivory-medium);
}
.pfo-card-copy { display: flex; flex-direction: column; gap: 4px; flex: 1 0 auto; }
.pfo-card-label { margin: 0 0 -2px; color: var(--kit-teal-medium); text-transform: uppercase; letter-spacing: .04em; }
.pfo-card-name { margin: 0; line-height: 1.3; color: var(--kit-text-strong); }
.pfo-card-text { margin: 0; font-size: var(--type-body); line-height: 1.3; color: var(--kit-text-medium); }
.pfo-card-art {
  display: flex; align-items: center; justify-content: center; height: 180px; overflow: hidden;
  background: var(--kit-ivory-tint); border-radius: 10px;
}
.pfo-card-art img { display: block; width: auto; height: 180px; max-width: 100%; object-fit: contain; }
.pfo-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.pfo-card-ways { margin: 0; color: var(--kit-text-medium); white-space: nowrap; }
.pfo-card-logos { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ---- other features: small secondary buttons (each opens a dialog) ---- */
.pfo-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pfo-link {
  display: inline-flex; align-items: center; padding: 5px 12px; border: 0; border-radius: 999px;
  background: var(--kit-white); box-shadow: 0 0 0 1px var(--kit-ivory-medium);
  font: inherit; font-size: var(--type-caption, 14px); line-height: 20px; color: var(--kit-text-medium);
  text-align: left; cursor: pointer; transition: box-shadow .15s ease, color .15s ease;
}
.pfo-link:hover { color: var(--kit-teal-shade); box-shadow: 0 0 0 1.5px var(--kit-teal-medium); }
.pfo-link:focus-visible { outline: 2px solid var(--kit-teal-medium); outline-offset: 2px; }

/* ---- d: phase accordions ---- */
.pfo-acc { border-top: 1px solid var(--kit-ivory-medium); }
.pfo-acc-item { border-bottom: 1px solid var(--kit-ivory-medium); }
.pfo-acc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none;
}
.pfo-acc-head::-webkit-details-marker { display: none; }
.pfo-acc-head:focus-visible { outline: 2px solid var(--kit-teal-medium); outline-offset: 2px; border-radius: 4px; }
.pfo-acc-title { margin: 0; color: var(--kit-teal-shade); }
.pfo-acc-title .pfo-tab-num { color: var(--kit-teal-medium); font-weight: 400; }
.pfo-acc-ico { display: inline-flex; width: 22px; height: 22px; color: var(--kit-text-strong); transition: transform .2s; }
.pfo-acc-ico svg { width: 22px; height: 22px; }
.pfo-acc-item[open] .pfo-acc-ico { transform: rotate(180deg); }
.pfo-acc-body { padding: 0 0 28px; }
.pfo-also { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-top: 24px; }
.pfo-also-label { margin: 0; color: var(--kit-text-medium); text-transform: uppercase; letter-spacing: .04em; }

@media (prefers-reduced-motion: reduce) {
  .pfo-acc-ico { transition: none; }
}

/* ---- feature dialogs: a plain X, and previous / next through the list ---- */
.pfo .pf2-dialog-close { background: none; box-shadow: none; border-radius: 4px; }
.pfo .pf2-dialog-close:hover { box-shadow: none; background: var(--kit-ivory-tint); }
.pfo-dlg-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--kit-ivory-medium);
}
.pfo-dlg-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none;
  font: inherit; font-size: var(--type-caption, 14px); line-height: 20px; color: var(--kit-teal-shade); cursor: pointer;
}
.pfo-dlg-btn:hover span:not(.pfo-dlg-ico) { text-decoration: underline; text-underline-offset: 3px; }
.pfo-dlg-btn:focus-visible { outline: 2px solid var(--kit-teal-medium); outline-offset: 2px; border-radius: 2px; }
.pfo-dlg-ico { display: inline-flex; width: 16px; height: 16px; color: var(--kit-teal-medium); }
.pfo-dlg-ico svg { width: 16px; height: 16px; }
.pfo-dlg-prev .pfo-dlg-ico { transform: rotate(90deg); }
.pfo-dlg-next .pfo-dlg-ico { transform: rotate(-90deg); }
.pfo-dlg-count { color: var(--kit-text-subtle); }

/* ---- d below desktop: no drawers. The three phases are boxed buttons
   (the open one filled teal) pinned under the site header; the open
   phase's step tabs pin under them. Drawer headers and closed phases are
   hidden; desktop keeps the drawers. --pfo-bar-h: the bar's height (script). */
.pfo-dbar { display: none; }
@media (max-width: 1023px) {
  .pfo-dbar {
    display: block; position: sticky; top: var(--fnav-top, 64px); z-index: 3;
    background: var(--kit-ivory-tint);
  }
  .pfo-dbar-in { display: flex; gap: 6px; padding: 8px 0; }
  .pfo-dbar-btn {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0;
    padding: 6px 4px; border: 0; border-radius: 8px; background: var(--kit-white);
    box-shadow: inset 0 0 0 1px var(--kit-ivory-medium);
    font: inherit; font-size: var(--type-caption, 14px); line-height: 18px; text-align: center; cursor: pointer;
    color: var(--kit-text-strong);
  }
  .pfo-dbar-btn .pfo-tab-num { font-size: var(--type-label-s, 12px); line-height: 16px; font-weight: 400; color: var(--kit-text-subtle); }
  .pfo-dbar-btn .pfo-tab-name { font-weight: var(--type-heading-weight, 500); }
  .pfo-dbar-btn[aria-current="true"] { background: var(--kit-teal-medium); box-shadow: none; color: var(--kit-white); }
  .pfo-dbar-btn[aria-current="true"] .pfo-tab-num { color: var(--kit-white); opacity: .8; }
  .pfo-dbar-btn:focus-visible { outline: 2px solid var(--kit-teal-medium); outline-offset: 2px; }
  .pfo--d .pfo-acc { border-top: 0; margin-top: 16px; }
  .pfo--d .pfo-acc-item { border-bottom: 0; }
  .pfo--d .pfo-acc-head { display: none; }
  .pfo--d .pfo-acc-item:not([open]) { display: none; }
  .pfo--d .pfo-acc-item[open] .pfo-tabs--sub {
    position: sticky; top: calc(var(--fnav-top, 64px) + var(--pfo-bar-h, 62px)); z-index: 2;
    margin-bottom: 20px; padding-top: 8px; background: var(--kit-ivory-tint);
  }
}

/* ---- phones: A's five steps as a dropdown in the tab style; C's three
   phases as equal tabs. Both stay pinned under the site header. ---- */
.pfo-drop { display: none; }
@media (max-width: 599px) {
  .pfo--a .pfo-tabs { display: none; }
  /* a white box with the current step; tapping it expands the same box
     downwards to list every step */
  .pfo--a .pfo-drop {
    display: block; position: sticky; top: var(--fnav-top, 64px); z-index: 3;
    margin: 0 0 16px; padding: 8px 0; background: var(--kit-ivory-tint);
  }
  .pfo-drop-box { border-radius: 10px; background: var(--kit-white); box-shadow: 0 0 0 1px var(--kit-ivory-medium); overflow: hidden; }
  .pfo-drop-btn, .pfo-drop-opt {
    display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; min-height: 48px;
    padding: 12px 16px; border: 0; background: none; text-align: left; cursor: pointer;
    font: inherit; font-size: var(--type-body); line-height: 1.375; color: var(--kit-text-medium);
  }
  .pfo-drop-btn { color: var(--kit-teal-shade); }
  .pfo-drop-btn .pfo-tab-name { flex: 1; font-weight: var(--type-heading-weight, 500); }
  .pfo-drop-btn .pfo-tab-num, .pfo-drop-opt[aria-current="true"] .pfo-tab-num { color: var(--kit-teal-medium); }
  .pfo-drop-btn:focus-visible, .pfo-drop-opt:focus-visible { outline: 2px solid var(--kit-teal-medium); outline-offset: -2px; }
  .pfo-drop-ico { display: inline-flex; width: 22px; height: 22px; color: var(--kit-teal-medium); transition: transform .2s; }
  .pfo-drop-ico svg { width: 22px; height: 22px; }
  .pfo-drop-btn[aria-expanded="true"] .pfo-drop-ico { transform: rotate(180deg); }
  .pfo-drop-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--kit-ivory-medium); }
  .pfo-drop-list li + li { border-top: 1px solid var(--kit-ivory-medium); }
  .pfo-drop-opt[aria-current="true"] { color: var(--kit-teal-shade); background: var(--kit-ivory-tint); }

  .pfo--c .pfo-tabs { gap: 0; overflow: visible; position: sticky; top: var(--fnav-top, 64px); z-index: 3; padding-top: 8px; background: var(--kit-ivory-tint); }
  .pfo--c .pfo-tab { flex: 1 1 0; min-width: 0; flex-direction: column; align-items: flex-start; gap: 0; padding-right: 8px; }
  .pfo--c .pfo-tab-num { font-size: var(--type-label-s, 12px); line-height: 16px; }
}
@media (prefers-reduced-motion: reduce) { .pfo-drop-ico { transition: none; } }

/* ---- c on desktop: the four standout cards in one row ---- */
@media (min-width: 1024px) {
  .pfo--c .pfo-cards--2 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .pfo--c .pfo-card { padding: 20px 16px; gap: 16px; }
  .pfo--c .pfo-card-copy { gap: 6px; }
  .pfo--c .pfo-card-art { height: 160px; }
  .pfo--c .pfo-card-art img { height: 160px; }
  .pfo--c .pfo-lead { margin-bottom: 16px; }
  .pfo--c .pfo-steps { margin-bottom: 32px; }
  .pfo--c .pfo-also { margin-top: 32px; }
}

/* ---- e: every phase and step in one long scroll. The phase bar pins under
   the site header and marks the phase in view (script). Underlined on
   desktop, boxed below it. ---- */
.pfo-ebar {
  position: sticky; top: var(--fnav-top, 64px); z-index: 3;
  margin: 0 0 8px; padding: 12px 0 0; background: var(--kit-ivory-tint);
}
.pfo-ebar-in { display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; }
.pfo-ebar-in > li { flex: 0 0 auto; display: flex; }
.pfo-ebar-btn {
  min-width: 160px; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 0 0 8px; border-bottom: 1px solid var(--kit-ivory-medium);
  font-size: var(--type-body); line-height: 1.375; text-decoration: none; color: var(--kit-text-medium);
}
.pfo-ebar-btn:hover { color: var(--kit-teal-shade); }
.pfo-ebar-btn[aria-current="true"] { color: var(--kit-teal-shade); border-bottom: 2px solid var(--kit-teal-medium); padding-bottom: 7px; }
.pfo-ebar-btn[aria-current="true"] .pfo-tab-num { color: var(--kit-teal-medium); }
.pfo-ebar-btn:focus-visible { outline: 2px solid var(--kit-teal-medium); outline-offset: 4px; border-radius: 2px; }

.pfo-phase { padding-top: 48px; scroll-margin-top: calc(var(--fnav-top, 64px) + var(--pfo-bar-h, 48px)); }
.pfo-phase + .pfo-phase { margin-top: 32px; border-top: 1px solid var(--kit-ivory-medium); }
.pfo-phase-title { margin: 0 0 8px; color: var(--kit-teal-shade); }
.pfo-phase-title .pfo-tab-num { color: var(--kit-teal-medium); font-weight: 400; }
.pfo--e .pfo-lead { margin-bottom: 32px; }
.pfo-step + .pfo-step { margin-top: 40px; }
.pfo-step-name {
  margin: 0 0 16px; font-family: var(--font-mono); font-size: var(--type-label-s, 12px); line-height: 16px;
  font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--kit-teal-medium);
}

@media (max-width: 1023px) {
  .pfo-ebar { padding: 8px 0; }
  .pfo-ebar-in { gap: 6px; }
  .pfo-ebar-in > li { flex: 1 1 0; min-width: 0; }
  .pfo-ebar-btn {
    flex: 1; min-width: 0; flex-direction: column; align-items: center; gap: 0;
    padding: 6px 4px; border: 0; border-radius: 8px; background: var(--kit-white);
    box-shadow: inset 0 0 0 1px var(--kit-ivory-medium);
    font-size: var(--type-caption, 14px); line-height: 18px; text-align: center; color: var(--kit-text-strong);
  }
  .pfo-ebar-btn .pfo-tab-num { font-size: var(--type-label-s, 12px); line-height: 16px; font-weight: 400; color: var(--kit-text-subtle); }
  .pfo-ebar-btn .pfo-tab-name { font-weight: var(--type-heading-weight, 500); }
  .pfo-ebar-btn[aria-current="true"] { background: var(--kit-teal-medium); box-shadow: none; color: var(--kit-white); padding-bottom: 6px; border: 0; }
  .pfo-ebar-btn[aria-current="true"] .pfo-tab-num { color: var(--kit-white); opacity: .8; }
  .pfo-phase { padding-top: 32px; }
  .pfo-step + .pfo-step { margin-top: 32px; }
}
