/* RSDWTools shared site shell.
   Provides the fixed header, tools dropdown, landing page styles,
   and footer. Tool-specific styles still live in styles.css /
   shared-header.css and per-tool sections inside styles.css.

   This file is loaded BEFORE styles.css so tool-specific overrides
   can take precedence where needed.
*/

:root {
  /* Warm palette inherited from the original /docs site. */
  --rsdw-bg: #0c0c0f;
  --rsdw-surface: rgba(20, 20, 24, 0.78);
  --rsdw-surface-2: rgba(30, 30, 35, 0.82);
  --rsdw-scroll-track: #15151a;
  --rsdw-scroll-thumb: #4a4133;
  --rsdw-scroll-thumb-hover: #6a5b46;
  --rsdw-text: #f5f1e8;
  --rsdw-muted: #cfc7b8;
  --rsdw-accent: #e0c896;
  --rsdw-accent-soft: rgba(224, 200, 150, 0.22);
  --rsdw-border: rgba(180, 164, 140, 0.55);
  --rsdw-border-strong: rgba(180, 164, 140, 0.9);
}

@font-face {
  font-family: "SofiaSansCustom";
  src: url("https://fonts.gstatic.com/s/sofiasans/v20/Yq6T-LCVXSLy9uPBwlATrORKkzApcb8.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

html.rsdw,
html.rsdw body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: "SofiaSansCustom", "Sofia Sans", system-ui, sans-serif;
  color: var(--rsdw-text);
  scrollbar-color: var(--rsdw-scroll-thumb) var(--rsdw-scroll-track);
  scrollbar-width: thin;
}

html.rsdw body {
  background:
    linear-gradient(rgba(12, 12, 15, 0.55), rgba(12, 12, 15, 0.85)),
    url("/shared/assets/bg.jpg") center/cover no-repeat fixed,
    var(--rsdw-bg);
}

html.rsdw * {
  box-sizing: border-box;
}

html.rsdw ::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

html.rsdw ::-webkit-scrollbar-track {
  background: var(--rsdw-scroll-track);
}

html.rsdw ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #344a65 0%, var(--rsdw-scroll-thumb) 100%);
  border-radius: 999px;
  border: 2px solid var(--rsdw-scroll-track);
}

html.rsdw ::-webkit-scrollbar-thumb:hover {
  background: var(--rsdw-scroll-thumb-hover);
}

html.rsdw ::-webkit-scrollbar-corner {
  background: var(--rsdw-scroll-track);
}

/* === Header === */

.rsdw-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--rsdw-border);
  background: rgba(12, 12, 15, 0.88);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

.rsdw-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.rsdw-brand__logo {
  width: 40px;
  height: 40px;
  border: 1px solid var(--rsdw-border);
  border-radius: 10px;
  background: rgba(20, 20, 24, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.rsdw-brand__logo img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.rsdw-brand__title {
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  font-weight: 700;
  white-space: nowrap;
  color: var(--rsdw-text);
  text-decoration: none;
}

.rsdw-page-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Crimson Pro", "Sofia Sans", serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rsdw-text);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  pointer-events: none;
}

.rsdw-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rsdw-iconbtn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--rsdw-border);
  border-radius: 10px;
  background: rgba(20, 20, 24, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.rsdw-iconbtn:hover {
  border-color: var(--rsdw-border-strong);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.rsdw-iconbtn img {
  width: 20px;
  height: 20px;
  display: block;
}

.rsdw-tools {
  position: relative;
}

.rsdw-tools__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 180px;
  border: 1px solid var(--rsdw-border);
  border-radius: 10px;
  background: rgba(18, 18, 22, 0.98);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 1001;
}

.rsdw-tools__menu[hidden] {
  display: none;
}

.rsdw-tools__menu a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.8rem;
  color: var(--rsdw-text);
  text-decoration: none;
  font-size: 0.9rem;
}

.rsdw-tools__menu a img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.rsdw-tools__menu a:hover,
.rsdw-tools__menu a.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf0;
}

.rsdw-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === Page body offset (so tool content clears the fixed header) === */

html.rsdw body {
  padding-top: 88px;
}

/* Tool pages that use map-style fullscreen layouts can opt out by
   adding the `rsdw-no-offset` class to <body>. */
html.rsdw body.rsdw-no-offset {
  padding-top: 0;
}

/* === Footer === */

.rsdw-footer {
  border-top: 1px solid var(--rsdw-border);
  color: var(--rsdw-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 0.9rem 1rem 1.1rem;
  margin-top: 2rem;
}

.rsdw-footer p {
  margin: 0.2rem 0;
}

.rsdw-footer a {
  color: var(--rsdw-accent);
  text-decoration: none;
}

.rsdw-footer a:hover {
  text-decoration: underline;
}

/* === Landing page === */

.rsdw-landing {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
  padding: 1rem;
}

.rsdw-landing__title {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--rsdw-text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.rsdw-landing__subtitle {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--rsdw-muted);
  max-width: 56rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.rsdw-landing__tools {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  width: 100%;
  max-width: 980px;
}

.rsdw-landing__tile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--rsdw-border);
  border-radius: 12px;
  background: var(--rsdw-surface);
  color: var(--rsdw-text);
  text-decoration: none;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.rsdw-landing__tile:hover {
  border-color: var(--rsdw-accent);
  background: var(--rsdw-surface-2);
  transform: translateY(-1px);
}

.rsdw-landing__tile.is-hidden {
  display: none;
}

.rsdw-landing__tile img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.rsdw-landing__tile-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.rsdw-landing__tile-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.rsdw-landing__tile-desc {
  font-size: 0.83rem;
  color: var(--rsdw-muted);
  line-height: 1.3;
}

.rsdw-landing__empty {
  margin: 0.6rem 0 0;
  color: var(--rsdw-muted);
  font-size: 0.9rem;
}

.rsdw-landing__empty[hidden] {
  display: none;
}

/* === Tool page wrapper helpers ===
   When a tool page uses the existing `.item-editor-wrapper` etc. layouts
   from styles.css, the only thing the shell needs to do is reset body
   background and clear the legacy framer-page classes' background junk.
*/

/* Tool pages keep the same warm bg as the landing.
   (Override removed; body background already set above.) */

/* Hide legacy in-page header titles (the "EDITOR" big logo line etc.)
   that were used in the framer build. The new header replaces them. */
html.rsdw body[data-tool] .landing-logo__editor-line {
  display: none;
}

/* Mobile / small */
@media (max-width: 720px) {
  .rsdw-page-title {
    display: none;
  }
  .rsdw-brand__title {
    font-size: 1.1rem;
  }
}

/* Appended for builds page (search bar, gallery, lightbox) */

.rsdw-tools__menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: currentColor;
}
.rsdw-tools__menu-icon svg {
  width: 18px;
  height: 18px;
}
