/*
 * Essex SDS Hub — phone layout (Figma section "Phone / dark v", 390 × 844).
 * Margin/spacing styles phone: margin 20 / gutter 12 / section pad 32.
 * Applies at ≤ 640 px.
 */

@media (max-width: 640px) {
  :root {
    --margin: 20px;
    --gutter: 12px;
    --section-pad: 32px;
  }

  /* ---------- Chrome ---------- */
  .site-nav {
    padding-top: 32px;
  }
  .logo-plus {
    width: 24px;
    height: 24px;
  }

  /* ---------- Hero (landing/ mobile) ---------- */
  .hero {
    min-height: 0;
    height: 100svh;
    max-height: 900px;
  }
  .hero__inner {
    inset: 32px 20px 48px;
  }
  /* title: 40/40 −2 %, w 350 centred, top 386/844 on every slide */
  .hero__slide-title br {
    display: none;
  }
  .hero__slide-title {
    white-space: normal;
    left: 50%;
    right: auto;
    translate: -50% 0;
    width: 350px;
    max-width: calc(100% - 40px);
    font-size: 40px;
    line-height: 40px;
    letter-spacing: -0.02em;
  }
  .hero__slide--1 .hero__slide-title,
  .hero__slide--2 .hero__slide-title,
  .hero__slide--3 .hero__slide-title {
    top: 45.7%;
  }
  /* info block: accessibility button sits above the text, hairline above credit */
  .hero__info {
    gap: 20px;
  }
  .hero__info-row {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 20px;
  }
  .hero__cta {
    max-width: 260px;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.01em;
  }
  .hero__credit {
    border-top: 1px solid var(--fg-muted);
    padding-top: 6px;
    width: 100%;
  }

  /* ---------- Our plan (phone: heading 24/28, embed 240 with map grid) ---------- */
  .section-plan {
    gap: 24px;
  }
  .plan__head {
    flex-direction: column;
    gap: 8px;
  }
  .plan__head h2 {
    width: 100%;
    font-size: 24px;
    line-height: 28px;
    letter-spacing: -0.02em;
  }
  .plan__head p {
    width: 100%;
    max-width: none;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0;
  }
  .plan__head p br {
    display: none;
  }
  .plan__embed {
    aspect-ratio: auto;
    height: 240px;
    min-height: 0;
    padding: 16px;
    justify-content: center;
    gap: 12px;
    /* Map_Grid_Simulation: faint horizontal rules */
    background-image: repeating-linear-gradient(
      to bottom,
      transparent 0 15px,
      rgba(208, 208, 208, 0.06) 15px 16px
    );
  }
  .plan__mouse {
    background: var(--c-aubergine);
  }

  /* ---------- About (mission/ phone): centred title + stacked cards ---------- */
  .about {
    padding: 0 0 32px;
    align-items: stretch;
    gap: 0;
  }
  .about__title {
    display: block;
    text-align: center;
    padding: 214px 20px;
    font-size: 32px;
    line-height: 32px;
  }
  .about__intro {
    width: 100%;
    padding: 80px 20px 16px;
    font-weight: 300;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -0.01em;
  }
  .about__rows {
    gap: 0;
    padding: 16px 20px 0;
  }
  .about-row {
    flex-direction: column;
    gap: 12px;
    background: var(--bg-alt);
    border-radius: 2px;
    padding: 24px 20px;
  }
  .about-row + .about-row {
    margin-top: 0;
  }
  .about-row__num {
    width: auto;
    color: var(--accent-text);
    font-weight: 500;
    font-size: 32px;
    line-height: 34px;
  }
  .about-row__body {
    width: 100%;
    max-width: none;
    flex-direction: column;
    gap: 12px;
  }
  .about-row__body h2 {
    width: 100%;
    max-width: none;
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
  }
  .about-row__body p {
    width: 100%;
    max-width: none;
    font-size: 16px;
    line-height: 20px;
  }
  .about-embed-wrap {
    padding-bottom: 32px;
  }
  body.page-about > .plan__embed {
    aspect-ratio: auto;
    margin-inline: 0;
  }

  /* ---------- Digital Place Portrait (dpp / phone): stacked accordion ---------- */
  .dpp {
    padding-top: 92px;
    gap: 0;
  }
  .dpp__title-clip {
    height: auto;
    padding-block: 215px 231px;   /* Title Section h 478, title at y 215 */
  }
  .dpp__title {
    font-size: 32px;
    line-height: 32px;
  }
  .themes {
    flex-direction: column;
    height: auto;
  }
  .theme,
  .themes.has-open .theme {
    width: 100%;
    min-height: 64px;
    padding: 20px;
    justify-content: flex-start;
    gap: 0;
  }
  .themes.has-open .theme.is-open {
    width: 100%;
  }
  .theme__num,
  .theme__title {
    font-size: 20px;
    line-height: 24px;
  }
  .theme__head {
    gap: 16px;
    width: 100%;
  }
  .theme__chev {
    display: block;
    position: absolute;
    top: 22px;
    right: 20px;
    width: 14px;
    height: 14px;
    color: var(--th-num);
    transition: rotate 0.3s var(--ease-soft);
  }
  .theme.is-open .theme__chev {
    rotate: 180deg;
  }
  .theme__body,
  .theme__subs {
    min-width: 0;
  }
  /* collapsed rows: hidden content must not take space on the stacked list */
  .theme:not(.is-open) .theme__body,
  .theme:not(.is-open) .theme__subs {
    display: none;
  }
  .theme.is-open .theme__subs {
    margin-top: 24px;
  }

  /* ---------- Footer (phone footer frame) ---------- */
  .site-footer {
    padding: 33px 20px;
  }
  .footer__grid {
    flex-direction: column;
    gap: 32px;
  }
  .footer__clientlogo {
    display: none;
  }
  .footer__chip[hidden] {
    display: inline-flex;
  }
  .footer__chip {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 2px;
    background: var(--c-black);
    color: var(--c-grey);
    font-weight: 500;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -0.02em;
  }
  .footer__main {
    width: 100%;
    min-height: 0;
    gap: 32px;
  }
  .footer__top {
    flex-direction: column;
    gap: 32px;
  }
  .footer__contact {
    width: 100%;
    gap: 32px;
  }
  /* phone footer: contact only (no London), 12/14 type, plain links */
  .footer__block--london {
    display: none;
  }
  .footer__block h3 {
    font-size: 12px;
    line-height: 14px;
    margin-bottom: 8px;
  }
  .footer__block p,
  .footer__block a {
    font-size: 12px;
    line-height: 14px;
  }
  .footer__block a {
    text-decoration: none;
  }
  .footer__settings {
    display: none;
  }
  .footer__place p {
    font-size: 12px;
    line-height: 14px;
  }
  .footer__bottom {
    align-items: flex-end;
    gap: 16px;
  }
  .footer__bottom-left {
    flex: 1 1 auto;
    gap: 0;
  }
  .footer__hwb {
    display: none;
  }
  .footer__copy {
    width: auto;
    font-size: 12px;
    line-height: 14px;
  }
  .footer__cookies {
    font-size: 12px;
    line-height: 14px;
    white-space: nowrap;
  }

  /* ---------- Menu (menu/ phone) ---------- */
  .overlay--menu .overlay__panel {
    padding: 32px 20px 40px;
  }
  .menu__photo {
    display: none;
  }
  .menu__links {
    font-size: 28px;
    line-height: 32px;
  }
  .menu__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
  }
  .menu__contact {
    gap: 24px;
  }

  /* ---------- Admin (adm access) ---------- */
  .overlay--admin .overlay__panel {
    padding: 32px 20px;
  }
  .admin__form {
    width: 350px;
  }
  .admin__fields {
    gap: 2px;
  }
  .admin__fields input {
    height: 22px;
  }

  /* ---------- Settings sheet ---------- */
  .settings {
    padding: 32px 20px;
    min-height: 0;
  }
  .settings__grid {
    flex-direction: column;
    gap: 28px;
    padding-top: 0;
  }
  .settings__intro {
    gap: 16px;
    padding-right: 48px;
    width: 100%;
  }
  .settings__intro .t-h2 {
    font-size: 28px;
    line-height: 32px;
  }
  .settings__options {
    gap: 24px;
    width: 100%;
  }
  .settings > .btn-circle {
    top: 32px;
  }
}
