@media (max-width: 1350px) {
  .ng-header__inner {
    grid-template-columns: auto auto;
  }

  .ng-header__nav,
  .ng-header__actions {
    display: none;
  }

  .ng-menu-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .ng-section--hero,
  .ng-section--story {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ng-hero__copy {
    order: 1;
  }

  .ng-hero__media {
    order: 2;
  }

  .ng-grid--4,
  .ng-value-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ng-footer__columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .ng-section {
    padding: 4rem 0;
  }

  .ng-section h1 {
    font-size: 3.25rem;
    line-height: 1.15;
  }

  .ng-section h2 {
    font-size: 2.25rem;
  }

  .ng-grid--3,
  .ng-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ng-footer__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.admin-bar .ng-site-header {
    top: 46px;
  }

  .ng-header__inner,
  .ng-footer__inner,
  .ng-footer__bottom,
  .ng-page {
    width: min(100% - 1.25rem, var(--ng-container));
  }

  .ng-header__inner {
    min-height: 68px;
  }

  .ng-header__brand img {
    width: auto;
    height: 46px;
    max-width: 145px;
    max-height: none;
  }

  .ng-mobile-panel {
    width: min(100% - 1.25rem, var(--ng-container));
  }

  .ng-section:first-child {
    padding-top: 2.75rem;
  }

  .ng-section {
    padding: 3.25rem 0;
  }

  .ng-section h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  .ng-section h2 {
    font-size: 2rem;
    line-height: 1.25;
  }

  .ng-lead {
    font-size: 1.02rem;
  }

  .ng-actions,
  .ng-footer__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ng-actions a,
  .ng-actions .ng-btn,
  .wp-block-button.ng-btn .wp-block-button__link {
    width: 100%;
  }

  .ng-grid--2,
  .ng-grid--3,
  .ng-grid--4,
  .ng-value-strip,
  .ng-footer__columns,
  .ng-form {
    grid-template-columns: 1fr;
  }

  .ng-section--cta {
    padding: 2rem;
  }

  .ng-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .ng-section h1 {
    font-size: 2.25rem;
  }

  .ng-section h2 {
    font-size: 1.75rem;
  }

  .ng-card,
  .ng-step,
  .ng-package,
  .ng-value,
  .ng-role,
  .ng-feature,
  .ng-contact-card,
  .ng-section--cta {
    padding: 1.1rem;
  }

  .ng-lang-switch {
    width: 100%;
    justify-content: center;
  }

  .ng-form button {
    width: 100%;
  }
}

/* REV4 responsive additions */
@media (max-width: 1200px) {
  .ng-grid--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ng-section--cta {
    align-items: stretch;
    flex-direction: column;
  }

  .ng-section--cta .ng-actions {
    margin-top: 0.5rem;
  }
}

@media (max-width: 768px) {
  .ng-grid--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ng-value-strip .ng-card {
    grid-template-columns: 42px 1fr;
  }

  .ng-section--hero {
    gap: 2rem;
  }

  .ng-step {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .ng-grid--6 {
    grid-template-columns: 1fr;
  }

  .ng-card__icon,
  .ng-step__icon {
    width: 52px;
    height: 52px;
  }

  .ng-package__icon {
    width: 76px;
    height: 76px;
  }
}

/* REV10 final responsive logo sizing */
@media (max-width: 768px) {
  .ng-header__brand img {
    width: 148px;
    height: auto;
    max-width: 148px;
  }
}

@media (max-width: 420px) {
  .ng-header__brand img {
    width: 132px;
    max-width: 132px;
  }
}

/* Gutenberg frame repair: core template parts + language-aware header/footer. */
.ng-editor-preview-frame {
  display: none !important;
}

.editor-styles-wrapper .ng-editor-preview-frame {
  display: block !important;
  width: 100%;
  max-width: none;
  margin: 0 0 2rem;
  padding: 0;
  border: 1px solid rgba(232, 210, 154, 0.16);
  border-radius: 8px;
  background: var(--ng-bg);
  overflow: clip;
}

.editor-styles-wrapper .ng-editor-preview-frame .ng-site-header {
  position: relative;
  top: auto;
  z-index: 1;
}

.editor-styles-wrapper .ng-editor-preview-frame .ng-site-footer {
  margin-top: 0;
}

.ng-lang-en-only {
  display: none !important;
}

body.ng-lang-en .ng-lang-sv-only {
  display: none !important;
}

body.ng-lang-en .ng-header__nav.ng-lang-en-only,
body.ng-lang-en .ng-header__actions.ng-lang-en-only {
  display: flex !important;
}

body.ng-lang-en .ng-footer__brand.ng-lang-en-only {
  display: block !important;
}

body.ng-lang-en .ng-footer__columns.ng-lang-en-only {
  display: grid !important;
}

body.ng-lang-en .ng-footer__bottom .ng-lang-en-only {
  display: block !important;
}

.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-lang-sv-only {
  display: none !important;
}

.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-header__nav.ng-lang-en-only,
.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-header__actions.ng-lang-en-only {
  display: flex !important;
}

.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__brand.ng-lang-en-only {
  display: block !important;
}

.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__columns.ng-lang-en-only {
  display: grid !important;
}

.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__bottom .ng-lang-en-only {
  display: block !important;
}

.ng-header__brand {
  margin: 0;
}

.ng-header__actions {
  margin: 0;
}

.ng-header__login {
  margin: 0;
}

.ng-header__login a,
.ng-footer__login a {
  color: inherit;
  text-decoration: none;
}

.ng-header__nav {
  min-width: 0;
}

.ng-header__nav .wp-block-navigation__container {
  gap: 0.55rem;
}

.ng-header__nav .wp-block-navigation-item__content {
  color: var(--ng-text);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.ng-header__nav .wp-block-navigation-item__content:hover {
  color: var(--ng-gold);
}

.ng-header__nav .ng-mobile-only {
  display: none !important;
}

.ng-site-header .wp-block-buttons {
  margin: 0;
}

.ng-site-header .wp-block-button {
  margin: 0;
}

@media (min-width: 1201px) {
  .ng-header__nav .wp-block-navigation__responsive-container-open {
    display: none !important;
  }
}

@media (max-width: 1200px) {
  .ng-header__inner {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  body:not(.ng-lang-en) .ng-site-header .ng-header__nav.ng-lang-sv-only,
  body.ng-lang-en .ng-site-header .ng-header__nav.ng-lang-en-only {
    display: flex !important;
    justify-content: flex-end;
  }

  .ng-site-header .ng-header__actions,
  body:not(.ng-lang-en) .ng-site-header .ng-header__actions.ng-lang-sv-only,
  body.ng-lang-en .ng-site-header .ng-header__actions.ng-lang-en-only {
    display: none !important;
  }

  .ng-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none;
  }

  .ng-header__nav .wp-block-navigation__responsive-container-open,
  .ng-header__nav .wp-block-navigation__responsive-container-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--ng-border-gold);
    border-radius: 6px;
    background: rgba(232, 210, 154, 0.08);
    color: var(--ng-text);
  }

  .ng-header__nav .wp-block-navigation__responsive-container-open svg,
  .ng-header__nav .wp-block-navigation__responsive-container-close svg {
    width: 24px;
    height: 24px;
  }

  .ng-header__nav .wp-block-navigation__responsive-container.is-menu-open {
    padding: 1.25rem;
    background: var(--ng-bg);
    color: var(--ng-text);
  }

  .ng-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    align-items: stretch;
    gap: 0.4rem;
  }

  .ng-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    padding: 0.7rem 0;
    font-size: 1rem;
  }

  .ng-header__nav .wp-block-navigation__responsive-container.is-menu-open .ng-mobile-only {
    display: flex !important;
  }

  .ng-header__nav .wp-block-navigation__responsive-container.is-menu-open .ng-mobile-login .wp-block-navigation-item__content {
    justify-content: center;
    margin-top: 0.4rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(245, 247, 250, 0.12);
    border-radius: 6px;
    background: rgba(245, 247, 250, 0.03);
  }

  .ng-header__nav .wp-block-navigation__responsive-container.is-menu-open .ng-mobile-cta .wp-block-navigation-item__content {
    justify-content: center;
    margin-top: 0.4rem;
    padding: 0.8rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--ng-gold), #f4c95d);
    color: var(--ng-bg);
  }
}

@media (max-width: 768px) {
  .ng-header__brand img {
    height: auto;
  }

  .ng-footer__inner {
    padding: 2rem 0 1.5rem;
  }
}

/* Final header guard: keep the public template part stable after WP renders core/navigation. */
.ng-site-header .ng-header__inner {
  width: min(100% - 2rem, 1680px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.15rem;
  min-height: 78px;
}

.ng-site-header .ng-header__brand img {
  width: 210px;
  max-width: 210px;
  height: auto;
}

body:not(.ng-lang-en) .ng-lang-en-only,
body.ng-lang-en .ng-lang-sv-only {
  display: none !important;
}

body:not(.ng-lang-en) .ng-site-header .ng-header__nav.ng-lang-sv-only,
body.ng-lang-en .ng-site-header .ng-header__nav.ng-lang-en-only,
body:not(.ng-lang-en) .ng-site-header .ng-header__actions.ng-lang-sv-only,
body.ng-lang-en .ng-site-header .ng-header__actions.ng-lang-en-only {
  display: flex !important;
}

.ng-site-header .ng-header__nav {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.ng-site-header .ng-header__nav .wp-block-navigation__container {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.ng-site-header .ng-header__nav .wp-block-navigation-item,
.ng-site-header .ng-header__nav .wp-block-navigation-item__content {
  width: auto;
  max-width: none;
}

.ng-site-header .ng-header__nav .wp-block-navigation-item__content {
  white-space: nowrap;
  font-size: 0.82rem;
  line-height: 1.15;
}

.ng-site-header .ng-header__actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.9rem;
  white-space: nowrap;
}

.ng-site-header .ng-header__login a,
.ng-site-header .wp-block-button__link {
  white-space: nowrap;
}

.ng-site-header .wp-block-button__link {
  min-width: 138px;
  text-align: center;
}

@media (max-width: 1350px) {
  .ng-site-header .ng-header__inner {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .ng-site-header .ng-header__brand img {
    width: 172px;
    max-width: 172px;
  }

  .ng-site-header .ng-header__actions,
  body:not(.ng-lang-en) .ng-site-header .ng-header__actions.ng-lang-sv-only,
  body.ng-lang-en .ng-site-header .ng-header__actions.ng-lang-en-only {
    display: none !important;
  }

  body:not(.ng-lang-en) .ng-site-header .ng-header__nav.ng-lang-sv-only,
  body.ng-lang-en .ng-site-header .ng-header__nav.ng-lang-en-only {
    display: flex !important;
    justify-content: flex-end;
  }

  .ng-site-header .ng-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none !important;
  }

  .ng-site-header .ng-header__nav .wp-block-navigation__responsive-container-open,
  .ng-site-header .ng-header__nav .wp-block-navigation__responsive-container-close {
    display: inline-flex !important;
  }
}

.ng-site-footer {
  overflow: hidden;
}

.ng-site-footer .ng-footer__inner {
  width: min(100% - 2rem, 1680px);
  display: grid;
  grid-template-columns: minmax(260px, 0.52fr) minmax(0, 1.48fr);
  gap: clamp(2rem, 4vw, 4.5rem);
}

body:not(.ng-lang-en) .ng-site-footer .ng-footer__brand.ng-lang-sv-only,
body.ng-lang-en .ng-site-footer .ng-footer__brand.ng-lang-en-only {
  display: block !important;
}

body:not(.ng-lang-en) .ng-site-footer .ng-footer__columns.ng-lang-sv-only,
body.ng-lang-en .ng-site-footer .ng-footer__columns.ng-lang-en-only {
  display: grid !important;
}

body:not(.ng-lang-en) .ng-site-footer .ng-footer__bottom .ng-lang-sv-only,
body.ng-lang-en .ng-site-footer .ng-footer__bottom .ng-lang-en-only {
  display: block !important;
}

.ng-site-footer .ng-footer__columns {
  min-width: 0;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: clamp(1.3rem, 2vw, 2.25rem);
}

.ng-site-footer .ng-footer__column {
  min-width: 0;
}

.ng-site-footer .ng-footer__column h2 {
  margin: 0 0 0.85rem;
  white-space: nowrap;
}

.ng-site-footer .ng-footer__column ul {
  display: grid;
  gap: 0.55rem;
}

.ng-site-footer .ng-footer__column li,
.ng-site-footer .ng-footer__column p,
.ng-site-footer .ng-footer__column a {
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.ng-site-footer .ng-footer__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.editor-styles-wrapper .ng-lang-en-only {
  display: none !important;
}

.block-editor-block-list__layout .ng-lang-en-only,
.is-root-container .ng-lang-en-only {
  display: none !important;
}

.editor-styles-wrapper .ng-site-footer .ng-footer__columns.ng-lang-sv-only {
  display: grid !important;
}

.block-editor-block-list__layout .ng-site-footer .ng-footer__columns.ng-lang-sv-only,
.is-root-container .ng-site-footer .ng-footer__columns.ng-lang-sv-only {
  display: grid !important;
}

.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-lang-sv-only,
.block-editor-block-list__layout .ng-editor-preview-frame.ng-lang-en-frame .ng-lang-sv-only,
.is-root-container .ng-editor-preview-frame.ng-lang-en-frame .ng-lang-sv-only {
  display: none !important;
}

.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__brand.ng-lang-en-only,
.block-editor-block-list__layout .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__brand.ng-lang-en-only,
.is-root-container .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__brand.ng-lang-en-only,
.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__bottom .ng-lang-en-only,
.block-editor-block-list__layout .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__bottom .ng-lang-en-only,
.is-root-container .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__bottom .ng-lang-en-only {
  display: block !important;
}

.editor-styles-wrapper .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__columns.ng-lang-en-only,
.block-editor-block-list__layout .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__columns.ng-lang-en-only,
.is-root-container .ng-editor-preview-frame.ng-lang-en-frame .ng-footer__columns.ng-lang-en-only {
  display: grid !important;
}

@media (max-width: 1180px) {
  .ng-site-footer .ng-footer__inner {
    grid-template-columns: 1fr;
  }

  .ng-site-footer .ng-footer__columns {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .ng-site-footer .ng-footer__columns {
    grid-template-columns: 1fr;
  }
}
