/**
 * WordPress adaptations on top of site.css (which is generated from the Astro
 * build and must not be edited by hand). Everything here exists because a
 * WordPress wrapper or core block differs from the Astro markup.
 */

/* ---- Page frame: .wp-site-blocks takes the role Astro gave <body> ---- */
.wp-site-blocks {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wp-site-blocks > main {
  flex: 1;
}

/* The sticky header sits under the admin bar when logged in. */
.admin-bar .header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .header {
    top: 46px;
  }
}

/* ---- Core block resets ---- */
.wp-block-image {
  margin: 0;
}

.wp-block-image img {
  vertical-align: middle;
}

/* ---- FAQ: core/details carries the Astro .faq__item look ----
   Astro rendered <summary class="faq__q"><span>Q</span><span class="faq__icon"></span>;
   core/details has a plain <summary>, so the +/− icon is drawn on ::after. */
.faq__item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5);
  font-size: var(--t-body);
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  min-height: 56px;
}

.faq__item > summary::-webkit-details-marker {
  display: none;
}

.faq__item > summary::after {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(var(--orange), var(--orange)) center / 14px 2px no-repeat,
    linear-gradient(var(--orange), var(--orange)) center / 2px 14px no-repeat;
  border-radius: 1px;
  transition: background-size var(--dur) var(--ease);
}

.faq__item[open] > summary::after {
  background-size: 14px 2px, 2px 0;
}

/* ---- Get Started spam trap: never visible, never focusable by people ---- */
.gs__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- One-page request form (blocks/request-form) ----
 * Reuses the multi-step form's field, choice and step styles from site.css. */
.rf__form {
  display: grid;
  gap: var(--s-8);
}

/* A floated legend is laid out like any other grid item, so the section's
 * top border no longer breaks around it. */
.rf__section > legend {
  float: left;
  width: 100%;
}

.gs__head .lead {
  margin-top: var(--s-4);
}

.rf__section + .rf__section,
.rf__next {
  padding-top: var(--s-7);
  border-top: 1px solid var(--rule);
}

.rf__req {
  margin-left: 0.2em;
  color: var(--red);
  font-weight: 700;
}

.rf__required-note {
  margin-bottom: calc(var(--s-8) * -1 + var(--s-3));
  font-size: var(--t-small);
  color: var(--ink-muted);
}

.field__label .rf__req {
  margin-left: calc(var(--s-2) * -1 + 0.15em);
}

.rf__required-note .rf__req {
  margin-left: 0;
}

.field__help {
  font-size: var(--t-fine);
  color: var(--ink-muted);
  line-height: 1.5;
}

.rf__prompts {
  margin: 0;
  list-style: disc;
  padding-left: 1.25rem;
  display: grid;
  gap: var(--s-1);
  font-size: var(--t-small);
  color: var(--ink-muted);
  line-height: 1.5;
}

.rf__next {
  display: grid;
  gap: var(--s-4);
  max-width: 62ch;
}

.rf__next-title {
  font-size: var(--t-display-3);
  color: var(--navy);
}

.rf__next p {
  color: var(--ink-muted);
}

.rf__next a,
.rf__consent a {
  color: var(--orange-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.rf__submit {
  display: grid;
  justify-items: start;
  gap: var(--s-4);
  padding: var(--s-6);
  background: var(--surface-sunken);
  border-radius: var(--r-lg);
}

.rf .rf__consent {
  color: var(--navy);
}

.rf__submit .field-error {
  margin-top: 0;
}

.rf__submit .btn {
  min-width: 12rem;
}

.rf__submit-note {
  margin: 0;
}

.rf__form[hidden] {
  display: none;
}

.rf .confirm:focus {
  outline: none;
}

/* ---- Process page (content/en/how-it-works.html) ---- */
.steps__title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.85rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
}

.proc-icon {
  display: inline-flex;
  flex: none;
  color: var(--orange);
}

.proc-box {
  margin-top: var(--s-5);
  padding: var(--s-5) var(--s-6);
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
}

.steps__content > .proc-box + * {
  margin-top: var(--s-5);
}

.proc-box__title {
  margin-bottom: var(--s-4);
  font-weight: 600;
  color: var(--navy);
}

.proc-pay {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--s-5);
}

.proc-pay__item {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
}

.proc-pay__item + .proc-pay__item {
  padding-left: var(--s-5);
  border-left: 1px solid var(--rule);
}

@media (max-width: 34rem) {
  .proc-box {
    padding: var(--s-4);
  }

  .proc-box .proc-timeline td:first-child {
    padding-right: var(--s-3);
  }

  .proc-box .proc-timeline td:last-child {
    padding-left: var(--s-3);
  }

  .proc-pay__item + .proc-pay__item {
    padding-left: 0;
    padding-top: var(--s-5);
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

.proc-pay__label {
  font-weight: 600;
  color: var(--navy);
}

.proc-pay__text {
  margin-top: var(--s-1);
  font-size: var(--t-small);
  color: var(--ink-muted);
}

.proc-timeline {
  margin: 0;
}

.proc-timeline table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
}

.proc-box .proc-timeline td {
  padding: var(--s-2) 0;
  border: 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  vertical-align: top;
}

.proc-box .proc-timeline td:first-child {
  padding-right: var(--s-5);
  color: var(--ink);
}

.proc-box .proc-timeline td:last-child {
  padding-left: var(--s-5);
  border-left: 1px solid var(--rule);
}

.proc-callout {
  position: relative;
  padding: var(--s-1) 0 var(--s-1) var(--s-5);
}

.proc-callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background-image: var(--gradient-energy);
}

.proc-callout__title {
  font-weight: 600;
  color: var(--orange-text);
}

.proc-callout__text {
  margin-top: var(--s-1);
  max-width: 62ch;
  color: var(--ink-muted);
}

.proc-period__head {
  max-width: none;
}

.proc-period__card {
  display: flex;
  gap: var(--s-5);
  align-items: flex-start;
}

.proc-period__body > * + * {
  margin-top: var(--s-2);
}

.resp__note {
  margin-top: var(--s-6);
  text-align: center;
  font-weight: 600;
  color: var(--ink);
}

.final__note {
  margin-top: var(--s-4);
}

/* ---- Pricing comparison table (blocks/comparison-table) ----
 * It sits in the narrow column, so the generic 640px table minimum would force
 * sideways scrolling. Fit it instead; on phones each package becomes a card. */
.cmp__details .data-table.cmp {
  min-width: 0;
  width: 100%;
}

.cmp__details .data-table.cmp th,
.cmp__details .data-table.cmp td {
  padding: var(--s-3) var(--s-3);
}

.cmp__details .data-table.cmp th:first-child,
.cmp__details .data-table.cmp td:first-child {
  padding-left: var(--s-4);
}

.cmp__details .data-table.cmp th:last-child,
.cmp__details .data-table.cmp td:last-child {
  padding-right: var(--s-4);
}

@media (max-width: 40rem) {
  .cmp__details .cmp__body {
    padding: 0 var(--s-4) var(--s-5);
  }

  .cmp__details .table-scroll {
    overflow: visible;
    border: 0;
    background: none;
  }

  .cmp__details .data-table.cmp thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .cmp__details .data-table.cmp,
  .cmp__details .data-table.cmp tbody {
    display: grid;
    gap: var(--s-3);
  }

  .cmp__details .data-table.cmp tr {
    display: grid;
    padding: var(--s-3) var(--s-4);
    background: var(--surface-raised);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
  }

  .cmp__details .data-table.cmp tbody th,
  .cmp__details .data-table.cmp tbody td {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-2) 0;
    border-bottom: 1px solid var(--rule);
    text-align: right;
    white-space: normal;
  }

  .cmp__details .data-table.cmp tbody th {
    padding-top: 0;
    text-align: left;
  }

  .cmp__details .data-table.cmp tbody th:first-child,
  .cmp__details .data-table.cmp tbody td:last-child {
    padding-left: 0;
    padding-right: 0;
  }

  .cmp__details .data-table.cmp tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .cmp__details .data-table.cmp tbody td::before {
    content: attr(data-label);
    flex: none;
    font-size: var(--t-fine);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-subtle);
    text-align: left;
  }
}

/* ---- Footer language list ----
 * "English | Español | Русский" is wider than the last footer column at
 * 600-1150px and pushed the whole page sideways. There, list the languages
 * vertically like the other footer links. */
@media (max-width: 72rem) {
  .footer__col .lang--full {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }

  .footer__col .lang--full .lang__sep {
    display: none;
  }
}

/* ---- Why Adevery capability cards ----
 * Two per row on phones leaves ~70px beside the icon, too narrow for single
 * long words ("Adjustments", "Корректировки"). Put the icon above the word. */
@media (max-width: 34rem) {
  .capabilities .capability-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
    padding: var(--s-4);
  }

  .capabilities .capability-card p {
    font-size: var(--t-small);
    overflow-wrap: anywhere;
  }
}

@media (max-width: 22.5rem) {
  .capabilities.wp-block-group {
    grid-template-columns: minmax(0, 1fr);
  }

  .capabilities .capability-card {
    flex-direction: row;
    align-items: center;
  }
}

/* ---- Privacy Policy (content/<locale>/privacy.html): sub-headings, lists, links ---- */
/* "Политика конфиденциальности" is one long word; keep it inside 320px phones. */
.legal__title {
  hyphens: auto;
  overflow-wrap: break-word;
}

@media (max-width: 22.5rem) {
  .legal__title:not(._) {
    font-size: 1.75rem;
  }
}

.legal__section h3 {
  margin-top: var(--s-5);
  margin-bottom: var(--s-3);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  font-weight: 600;
  color: var(--navy);
}

.legal__section .legal__list {
  margin-block: var(--s-3) var(--s-4);
  padding-left: 1.25em;
  list-style: disc;
  font-size: var(--t-small);
  color: var(--ink-muted);
  line-height: 1.7;
  max-width: 70ch;
}

.legal__section .legal__list li + li {
  margin-top: var(--s-1);
}

.legal__section a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  overflow-wrap: anywhere;
}

.legal__section a:hover {
  text-decoration-thickness: 2px;
}

/* ---- Editor ---- */
.editor-styles-wrapper .wp-block-adevery-cta,
.editor-styles-wrapper [data-type='adevery/cta'] {
  display: inline-block;
}

/* Package cards are grid items on the front end; in the editor they sit inside
   block + preview wrappers, so those wrappers take the stretch instead. */
.editor-styles-wrapper [data-type='adevery/package-card'] div:not(.pkg *),
.editor-styles-wrapper [data-type='adevery/package-card'] .pkg {
  height: 100%;
}

.editor-styles-wrapper .header {
  position: relative;
}

/* Hidden Get Started screens stay hidden in the editor preview too. */
.editor-styles-wrapper [hidden] {
  display: none !important;
}
