/*
 * POLYALIS Presence V1 - shell foundations
 *
 * Responsive contract:
 * - fluid by default;
 * - breakpoints are content-driven;
 * - local Desktop switch = 1120px;
 * - Wide keeps the Desktop composition;
 * - central composition never exceeds 1600px.
 */

/* Full-width structural surface */

.v1-shell {
  width: 100%;
}

/*
 * Central composition.
 *
 * Horizontal padding remains fluid. The max-width token limits the complete
 * central composition to the locked Presence V1 Wide width.
 */

.v1-container {
  width: 100%;
  max-width: var(--presence-v1-layout-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 4rem);
}

/* Reading/content regions must remain intrinsically shrinkable. */

.v1-container > * {
  min-width: 0;
}

/* Generic vertical section primitive. */

.v1-section {
  width: 100%;
}

/*
 * Skip link.
 *
 * Hidden outside keyboard focus without removing it from the accessibility
 * tree.
 */

.v1-skip-link {
  position: fixed;
  z-index: 1000;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  padding: 0.75rem 1rem;
  transform: translateY(calc(-100% - 2rem));
  font-family: var(--presence-v1-font-body);
  font-weight: var(--presence-v1-font-weight-semibold);
  text-decoration: none;
}

.v1-skip-link:focus-visible {
  transform: translateY(0);
}

/*
 * Flexible layout safety.
 *
 * These primitives prevent intrinsic content sizing from forcing accidental
 * horizontal overflow. They do not hide overflow.
 */

.v1-flex-item,
.v1-grid-item {
  min-width: 0;
}

/*
 * Desktop is a local Presence state reached at 1120px.
 *
 * No layout is attached here yet: actual component changes will be introduced
 * only when their implementation requires the locked Desktop composition.
 */

@media (min-width: 70rem) {
  .v1-container {
    padding-inline: clamp(2rem, 4vw, 4rem);
  }
}
/*
 * IMP-0B - V1 shell chrome
 *
 * Only the persistent header/footer chrome is implemented here.
 * Homepage content remains outside this step.
 */

/* Skip link */

.v1-skip-link {
  background: white;
  color: var(--presence-v1-color-accent-dark);
  border: 2px solid var(--presence-v1-color-accent);
}

/* Brand */

.v1-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.v1-brand img {
  width: 8.75rem; /* H02 official minimum digital width = 140px */
  height: auto;
}

/* Header */

.v1-site-header {
  position: sticky;
  z-index: 100;
  inset-block-start: 0;
  width: 100%;
  background: white;
  border-block-end: 1px solid var(--presence-v1-color-accent-soft);
}

.v1-header-inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 2rem);
  padding-block: 0.75rem;
}

.v1-desktop-nav {
  display: none;
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  margin-inline-start: auto;
}

.v1-desktop-nav a,
.v1-mobile-menu nav a,
.v1-footer-nav a,
.v1-footer-meta a {
  display: flex;
  align-items: center;
  min-block-size: 2.75rem;
  font-weight: var(--presence-v1-font-weight-semibold);
  text-decoration: none;
}

.v1-header-actions {
  display: none;
  align-items: center;
}

.v1-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-block-size: 2.75rem;
  padding-inline: 1rem;
  background: var(--presence-v1-color-accent);
  color: white;
  font-weight: var(--presence-v1-font-weight-bold);
  text-decoration: none;
}

/* Graphical arrow-right: no typographic arrow glyph. */

.v1-arrow-right {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1rem;
  height: 0.75rem;
}

.v1-arrow-right::before,
.v1-arrow-right::after {
  content: "";
  position: absolute;
}

.v1-arrow-right::before {
  inset-inline-start: 0;
  inset-inline-end: 0.2rem;
  inset-block-start: 50%;
  border-block-start: 2px solid currentColor;
  transform: translateY(-50%);
}

.v1-arrow-right::after {
  width: 0.45rem;
  height: 0.45rem;
  inset-inline-end: 0.1rem;
  inset-block-start: 50%;
  border-block-start: 2px solid currentColor;
  border-inline-end: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

/* Compact menu */

.v1-mobile-menu {
  position: relative;
  margin-inline-start: auto;
}

.v1-mobile-menu summary {
  display: flex;
  align-items: center;
  min-block-size: 2.75rem;
  padding-inline: 0.75rem;
  cursor: pointer;
  font-weight: var(--presence-v1-font-weight-semibold);
}

.v1-mobile-menu nav {
  position: absolute;
  z-index: 110;
  inset-block-start: calc(100% + 0.5rem);
  inset-inline-end: 0;
  display: grid;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--presence-v1-color-accent-soft);
}

/* Shell route context retained for the existing progressive router. */

.v1-shell-context {
  min-height: 0;
}

.v1-shell-back {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  font-weight: var(--presence-v1-font-weight-semibold);
}

/*
 * Safe Presence-local state already proven at 600px:
 * H02 + primary CTA + compact menu.
 */

@media (min-width: 37.5rem) {
  .v1-header-actions {
    display: flex;
    margin-inline-start: auto;
  }

  .v1-mobile-menu {
    margin-inline-start: 0;
  }
}

/*
 * Locked Presence Desktop switch at 1120px:
 * full navigation + CTA, compact menu removed.
 */

@media (min-width: 70rem) {
  .v1-desktop-nav {
    display: flex;
  }

  .v1-header-actions {
    margin-inline-start: 0;
  }

  .v1-mobile-menu {
    display: none;
  }
}

/* Footer */

.v1-site-footer {
  width: 100%;
  background: white;
  border-block-start: 1px solid var(--presence-v1-color-accent-soft);
}

.v1-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-block: clamp(2rem, 5vw, 4rem);
}


.v1-footer-nav,
.v1-footer-meta {
  display: grid;
  align-content: start;
}

.v1-footer-nav h2,
.v1-footer-meta h2 {
  margin-block-end: 0.5rem;
  font-size: 1rem;
}

.v1-footer-meta h2:not(:first-child) {
  margin-block-start: 1.5rem;
}

/* At the validated 600px state, footer becomes three columns. */

@media (min-width: 37.5rem) {
  .v1-footer-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}
/*
 * V1 shell behavior hooks
 *
 * The existing smart-header JavaScript owns the state.
 * V1 owns its visual response without depending on V0 .site-header rules.
 */

.v1-site-header {
  will-change: transform;
}

.v1-site-header[data-shell-hidden="true"] {
  transform: translateY(calc(-100% - 1px));
}

.v1-site-header[data-shell-locked="true"] {
  transform: translateY(0);
}
