/* 7-Zip reference site — teal / slate theme (colors + type only; layout unchanged) */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg-page: #e8f2f3;
  --bg-panel: #ffffff;
  --sidebar-bg: #0c2a2e;
  --sidebar-hover: #154a52;
  --sidebar-active: #1c6570;
  --text: #0f2224;
  --text-muted: #3a555a;
  --accent: #c25622;
  --accent-soft: #f2d8cc;
  --accent-on-soft: #5c2a14;
  --border: #c5d9dc;
  --shadow: 0 12px 40px rgba(12, 42, 46, 0.1);
  --radius: 14px;
  --sidebar-w: 260px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-page);
}

a {
  color: #156b75;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #0d4a52;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #123a40 0%, var(--sidebar-bg) 45%, #061a1d 100%);
  color: #e8e0f0;
  padding: 1.5rem 0;
  z-index: 20;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img {
  width: 44px;
  height: auto;
  max-height: 44px;
  border-radius: 10px;
  object-fit: contain;
}

.sidebar-brand span {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.75rem 0.75rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  color: #d8cfe8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav a[aria-current="page"] {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(194, 86, 34, 0.35);
}

.nav-ico {
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.9rem;
}

.sidebar-foot {
  margin-top: auto;
  padding: 1rem 1.25rem 1.5rem;
  font-size: 0.75rem;
  color: rgba(232, 224, 240, 0.45);
  line-height: 1.4;
  flex-shrink: 0;
}

/* ----- Main column ----- */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.5rem 1.75rem;
  background: rgba(232, 242, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-header-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.top-header-logo img {
  width: 48px;
  height: auto;
  max-height: 48px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  object-fit: contain;
}

.top-header-titles .brand-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.top-header-titles p {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.content {
  flex: 1;
  padding: 1.75rem 1.75rem 3rem;
  max-width: 900px;
}

/* ----- Typography blocks ----- */
.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 0;
}

.card {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.feature-tile {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.feature-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-tile h2,
.feature-tile h3,
.feature-tile .feature-tile-heading {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.feature-tile p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.content-shot {
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-panel);
}

.content-shot img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: bottom;
}

.content-shot figcaption {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.content-shot--compact {
  max-width: 720px;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  margin-bottom: 0.75rem;
}

/* ----- Tables & lists ----- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.format-list {
  columns: 2;
  column-gap: 2rem;
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .format-list {
    columns: 1;
  }
}

/* ----- Download buttons (local media only) ----- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #d9733a, var(--accent));
  color: #1a0f08;
  box-shadow: 0 4px 14px rgba(194, 86, 34, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.05);
  color: #1a0f08;
}

.btn-secondary {
  background: var(--sidebar-bg);
  color: #f0e8ff;
}

.btn-secondary:hover {
  filter: brightness(1.12);
  color: #fff;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.callout {
  background: #dceef0;
  border-left: 4px solid #156b75;
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  margin: 1rem 0;
}

details.faq-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
}

details.faq-item summary {
  font-weight: 600;
  cursor: pointer;
}

details.faq-item p {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ----- Mobile ----- */
.menu-toggle {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 30;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--sidebar-bg);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

@media (max-width: 880px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: min(280px, 85vw);
  }

  html[dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.25);
  }

  html[dir="rtl"] body.nav-open .sidebar {
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.25);
  }

  .main-wrap {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .top-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .content {
    padding: 1.25rem 1rem 4.5rem;
  }
}

body.nav-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 15;
}

@media (min-width: 881px) {
  body.nav-open::after {
    display: none;
  }
}

/* ----- Accessibility & SEO UX ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--sidebar-bg);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.page-heading {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.breadcrumbs {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumbs ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--border);
  font-weight: 400;
}

.breadcrumbs a {
  font-weight: 500;
}

.breadcrumbs [aria-current="page"] {
  font-weight: 600;
  color: var(--text);
}

a:focus-visible,
button:focus-visible,
.skip-link:focus-visible,
details.faq-item summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ----- Technical code blocks (SEO / documentation) ----- */
.code-snippet {
  margin-bottom: 1.25rem;
  padding: 0;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.code-snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: #dceef0;
  border-bottom: 1px solid var(--border);
}

.code-snippet-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.btn-copy {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-copy:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.btn-copy:disabled {
  opacity: 0.85;
  cursor: default;
}

.code-snippet pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow: auto;
  max-height: 22rem;
  background: #0a2226;
  color: #e8e0f0;
  font-size: 0.85rem;
  line-height: 1.5;
  border-radius: 0 0 var(--radius) var(--radius);
}

.code-snippet code {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  white-space: pre;
}

/* ----- Language switcher + locale layout ----- */
.lang-switcher {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.lang-switcher__link {
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.lang-switcher__link:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-panel);
}

.lang-switcher__link.is-current {
  color: var(--accent-on-soft);
  background: var(--accent-soft);
  border-color: rgba(194, 86, 34, 0.45);
}

.sidebar nav.lang-switcher--sidebar {
  margin: 0.75rem 1.25rem 0;
  padding-top: 0.75rem;
  padding-bottom: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 0;
  width: calc(100% - 2.5rem);
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.sidebar nav.lang-switcher--sidebar .lang-switcher__link {
  color: #c8bdd8;
}

.sidebar nav.lang-switcher--sidebar .lang-switcher__link:hover {
  color: #fff;
  background: var(--sidebar-hover);
}

.sidebar nav.lang-switcher--sidebar .lang-switcher__link.is-current {
  color: #fff;
  background: var(--sidebar-active);
  border-color: rgba(194, 86, 34, 0.35);
}

/* Simplified Chinese: slightly open tracking in sidebar nav */
.lang-cn .sidebar-nav a {
  letter-spacing: 0.06em;
}

/* Russian: more comfortable tap targets */
.lang-ru .btn {
  padding: 0.85rem 1.4rem;
}

.lang-ru .sidebar-nav a {
  padding: 0.8rem 1.15rem;
}

/* Arabic RTL: mirror shell layout */
html[dir="rtl"] .layout {
  flex-direction: row-reverse;
}

html[dir="rtl"] .main-wrap {
  margin-left: 0;
  margin-right: var(--sidebar-w);
}

html[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

html[dir="rtl"] .lang-switcher {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .breadcrumbs li:not(:last-child)::after {
  margin-left: 0;
  margin-right: 0.35rem;
}

html[dir="rtl"] .skip-link:focus {
  left: auto;
  right: 0.75rem;
}

@media (max-width: 880px) {
  html[dir="rtl"] .main-wrap {
    margin-right: 0;
  }
}

/* ----- Fixed corner: language slide-over + direct download ----- */
.corner-fab {
  position: fixed;
  z-index: 201;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(12, 42, 46, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.corner-fab:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 26px rgba(12, 42, 46, 0.28);
}

.corner-fab--lang {
  top: 1rem;
  right: 1rem;
  background: var(--sidebar-bg);
  color: #f0e8ff;
}

.corner-fab--download {
  bottom: 1rem;
  left: auto;
  right: 1rem;
  background: linear-gradient(135deg, #d9733a, var(--accent));
  color: #1a0f08;
  min-width: 9.25rem;
  min-height: 3.35rem;
  padding: 0.65rem 1.15rem;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 999px;
  max-width: 12rem;
  text-align: center;
}

/* Mobile: keep clear of fixed menu button (bottom-right, 52px) */
@media (max-width: 880px) {
  .corner-fab--download {
    right: calc(1rem + 52px + 0.75rem);
  }
}

html[dir="rtl"] .corner-fab--lang {
  right: auto;
  left: 1rem;
}

html[dir="rtl"] .corner-fab--download {
  right: auto;
  left: 1rem;
}

.corner-lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.corner-lang-overlay.is-open {
  pointer-events: auto;
}

/* Full-viewport dimmer so main column + sidebar are covered evenly */
.corner-lang-overlay__shade {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.32);
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.corner-lang-overlay.is-open .corner-lang-overlay__shade {
  opacity: 1;
}

/* Compact dropdown under globe: fade + drop (no slide toward sidebar) */
.corner-lang-sheet {
  position: absolute;
  z-index: 1;
  top: max(4.35rem, calc(env(safe-area-inset-top, 0px) + 3.75rem));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  width: min(13.75rem, calc(100vw - 1.5rem));
  max-height: min(22rem, calc(100vh - 5.5rem));
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(12, 42, 46, 0.05);
  transform: translateY(-10px) scale(0.97);
  transform-origin: top right;
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.corner-lang-overlay.is-open .corner-lang-sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}

html[dir="rtl"] .corner-lang-sheet {
  right: auto;
  left: max(0.75rem, env(safe-area-inset-left, 0px));
  transform-origin: top left;
}

.corner-lang-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem 0.55rem 0.85rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: #dceef0;
}

.corner-lang-sheet__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
}

.corner-lang-sheet__close {
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}

.corner-lang-sheet__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.corner-lang-sheet__nav {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.corner-lang-sheet__link {
  display: block;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.corner-lang-sheet__link:last-child {
  border-bottom: none;
}

.corner-lang-sheet__link:hover {
  background: var(--bg-page);
}

.corner-lang-sheet__link.is-current {
  background: var(--accent-soft);
  color: var(--accent-on-soft);
}

body.corner-lang-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .feature-tile,
  .btn {
    transition: none;
  }

  .feature-tile:hover {
    transform: none;
  }

  .corner-lang-sheet {
    transition: none;
  }

  .corner-lang-overlay__shade {
    transition: none;
  }

  .corner-fab {
    transition: none;
  }
}
