/*
Theme Name: Jalalzadeh Persian Academic
Theme URI: https://atlasui.net
Author: AtlasUi
Author URI: https://atlasui.net
Description: A lightweight RTL Persian academic WordPress theme with Customizer-powered homepage sections.
Version: 1.2.1
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jalalzadeh-persian-academic
Tags: rtl-language-support, blog, custom-logo, custom-menu, featured-images, one-column, two-columns, custom-background
*/

:root {
  --jpa-ink: #111827;
  --jpa-muted: #5f6675;
  --jpa-soft: #f6f3ed;
  --jpa-paper: #ffffff;
  --jpa-line: #ded9ce;
  --jpa-accent: #b89455;
  --jpa-accent-dark: #856433;
  --jpa-night: #07182c;
  --jpa-night-2: #102d4c;
  --jpa-shadow: 0 14px 40px rgba(7, 24, 44, 0.11);
  --jpa-radius: 8px;
  --jpa-container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  direction: rtl;
  color: var(--jpa-ink);
  background: var(--jpa-soft);
  line-height: 1.85;
  text-align: justify;
  text-rendering: optimizeLegibility;
}

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

img {
  max-width: 100%;
  height: auto;
}

.entry-body img,
.entry-content img,
.single-wrap > p > img,
.entry-card img,
.article-row img {
  display: block;
  margin-inline: auto;
}

.entry-body figure,
.entry-content figure,
.single-wrap figure {
  margin-inline: auto;
  text-align: center;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

.jpa-container {
  width: min(100% - 32px, var(--jpa-container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(222, 217, 206, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--jpa-night);
  font-size: 14px;
  line-height: 1;
}

.brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.brand img {
  max-height: 46px;
  width: auto;
}

.brand .brand-avatar {
  width: 36px;
  height: 36px;
  max-height: 36px;
}

.header-inner.no-brand .nav-wrap {
  margin-inline-start: 0;
}

.nav-wrap {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.home .site-header .english-link,
.site-header .english-link--front-hidden {
  display: none;
}

.primary-menu,
.primary-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #243146;
  font-size: 14px;
  font-weight: 650;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
  color: var(--jpa-accent-dark);
  background: #f3eee3;
}

.english-link,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 6px;
  border: 1px solid var(--jpa-accent);
  color: #fff;
  background: var(--jpa-accent);
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(164, 132, 75, 0.2);
}

.english-link:hover,
.button-link:hover {
  background: var(--jpa-accent-dark);
  border-color: var(--jpa-accent-dark);
}

.button-link.secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

.button-link.secondary:hover {
  color: var(--jpa-night);
  background: #fff;
  border-color: #fff;
}

.english-hero-link {
  background: linear-gradient(135deg, var(--jpa-accent), #d8b66d);
  border-color: transparent;
}

.menu-toggle {
  display: block;
  width: 42px;
  height: 42px;
  border: 1px solid var(--jpa-line);
  border-radius: 6px;
  background: #fff;
  color: var(--jpa-ink);
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  content: "";
  display: block;
  width: 19px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-open .menu-toggle span {
  opacity: 0;
}

.nav-open .menu-toggle::before {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .menu-toggle::after {
  transform: translateY(-7px) rotate(-45deg);
}

.primary-navigation {
  position: fixed;
  inset: 78px 50% auto auto;
  display: none;
  width: min(280px, calc(100vw - 24px));
  transform: translateX(50%);
  padding: 12px;
  border: 1px solid var(--jpa-line);
  border-radius: var(--jpa-radius);
  background: #fff;
  box-shadow: var(--jpa-shadow);
}

.nav-open .primary-navigation {
  display: block;
}

.primary-navigation .primary-menu {
  display: grid;
  gap: 4px;
}

.primary-navigation .primary-menu a {
  padding: 12px 10px;
  font-size: 15px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 48px;
  background:
    radial-gradient(circle at 20% 0%, rgba(184, 148, 85, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(7, 24, 44, 0.98), rgba(16, 45, 76, 0.93)),
    var(--jpa-night);
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/images/world-map.png") center 42% / min(1180px, 118vw) auto no-repeat;
  opacity: 0.13;
  filter: brightness(2.2) contrast(0.9);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 310px;
  gap: 42px;
  align-items: center;
}

.hero-kicker {
  color: #d7c49a;
  font-weight: 800;
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.35;
  text-align: right;
}

.hero-summary {
  max-width: 760px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
  text-align: justify;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-card {
  justify-self: end;
  width: min(100%, 310px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--jpa-radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.2);
}

.profile-image {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.profile-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
}

.profile-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.74);
  font-size: 18px;
  font-weight: 800;
}

.profile-placeholder-featured {
  aspect-ratio: 4 / 3;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.social-links a,
.social-links span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
  color: #fff;
  border: 0;
  padding: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.social-links img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.social-links a:hover {
  transform: translateY(-2px);
  opacity: 0.94;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.section {
  padding: 54px 0;
}

.section.alt {
  background: #fff;
}

.section.dark {
  color: #fff;
  background:
    linear-gradient(180deg, var(--jpa-night), #081527),
    var(--jpa-night);
  border-bottom: 1px solid rgba(184, 148, 85, 0.34);
  padding-bottom: 72px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 22px;
}

.section-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.45;
  text-align: right;
}

.section-text {
  margin: 7px 0 0;
  color: var(--jpa-muted);
}

.dark .section-text {
  color: rgba(255, 255, 255, 0.72);
}

.content-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.archive-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--jpa-accent);
  border-radius: 6px;
  color: #fff;
  background: var(--jpa-night);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.archive-button:hover {
  background: var(--jpa-accent-dark);
  border-color: var(--jpa-accent-dark);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.content-columns .card-grid {
  grid-template-columns: 1fr;
}

.column-title {
  margin: 0 0 12px;
  color: var(--jpa-ink);
  font-size: 20px;
  line-height: 1.45;
}

.post-card,
.research-card,
.work-card,
.article-row,
.entry-card {
  border: 1px solid var(--jpa-line);
  border-radius: var(--jpa-radius);
  background: var(--jpa-paper);
  box-shadow: 0 1px 0 rgba(20, 32, 51, 0.03);
}

.post-card,
.research-card,
.entry-card {
  padding: 20px;
}

.post-card h3,
.entry-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.55;
  text-align: right;
}

.post-card p,
.entry-card p,
.lead-text {
  margin: 0;
  color: #4f5868;
  background: #f7f5f0;
  border-right: 3px solid rgba(184, 148, 85, 0.52);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  text-align: justify;
}

.lead-text-academic {
  font-size: 15px;
  line-height: 2.05;
}

.post-meta {
  display: block;
  margin-top: 12px;
  color: var(--jpa-accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.single-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  direction: rtl;
}

.single-date img {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  border-radius: 0;
  flex: 0 0 auto;
}

.source-attribution {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(184, 148, 85, 0.28);
  border-radius: 999px;
  color: #4f5868;
  background: #fbfaf6;
  font-size: 13px;
  font-weight: 700;
}

.source-attribution .source-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.source-attribution strong {
  color: var(--jpa-ink);
}

.source-attribution a {
  color: var(--jpa-accent-dark);
}

.source-attribution a:hover {
  color: var(--jpa-night-2);
}

.source-divider {
  color: var(--jpa-line);
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.research-card {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 18px;
  font-weight: 850;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.research-card:hover {
  transform: translateY(-2px);
  border-color: rgba(164, 132, 75, 0.65);
  box-shadow: var(--jpa-shadow);
}

.articles-list {
  display: grid;
  gap: 14px;
}

.article-row {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 18px;
  align-items: start;
}

.article-row.no-date {
  grid-template-columns: 1fr;
}

.article-row h3 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.55;
  text-align: right;
}

.article-row p {
  margin: 0;
}

.article-meta {
  color: var(--jpa-accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.work-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.work-card .work-title {
  display: block;
  padding: 13px 14px;
  font-weight: 800;
}

.site-footer {
  padding: 42px 0 22px;
  color: rgba(255, 255, 255, 0.82);
  background: var(--jpa-night);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}

.footer-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 16px;
}

.footer-text {
  margin: 0;
  font-size: 14px;
}

.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.footer-menu a:hover {
  color: #fff;
}

.site-info {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

.page-header {
  padding: 48px 0 24px;
}

.page-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.jpa-breadcrumb {
  width: min(100% - 32px, var(--jpa-container));
  margin: 0 auto 18px;
  color: var(--jpa-muted);
  font-size: 13px;
  line-height: 1.8;
  text-align: right;
}

.jpa-breadcrumb a {
  color: var(--jpa-night-2);
}

.jpa-breadcrumb a:hover {
  color: var(--jpa-accent-dark);
}

.breadcrumb-separator {
  margin: 0 7px;
  color: var(--jpa-accent);
}

.entries-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 54px;
}

.entry-content,
.single-wrap {
  width: min(100% - 32px, 820px);
  margin: 0 auto;
  padding: 42px 0 64px;
}

.entry-content img,
.single-wrap img {
  border-radius: var(--jpa-radius);
}

.single-wrap h1 {
  margin-top: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.35;
  text-align: right;
}

.single-lead {
  margin: 18px 0 26px;
  padding: 18px 20px;
  border: 1px solid rgba(184, 148, 85, 0.28);
  border-right: 4px solid var(--jpa-accent);
  border-radius: var(--jpa-radius);
  color: #3f4857;
  background: #f8f5ee;
  font-size: 17px;
  line-height: 2;
  text-align: justify;
}

.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding-bottom: 44px;
}

.page-numbers {
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--jpa-line);
  border-radius: 6px;
  background: #fff;
}

.page-numbers.current {
  color: #fff;
  background: var(--jpa-accent);
  border-color: var(--jpa-accent);
}

@media (max-width: 920px) {
  .header-inner {
    min-height: 66px;
  }

  .nav-wrap {
    margin-inline-start: auto;
  }

  .primary-navigation {
    inset: 66px 12px auto 12px;
    width: auto;
    transform: none;
  }

  .primary-menu {
    display: grid;
    gap: 4px;
  }

  .primary-menu a {
    padding: 12px 10px;
    font-size: 15px;
  }

  .english-link {
    min-height: 38px;
    padding-inline: 12px;
  }

  .hero {
    padding: 28px 0 34px;
  }

  .hero::before {
    background-size: 110% auto;
    background-position: center 43%;
    opacity: 0.09;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .profile-card {
    justify-self: stretch;
    width: 100%;
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    order: -1;
  }

  .profile-image {
    aspect-ratio: 1;
  }

  .profile-image img,
  .brand-avatar {
    object-position: center 42%;
  }

  .profile-card .social-links {
    margin-top: 0;
    align-content: center;
  }

  .content-columns,
  .card-grid,
  .latest-grid,
  .research-grid,
  .works-grid,
  .entries-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .article-row {
    grid-template-columns: 1fr;
  }

  .article-meta {
    text-align: right;
  }
}

@media (max-width: 640px) {
  .jpa-container {
    width: min(100% - 22px, var(--jpa-container));
  }

  .brand-name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    font-weight: 900;
  }

  .hero::before {
    background-size: 116% auto;
    background-position: center 48%;
    opacity: 0.08;
  }

  .nav-wrap {
    gap: 8px;
  }

  .english-link {
    font-size: 12px;
    padding-inline: 10px;
  }

  .hero h1 {
    font-size: 29px;
  }

  .hero-summary {
    font-size: 15px;
  }

  .hero-actions .button-link {
    flex: 1 1 130px;
  }

  .profile-card {
    grid-template-columns: 104px minmax(0, 1fr);
    padding: 10px;
    order: -1;
  }

  .social-links {
    gap: 8px;
  }

  .social-links a,
  .social-links span {
    width: 38px;
    height: 38px;
  }

  .lead-text-academic {
    font-size: 14px;
    line-height: 1.95;
  }

  .section {
    padding: 40px 0;
  }

  .section-head {
    display: block;
  }

  .archive-button {
    width: 100%;
    margin-top: 14px;
  }

  .content-columns,
  .card-grid,
  .latest-grid,
  .research-grid,
  .works-grid,
  .entries-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .post-card,
  .research-card,
  .entry-card,
  .article-row {
    padding: 17px;
  }

  .research-card {
    min-height: 86px;
    justify-content: flex-start;
    text-align: right;
  }
}
