:root {
  --at-container: 1140px;
  --at-radius: 14px;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background: #fafafa;
  color: #1a1a1a;
}

.wp-site-blocks {
  max-width: var(--at-container);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* Narrow pages (About, front page): 720px content column, left-aligned in the site container. */
main.page-content-left.has-global-padding {
  padding-top: 0.5rem;
  padding-left: 0;
  padding-right: 0;
}

main.page-content-left.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
main.page-content-left .wp-block-post-content.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 720px;
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Request guide: match About (720px) even when a wide template is assigned in the editor. */
body.at-request-guide-page main.page-wide,
body.at-request-guide-page main:not(.page-content-left) {
  max-width: 720px;
  margin-left: 0;
  margin-right: auto;
}

body.at-request-guide-page main.page-wide.has-global-padding,
body.at-request-guide-page main:not(.page-content-left).has-global-padding {
  padding-left: 0;
  padding-right: 0;
}

body.at-request-guide-page main.page-wide .wp-block-post-content.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
body.at-request-guide-page main:not(.page-content-left) .wp-block-post-content.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 720px;
  margin-left: 0 !important;
  margin-right: auto !important;
}

body.at-front-page .at-hero {
  margin-left: 0;
  margin-right: auto;
  padding-left: 0;
  max-width: 900px;
  overflow: visible;
}

body.at-front-page .at-hero__actions {
  overflow: visible;
}

main.page-content-left .wp-block-buttons.at-guides-browse {
  margin: 0.5rem 0 2.5rem;
}

.site-header,
.wp-block-group.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e8e8e8;
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.site-header .wp-block-navigation {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
}

.wp-block-navigation .wp-block-navigation__container {
  gap: 1.25rem;
  justify-content: flex-end;
}

.site-header .wp-block-site-title a {
  text-decoration: none;
  font-family: var(--wp--preset--font-family--geist-mono, monospace);
  font-weight: 600;
  font-size: 1.15rem;
}

.wp-block-navigation a {
  text-decoration: none;
  font-size: 0.95rem;
}

.wp-block-navigation a:hover {
  color: #0066cc;
}

main.wp-block-group {
  padding-top: 0.5rem;
}

.at-404__search {
  margin: 0 0 1.5rem;
}

.at-404 {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
  text-align: center;
}

.at-404__title {
  font-family: var(--wp--preset--font-family--geist-mono, monospace);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.at-404__lead {
  margin: 0 0 1.5rem;
  color: #666;
  font-size: 1rem;
  line-height: 1.5;
}

.at-404__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.at-404__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.25;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.at-404__cta--primary {
  background: #0066cc;
  color: #fff;
  border: none;
}

.at-404__cta--primary:hover,
.at-404__cta--primary:focus-visible {
  background: #0052a3;
  color: #fff;
}

.at-404__cta--secondary {
  background: transparent;
  color: #666;
  border: 1px solid #d0d0d0;
  font-weight: 500;
}

.at-404__cta--secondary:hover,
.at-404__cta--secondary:focus-visible {
  color: #0066cc;
  border-color: #0066cc;
}

.wp-block-group main > .wp-block-heading {
  font-family: var(--wp--preset--font-family--geist-mono, monospace);
  font-size: 1.5rem;
  margin: 2rem 0 1.25rem;
}

.wp-block-post-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.wp-block-post-content p {
  margin-bottom: 1.25rem;
}

.wp-block-post-title {
  font-family: var(--wp--preset--font-family--geist-mono, monospace);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

/* Outline CTA — minimal; hero Search keeps solid primary in blocks.css */
main .wp-block-buttons {
  margin: 2rem 0 3rem;
  display: flex;
  justify-content: center;
}

/* Norrsken parent injects gradient via :root :where(.wp-block-button .wp-block-button__link) */
main .wp-block-button .wp-block-button__link,
main .wp-block-button__link.wp-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  color: var(--wp--preset--color--text-secondary, #666) !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 10px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--wp--preset--font-family--inter, Inter, system-ui, sans-serif);
  text-decoration: none;
  line-height: 1.25;
  box-shadow: none !important;
  transition: color 0.2s ease, border-color 0.2s ease;
}

main .wp-block-button .wp-block-button__link:hover,
main .wp-block-button .wp-block-button__link:focus-visible,
main .wp-block-button__link.wp-element-button:hover,
main .wp-block-button__link.wp-element-button:focus-visible {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  color: var(--wp--preset--color--primary, #0066cc) !important;
  border-color: var(--wp--preset--color--primary, #0066cc) !important;
  box-shadow: none !important;
}

@keyframes at-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.at-guides {
  animation: at-fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
  position: relative;
  z-index: 1;
}

/* Header brand: hide text title when custom logo is set */
.site-header__brand:has(.wp-block-site-logo img) .wp-block-site-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wp-block-site-logo,
.wp-block-site-logo img,
.wp-block-site-logo a {
  border-radius: 0 !important;
}

.site-header__logo img {
  max-height: 40px;
  width: auto;
}

/* Static / company / legal pages */
.at-static-page main .wp-block-post-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e8e8e8;
}

.at-static-page .at-page-lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 1.5rem;
}

.at-static-page .at-page-updated {
  font-size: 0.8125rem;
  color: #666;
  margin: -0.5rem 0 1.75rem;
}

.at-static-page .at-page-section {
  margin-bottom: 1.75rem;
  padding: 1.5rem;
  border: 1px solid #ececec;
  border-radius: var(--at-radius);
  background: #fcfcfd;
}

.at-static-page .at-page-section .wp-block-heading {
  font-size: 1.375rem;
  margin: 0 0 0.875rem;
}

.at-static-page .at-page-section p {
  margin-bottom: 0.75rem;
  color: #333;
}

.at-static-page .at-page-section p:last-child {
  margin-bottom: 0;
}

.legal-page .wp-block-heading {
  margin-top: 0;
}

/* Page with sidebar */
.page-with-sidebar__layout {
  display: grid;
  gap: 2rem;
  align-items: start;
  padding-top: 0.5rem;
}

@media (min-width: 900px) {
  .page-with-sidebar__layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .page-with-sidebar__layout:not(:has(.page-sidebar .page-sidebar-inner > *)) {
    grid-template-columns: minmax(0, 720px);
  }

  .page-with-sidebar__layout:not(:has(.page-sidebar .page-sidebar-inner > *)) .page-main {
    max-width: 720px;
    justify-self: start;
  }
}

.page-sidebar {
  font-size: 0.95rem;
  align-self: start;
}

@media (min-width: 900px) {
  .page-with-sidebar__layout .page-sidebar {
    position: sticky;
    top: 1.5rem;
  }
}

main.page-wide.has-global-padding {
  padding-top: 0.5rem;
  padding-left: 0;
  padding-right: 0;
}

/* Countries page: block renders its own H1 */
body.page-countries .wp-block-post-title {
  display: none;
}

/* Wide template: let post content blocks use the full main width (not theme.json 800px content size). */
.page-wide .wp-block-post-content.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: var(--at-container);
}

main.page-wide .at-single-guide__layout {
  width: 100%;
  max-width: var(--at-container);
  margin-inline: auto;
}

main.page-wide .at-single-guide__main .wp-block-post-content > * {
  max-width: none;
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  background: #1a1a1a;
  color: #f5f5f5;
  border-radius: var(--at-radius);
}

.site-footer a {
  color: #e8e8e8;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer .wp-block-heading {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.site-footer__logo {
  margin-bottom: 1.5rem;
}

.site-footer__logo img {
  max-width: 160px;
  height: auto;
}
