/* 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; }
}
