/*
Theme Name: ES2DT
Theme URI: https://eghbalisteel.com
Author: Bahman2D
Author URI: https://t.me/behman2d
Description: A custom WordPress theme with advanced features
tags: persian, personal, dark-mode, responsive, persian-fonts, tailwindcss , persian-date
Version: 1.0
Text Domain: es2dt
*/
/* Tailwind Theme Fonts */
:root {
  --font-sans: "IRANYekanXVF", "IRANYekanX", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

/* Light Mode Tokens */
:root {
  --primary: #40A7E3;
  --secondary: #4A96D6;
  --accent: #E35A62;
  --success: #79CA7B;
  --danger: #CD6297;
  --warning: #E39552;
  --info: #06b6d4;

  --text-primary: #222222;
  --text-secondary: #3e4653;
  --text-muted: #999999;
  --text-inverse: #ffffff;
  --text-link: #026096;
  --text-accent: #b23d45;

  --bg-primary: #f1f1f1;
  --bg-secondary: #ffffff;
  --bg-tertiary: #E2E8F0;
  --bg-dark: #222222;
  --bg-layer: #F1F1F120;
  --bg-hover-inverse: #17212B;

  --border-light: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-dark: rgba(0, 0, 0, 0.3);
  --border-inverse: rgba(255, 255, 255, 0.08);
}

/* Dark Mode Tokens */
.dark {
  --primary: #5EB5F7;
  --secondary: #3380C1;
  --accent: #E35A62;
  --success: #79CA7B;
  --danger: #B64C82;
  --warning: #E39552;
  --info: #06b6d4;

  --text-primary: #F5F5F5;
  --text-secondary: #cbd5e1;
  --text-muted: #7F91A4;
  --text-inverse: #0f172a;
  --text-link: #79bdf8;
  --text-accent: #E35A62;

  --bg-primary: #0E1621;
  --bg-secondary: #0a1927;
  --bg-tertiary: #25303E;
  --bg-dark: #cecece;
  --bg-layer: #0e162180;
  --bg-hover-inverse: #dde4ed;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-dark: rgba(255, 255, 255, 0.3);
  --border-inverse: rgba(0, 0, 0, 0.08);
}

/* ============================
   Custom Fonts
   ============================ */
@font-face {
  font-family: "IRANYekanXVF";
  src:
    url("./assets/fonts/IRANYekanXVF.woff2") format("woff2-variations"),
    url("./assets/fonts/IRANYekanXVF.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@supports not (font-variation-settings: normal) {
  @font-face {
    font-family: "IRANYekanX";
    src: url("./assets/fonts/staticfonts/IRANYekanX-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: "IRANYekanX";
    src: url("./assets/fonts/staticfonts/IRANYekanX-Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
  }
}

/* ============================
   Layout
   ============================ */

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "s"
    "m"
    "f"
    "n";
}

.n { grid-area: n; position: sticky; bottom: 0; }
.m { grid-area: m; }
.a { grid-area: a; }
.c { grid-area: c; }
.b { grid-area: b; }
.h { grid-area: h; }
.f { grid-area: f; }
.s { grid-area: s; }
.cta { grid-area: cta; }

@media (min-width: 768px) {
  .layout {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "n s"
      "n m"
      "n f";
  }

  .n {
    top: 0;
    position: sticky;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
  }
}

/* page layout */
.page-layout {
  grid-template-rows: auto auto 1fr auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "b"
    "cta"
    "c"
    "a";
}

.page-layout > * {
  min-width: 0;
}

@media (min-width: 1536px) {
  .page-layout {
    grid-template-rows: auto auto 1fr;
    grid-template-columns: minmax(780px, 900px) minmax(380px, 900px);
    grid-template-areas:
      "b b"
      "cta cta"
      "c a";
  }
  .a {
    position: sticky;
    top: 10px;
    height: calc(100vh - 82px);
  }
}

/* TOC placement control */
.es2dt-toc--aside { display: none; }
.es2dt-toc--main  { display: block; }

@media (min-width: 1536px) {
  .es2dt-toc--aside { display: block; }
  .es2dt-toc--main  { display: none; }
}

.open-toc {
  max-height: 1000px;
}

/* Navigation */
.open {
  display: flex;
  overflow-x: auto;
  max-height: 50px;
  position: fixed;
  bottom: 75px;
  right: 0;
  align-items: center;
  width: 100%;
  border-top: 1px solid var(--border-inverse);
}

@media (min-width: 768px) {
  .close {
    padding: 0.375rem;
    width: 60px;
  }

  .open {
    display: block;
    max-height: 900px;
    border-top: none;
    position: static;
    right: auto;
    overflow: hidden;
  }
}

.open-2 {
  display: flex;
  overflow-x: auto;
  max-height: 50px;
  position: fixed;
  bottom: 120.5px;
  right: 0;
  align-items: center;
  width: 100%;
  border-top: 1px solid var(--border-inverse);
}

@media (min-width: 768px) {
  .open-2 {
    display: block;
    max-height: 800px;
    border-top: none;
    position: static;
    right: auto;
    overflow: hidden;
  }
}

.rotate svg:last-child {
  transform: rotate(180deg);
}

#theme-toggle svg:nth-of-type(1) {
  display: none;
}

body.dark #theme-toggle svg:nth-of-type(2) {
  display: none;
}

body.dark #theme-toggle svg:nth-of-type(1) {
  display: inline-block;
}

/* alloy selector layout */
.alloy-selector-layout {
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "h"
    "b"
    "c";
}

/* Prevent CLS in header area */
header.s {
  min-height: 70vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.s > header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    
  overflow: hidden;
}

.s figure img {
  width: 100%;
  height: 70vh;
  object-fit: cover;
}

.s figure {
  margin: 0;
}
