/* PortusSophia™ canonical shoreline mobile composition.
 *
 * Desktop is intentionally untouched. The home identity becomes one compact
 * lockup row, while internal mastheads retain their role line at small widths.
 */

.shoreline-identity-mobile-role {
  display: none;
}

@media (max-width: 40rem) {
  /* Home: programme mark, identity copy, and anchor share one coherent row. */
  .site-header--shoreline-identity .shoreline-identity-header-inner {
    display: grid;
    width: min(calc(100% - 1.5rem), var(--shell, 76rem));
    min-height: var(--shoreline-height, clamp(13rem, 27vh, 21rem));
    padding: 0.75rem 0 0;
    grid-template-columns: 3.35rem minmax(0, 1fr) 3.1rem;
    gap: 0.65rem;
    align-items: start;
  }

  .site-header--shoreline-identity .shoreline-identity-logo {
    position: static;
    width: 3.35rem;
    margin: 0;
    transform: none;
  }

  .site-header--shoreline-identity .shoreline-identity-copy {
    position: static;
    min-width: 0;
    padding-top: 0.08rem;
  }

  .site-header--shoreline-identity .shoreline-identity-title {
    margin: 0;
    font-size: clamp(1.45rem, 7vw, 1.9rem);
    line-height: 1;
    white-space: nowrap;
  }

  .site-header--shoreline-identity .shoreline-identity-declaration {
    display: none;
  }

  .site-header--shoreline-identity .shoreline-identity-mobile-role {
    display: block;
    max-width: none;
    margin: 0.22rem 0 0;
    color: var(--ps-dark, #1a1a2e);
    font-family: var(--sans, system-ui, sans-serif);
    font-size: clamp(0.68rem, 2.8vw, 0.78rem);
    font-weight: 720;
    letter-spacing: 0.045em;
    line-height: 1.12;
    text-shadow: 0 1px 0 rgba(250, 248, 245, 0.5), 0 0.18rem 0.42rem rgba(250, 248, 245, 0.28);
    text-transform: uppercase;
  }

  .site-header--shoreline-identity .anchor-menu {
    position: relative;
    top: auto;
    right: auto;
    align-self: start;
    margin: -0.18rem 0 0;
  }

  /* Internal pages: keep the programme role visible below the surface name. */
  .site-header--shoreline .header-inner {
    align-items: start;
  }

  .site-header--shoreline .shoreline-site-lockup {
    width: auto;
    grid-template-columns: 2.65rem minmax(0, 1fr);
    gap: 0.62rem;
    align-items: start;
  }

  .site-header--shoreline .shoreline-programme-mark {
    width: 2.65rem;
  }

  .site-header--shoreline .shoreline-site-copy {
    padding-top: 0.04rem;
    gap: 0.08rem;
  }

  .site-header--shoreline .site-name {
    font-size: clamp(1.42rem, 7vw, 1.72rem);
    line-height: 1.02;
    white-space: nowrap;
  }

  .site-header--shoreline .site-role {
    display: block;
    margin-top: 0.08rem;
    color: var(--ps-dark, #1a1a2e);
    font-size: clamp(0.68rem, 2.8vw, 0.78rem);
    font-weight: 720;
    letter-spacing: 0.045em;
    line-height: 1.12;
    text-shadow: 0 1px 0 rgba(250, 248, 245, 0.5), 0 0.18rem 0.42rem rgba(250, 248, 245, 0.28);
  }
}

@media (max-width: 22rem) {
  .site-header--shoreline-identity .shoreline-identity-header-inner {
    grid-template-columns: 2.9rem minmax(0, 1fr) 2.8rem;
    gap: 0.45rem;
  }

  .site-header--shoreline-identity .shoreline-identity-logo {
    width: 2.9rem;
  }

  .site-header--shoreline-identity .shoreline-identity-title {
    font-size: 1.35rem;
  }

  .site-header--shoreline .site-name {
    font-size: 1.32rem;
  }
}
