/* Clean desktop homepage hero.
   Desktop uses the landscape castle asset and live HTML copy; mobile styling remains unchanged. */
@media (min-width: 801px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .castle-header {
    width: 100%;
  }

  .castle-header .header-inner {
    width: min(1320px, calc(100% - 64px));
    max-width: 1320px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-sizing: border-box;
  }

  .castle-header .castle-brand {
    flex: 0 0 400px;
    min-width: 0;
  }

  .castle-header .castle-brand img.logo {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: contain;
  }

  .castle-header .nav {
    flex: 0 1 auto;
    min-width: 0;
    margin-left: auto;
    gap: clamp(6px, 0.7vw, 11px);
  }

  .castle-header .header-actions {
    flex: 0 0 auto;
    gap: 8px;
    margin-left: 0;
  }

  .castle-hero {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 760px;
    min-height: 760px;
    overflow: hidden;
    isolation: isolate;
    background: #061a2e;
  }

  .castle-hero .hero-backdrop {
    position: absolute;
    inset: 0;
    background-color: #061a2e;
    background-image: url("assets/hero-castle.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: none;
    transform: none;
  }

  /* Do not add overlays to the background image itself: keep all copy in HTML. */
  .castle-hero .hero-backdrop::before {
    content: none;
    display: none;
  }

  .castle-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background:
      linear-gradient(90deg,
        rgba(3, 16, 30, .97) 0%,
        rgba(3, 16, 30, .91) 30%,
        rgba(3, 16, 30, .70) 48%,
        rgba(3, 16, 30, .20) 72%,
        rgba(3, 16, 30, .06) 100%),
      linear-gradient(180deg,
        rgba(3, 16, 30, .24) 0%,
        rgba(3, 16, 30, .02) 48%,
        rgba(3, 16, 30, .22) 100%);
  }

  .castle-hero .hero-content,
  .castle-hero .hero-content.container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(180px, 260px);
    column-gap: clamp(24px, 4vw, 56px);
    align-items: start;
    justify-content: space-between;
    width: min(1180px, calc(100% - 96px));
    max-width: 1180px;
    height: 100%;
    min-height: 0;
    margin-inline: auto;
    padding: 178px 0 40px;
    box-sizing: border-box;
    inset: auto;
    transform: none;
  }

  .castle-hero .hero-copy {
    grid-column: 1;
    width: 100%;
    max-width: 640px;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  .castle-hero .hero-copy h1 {
    max-width: 640px;
    font-size: clamp(3.3rem, 5.1vw, 5.3rem);
    line-height: .94;
    overflow-wrap: break-word;
  }

  .castle-hero .hero-copy p {
    max-width: 520px;
  }

  .castle-hero .hero-signature {
    grid-column: 2;
    width: 100%;
    max-width: 260px;
    margin: 60px 0 0;
  }
}

@media (min-width: 801px) and (max-width: 1120px) {
  .castle-header .header-inner {
    width: calc(100% - 40px);
    gap: 10px;
  }

  .castle-header .castle-brand {
    flex-basis: 240px;
  }

  .castle-header .castle-brand img.logo {
    max-width: 240px;
  }

  .castle-header .nav {
    gap: 9px;
  }

  .castle-header .nav a {
    font-size: .72rem;
  }

  .castle-header .header-actions .btn {
    padding-inline: 9px;
  }

  .castle-hero .hero-content,
  .castle-hero .hero-content.container {
    width: calc(100% - 56px);
    grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
    column-gap: 20px;
    padding-top: 155px;
  }

  .castle-hero .hero-copy h1 {
    font-size: clamp(3rem, 5vw, 4.2rem);
  }
}

/* Final header balance: larger visible logo while keeping navigation aligned and in view. */
@media (min-width: 1121px) {
  .castle-header .header-inner { gap: 14px; }
  .castle-header .castle-brand { flex: 0 0 400px; width: 400px; }
  .castle-header .castle-brand img.logo { width: 400px; max-width: 400px; max-height: none; height: auto; }
  .castle-header .nav { flex: 1 1 auto; justify-content: flex-end; gap: 12px; }
  .castle-header .nav a { font-size: 12px; white-space: nowrap; }
  .castle-header .header-actions { flex: 0 0 auto; }
}
@media (min-width: 801px) and (max-width: 1120px) {
  .castle-header .castle-brand { flex: 0 0 300px; width: 300px; }
  .castle-header .castle-brand img.logo { width: 300px; max-width: 300px; max-height: none; height: auto; }
  .castle-header .nav { gap: 8px; }
  .castle-header .nav a { font-size: 11px; white-space: nowrap; }
}

/* Align the Home navigation item and keep the full navigation row centered vertically with the logo. */
@media (min-width: 801px) {
  .castle-header .header-inner { align-items: center; }
  .castle-header .nav { align-self: center; margin-top: 0; margin-bottom: 0; transform: translateY(0); }
  .castle-header .nav a { display: inline-flex; align-items: center; line-height: 1.2; padding-top: 10px; padding-bottom: 10px; }
  .castle-header .nav a.active { align-self: center; }
}


/* Authoritative desktop header layout: logo left, navigation and actions grouped on the right. */
@media (min-width: 1121px) {
  .castle-header .header-inner {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr) auto;
    align-items: center;
    justify-content: initial;
    column-gap: 24px;
    width: calc(100% - 64px);
    max-width: 1440px;
    margin-inline: auto;
  }
  .castle-header .castle-brand { width: 360px; min-width: 0; flex: none; }
  .castle-header .castle-brand img.logo { display: block; width: 360px; max-width: 100%; max-height: none; height: auto; }
  .castle-header .nav { display: flex; align-items: center; justify-content: flex-end; gap: clamp(12px, 1.2vw, 20px); min-width: 0; margin: 0; flex: none; }
  .castle-header .nav a { display: inline-flex; align-items: center; padding: 10px 0; margin: 0; line-height: 1.2; font-size: 12px; white-space: nowrap; }
  .castle-header .header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0; flex: none; }
}
@media (min-width: 801px) and (max-width: 1120px) {
  .castle-header .header-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
  .castle-header .castle-brand { flex: 0 0 280px; width: 280px; }
  .castle-header .castle-brand img.logo { width: 280px; max-width: 100%; max-height: none; height: auto; }
  .castle-header .nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 0 auto; }
  .castle-header .nav a { font-size: 10px; white-space: nowrap; }
  .castle-header .header-actions { display: flex; gap: 6px; margin: 0; }
  .castle-header .header-actions .btn { padding-inline: 8px; font-size: 10px; }
}
