/*
Theme Name: Kharj Negar Wise
Theme URI: https://blog-stage.raminakhavan.ir
Description: Theme for Kharj Negar Blog exactly matching Kharj Negar Design Language.
Author: Hermes Agent & Ramin Akhavan
Version: 1.1.0
Text Domain: kharjnegar-wise
*/

@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/vazirmatn-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/vazirmatn-700.woff2') format('woff2');
}

:root {
  font-family: 'Vazirmatn', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --card-ink: #ffffff;
  --card-kicker: rgba(255, 255, 255, .78);
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'calt' 1;
  color-scheme: light;
  --canvas: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f1f4ee;
  --mint: #e2f6d5;
  --pastel: #cdffad;
  --wise-green: #9fe870;
  --dark-green: #163300;
  --positive: #054d28;
  --danger: #d03238;
  --warning: #ffd11a;
  --ink: #0e0f0c;
  --muted: #5d6259;
  --muted-light: #868685;
  --line: rgba(14, 15, 12, .14);
  --line-strong: rgba(14, 15, 12, .28);
  --soft-green: rgba(22, 51, 0, .08);
  --shadow-ring: 0 0 0 1px rgba(14, 15, 12, .12);
  --shadow-float: 0 8px 24px rgba(14, 15, 12, .12);
  --on-accent: #163300;
  --accent-soft: #e2f6d5;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --radius-xl: 40px;
  --pill: 9999px;
  --palette-accent: var(--wise-green);
  --palette-accent-hover: var(--pastel);
  --palette-deep: var(--dark-green);
  --deep-surface: var(--dark-green);
  --palette-strong: var(--positive);
  --palette-person-ink: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: inherit;
  background-color: var(--canvas);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header - Exactly matching kndemo .landing-header */
.landing-header {
  width: min(1180px, calc(100% - 52px));
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-sizing: border-box;
  padding: 4px;
  color: var(--on-accent);
  background: var(--palette-accent);
  border-radius: 13px;
  font-size: 19px;
  font-weight: 800;
  box-shadow: var(--shadow-ring);
}

.brand-mark img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.landing-brand strong {
  font-size: 17px;
  font-weight: 700;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-right: auto;
  margin-left: 32px;
}

.landing-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  border-radius: 0;
  background: transparent;
  transition: color 0.15s ease;
}

.landing-nav a:hover,
.landing-nav a.active {
  color: var(--palette-strong);
  background: transparent;
}

.landing-login-link {
  min-height: 38px;
  color: var(--on-accent);
  background: var(--palette-accent);
  border: 0;
  border-radius: var(--pill);
  padding: 0 18px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--shadow-ring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.landing-login-link:hover {
  background: var(--palette-accent-hover);
}

.landing-menu-toggle {
  display: none;
}

.landing-mobile-menu {
  display: none;
}

/* Blog Layout Elements */
.landing-eyebrow {
  display: inline-block;
  color: var(--palette-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1px;
}

.blog-hero {
  width: min(900px, calc(100% - 52px));
  margin: 0 auto;
  padding: 92px 0 54px;
  text-align: center;
}

.blog-hero h1 {
  max-width: none;
  margin: 15px 0 14px;
  font-size: clamp(31px, 4vw, 50px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -1.4px;
  color: var(--ink);
}

.blog-hero p {
  max-width: 580px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.blog-list {
  width: min(900px, calc(100% - 52px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 auto;
  padding: 0 0 100px;
}

/* Thumbnail Styles */
.blog-card-thumbnail {
  width: 100%;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.blog-card-thumbnail a {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.blog-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-thumb-img {
  transform: scale(1.04);
}

.blog-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-soft) 0%, var(--mint) 100%);
}

.blog-card-placeholder-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--palette-accent);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-ring);
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-placeholder-mark {
  transform: scale(1.08);
}

.blog-card-placeholder-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.blog-article-featured-image {
  width: 100%;
  max-width: 690px;
  height: 380px;
  border-radius: 20px;
  overflow: hidden;
  margin: 0 auto 35px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-ring);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.blog-article-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 20px;
}

.blog-card {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 27px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-ring);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.blog-card-meta, .blog-article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.blog-card-meta span, .blog-article-meta span {
  color: var(--palette-strong);
  font-size: 10px;
  font-weight: 800;
}

.blog-card-meta small, .blog-article-meta small {
  color: var(--muted-light);
  font-size: 9px;
}

.blog-card h2 {
  margin: 28px 0 12px;
  font-size: 19px;
  line-height: 1.7;
  font-weight: 700;
  color: var(--ink);
}

.blog-card h2 a:hover {
  color: var(--palette-strong);
}

.blog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}

.blog-card a.readmore, .blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 23px;
  color: var(--palette-strong);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.blog-card a.readmore svg, .blog-back-link svg {
  transform: rotate(180deg);
}

/* Single Post View */
.blog-article {
  width: min(780px, calc(100% - 52px));
  margin: 0 auto;
  padding: 75px 0 105px;
}

.blog-back-link {
  margin: 0 0 45px;
  padding: 0;
  color: var(--muted);
}

.blog-back-link:hover {
  color: var(--palette-strong);
}

.blog-article-meta {
  justify-content: flex-start;
}

.blog-article h1 {
  max-width: 760px;
  margin: 20px 0 22px;
  font-size: clamp(30px, 4vw, 49px);
  line-height: 1.45;
  font-weight: 800;
  color: var(--ink);
}

.blog-article-lead {
  max-width: 680px;
  margin: 0 0 44px;
  color: var(--muted);
  font-size: 16px;
  line-height: 2.1;
}

.blog-article-body {
  max-width: 690px;
  margin-bottom: 38px;
}

.blog-article-body p {
  margin: 0 0 25px;
  color: var(--ink);
  font-size: 14px;
  line-height: 2.35;
}

.blog-article-body h2,
.blog-article-body h3 {
  margin: 35px 0 16px;
  font-weight: 700;
  color: var(--ink);
}

/* Primary Button in Blog / CTA */
.primary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--pill);
  padding: 0 19px;
  border: 0;
  cursor: pointer;
  color: var(--on-accent);
  background: var(--palette-accent);
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-ring);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.primary-button:hover {
  background: var(--palette-accent-hover);
  transform: scale(1.035);
}

.primary-button:active {
  transform: scale(.97);
}

/* Final CTA Section - Exactly matching kndemo .landing-final-cta */
.landing-final-cta {
  width: min(1040px, calc(100% - 52px));
  margin: 0 auto 80px;
  padding: 75px 25px;
  text-align: center;
  background: var(--mint);
  border-radius: 30px;
  color: var(--ink);
}

.landing-final-cta h2 {
  margin: 12px 0 12px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.35;
  font-weight: 800;
  color: var(--ink);
}

.landing-final-cta .primary-button {
  margin-top: 14px;
}

/* Footer - Exactly matching kndemo .landing-footer */
.landing-footer {
  width: min(1180px, calc(100% - 52px));
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  align-items: center;
  gap: 30px;
  margin: 0 auto;
  padding: 30px 0 38px;
  border-top: 1px solid var(--line);
}

.landing-footer p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.landing-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.landing-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}

.landing-footer-links a:hover {
  color: var(--palette-strong);
}

.landing-footer small {
  color: var(--muted-light);
  font-size: 10px;
  white-space: nowrap;
}

/* Mobile Media Queries */
@media (max-width: 760px) {
  .blog-article-featured-image {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .blog-card-thumbnail {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .landing-header, .landing-hero, .landing-section, .landing-final-cta, .landing-footer {
    width: calc(100% - 32px);
  }
  .landing-header {
    min-height: 70px;
    position: relative;
  }
  .landing-nav {
    display: none;
  }
  .landing-login-link {
    display: none;
  }
  .landing-menu-toggle {
    width: 42px;
    height: 42px;
    color: var(--palette-strong);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    place-items: center;
    padding: 0;
    display: grid;
    cursor: pointer;
  }
  .landing-mobile-menu {
    position: absolute;
    z-index: 20;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-float);
    padding: 8px;
    display: none;
    grid-gap: 2px;
  }
  .landing-mobile-menu.open {
    display: grid;
  }
  .landing-mobile-menu a {
    color: var(--ink);
    border-radius: 10px;
    padding: 12px 14px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
  }
  .landing-mobile-menu a:active,
  .landing-mobile-menu a:hover {
    background: var(--surface-soft);
  }
  .landing-mobile-login {
    width: 100%;
    min-height: 40px;
    color: var(--on-accent);
    background: var(--palette-accent);
    border: 0;
    border-radius: var(--pill);
    margin-top: 6px;
    padding: 0 14px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .landing-brand strong {
    font-size: 15px;
  }
  .landing-final-cta {
    margin-bottom: 55px;
    padding: 55px 18px;
  }
  .landing-footer {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .blog-hero, .blog-list, .blog-article {
    width: calc(100% - 32px);
  }
  .blog-hero {
    padding: 60px 0 38px;
  }
  .blog-hero h1 {
    font-size: 31px;
  }
  .blog-list {
    grid-template-columns: 1fr;
    padding-bottom: 65px;
  }
  .blog-card {
    min-height: 0;
  }
  .blog-article {
    padding: 45px 0 70px;
  }
  .blog-article h1 {
    font-size: 29px;
  }
  .blog-article-lead {
    font-size: 13px;
  }
}
