/* =========================================================================
   PERSIAN BOOTSTRAP SHELL  —  aimatin.com
   Unified site shell (navbar + mobile drawer + footer) for the blog.
   Ported 1:1 from the main landing page (index.html) so every article
   shares the exact same header, logo, navigation and footer as the site.

   Design notes:
   - Nav rules are scoped under `.navbar`, footer rules under `.footer`,
     so legacy articles still using `.glass-nav` / `.dark-footer` are
     untouched until they are migrated.
   - Tokens here use names that do NOT collide with prompt.css
     (prompt.css owns --primary-green / --radius-* for article content).
   ========================================================================= */

:root {
    --primary: #066ac9;
    --primary-deep: #0555a1;
    --primary-soft: rgba(6, 106, 201, 0.1);
    --secondary: #6f42c1;
    --dark: #1a1d21;
    --dark-2: #2d3239;
    --line: #ebedf0;
    --line-2: #d8dce0;
    --bg-soft: #f6f8fb;
    --muted: #8a8f96;
    --red: #e84353;
    --shadow-primary: 0 12px 28px -10px rgba(6, 106, 201, 0.5);
    --font: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    --gutter: clamp(16px, 3vw, 32px);
}

/* keep anchored sections clear of the sticky bar */
:where(h1, h2, h3, h4, h5, h6, section, header, article)[id] { scroll-margin-top: 96px; }

/* ---------------------------------------------------------------- BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 0.6rem;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    line-height: 1.3;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #074ea6 100%);
    color: #fff;
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 30px -10px rgba(6,106,201,.55); }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

/* ----------------------------------------------------------------- NAVBAR */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
    transition: box-shadow .3s ease, padding .3s ease;
}
.navbar.scrolled { box-shadow: 0 4px 20px -10px rgba(15,23,42,.1); padding: 10px 0; }

.navbar .nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.navbar .brand { display: inline-flex; align-items: center; gap: 12px; }
.navbar .brand-icon {
    width: 46px; height: 46px;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, rgba(6,106,201,.1) 0%, rgba(122,69,232,.1) 100%);
    display: grid; place-items: center;
    transition: transform .3s ease;
    border: 1px solid rgba(6,106,201,.08);
    flex-shrink: 0;
}
.navbar .brand:hover .brand-icon { transform: rotate(-8deg) scale(1.05); }
.navbar .brand-icon img { width: 32px; height: 32px; border-radius: 7px; }
.navbar .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.navbar .brand-text .name { font-size: 18px; font-weight: 800; color: var(--dark); }
.navbar .brand-text .academy { font-size: 12px; font-weight: 500; color: var(--primary); margin-top: 2px; }

.navbar .nav-links {
    display: flex; gap: 6px; align-items: center;
    list-style: none; margin: 0; padding: 0;
}
.navbar .nav-links a {
    font-size: 15px; font-weight: 500;
    color: var(--dark-2);
    padding: 8px 14px;
    border-radius: 0.6rem;
    transition: color .2s ease, background .2s ease;
    position: relative;
}
.navbar .nav-links a:hover { color: var(--primary); background: var(--primary-soft); }
.navbar .nav-links a.active { color: var(--primary); }
.navbar .nav-links a.active::after {
    content: ""; position: absolute; bottom: 0;
    inset-inline-start: 14px; inset-inline-end: 14px;
    height: 2px; border-radius: 2px; background: var(--primary);
}

.navbar .nav-actions { display: flex; align-items: center; gap: 12px; }

/* burger */
.navbar .burger {
    display: none;
    width: 44px; height: 44px;
    border-radius: 0.6rem;
    background: var(--primary-soft);
    border: none; position: relative; padding: 0;
}
.navbar .burger span {
    position: absolute; left: 50%; transform: translateX(-50%);
    width: 20px; height: 2px; background: var(--primary);
    border-radius: 2px; transition: transform .3s ease, opacity .2s ease, top .3s ease;
}
.navbar .burger span:nth-child(1) { top: 15px; }
.navbar .burger span:nth-child(2) { top: 21px; }
.navbar .burger span:nth-child(3) { top: 27px; }
.navbar .burger.active span:nth-child(1) { top: 21px; transform: translateX(-50%) rotate(45deg); }
.navbar .burger.active span:nth-child(2) { opacity: 0; }
.navbar .burger.active span:nth-child(3) { top: 21px; transform: translateX(-50%) rotate(-45deg); }

/* ----------------------------------------------------- MOBILE NAV OVERLAY */
.nav-overlay {
    position: fixed; inset: 0;
    background: #fff;
    z-index: 99;
    padding: 100px var(--gutter) 40px;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.6,.05,.1,1);
    display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto;
}
html[dir="rtl"] .nav-overlay,
body[dir="rtl"] .nav-overlay { transform: translateX(-100%); }
.nav-overlay.active { transform: translateX(0) !important; }
.nav-overlay a {
    font-size: 18px; font-weight: 700;
    padding: 16px 20px; border-radius: 0.6rem;
    color: var(--dark); background: var(--bg-soft);
    display: flex; justify-content: space-between; align-items: center;
}
.nav-overlay a:hover { background: var(--primary-soft); color: var(--primary); }
.nav-overlay a i { color: var(--muted); font-size: 13px; }
.nav-overlay a:hover i { color: var(--primary); }
.nav-overlay .nav-cta-mobile {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; margin-top: 12px; box-shadow: var(--shadow-primary);
}
.nav-overlay .nav-cta-mobile:hover { color: #fff; }
.nav-overlay .nav-cta-mobile i { color: #fff; }

/* ----------------------------------------------------------------- FOOTER */
.footer {
    background: linear-gradient(180deg, #1a1d21 0%, #0f1316 100%);
    color: rgba(255,255,255,.7);
    padding: 64px 0 24px;
    position: relative;
    overflow: hidden;
    margin-top: 80px;
}
.footer::before {
    content: ""; position: absolute; top: 0;
    inset-inline-start: 0; inset-inline-end: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
}
.footer .footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    align-items: start;
}
.footer .brand { display: inline-flex; align-items: center; gap: 12px; }
.footer .brand-icon {
    width: 46px; height: 46px; border-radius: 0.6rem;
    background: rgba(6,106,201,.2);
    border: 1px solid rgba(255,255,255,.08);
    display: grid; place-items: center; flex-shrink: 0;
}
.footer .brand-icon img { width: 32px; height: 32px; border-radius: 7px; }
.footer .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.footer .brand-text .name { font-size: 18px; font-weight: 800; color: #fff; }
.footer .brand-text .academy { font-size: 12px; font-weight: 500; color: var(--primary); margin-top: 2px; }
.footer .footer-brand p {
    margin-top: 16px; color: rgba(255,255,255,.6);
    font-size: 14px; line-height: 1.8; max-width: 360px;
}
.footer h4 {
    color: #fff; font-size: 14px; font-weight: 800;
    margin: 0 0 16px; letter-spacing: .02em;
}
.footer .footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer .footer-links a {
    color: rgba(255,255,255,.65); font-size: 14px;
    transition: color .2s ease, transform .2s ease;
    display: inline-flex; align-items: center; gap: 8px;
}
.footer .footer-links a:hover { color: var(--primary); transform: translateX(-4px); }
.footer .footer-links a i { font-size: 9px; color: var(--primary); opacity: .6; }
.footer .footer-social { display: flex; gap: 10px; margin-bottom: 24px; }
.footer .social-btn {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255,255,255,.08); color: #fff;
    display: grid; place-items: center; font-size: 16px;
    transition: transform .2s ease, background .2s ease;
}
.footer .social-btn:hover { transform: translateY(-4px); color: #fff; }
.footer .social-btn.tg:hover { background: #229ed9; }
.footer .social-btn.ig:hover { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.footer .social-btn.li:hover { background: #0077b5; }
.footer .footer-bottom {
    padding-top: 24px; display: flex; justify-content: space-between;
    align-items: center; font-size: 13px; color: rgba(255,255,255,.5);
    flex-wrap: wrap; gap: 12px;
}
.footer .footer-bottom .heart { color: var(--red); }

/* ------------------------------------------------------------- RESPONSIVE */
@media (max-width: 980px) {
    .navbar .nav-links { display: none; }
    .navbar .nav-actions .btn-primary { display: none; }
    .navbar .burger { display: inline-grid; }
    .footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 640px) {
    .footer .footer-grid { grid-template-columns: 1fr; }
    .footer .footer-bottom { justify-content: center; text-align: center; }
}
@media (max-width: 480px) {
    .navbar .brand-text .name { font-size: 16px; }
    .navbar .brand-icon { width: 42px; height: 42px; }
}
