/* =========================================================
   slavetohim.com — Standard, Responsive, Public-ready CSS
   One file, no redundant overrides. Replace your site.css.
   ========================================================= */

/* ---------- Theme & fonts ---------- */
:root{
  --bg:#0c0e12;
  --surface:#141821;
  --border:#23293a;
  --text:#e8ecf1;
  --muted:#a9b2c1;
  --accent:#4da3ff;
  --danger:#ff6b6b;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --arabic: "Scheherazade New", "Amiri", "Noto Naskh Arabic", "Noto Kufi Arabic", system-ui, sans-serif;

  /* Typography scale (sensible defaults) */
  --scale-base: 18px;  /* body text */
  --scale-step: 1.25;  /* heading growth ratio */

  /* Header & nav */
  --icon-lg: 48px;
  --nav-size: 16px;

  /* Sidebar */
  --sidebar-title: 20px;
  --sidebar-link: 16px;
  --sidebar-sub: 13px;

  /* Small subtitle under site title */
  --subtitle-size: 14px;

  /* Layout widths */
  --sidebar-min: 260px;
  --sidebar-max: 320px;
}

/* ---------- Resets / base ---------- */
*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0;
  background:linear-gradient(180deg, #0b0d11 0%, #0f1320 100%);
  color:var(--text);
  font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans", Arial, var(--arabic), sans-serif;
  font-size:var(--scale-base);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
a{ color:var(--accent); text-decoration:none }
a:hover{ text-decoration:underline }

/* ---------- Header ---------- */
.site-header{
  display:grid;
  grid-template-columns: auto 1fr auto; /* brand | nav | counter */
  gap:16px;
  align-items:center;
  padding:14px 20px;
  border-bottom:1px solid var(--border);
  background:rgba(0,0,0,0.2);
  position:sticky; top:0; backdrop-filter: blur(8px);
}
.brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.logo{ font-size:var(--icon-lg); line-height:1; }
.titles h1{
  font-size: calc(var(--scale-base) * var(--scale-step) * var(--scale-step)); /* ~25px */
  line-height:1.2;
  margin:0;
  white-space:nowrap;           /* keep site name on one line */
  overflow-wrap:normal;
  word-break:keep-all;
}
.subtitle{ margin:2px 0 0; color:var(--muted); font-size:var(--subtitle-size); }
.nav{
  display:flex; gap:10px; flex-wrap:wrap; justify-self:center;
}
.nav a{
  font-size:var(--nav-size);
  padding:8px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#0f1320;
  white-space:nowrap;
}
.nav a.active{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset }
.counter{ justify-self:end; font-family:var(--mono) }
.counter strong{ font-size:18px; margin-inline-start:6px }

/* ---------- Generic containers for inner pages ---------- */
.container{ max-width:1100px; margin:24px auto; padding:0 16px }
.container.narrow{ max-width:800px }

/* ---------- Cards, forms, buttons ---------- */
.card{
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:14px;
  padding:16px;
  margin:16px 0;
  box-shadow:0 4px 20px rgba(0,0,0,0.2);
}
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:16px }
.editable{
  min-height:80px; padding:12px; border-radius:10px;
  border:1px dashed var(--border); background:rgba(255,255,255,0.02);
}
.actions{ display:flex; gap:8px; margin-top:10px }
.btn{
  border:1px solid var(--border); background:#161c29; color:var(--text);
  padding:8px 12px; border-radius:10px; cursor:pointer;
  min-height:40px;
}
.btn:hover{ border-color:var(--accent) }
.btn.subtle{ opacity:.9 }

.form{ display:grid; gap:12px }
.form-row{ display:grid; gap:6px }
.form-row input, .form-row textarea{
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--border);
  background:#0f1320; color:var(--text); font-family:inherit;
}
.status{ margin-top:8px }
.muted{ color:var(--muted) }
.small{ font-size:13px }

/* ---------- Footer ---------- */
.site-footer{
  border-top:1px solid var(--border); padding:16px 20px; color:var(--muted); text-align:center;
  margin-top:40px;
}

/* ---------- Landing layout: content + right sidebar ---------- */
/* Desktop/laptop default: two columns */
.layout{
  display:grid;
  grid-template-columns: minmax(0,1fr) minmax(var(--sidebar-min), var(--sidebar-max));
  gap:16px;
  padding:16px 0 24px 0;
  min-height:calc(100vh - 72px);
}
.content{ grid-column:1; padding-inline-start:16px; }
.sidebar{ grid-column:2; padding-inline-end:16px; position:sticky; top:80px; }

/* Sidebar titles and links (high contrast) */
.sidebar-title{ margin:16px 0 10px 0; font-size:var(--sidebar-title); color:var(--text) }
.sidebar-sub{ margin:18px 0 8px 0; color:var(--text); font-size:14px }

.app-link{
  display:block; width:100%; text-align:start;
  border:1px solid #334155; border-radius:14px;
  padding:12px 14px; background:#0b1120;
  transition:transform .08s ease, border-color .15s ease, background .15s ease;
  cursor:pointer; margin-bottom:10px; min-height:44px;
}
.app-link:hover{ transform:translateY(-2px); border-color:#60a5fa; background:#111827 }
.app-link strong{ font-size:var(--sidebar-link); color:var(--text) }
.app-link .sub{ font-size:var(--sidebar-sub); color:#cbd5e1; opacity:.95; margin-top:4px }
.app-link.disabled{ opacity:.9; cursor:not-allowed }
.app-link.disabled strong{ color:#e2e8f0 }
.app-link.disabled .sub{ color:#94a3b8 }

/* ---------- Headings ---------- */
h1{ font-size:calc(var(--scale-base) * var(--scale-step) * var(--scale-step)); line-height:1.2; margin:0 0 8px }
h2{ font-size:calc(var(--scale-base) * var(--scale-step)); line-height:1.3; margin:0 0 8px }
h3{ font-size:calc(var(--scale-base) * 1.0); line-height:1.35; margin:12px 0 6px }

/* Arabic readability */
[dir="rtl"]{ font-family:var(--arabic); line-height:1.8 }

/* ---------- Responsive rules (standard public breakpoints) ---------- */
/* ≥1200px: comfortable wide screens — current layout already fits well */

/* 992px–1199px: laptops/tablets landscape — keep two columns, slightly narrower sidebar */
@media (max-width: 1199.98px){
  :root{ --sidebar-min: 240px; --sidebar-max: 300px; }
}

/* 768px–991px: tablets — still two columns if space allows */
@media (max-width: 991.98px){
  .site-header{ grid-template-columns: auto 1fr auto; }
  .nav{ gap:8px }
}

/* <768px: phones / small tablets — stack layout & make nav scrollable */
@media (max-width: 767.98px){
  .site-header{
    grid-template-columns: 1fr;
    row-gap:8px;
    padding:12px 14px;
  }
  .nav{
    justify-self:start;
    overflow-x:auto;
    white-space:nowrap;
    -webkit-overflow-scrolling:touch;
  }
  .layout{ grid-template-columns: 1fr; }
  .content{ grid-column:1; padding-inline:14px; }
  .sidebar{ grid-column:1; padding-inline:14px; position:static; }
  .grid-2{ grid-template-columns:1fr; }
}

/* ---------- Misc usability ---------- */
p, .editable{ overflow-wrap:anywhere }
h1,h2,h3,.nav a{ overflow-wrap:normal; word-break:normal }
*{ scroll-behavior:smooth }
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior:auto; transition:none !important; }
}
