/* SAGE visual details. Shared layout and interactions remain in site.css. */

/* Give the two original gradient stops room to read across the viewport. */
body {
  background: linear-gradient(118deg, #521710 8%, #7b2b45 100%);
  background-attachment: fixed;
}

.page-art {
  position: fixed;
  z-index: -2;
  background-image:
    radial-gradient(ellipse at 100% 12%, rgb(165 52 63 / 22%), transparent 56%),
    linear-gradient(118deg, #521710 8%, #7b2b45 100%);
  background-size: cover;
  opacity: 1;
}

/* These are the supplied vector assets, placed separately from the text. */
.site-decoration {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: clip;
  pointer-events: none;
  user-select: none;
  /* Keep the heading and subtitle area completely clear of line artwork. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 520px, #000 640px);
  mask-image: linear-gradient(to bottom, transparent 520px, #000 640px);
}

.site-decoration img {
  position: absolute;
  max-width: none;
  pointer-events: none;
}

.decor-contours {
  width: min(1100px, 88vw);
  right: -160px;
  bottom: 90px;
  opacity: .56;
}

.decor-orbits {
  width: 540px;
  top: 680px;
  right: -330px;
  opacity: .42;
}

.decor-accent {
  width: 440px;
  right: -190px;
  top: 48%;
  opacity: .24;
}

.home-page .site-decoration {
  -webkit-mask-image: linear-gradient(to bottom, transparent 740px, #000 940px);
  mask-image: linear-gradient(to bottom, transparent 740px, #000 940px);
}

.home-page .decor-orbits { top: 820px; }
.home-page .decor-accent { display: none; }

/* A clipped logo tile stays fully inside the navigation bar at every size. */
.site-header {
  min-height: 80px;
  padding: 8px 24px 8px 8px;
  gap: 24px;
  align-items: center;
  border-radius: 20px;
  background: linear-gradient(110deg, var(--brown) 30%, rgb(60 16 4 / 94%));
  box-shadow:
    inset 0 1px 0 rgb(247 237 219 / 12%),
    0 8px 24px rgb(0 0 0 / 12%);
}

.site-header .brand {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  min-height: 0;
  align-self: center;
  margin: 0;
  padding: 0;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--brown);
}

.site-header .brand img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: inherit;
}

/* The inset shadow follows the original About contents panel in Figma. */
.panel {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(145deg, rgb(255 152 79 / 12%), transparent 46%),
    linear-gradient(165deg, transparent 36%, rgb(60 16 4 / 12%)),
    var(--panel);
  border-color: rgb(247 237 219 / 25%);
  box-shadow:
    inset 0 12px 59.1px rgb(0 0 0 / 25%),
    inset 0 1px 0 rgb(247 237 219 / 16%),
    -8px 9px 10px rgb(0 0 0 / 30%);
}

.quick-card {
  border-radius: 22px;
  box-shadow:
    inset 0 12px 48px rgb(0 0 0 / 23%),
    inset 0 1px 0 rgb(247 237 219 / 18%),
    -8px 10px 18px rgb(0 0 0 / 27%);
}

.card-icon {
  filter: drop-shadow(0 4px 7px rgb(0 0 0 / 16%));
}

.toc-link,
.toc-links .button--dark {
  background: linear-gradient(135deg, rgb(165 52 63 / 9%), transparent 65%), var(--brown);
  border-color: rgb(247 237 219 / 8%);
  box-shadow:
    inset 0 1px 0 rgb(247 237 219 / 7%),
    inset 0 -12px 22px rgb(0 0 0 / 13%),
    0 3px 8px rgb(0 0 0 / 10%);
}

.toc-link:hover,
.toc-link[data-current],
.toc-link[aria-current],
.toc-links .button--dark:hover {
  background: linear-gradient(135deg, rgb(255 152 79 / 9%), transparent 70%), var(--red);
  border-color: var(--peach);
}

.toc-link:active,
.toc-links .button--dark:active {
  background: var(--brown);
  box-shadow: inset 0 3px 10px rgb(0 0 0 / 30%);
}

/* Do not replace position:sticky with position:relative when styling panels. */
.toc,
.filter-panel,
.profile-summary { position: sticky; }

.account-page .site-form {
  background:
    linear-gradient(145deg, rgb(255 152 79 / 8%), transparent 52%),
    rgb(128 39 29 / 52%);
  box-shadow: inset 0 12px 44px rgb(0 0 0 / 18%), 0 10px 26px rgb(0 0 0 / 16%);
}

.field input,
.field textarea,
.field select {
  box-shadow: inset 0 3px 10px rgb(0 0 0 / 13%), 0 1px 0 rgb(247 237 219 / 5%);
}

/* The About line-and-dot graphic is a repeating rail under each sidebar. */
.sidebar {
  position: relative;
  isolation: isolate;
}

.sidebar-rail {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  top: -44px;
  bottom: 0;
  left: -48px;
  width: calc(100% + 96px);
  background: url("assets/sidebar-flow.svg") center top / 100% auto repeat-y;
  opacity: .86;
}

.contact-details-column {
  position: relative;
  isolation: isolate;
}

.contact-details-column .sidebar-rail {
  left: -30px;
  width: calc(100% + 40px);
  opacity: .19;
}

.reading-layout--single { position: relative; isolation: isolate; }
.standalone-rail {
  position: absolute;
  z-index: -1;
  top: -24px;
  bottom: 0;
  left: -96px;
  width: 64px;
  background: url("assets/sidebar-flow.svg") center top / 250px auto repeat-y;
  opacity: .58;
  pointer-events: none;
}

/* Restore the actual editing-timeline artwork over the About photograph. */
.photo--overlap {
  position: relative;
  isolation: isolate;
  overflow: visible;
  margin-top: 40px !important;
  margin-bottom: 20px;
}

.photo--overlap::before { display: none; }
.photo--overlap > img { position: relative; z-index: 1; }

.editing-glass {
  position: absolute;
  z-index: 2;
  width: 102%;
  left: -76%;
  bottom: 10px;
  aspect-ratio: 499 / 265;
  border-radius: 8.2% / 15.5%;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  filter: drop-shadow(0 7px 10px rgb(0 0 0 / 18%));
  pointer-events: none;
}

.photo--overlap .editing-glass img {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  object-fit: contain;
}

/* Keep the deliberate overlap, with its own clear space below the paragraph. */
@media (max-width: 1399px) {
  [data-page="about"] .text-and-image {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .photo--overlap {
    width: 74%;
    margin-left: auto;
    margin-right: 0;
    margin-top: 0 !important;
    margin-bottom: 36px;
  }

  .editing-glass {
    width: 90%;
    left: -38%;
    bottom: -6%;
  }
}

/* Cream editorial and utility screens keep their original light treatment. */
body:is([data-page="event"], [data-page="news-article"]) {
  background: #f7eddb;
}

body:is([data-page="event"], [data-page="news-article"]) .page-art {
  background: linear-gradient(120deg, #f7eddb, #f4ead7);
}

body:is([data-page="event"], [data-page="news-article"], .utility-page) .site-decoration {
  opacity: .26;
}

.utility-page .site-decoration {
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 22%, transparent 78%, #000);
  mask-image: linear-gradient(90deg, #000, transparent 22%, transparent 78%, #000);
}

.utility-page .decor-orbits { top: 12%; }
.utility-page .decor-accent { display: none; }

@media (max-width: 1100px) and (min-width: 901px) {
  .site-header { min-height: 72px; padding: 8px 18px 8px 8px; gap: 16px; }
  .site-header .brand { flex-basis: 56px; width: 56px; height: 56px; border-radius: 11px; }
  .sidebar-rail { left: -30px; width: calc(100% + 60px); }
  .standalone-rail { left: -28px; width: 20px; opacity: .35; }
}

@media (max-width: 900px) {
  .page-art { background-attachment: scroll; }
  .site-decoration {
    -webkit-mask-image: linear-gradient(to bottom, transparent 520px, #000 640px);
    mask-image: linear-gradient(to bottom, transparent 520px, #000 640px);
  }

  .decor-orbits { width: 340px; right: -235px; top: 700px; opacity: .36; }
  .decor-accent { width: 260px; right: -200px; opacity: .2; }
  .decor-contours { width: 820px; right: -350px; bottom: 130px; opacity: .4; }

  .site-header {
    min-height: 64px;
    padding: 6px 12px 6px 6px;
    gap: 8px;
    border-radius: 14px;
  }

  .site-header .brand {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    min-height: 0;
    align-self: center;
    border-radius: 10px;
  }

  .site-header .brand img { width: 100%; height: 100%; }
  .mobile-account { min-height: 48px; margin: 0; }
  .menu-toggle { padding: 10px 0 10px 4px; min-height: 48px; flex-shrink: 0; }
  .main-navigation { border-radius: 14px; }

  .toc,
  .filter-panel,
  .profile-summary { position: relative; }

  .sidebar-rail {
    top: -26px;
    bottom: 0;
    left: 0;
    width: 100%;
    opacity: .56;
  }

  .contact-details-column .sidebar-rail { left: 0; width: 100%; opacity: .14; }
  .standalone-rail { left: -18px; width: 12px; opacity: .3; }
  .quick-card { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-decoration, .sidebar-rail { animation: none; }
}

@media print {
  .site-decoration, .sidebar-rail, .standalone-rail, .editing-glass { display: none; }
}

/* Revision 3: add accents only in the clear header/footer gaps. */
.top-detail {
  position: absolute;
  top: -30px;
  right: 0;
  width: min(440px, 32%);
  height: 18px;
  background: url("assets/vec-f2ed942373d.svg") right center / cover no-repeat;
  opacity: .62;
  pointer-events: none;
  user-select: none;
}

.site-footer { position: relative; }
.site-footer::before {
  content: "";
  position: absolute;
  top: -66px;
  right: 0;
  width: min(240px, 42%);
  height: 38px;
  background: url("assets/vec-e609b43a4b5.svg") center / contain no-repeat;
  opacity: .58;
  pointer-events: none;
}

.utility-page .top-detail { display: none; }

/* The phone gradient stays as approved. Make the desktop colour transition clearer. */
@media (min-width: 901px) {
  body:not(.utility-page):not([data-page="event"]):not([data-page="news-article"]) {
    background: linear-gradient(105deg, #521710 0%, #7b2b45 72%, #7b2b45 100%);
    background-attachment: fixed;
  }

  body:not(.utility-page):not([data-page="event"]):not([data-page="news-article"]) .page-art {
    background-image:
      radial-gradient(ellipse at 100% 8%, rgb(165 52 63 / 36%), transparent 62%),
      linear-gradient(105deg, #521710 0%, #7b2b45 72%, #7b2b45 100%);
  }
}

/* Give the expanded mobile navigation the same inset surface as the contents panels. */
@media (max-width: 900px) {
  .menu-toggle {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid rgb(247 237 219 / 16%);
    border-radius: 10px;
    background: linear-gradient(140deg, rgb(255 152 79 / 9%), transparent 65%), rgb(128 39 29 / 58%);
    box-shadow: inset 0 4px 12px rgb(0 0 0 / 20%), inset 0 1px 0 rgb(247 237 219 / 8%);
    transition: background-color .15s, border-color .15s, box-shadow .15s;
  }

  .menu-toggle:hover,
  .menu-toggle[aria-expanded="true"] {
    background-color: var(--red);
    border-color: var(--peach);
  }

  .menu-toggle:active { box-shadow: inset 0 3px 10px rgb(0 0 0 / 32%); }

  .main-navigation.is-open {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 20px;
    border: 1px solid rgb(247 237 219 / 25%);
    border-radius: 20px;
    background:
      linear-gradient(145deg, rgb(255 152 79 / 12%), transparent 46%),
      linear-gradient(165deg, transparent 36%, rgb(60 16 4 / 12%)),
      var(--panel);
    box-shadow:
      inset 0 12px 59.1px rgb(0 0 0 / 25%),
      inset 0 1px 0 rgb(247 237 219 / 16%),
      -8px 9px 18px rgb(0 0 0 / 34%);
    max-height: calc(100dvh - 116px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--red) var(--brown);
  }

  .main-navigation.is-open > a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 50px;
    padding: 13px 16px;
    border: 1px solid rgb(247 237 219 / 8%);
    border-radius: 12px;
    background: linear-gradient(135deg, rgb(165 52 63 / 9%), transparent 65%), var(--brown);
    box-shadow:
      inset 0 1px 0 rgb(247 237 219 / 7%),
      inset 0 -12px 22px rgb(0 0 0 / 13%),
      0 3px 8px rgb(0 0 0 / 10%);
    color: var(--cream);
    text-align: center;
    white-space: normal;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
  }

  .main-navigation.is-open > a:hover,
  .main-navigation.is-open > a[aria-current="page"] {
    background: linear-gradient(135deg, rgb(255 152 79 / 9%), transparent 70%), var(--red);
    border-color: var(--peach);
    color: var(--cream);
  }

  .main-navigation.is-open > a:active {
    background: var(--brown);
    box-shadow: inset 0 3px 10px rgb(0 0 0 / 30%);
  }

  .top-detail { width: 38%; height: 15px; top: -25px; opacity: .5; }
}

@media print {
  .top-detail, .site-footer::before { display: none; }
}

/* Secondary actions share the homepage glass button and its existing states. */
.button--glass { -webkit-backdrop-filter: blur(12px); }

/* Frosted cream keeps secondary labels readable on the light editorial screens. */
body:is(.utility-page, [data-page="event"], [data-page="news-article"]) .button--glass {
  color: var(--brown);
  background: linear-gradient(120deg, rgb(247 237 219 / 72%), rgb(60 16 4 / 12%));
  border-color: rgb(60 16 4 / 28%);
  box-shadow: inset 0 1px 0 rgb(247 237 219 / 85%), 0 7px 18px rgb(60 16 4 / 12%);
}

body:is(.utility-page, [data-page="event"], [data-page="news-article"]) .button--glass:hover {
  color: var(--brown);
  background: linear-gradient(120deg, rgb(247 237 219 / 90%), rgb(165 52 63 / 18%));
  border-color: var(--red);
}

body:is(.utility-page, [data-page="event"], [data-page="news-article"]) .button--glass:active {
  background: rgb(60 16 4 / 16%);
  box-shadow: inset 0 2px 7px rgb(60 16 4 / 18%);
}

/* Mirror the About composition by placing the Membership artwork bottom right. */
.membership-benefits-layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.membership-benefits-layout .photo--overlap-right {
  width: 70%;
  margin: 32px auto 36px 0 !important;
}

.photo--overlap-right .editing-glass {
  width: 90%;
  left: auto;
  right: -38%;
  bottom: -6%;
}
