/*
Theme Name: Kemplerer
Author: Jack Truffo
Version: 0.1.0
Text Domain: jacktruffo
*/

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap');

:root {
  --font-title: "Merriweather", "Times New Roman", Georgia, serif;
  --font-body: "Merriweather", "Times New Roman", Georgia, serif;
  --site-header-padding-top: 48px;
  --site-header-padding-bottom: 38px;
  --site-header-padding-x: 32px;
  --home-aside-top: calc(var(--site-header-padding-top) + 12px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: #1f1f1f;
  min-height: 100vh;
}

/* Global paragraph spacing consistent with home-content */
p {
  margin: 0 0 0em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1400px, 92vw);
  margin: 0 auto;
  padding: 0 0 0;
}

.site-header {
  padding: var(--site-header-padding-top) 0 var(--site-header-padding-bottom); /* +20px top/bottom for roomier desktop header */
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  padding-right: var(--site-header-padding-x);
  padding-left: var(--site-header-padding-x);
  width: 100%;
  max-width: none;
}

.site-title-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
}

.site-tagline {
  margin-left: 0;
  padding-left: 10px;
  border-left: 1px solid #2f2f2f;
  line-height: 1.3;
  white-space: normal;
}

.burger {
  display: none;
  width: 46px;
  height: 36px;
  padding: 8px;
  margin-left: auto;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: column;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
  z-index: 40;
  flex-shrink: 0;
  overflow: visible;
  outline: none;
}

.burger-line {
  display: block;
  width: 24px;
  height: 3px;
  background: #111;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border-radius: 2px;
  transform-origin: center;
  position: relative;
}

.burger.open .burger-line:nth-child(1) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.burger.open .burger-line:nth-child(2) {
  opacity: 0;
}

.burger.open .burger-line:nth-child(3) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.site-header-right-mobile {
  display: none;
}

.site-title {
  margin: 0;
  font-family: var(--font-title);
}

.site-title-link {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: #1f1f1f;
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-decoration: none;
  font-family: var(--font-title);
}

.site-title-text {
  display: inline;
  font-weight: bold;
  font-family: var(--font-title);
}

.site-tagline {
  display: inline;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

.menu-primary {
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
  list-style: none;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.menu-primary a {
  position: relative;
  color: #6c6c6c;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.menu-primary a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: #000;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.menu-primary a:hover,
.menu-primary a:focus-visible {
  color: #000;
}

.menu-primary a:hover::after,
.menu-primary a:focus-visible::after {
  transform: scaleX(1);
}

.menu-primary .current-menu-item > a {
  color: #000;
  font-weight: 700;
}

.menu-primary .current-menu-item > a::after {
  transform: scaleX(0);
}

.site-header {
  position: relative;
  z-index: 10;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-footer {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  gap: 16px;
  font-family: var(--font-title);
  font-size: 14px;
  color: #666;
}

.menu-footer a { color: inherit; }

@media (max-width: 900px) {
  .burger {
    display: inline-flex;
    width: 46px;
    height: 38px;
    padding: 8px;
    border-radius: 8px;
    justify-content: center;
    align-items: center;
  }

  .burger-line {
    height: 3px;
    width: 24px;
  }

  .site-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 30;
    padding: 18px 4px 12px;
  }

  .site-header .container {
    gap: 16px;
    align-items: center;
    flex-direction: row;
    padding-right: 0;
    padding-left: 0;
  }

  .site-title-link {
    font-size: 1.15rem;
    align-items: flex-start;
  }

  /* hide desktop nav on mobile */
  .site-header-right {
    display: none;
  }

  /* mobile overlay nav */
  .site-header-right-mobile {
    position: fixed;
    inset: 0;
    z-index: 9999; /* sit above header/admin bar */
    background: #fff;
    padding: 36px 20px 32px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    height: 100vh;
  }

  .site-header-right-mobile.active {
    display: flex;
    transform: translateX(0);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  }

  .mobile-nav-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    color: #000;
    z-index: 1;
  }

  /* Offset for admin bar when logged in */
  body.admin-bar .site-header-right-mobile {
    top: 32px;
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
  }

  .menu-primary {
    flex-direction: column;
    gap: 18px;
    font-size: 1.1rem;
    width: 100%;
    align-items: flex-start;
  }

  .menu-primary-container {
    display: block;
    width: 100%;
  }

  .menu-primary li {
    width: 100%;
  }

  .site-header-right nav,
  .site-header-right-mobile nav {
    width: 100%;
    max-width: 100%;
  }

  /* Mobile overlay ordering: primary menu, separator, secondary menu, search */
  .site-header-right-mobile nav.menu-primary-container {
    order: 0;
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .header-menu-separator {
    order: 1;
  }
  .header-aside-menu {
    order: 2;
    display: block;
    width: 100%;
  }
  .menu-search-inline {
    order: 3;
  }

  .menu-primary a {
    padding: 4px 0;
  }

  .header-aside-menu {
    display: block;
    width: 100%;
  }

  .header-aside-menu .home-aside-list {
    gap: 12px;
    font-size: 0.95rem;
  }


  .menu-search-inline {
    width: 100%;
    max-width: min(360px, 100%);
    margin: 0;
    align-self: stretch;
    box-sizing: border-box;
  }

  .menu-search-inline .searchform {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .menu-search-inline .searchform input[type="search"] {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Remove desktop inline offset that shifts the field to the right on mobile */
  .site-header-right .menu-search-inline {
    margin-left: 0;
    max-width: 100%;
  }

  .site-header-right .menu-search-inline .searchform {
    max-width: 100%;
  }

  .site-header-right .menu-search-inline .searchform input[type="search"] {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.menu-open {
    overflow: hidden;
  }
}

.site-content {
  padding: 0 0 64px;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  grid-template-areas: "main aside";
  justify-items: stretch;
  align-items: start;
  gap: 48px;
  padding: 24px 0 80px;
}

.home-rail {
  display: none !important;
}

.home-content {
  grid-area: main;
  font-size: 1.6rem !important;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #1e1e1e;
  max-width: 760px;
  font-family: var(--font-body) !important;
}

.home-content p,
.home-content .wp-block-paragraph,
.home-content span,
.home-content a {
  margin: 0 0 1.4em;
  font-family: var(--font-body) !important;
  font-size: 1.5rem !important;
  line-height: 1.5 !important;
}

.home-content a,
.home-content li,
.home-content span,
.home-content strong,
.home-content em {
  font-family: var(--font-body) !important;
}

.home-content a {
  color: #8a8a8a;
  border-bottom: 1px solid #cfcfcf;
  font-weight: 400;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.home-content a:hover {
  color: #4a4a4a;
  border-color: #4a4a4a;
}

.home-aside {
  grid-area: aside;
  justify-self: end;
  align-self: start;
  position: sticky;
  top: var(--home-aside-top);
}

.home-aside-nav {
  font-family: var(--font-title);
  font-size: 18px; /* +~30% for home secondary menu */
  color: #7a7a7a;
}

.home-aside-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-aside-list a {
  position: relative;
  color: #b3b3b3; /* light grey for secondary menu links */
  transition: color 0.15s ease;
  font-family: var(--font-title);
}

.home-aside-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: #000;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.home-aside-list a:hover,
.home-aside-list a:focus-visible {
  color: #8a8a8a;
}

.home-aside-list a:hover::after,
.home-aside-list a:focus-visible::after {
  transform: scaleX(1);
}

.home-aside-list .current-menu-item > a {
  color: #000;
  font-weight: 700;
}

.home-aside-list .current-menu-item > a::after {
  transform: scaleX(0);
}

.header-aside-menu {
  display: none;
}

.header-menu-separator {
  width: 100%;
  border: 0;
  border-top: 1px solid #e2e2e2;
  margin: 4px 0 12px;
  display: none;
}

.home-aside-nav--empty {
  border: 1px dashed #d4d4d4;
  padding: 12px;
  background: #fafafa;
  color: #555;
}

.searchform {
  display: flex;
  align-items: center;
  gap: 8px;
}

.searchform input[type="search"] {
  border: 1px solid #dedede;
  background: #fff;
  padding: 8px 10px;
  border-radius: 2px;
  min-width: 180px;
  font-size: 14px;
  font-family: var(--font-title);
}

.menu-search-button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

.site-header .menu-search-button {
  margin-left: 12px;
}

.menu-search-inline {
  display: block;
  position: relative;
  margin-left: 14px;
  align-self: center;
}

.menu-search-inline.is-open {
  display: block;
}

.menu-search-inline__panel {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}

.menu-search-inline .searchform {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid #bfbfbf;
  border-radius: 2px;
  padding: 4px 6px;
  height: 32px;
  font-family: var(--font-title);
}

.menu-search-inline .searchform input[type="search"] {
  border: none;
  padding: 2px 6px;
  min-width: 200px;
  outline: none;
  height: 24px;
  font-size: 14px;
  font-family: var(--font-title);
  background: transparent;
  color: #1f1f1f;
}

.menu-search-inline .menu-search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.search-dim {
  display: none !important;
}

.search-dim.is-open {
  display: none;
}

.search-open {
  overflow: hidden;
}

.menu-search-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #6c6c6c;
  border-radius: 50%;
  position: relative;
}

.menu-search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  background: #6c6c6c;
  top: 11px;
  left: 11px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-hero {
  margin: 0 0 24px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e8e8e8;
}

.search-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 600;
}

.search-lead {
  margin: 0;
  color: #5f5f5f;
}

.search-results {
  display: block;
}

.search-grid {
  margin-top: 20px;
}

.search-pagination {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.search-no-results {
  padding: 24px;
  background: #fafafa;
  border: 1px solid #ededed;
}

/* Blog / archive cards */
.layout--blog-archive {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 36px;
  align-items: start;
}

.card {
  margin: 0 0 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid #ededed;
}

.card h2 {
  margin: 0 0 8px;
}

.layout--blog-archive aside {
  font-family: var(--font-body);
  font-size: 14px;
  color: #666;
}

/* Portfolio listings */
.portfolio-archive {
  display: grid;
  gap: 28px;
}

.grid-portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  color: #1f1f1f;
  background: #fff;
}

.portfolio-card a {
  display: block;
}

.portfolio-card__thumb {
  position: relative;
  width: 100%;
  padding-top: 100%; /* force carré même sans support aspect-ratio */
  overflow: hidden;
  margin: 0 0 25px;
}

.portfolio-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.portfolio-card h2 {
  margin: 15px 0 0;
  font-size: 1.05rem;
  line-height: 1; /* interline equal to font height */
  min-height: calc(1.05rem * 1 * 4); /* hauteur de base */
  max-height: calc(1.05rem * 1 * 4); /* évite de pousser le hr si > 4 lignes */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  padding: 0 10px;
  font-family: var(--font-title);
}

.portfolio-card img {
  width: 100%;
  display: block;
}

.portfolio-card__divider {
  margin: 15px 0 15px;
  border: 0;
  border-top: 1px solid #e0e0e0;
}

.portfolio-card__excerpt {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
  align-self: flex-start;
  padding: 0 10px;
}

/* Inline menu on portfolio/archive/search */
.portfolio-inline-menu {
  margin: 10px 0 24px;
}

.portfolio-inline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.95rem;
  line-height: 1.4;
  font-family: var(--font-title);
}

.portfolio-inline-list a {
  position: relative;
  color: #b3b3b3; /* light grey for portfolio secondary menu links */
  text-decoration: none;
  transition: color 0.15s ease;
}

.portfolio-inline-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: #000;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.portfolio-inline-list a:hover,
.portfolio-inline-list a:focus-visible {
  color: #8a8a8a;
}

.portfolio-inline-list a:hover::after,
.portfolio-inline-list a:focus-visible::after {
  transform: scaleX(1);
}

/* Active state */
.portfolio-inline-list .current-menu-item > a,
.portfolio-inline-list .current_page_item > a {
  color: #000;
  font-weight: 700;
}

.portfolio-inline-list .current-menu-item > a::after,
.portfolio-inline-list .current_page_item > a::after {
  transform: scaleX(0);
}

@media (max-width: 900px) {
  .portfolio-inline-menu {
    display: none;
  }
}
@media (hover: hover) and (pointer: fine) {
  .portfolio-card {
    opacity: 1;
  }

  .portfolio-card:hover,
  .portfolio-card:focus-within {
    background: #fff9d9;
    opacity: 1;
  }
}

.portfolio-loader {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px 0 6px;
  font-size: 0.95rem;
  color: #666;
}

.portfolio-loader.is-visible {
  display: flex;
}

.portfolio-load-sentinel {
  width: 100%;
  height: 1px;
}

body.has-portfolio-infinite .navigation.pagination,
body.has-portfolio-infinite .pagination,
body.has-portfolio-infinite .page-numbers {
  display: none;
}

.term-description {
  color: #4a4a4a;
}

/* Portfolio single */
.portfolio-single__grid {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(400px, 1fr);
  gap: 48px;
  align-items: start;
}

.portfolio-single__text {
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* align content to top of slider */
  margin-top:50px;
  gap: 0px; /* space between title and body */
}

.portfolio-single__text p{
  margin-bottom:10px;
}

.portfolio-single__text a{
  color:gray; 
}
.portfolio-single__text a:hover{
  color:black;}

.portfolio-single__text h1 {
  margin-top: 0;
  margin-bottom: 40px;
  line-height: 1; /* interline equal to font height */
}

.portfolio-single__media {
  position: sticky;
  top: 80px;
}

/* About page */
.a-propos {
  display: grid;
  gap: 24px;
}

.a-propos__layout {
  display: grid;
  grid-template-columns: minmax(360px, 540px) minmax(240px, 1fr);
  gap: 40px;
  align-items: start;
}

.a-propos__title {
  margin: 0;
}

.a-propos__image {
  width: 100%;
  height: auto;
  display: block;
}

/* Page full-width */
.page--full {
  margin: 0 0 32px;
}

.content--full {
  max-width: 980px;
}

/* Generic post/page */
.post, .page {
  margin: 0 0 32px;
  font-family: var(--font-body);
}

.post-title {
  margin: 0 0 10px;
  font-size: 1.6rem;
  font-family: var(--font-title);
}

.post-meta {
  color: #666;
  font-size: 0.95rem;
  margin: 0 0 12px;
  font-family: var(--font-body);
}

.post-content img, .content img {
  max-width: 100%;
  height: auto;
}

/* Footer */
.site-footer {
  padding: 48px 0 36px;
  text-align: center;
  color: #1f1f1f;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.menu-footer {
  display: none;
}

.site-footer p {
  margin: 0;
  line-height: 1.6;
}

/* Search overlay (JS hooks) */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.search-overlay__inner {
  background: #fff;
  padding: 24px;
  border: 1px solid #e6e6e6;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.search-overlay.is-open {
  display: flex;
}

.search-open {
  overflow: hidden;
}

/* Custom block: portfolio slider (front) */
.klemperer-portfolio-slider {
  max-width: 900px;
  margin: 2rem auto;
  height: auto;
}

.klemperer-portfolio-slider img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.portfolio-single__media .klemperer-portfolio-slider {
  height: min(75vh, 800px) !important;
  max-height: 90vh !important;
  overflow: hidden;
}
.portfolio-single__media .klemperer-portfolio-slider .swiper,
.portfolio-single__media .klemperer-portfolio-slider .swiper-wrapper {
  height: 100% !important;
}
.portfolio-single__media .klemperer-portfolio-slider .swiper-slide {
  height: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portfolio-single__media .klemperer-portfolio-slider .swiper-slide img {
  max-height: 100% !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

.klemperer-portfolio-slider-editor .klemperer-portfolio-slider-preview {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  margin-top: 1rem;
}

.klemperer-portfolio-slider-preview-item {
  flex: 0 0 auto;
  width: 120px;
  border: 1px solid #ddd;
  padding: 4px;
  background: #fff;
}

.klemperer-portfolio-slider-preview-item img {
  display: block;
  width: 100%;
  height: auto;
}

.klemperer-portfolio-slider-empty {
  margin-top: 1rem;
  font-style: italic;
  color: #666;
}

/* Responsive tweaks */
@media (max-width: 1024px) {
  .menu-primary {
    gap: 18px;
    font-size: 14px;
  }

  .home-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "aside";
    gap: 32px;
  }

  .home-aside {
    justify-self: start;
  }

  .layout--blog-archive {
    grid-template-columns: 1fr;
  }

  .portfolio-single__grid,
  .a-propos__layout {
    grid-template-columns: 1fr;
  }

  .portfolio-single__media {
    position: static;
  }
}

@media (max-width: 700px) {
  /* Reduce gap between slider and text, prevent horizontal overflow */
  .portfolio-single__grid {
    gap: 8px;
  }

  .portfolio-single__media .klemperer-portfolio-slider {
    margin: 0 auto 8px;
  }

  .klemperer-portfolio-slider {
    max-width: 100vw;
    margin: 0 auto 8px;
  }

  .klemperer-portfolio-slider img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Trim bottom margin of last paragraph before slider */
  .portfolio-single__text p:last-child {
    margin-bottom: 0.2em;
  }

  /* Smaller home content text on mobile */
  .home-content {
    font-size: 1rem !important;
    
  }

  .home-content p,
  .home-content .wp-block-paragraph,
  .home-content span,
  .home-content a {
    font-size: 1.4rem !important;
    line-height: 1.45 !important;
  }
}

@media (min-width: 1100px) {
  .home-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  }

  .home-content {
    max-width: 620px;
  }
}

@media (min-width: 901px) {
  .site-header-right {
    flex-direction: row;
  }

  .menu-search-inline {
    order: 1;
  }

  .site-header-right nav:first-of-type {
    order: 2;
  }

  .header-aside-menu {
    order: 3;
  }
}

/* Ensure secondary menu shows inside mobile overlay */
@media (max-width: 900px) {
  .header-aside-menu {
    display: block;
    width: 100%;
  }

  .header-aside-menu .home-aside-list {
    gap: 12px;
    font-size: 0.95rem;
  }

  .header-menu-separator {
    display: block;
  }

  /* Home page: hide sidebar (second menu) on small screens */
  .home .home-aside {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
    line-height: 1.65;
  }

  .site-header .container {
    flex-direction: row;
    align-items: center;
    margin-left:5px;
    gap: 90px;
  }

  .site-title-link {
    gap: 4px;
  }

  .menu-primary {
    margin-left: 0;
  }

  .site-tagline {
    margin-left: 0;
    padding-left: 10px; /* keep space between rule and subtitle text */
  }
}
