/*
 Theme Name: Twenty Twenty-Five Child
 Theme URI: https://mars-wiki.datalink.com.gr/
 Description: Child theme for the M.A.R.S. Wiki
 Author: Datalink
 Template: twentytwentyfive
 Version: 1.0.1
*/

/* =========================================================
   M.A.R.S. Wiki — documentation app shell
   Applies only when the .mars-wiki-layout wrapper exists.
   ========================================================= */

html:has(.mars-wiki-layout),
body:has(.mars-wiki-layout) {
  height: 100%;
  overflow: hidden;
}

.mars-wiki-layout {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) 42px;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #ffffff;
  color: #111827;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", sans-serif;
}

/* Top admin header */
.mars-wiki-layout__header {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* 30% TOC / 70% reading panel */
.mars-wiki-layout__body {
  display: grid;
  grid-template-columns: minmax(260px, 30%) minmax(0, 70%);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Independent TOC scroll */
.mars-wiki-layout__toc {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 20px;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  scrollbar-gutter: stable;
}

/* Label created from functions.php */
.mars-wiki-layout__toc-label {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

/* Independent article scroll */
.mars-wiki-layout__content {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 42px clamp(24px, 5vw, 72px) 56px;
  background: #ffffff;
  scrollbar-gutter: stable;
}

/* Reading width: content inside the right pane, not the pane itself */
.mars-wiki-layout__content > .wp-block-post-content {
  width: min(100%, 900px);
  margin: 0 auto;
}

/* Footer utility bar */
.mars-wiki-layout__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 24px;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 12px;
}

/* Easy Table of Contents — free version overrides */
.mars-wiki-layout__toc .ez-toc-container {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.mars-wiki-layout__toc .ez-toc-title-container {
  margin: 0 0 8px;
}

.mars-wiki-layout__toc .ez-toc-title {
  display: none;
}

.mars-wiki-layout__toc .ez-toc-list,
.mars-wiki-layout__toc .ez-toc-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mars-wiki-layout__toc .ez-toc-list ul {
  padding-left: 14px;
}

.mars-wiki-layout__toc .ez-toc-list-item {
  margin: 0;
}

.mars-wiki-layout__toc .ez-toc-link {
  display: block;
  padding: 6px 8px;
  border-radius: 4px;
  color: #374151;
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}

.mars-wiki-layout__toc .ez-toc-link:hover,
.mars-wiki-layout__toc .ez-toc-link:focus {
  background: #eaf2ff;
  color: #1d4ed8;
  outline: none;
}

/* Article typography */
.mars-wiki-layout__content .wp-block-post-content {
  font-size: 16px;
  line-height: 1.7;
}

.mars-wiki-layout__content .wp-block-post-content > :first-child {
  margin-top: 0;
}

.mars-wiki-layout__content h1,
.mars-wiki-layout__content h2,
.mars-wiki-layout__content h3,
.mars-wiki-layout__content h4 {
  scroll-margin-top: 24px;
  color: #111827;
  letter-spacing: -0.02em;
}

.mars-wiki-layout__content h1 {
  margin: 0 0 28px;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.15;
}

.mars-wiki-layout__content h2 {
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 25px;
  line-height: 1.25;
}

.mars-wiki-layout__content h3 {
  margin: 32px 0 12px;
  font-size: 20px;
  line-height: 1.35;
}

.mars-wiki-layout__content h4 {
  margin: 24px 0 10px;
  font-size: 17px;
  line-height: 1.4;
}

.mars-wiki-layout__content p,
.mars-wiki-layout__content ul,
.mars-wiki-layout__content ol,
.mars-wiki-layout__content table {
  margin-top: 0;
  margin-bottom: 18px;
}

.mars-wiki-layout__content a {
  color: #2563eb;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.mars-wiki-layout__content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mars-wiki-layout__content th,
.mars-wiki-layout__content td {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.mars-wiki-layout__content th {
  background: #f8fafc;
  font-weight: 650;
}

/* Responsive: TOC precedes article and uses natural page flow */
@media (max-width: 782px) {
  html:has(.mars-wiki-layout),
  body:has(.mars-wiki-layout) {
    height: auto;
    overflow: auto;
  }

  .mars-wiki-layout {
    position: relative;
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .mars-wiki-layout__header,
  .mars-wiki-layout__footer {
    min-height: 52px;
  }

  .mars-wiki-layout__body {
    display: block;
    overflow: visible;
  }

  .mars-wiki-layout__toc,
  .mars-wiki-layout__content {
    overflow: visible;
  }

  .mars-wiki-layout__toc {
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .mars-wiki-layout__content {
    padding: 32px 20px 48px;
  }

  .mars-wiki-layout__footer {
    padding: 12px 20px;
  }
}