/*
Theme Name: Mortezaee Quran Gallery
Theme URI: https://whale-agency.ir/
Author: Whale Advertising Agency
Author URI: https://whale-agency.ir/
Description: قالب اختصاصی گالری سه‌زبانه آثار منبت قرآنی علی‌اصغر مرتضایی، تبدیل‌شده از نسخه نهایی V6.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: mortezaee-quran-gallery
*/

@import url('https://fonts.googleapis.com/css2?family=Forum&display=swap');

@font-face {
  font-family: 'DimaShekastehCustom';
  src: local('Dima Shekasteh'), local('DimaShekasteh'), url('assets/fonts/Dima-Shekasteh.ttf') format('truetype');
  font-display: swap;
}

:root {
  --font-fa: 'DimaShekastehCustom', Tahoma, serif;
  --font-alt: 'Forum', Georgia, 'Times New Roman', serif;
  --paper: #f5efe5;
  --paper-2: #fbf8f1;
  --paper-3: #eee8db;
  --taupe: #9b9373;
  --taupe-deep: #827a5f;
  --taupe-light: #b9b191;
  --ink: #342d27;
  --muted: #70675d;
  --red: #900f0b;
  --red-dark: #75100d;
  --bronze: #aa8f68;
  --line: rgba(80, 67, 53, .16);
  --line-strong: rgba(80, 67, 53, .28);
  --white: #fffdfa;
  --shadow: 0 24px 64px rgba(52, 42, 32, .10);
  --shadow-soft: 0 14px 36px rgba(52, 42, 32, .055);
  --shell: min(1360px, calc(100% - 52px));
  --gallery: min(1260px, calc(100% - 52px));
  --content: min(1160px, calc(100% - 52px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-fa);
  font-size: 22px;
  line-height: 1.8;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
body, button, input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }
.shell { width: var(--shell); margin-inline: auto; }
.gallery-shell { width: var(--gallery); margin-inline: auto; }
.content-shell { width: var(--content); }
.section-space { padding: 96px 0; }

html[data-language="en"] body,
html[data-language="ru"] body,
html[data-language="en"] button,
html[data-language="ru"] button,
html[data-language="en"] input,
html[data-language="ru"] input,
html[data-language="en"] textarea,
html[data-language="ru"] textarea,
html[data-language="en"] select,
html[data-language="ru"] select {
  font-family: var(--font-alt);
  letter-spacing: .006em;
}

/* The visual chart never flips when language changes. */
html[data-language="en"] [data-i18n],
html[data-language="ru"] [data-i18n],
html[data-language="en"] .locale-text,
html[data-language="ru"] .locale-text {
  direction: ltr;
  unicode-bidi: plaintext;
}
html[data-language="fa"] [data-i18n],
html[data-language="fa"] .locale-text {
  direction: rtl;
  unicode-bidi: plaintext;
}

.page-texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .42;
  background:
    radial-gradient(circle at 12% 8%, rgba(155,147,115,.10), transparent 28%),
    radial-gradient(circle at 88% 36%, rgba(144,15,11,.035), transparent 34%),
    linear-gradient(90deg, rgba(255,255,255,.10), transparent 25%, transparent 75%, rgba(255,255,255,.10));
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  padding: 14px 0 10px;
  background: rgba(245,239,229,.94);
  border-bottom: 1px solid rgba(80,67,53,.10);
  box-shadow: 0 10px 30px rgba(52,42,32,.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.header-row {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 0;
  border-bottom: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  max-width: calc(100% - 190px);
}
.brand img {
  width: clamp(150px, 13vw, 205px);
  height: 64px;
  object-fit: contain;
  object-position: right center;
  flex: 0 0 auto;
}
.brand-copy {
  display: grid;
  min-width: 0;
  padding-inline-start: 15px;
  border-inline-start: 1px solid rgba(80,67,53,.14);
}
.brand-copy strong {
  font-size: clamp(24px, 1.8vw, 31px);
  line-height: 1.15;
  white-space: nowrap;
}
.brand-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
  white-space: nowrap;
}
.language-switcher {
  direction: ltr;
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251,248,241,.78);
  backdrop-filter: blur(12px);
  flex: 0 0 auto;
}
.lang-btn {
  min-width: 45px;
  height: 37px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-alt);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}
.lang-btn.active { color: var(--white); background: var(--red); }
.lang-btn.loading { opacity: .48; cursor: progress; }

/* ---------- Hero ---------- */
.hero { padding-top: 26px; }
.hero-frame {
  position: relative;
  overflow: hidden;
  min-height: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 66px;
  border: 1px solid rgba(80,67,53,.10);
  border-radius: 32px;
  background:
    linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,.08)),
    linear-gradient(140deg, #b5ad8b 0%, var(--taupe) 54%, #8d8568 100%);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--white);
}
.hero-frame::after {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 22px;
  pointer-events: none;
}
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: .075;
  background-image:
    linear-gradient(30deg, transparent 45%, #fff 46% 48%, transparent 49%),
    linear-gradient(-30deg, transparent 45%, #fff 46% 48%, transparent 49%);
  background-size: 62px 106px;
}
.basmala,
.eyebrow,
.hero-frame h1,
.hero-lead,
.hero-ornament { position: relative; z-index: 1; }
.basmala {
  margin: 0 0 10px;
  color: var(--red-dark);
  font-size: clamp(31px, 3vw, 44px);
  font-weight: 700;
  line-height: 1.3;
}
.eyebrow {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: clamp(18px, 1.3vw, 21px);
}
.hero-frame h1 {
  margin: 0;
  width: 100%;
  font-size: clamp(52px, 5vw, 76px);
  font-weight: 800;
  color: var(--red-dark);
  line-height: 1.12;
}
.hero-lead {
  margin: 18px auto 0;
  max-width: 1040px;
  color: #ffffff;
  font-size: clamp(20px, 1.5vw, 24px);
  line-height: 1.72;
}
.hero-ornament {
  width: min(390px, 70%);
  margin-top: 27px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.hero-ornament span { height: 1px; background: rgba(117,16,13,.32); }
.hero-ornament i {
  width: 8px;
  height: 8px;
  display: block;
  border: 1px solid var(--red-dark);
  transform: rotate(45deg);
}

/* ---------- Section headings ---------- */
.section-heading {
  width: 100%;
  margin-bottom: 66px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}
.section-kicker {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 20px;
  line-height: 1.35;
}
.section-kicker.light { color: var(--red-dark); }
.lined-kicker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
}
.lined-kicker::before,
.lined-kicker::after {
  content: '';
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155,147,115,.68), transparent);
}
.lined-kicker > span { white-space: nowrap; }
.section-heading h2,
.about-card h2,
.contact-card h2 {
  margin: 0;
  font-size: clamp(44px, 3.7vw, 59px);
  font-weight: 500;
  line-height: 1.2;
}
.section-lead {
  max-width: 1100px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: clamp(19px, 1.38vw, 22px);
  line-height: 1.75;
  text-align: center;
}

/* ---------- Artworks: image right / information left ---------- */
.artwork-list { width: 100%; display: grid; gap: 92px; }
.artwork-item {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: 'caption image';
  align-items: stretch;
  gap: clamp(20px, 2.2vw, 30px);
  direction: ltr;
}
.artwork-image-wrap {
  grid-area: image;
  min-width: 0;
  width: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}
.artwork-image {
  width: 100%;
  height: auto;
  max-height: 820px;
  min-height: 0;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  background: transparent;
  cursor: zoom-in;
  filter: drop-shadow(0 18px 24px rgba(47,37,28,.10));
}
.artwork-caption {
  grid-area: caption;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 34px 36px 34px 38px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(251,248,241,.92);
  box-shadow: var(--shadow-soft);
  direction: rtl;
}
.artwork-caption::before {
  content: '';
  position: absolute;
  inset-block: 32px;
  inset-inline-start: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent, var(--red), transparent);
}
.artwork-caption::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(155,147,115,.09);
  border-radius: 11px;
  pointer-events: none;
}
.artwork-caption-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
  padding-bottom: 0;
  border-bottom: 0;
}
.artwork-caption h3 {
  margin: 0;
  min-width: 0;
  font-size: clamp(34px, 2.45vw, 41px);
  font-weight: 500;
  line-height: 1.2;
}
.artwork-number {
  flex: 0 0 auto;
  color: var(--red);
  font-family: var(--font-alt);
  font-size: 15px;
  letter-spacing: .17em;
}
.quran-block {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  padding: 16px 16px;
  background: rgba(238,232,219,.66);
  border-inline-start: 2px solid rgba(144,15,11,.55);
  direction: rtl !important;
  text-align: center !important;
}
.quran-text {
  margin: 0;
  color: var(--red);
  font-size: clamp(18px, 1.2vw, 22px);
  font-weight: 700;
  line-height: 1.65;
  white-space: pre-line;
}
.quran-reference {
  display: none;
}
.spec-title {
  position: relative;
  z-index: 1;
  margin: 0 0 9px;
  color: var(--red);
  font-size: 16px;
  line-height: 1.4;
}
.spec-list {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 18px;
}
.spec-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dotted rgba(80,67,53,.18);
  font-size: 16px;
  line-height: 1.42;
}
.spec-label { color: var(--muted); }
.spec-value { color: var(--ink); font-weight: 600; }
.artwork-description {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  color: rgba(52,45,39,.84);
  font-size: clamp(17px, 1.14vw, 20px);
  line-height: 1.78;
  text-align: justify;
}

/* ---------- About ---------- */
.about-card {
  min-height: 270px;
  display: grid;
  grid-template-columns: 210px minmax(0,1fr);
  align-items: center;
  gap: 42px;
  padding: 48px 54px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(251,248,241,.90);
  box-shadow: var(--shadow-soft);
}
.about-card > * { min-width: 0; }
.about-symbol {
  width: 190px;
  height: 122px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-inline-end: 1px solid rgba(80,67,53,.12);
}
.about-symbol img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.about-card .section-kicker { font-size: 19px; }
.about-card h2 { font-size: clamp(38px, 3vw, 50px); }
.about-card p:last-child {
  width: 100%;
  margin: 12px 0 0;
  color: rgba(52,45,39,.82);
  font-size: clamp(18px, 1.23vw, 21px);
  line-height: 1.82;
  text-align: justify;
}

/* ---------- Contact ---------- */
.contact-section { padding-top: 20px; }
.contact-card {
  min-height: 340px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 390px;
  align-items: center;
  gap: 56px;
  padding: 52px 58px;
  border: 1px solid rgba(80,67,53,.11);
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 0%, rgba(255,255,255,.20), transparent 30%),
    linear-gradient(140deg, #aaa383, var(--taupe) 65%, #8a8265);
  box-shadow: var(--shadow);
  color: var(--white);
}
.contact-card > * { min-width: 0; }
.contact-copy .section-kicker { color: var(--red-dark); font-size: 19px; font-weight: 700; }
.contact-copy h2 { color: var(--red-dark); font-size: clamp(38px, 3vw, 50px); font-weight: 800; }
.contact-copy p:not(.section-kicker) {
  margin: 14px 0 0;
  color: #ffffff;
  font-size: clamp(18px,1.25vw,21px);
  line-height: 1.82;
  text-align: justify;
}
.contact-details { width: 100%; display: grid; gap: 13px; }
.contact-item {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.31);
  border-radius: 16px;
  background: rgba(251,248,241,.32);
}
.contact-item img { width: 27px; height: 27px; flex: 0 0 auto; }
.contact-item span:last-child { display: grid; gap: 2px; min-width: 0; }
.contact-item small { color: #ffffff; font-size: 15px; }
.contact-value {
  color: #ffffff;
  font-family: var(--font-alt);
  font-size: 18px;
  direction: ltr !important;
  unicode-bidi: embed;
  text-align: left !important;
}
.email-value { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 92px;
  padding: 48px 0 22px;
  border-top: 1px solid rgba(80,67,53,.13);
  background: #8e876a;
  color: var(--white);
}
.footer-main {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: start;
  gap: 54px;
}
.footer-identity {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 850px;
  min-width: 0;
}
.footer-identity img {
  width: 180px;
  height: 72px;
  object-fit: contain;
  flex: 0 0 auto;
}
.footer-identity strong { display: block; color: var(--red-dark); font-size: 28px; font-weight: 800; line-height: 1.3; }
.footer-identity p {
  margin: 6px 0 0;
  color: rgba(255,255,255,.94);
  font-size: 18px;
  line-height: 1.75;
  text-align: justify;
}
.footer-contact { display: grid; gap: 6px; text-align: start; }
.footer-contact span { color: var(--red-dark); font-weight: 800; }
.footer-contact a {
  font-family: var(--font-alt);
  direction: ltr;
  unicode-bidi: embed;
  font-size: 17px;
  color: #ffffff;
}
.footer-bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(52,45,39,.13);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255,255,255,.86);
  font-size: 15px;
}
.footer-bottom p { margin: 0; }
.credit a { color: #ffffff; font-weight: 700; }

/* ---------- Floating controls ---------- */
.floating-contact,
.scroll-top {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 30;
  border: 0;
  box-shadow: 0 14px 36px rgba(52,42,32,.16);
}
.floating-contact {
  inset-inline-start: 22px;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px;
  background: var(--taupe-deep);
  color: var(--white);
  white-space: nowrap;
}
.floating-contact img { width: 25px; height: 25px; }
.floating-contact { cursor: pointer; font-family: inherit; }
.scroll-top {
  inset-inline-end: 22px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: .2s ease;
  cursor: pointer;
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top img { width: 24px; height: 24px; }

/* ---------- Modal ---------- */
.art-modal {
  width: min(94vw, 1240px);
  max-height: 92vh;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: #2a2420;
  box-shadow: 0 40px 100px rgba(0,0,0,.36);
}
.art-modal::backdrop { background: rgba(34,29,25,.82); backdrop-filter: blur(6px); }
.art-modal img { width: 100%; max-height: calc(92vh - 32px); object-fit: contain; }
.modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: rgba(0,0,0,.50);
  color: white;
  cursor: pointer;
  font-family: var(--font-alt);
  font-size: 28px;
  line-height: 1;
}

@media (max-width: 1080px) {
  .brand-copy { display: none; }
  .artwork-item { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 22px; }
  .artwork-caption { min-height: 0; padding: 28px 28px 28px 30px; }
  .artwork-image { min-height: 0; max-height: 760px; }
  .quran-text { font-size: 18px; line-height: 1.58; }
  .spec-list { grid-template-columns: 1fr 1fr; }
  .contact-card { grid-template-columns: 1fr; gap: 30px; }
  .footer-main { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root {
    --shell: min(100% - 26px, 1360px);
    --gallery: min(100% - 26px, 1260px);
    --content: min(100% - 26px, 1160px);
  }
  body { font-size: 18px; }
  .section-space { padding: 66px 0; }
  .site-header { padding: 9px 0 7px; }
  .header-row { min-height: 60px; padding-bottom: 10px; }
  .brand { max-width: calc(100% - 128px); }
  .brand img { width: 125px; height: 48px; }
  .brand-copy { display: none; }
  .lang-btn { min-width: 36px; height: 32px; padding: 0 7px; font-size: 11px; }
  .hero { padding-top: 14px; }
  .hero-frame { min-height: 360px; padding: 44px 20px; border-radius: 25px; }
  .hero-frame::after { inset: 9px; border-radius: 18px; }
  .basmala { font-size: clamp(22px,7vw,31px); }
  .eyebrow { font-size: 14px; }
  .hero-frame h1 { font-size: clamp(31px,9vw,48px); }
  .hero-lead { font-size: 18px; line-height: 1.82; }
  .hero-ornament { margin-top: 21px; }
  .section-heading { margin-bottom: 44px; }
  .section-heading h2,.about-card h2,.contact-card h2 { font-size: 35px; }
  .section-lead { font-size: 17px; }
  .lined-kicker { gap: 12px; }
  .artwork-list { gap: 72px; }
  .artwork-item {
    grid-template-columns: 1fr;
    grid-template-areas: 'image' 'caption';
    gap: 20px;
  }
  .artwork-image { width: 100%; min-height: 0; max-height: 72vh; filter: drop-shadow(0 12px 18px rgba(47,37,28,.08)); }
  .artwork-caption { min-height: 0; padding: 25px 23px; border-radius: 17px; }
  .artwork-caption::after { inset: 7px; }
  .artwork-caption h3 { font-size: 31px; }
  .quran-text { font-size: 18px; line-height: 1.6; }
  .spec-list { grid-template-columns: 1fr 1fr; }
  .spec-item { font-size: 15px; }
  .artwork-description { font-size: 17px; line-height: 1.85; }
  .about-card { grid-template-columns: 1fr; gap: 18px; padding: 30px 24px; }
  .about-symbol { width: 145px; height: 86px; padding: 0; border: 0; }
  .about-card p:last-child { font-size: 17px; line-height: 1.85; }
  .contact-card { padding: 30px 24px; border-radius: 24px; }
  .contact-copy p:not(.section-kicker) { font-size: 17px; line-height: 1.85; }
  .footer-identity { align-items: flex-start; }
  .footer-identity img { width: 135px; height: 58px; }
  .footer-identity strong { font-size: 23px; }
  .footer-identity p { font-size: 16px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 8px; }
  .floating-contact { width: 52px; height: 52px; padding: 0; display: grid; place-items: center; }
  .floating-contact span { display: none; }
  .floating-contact img { width: 24px; height: 24px; }
  .scroll-top { width: 50px; height: 50px; }
}

@media (max-width: 520px) {
  .header-row { align-items: center; }
  .spec-list { grid-template-columns: 1fr; }
  .artwork-caption-top { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { transition: none !important; }
}


/* ---------- Artist profile ---------- */
.artist-card {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  grid-template-areas: 'gallery copy';
  align-items: stretch;
  gap: clamp(42px, 5vw, 72px);
  direction: ltr;
}
.artist-gallery {
  grid-area: gallery;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  gap: 14px;
  align-items: stretch;
}
.artist-photo-stack {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}
.artist-photo {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(80,67,53,.12);
  border-radius: 18px;
  background: rgba(251,248,241,.92);
  box-shadow: var(--shadow-soft);
}
.artist-photo img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
}
.artist-photo-main { min-height: 560px; }
.artist-photo-main img { object-position: 50% 42%; }
.artist-photo-stack .artist-photo { min-height: 270px; }
.artist-copy {
  grid-area: copy;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 46px 48px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(251,248,241,.90);
  box-shadow: var(--shadow-soft);
  direction: rtl;
}
.artist-copy .section-kicker { margin-bottom: 8px; }
.artist-copy h2 {
  margin: 0;
  font-size: clamp(38px, 3vw, 50px);
  line-height: 1.25;
  font-weight: 600;
}
.artist-lead,
.artist-technique,
.artist-exhibitions {
  margin: 15px 0 0;
  color: rgba(52,45,39,.82);
  font-size: clamp(17px, 1.12vw, 20px);
  line-height: 1.9;
  text-align: justify;
}
.artist-facts {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.artist-fact {
  min-width: 0;
  padding: 14px 13px;
  border-top: 1px solid rgba(144,15,11,.34);
  background: rgba(238,232,219,.46);
}
.artist-fact strong {
  display: block;
  margin-bottom: 3px;
  color: var(--red);
  font-size: 15px;
  line-height: 1.4;
}
.artist-fact span {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
.artist-technique {
  padding-top: 18px;
  border-top: 1px solid rgba(80,67,53,.10);
}
.artist-exhibitions {
  color: var(--muted);
  font-size: 16px;
}

@media (max-width: 1060px) {
  .artist-card {
    grid-template-columns: 1fr;
    grid-template-areas: 'copy' 'gallery';
  }
  .artist-gallery { max-width: 860px; margin-inline: auto; }
}

@media (max-width: 720px) {
  .artist-card { width: min(100% - 26px, 1240px); gap: 22px; }
  .artist-copy { padding: 30px 24px; }
  .artist-copy h2 { font-size: 34px; }
  .artist-facts { grid-template-columns: 1fr; }
  .artist-gallery { grid-template-columns: 1fr; }
  .artist-photo-stack { grid-template-rows: auto; }
  .artist-photo-main,
  .artist-photo-stack .artist-photo { min-height: 0; }
  .artist-photo img { height: auto; object-fit: contain; }
}


/* Final artist placement: after all works and immediately before contact */
.artist-section {
  position: relative;
  padding-top: 112px;
}
.artist-section::before {
  content: '';
  position: absolute;
  top: 38px;
  left: 50%;
  width: min(720px, 70vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(144,15,11,.28), transparent);
}
@media (max-width: 720px) {
  .artist-section { padding-top: 78px; }
  .artist-section::before { top: 24px; width: min(86vw, 520px); }
}


/* ---------- Final taupe-panel typography system ---------- */
.hero-frame .basmala,
.hero-frame h1,
.contact-card .section-kicker,
.contact-card h2,
.site-footer .footer-identity strong,
.site-footer .footer-contact > span {
  color: var(--red-dark) !important;
  font-weight: 800;
}

.hero-frame .eyebrow,
.hero-frame .hero-lead,
.contact-card .contact-copy > p:not(.section-kicker),
.contact-card .contact-item small,
.contact-card .contact-value,
.site-footer .footer-identity p,
.site-footer .footer-contact a,
.site-footer .footer-bottom,
.site-footer .footer-bottom a {
  color: #ffffff !important;
}

/* Sticky header remains readable above all sections. */
.site-header .brand-copy strong { font-weight: 800; }


/* ---------- FINAL V4: Persian layout is the immutable master chart ---------- */
/*
   The page root remains RTL for every language.  Only the glyph flow of translated
   leaf text changes to LTR.  Flex/grid containers never reverse, so EN/RU occupy
   exactly the same physical slots as FA.
*/
html[data-language="fa"],
html[data-language="en"],
html[data-language="ru"] {
  direction: rtl;
}

/* Header: same logo/text/language-switch positions in every language. */
.header-row,
.brand,
.brand-copy,
.language-switcher {
  flex-direction: initial;
}
.brand-copy { text-align: right; }
html[data-language="en"] .brand-copy [data-i18n],
html[data-language="ru"] .brand-copy [data-i18n] {
  direction: ltr;
  text-align: right;
}

/* Hero and section titles stay centered exactly like Persian. */
.hero-frame,
.section-heading,
.lined-kicker {
  text-align: center;
}
html[data-language="en"] .hero-frame [data-i18n],
html[data-language="ru"] .hero-frame [data-i18n],
html[data-language="en"] .section-heading [data-i18n],
html[data-language="ru"] .section-heading [data-i18n] {
  text-align: center;
}

/* Artwork geometry is permanently: information LEFT / image RIGHT on desktop. */
.artwork-item { direction: ltr !important; }
.artwork-caption { direction: rtl !important; }
.artwork-caption-top,
.spec-item { direction: rtl !important; }

/* Leaf translation flow changes, but its physical anchor does not. */
html[data-language="en"] .artwork-caption h3,
html[data-language="ru"] .artwork-caption h3,
html[data-language="en"] .spec-title,
html[data-language="ru"] .spec-title,
html[data-language="en"] .spec-label,
html[data-language="ru"] .spec-label,
html[data-language="en"] .spec-value,
html[data-language="ru"] .spec-value {
  direction: ltr;
  unicode-bidi: plaintext;
}
html[data-language="en"] .artwork-caption h3,
html[data-language="ru"] .artwork-caption h3,
html[data-language="en"] .spec-title,
html[data-language="ru"] .spec-title,
html[data-language="en"] .spec-label,
html[data-language="ru"] .spec-label {
  text-align: right;
}
html[data-language="en"] .spec-value,
html[data-language="ru"] .spec-value {
  text-align: left;
}
html[data-language="en"] .artwork-description,
html[data-language="ru"] .artwork-description {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: justify;
}
/* Sacred/Arabic content stays visually identical in all languages. */
.quran-block,
.quran-text {
  direction: rtl !important;
  text-align: center !important;
}

/* Artist section: gallery remains LEFT and biography remains RIGHT. */
.artist-card { direction: ltr !important; }
.artist-copy {
  direction: rtl !important;
  text-align: right;
}
html[data-language="en"] .artist-copy [data-i18n],
html[data-language="ru"] .artist-copy [data-i18n] {
  direction: ltr;
  unicode-bidi: plaintext;
}
html[data-language="en"] .artist-copy .section-kicker,
html[data-language="ru"] .artist-copy .section-kicker,
html[data-language="en"] .artist-copy h2,
html[data-language="ru"] .artist-copy h2,
html[data-language="en"] .artist-fact strong,
html[data-language="ru"] .artist-fact strong,
html[data-language="en"] .artist-fact span,
html[data-language="ru"] .artist-fact span {
  text-align: right;
}
html[data-language="en"] .artist-lead,
html[data-language="ru"] .artist-lead,
html[data-language="en"] .artist-technique,
html[data-language="ru"] .artist-technique,
html[data-language="en"] .artist-exhibitions,
html[data-language="ru"] .artist-exhibitions {
  direction: ltr;
  text-align: justify;
}

/* Contact section: copy remains RIGHT, contact cards remain LEFT. */
.contact-card { direction: rtl !important; }
.contact-copy { text-align: right; }
html[data-language="en"] .contact-copy [data-i18n],
html[data-language="ru"] .contact-copy [data-i18n] {
  direction: ltr;
}
html[data-language="en"] .contact-copy .section-kicker,
html[data-language="ru"] .contact-copy .section-kicker,
html[data-language="en"] .contact-copy h2,
html[data-language="ru"] .contact-copy h2 {
  text-align: right;
}
html[data-language="en"] .contact-copy > p:not(.section-kicker),
html[data-language="ru"] .contact-copy > p:not(.section-kicker) {
  text-align: justify;
}
.contact-item { direction: rtl !important; }
.contact-item > span { text-align: right; }
html[data-language="en"] .contact-item small,
html[data-language="ru"] .contact-item small {
  direction: ltr;
  text-align: right;
}
.contact-value {
  direction: ltr !important;
  text-align: left !important;
}

/* Footer: logo/identity and contact stay in the Persian positions. */
.footer-main,
.footer-identity,
.footer-contact,
.footer-bottom {
  direction: rtl;
}
.footer-identity,
.footer-contact { text-align: right; }
html[data-language="en"] .footer-identity [data-i18n],
html[data-language="ru"] .footer-identity [data-i18n],
html[data-language="en"] .footer-contact [data-i18n],
html[data-language="ru"] .footer-contact [data-i18n],
html[data-language="en"] .footer-bottom [data-i18n],
html[data-language="ru"] .footer-bottom [data-i18n] {
  direction: ltr;
}
html[data-language="en"] .footer-identity strong,
html[data-language="ru"] .footer-identity strong,
html[data-language="en"] .footer-contact > span,
html[data-language="ru"] .footer-contact > span {
  text-align: right;
}
.footer-contact a { direction: ltr !important; }

/* Keep EN/RU readable without forcing any chart reflow. */
html[data-language="en"] .artwork-caption h3,
html[data-language="ru"] .artwork-caption h3 { font-size: clamp(31px, 2.15vw, 38px); }
html[data-language="en"] .artwork-description,
html[data-language="ru"] .artwork-description { font-size: clamp(16px, 1.05vw, 19px); }
html[data-language="en"] .spec-item,
html[data-language="ru"] .spec-item { font-size: 15px; }
html[data-language="en"] .artist-copy h2,
html[data-language="ru"] .artist-copy h2,
html[data-language="en"] .contact-copy h2,
html[data-language="ru"] .contact-copy h2 { font-size: clamp(34px, 2.55vw, 46px); }

@media (max-width: 820px) {
  /* Same mobile order as Persian for all languages: image, then info. */
  .artwork-item {
    direction: ltr !important;
    grid-template-areas: 'image' 'caption' !important;
  }
  .artist-card {
    direction: ltr !important;
    grid-template-areas: 'copy' 'gallery' !important;
  }
}


/* ---------- FINAL V5: native LTR ordering only inside artwork information cards ---------- */
/*
   The artwork card itself stays in the exact Persian physical position (LEFT of image).
   Only its internal reading/order changes for English and Russian.
*/
html[data-language="en"] .artwork-caption,
html[data-language="ru"] .artwork-caption {
  direction: ltr !important;
}

html[data-language="en"] .artwork-caption-top,
html[data-language="ru"] .artwork-caption-top {
  direction: ltr !important;
  flex-direction: row !important;
}

html[data-language="en"] .artwork-caption h3,
html[data-language="ru"] .artwork-caption h3,
html[data-language="en"] .spec-title,
html[data-language="ru"] .spec-title {
  direction: ltr !important;
  text-align: left !important;
}

/* Label first on the left, value second on the right. */
html[data-language="en"] .spec-item,
html[data-language="ru"] .spec-item {
  direction: ltr !important;
  flex-direction: row !important;
}
html[data-language="en"] .spec-label,
html[data-language="ru"] .spec-label {
  direction: ltr !important;
  text-align: left !important;
}
html[data-language="en"] .spec-value,
html[data-language="ru"] .spec-value {
  direction: ltr !important;
  text-align: right !important;
}

html[data-language="en"] .artwork-description,
html[data-language="ru"] .artwork-description {
  direction: ltr !important;
  text-align: justify !important;
  text-align-last: left;
}

/* The red accent line follows the reading edge of the card. */
html[data-language="en"] .artwork-caption::before,
html[data-language="ru"] .artwork-caption::before {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

/* Arabic / sacred content remains RTL and centered exactly as before. */
html[data-language="en"] .quran-block,
html[data-language="ru"] .quran-block,
html[data-language="en"] .quran-text,
html[data-language="ru"] .quran-text {
  direction: rtl !important;
  text-align: center !important;
}


/* ---------- Contact popup ---------- */
.contact-modal {
  width: min(92vw, 520px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 0 32px 90px rgba(42, 35, 29, .28);
}
.contact-modal::backdrop {
  background: rgba(35, 30, 26, .62);
  backdrop-filter: blur(6px);
}
.contact-modal-head {
  padding: 34px 34px 20px;
  text-align: center;
}
.contact-modal-kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-weight: 700;
}
.contact-modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.35;
}
.contact-modal-head > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}
.contact-modal-actions {
  display: grid;
  gap: 12px;
  padding: 0 24px 28px;
}
.contact-modal-action {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.contact-modal-action:hover {
  transform: translateY(-1px);
  border-color: rgba(143,13,8,.34);
  box-shadow: 0 10px 24px rgba(52,42,32,.08);
}
.contact-modal-action img { width: 28px; height: 28px; flex: 0 0 auto; }
.contact-modal-action span { min-width: 0; display: grid; gap: 2px; }
.contact-modal-action small { color: var(--red); font-weight: 700; }
.contact-modal-action strong {
  color: var(--ink);
  font-family: var(--font-alt);
  direction: ltr;
  unicode-bidi: embed;
  overflow-wrap: anywhere;
}
.contact-modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-alt);
  font-size: 25px;
  line-height: 1;
}
html[data-language="en"] .contact-modal,
html[data-language="ru"] .contact-modal { direction: ltr; }
html[data-language="fa"] .contact-modal { direction: rtl; }

@media (max-width: 560px) {
  .contact-modal-head { padding: 30px 22px 18px; }
  .contact-modal-actions { padding: 0 16px 20px; }
  .contact-modal-action { padding: 14px 15px; }
}


/* ---------- WordPress integration ---------- */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

/* Keep WordPress frontend additions from changing the gallery chart. */
#wpadminbar { direction: ltr; }
