/* BERTA bilingual typography — English first, Persian preserves the pre-bilingual layout rhythm. */
html[lang^="en"] {
  --berta-font-body: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --berta-font-display: "Bodoni MT", Didot, Baskerville, Georgia, "Times New Roman", serif;
  --berta-font-brand: "Bodoni MT", Didot, Baskerville, Georgia, serif;
}

/* Persian returns to the exact theme font family used before bilingual mode. */
html[lang^="fa"] {
  --berta-font-body: "IRANYekanX", Tahoma, "Segoe UI", Arial, sans-serif;
  --berta-font-display: "IRANYekanX", Tahoma, "Segoe UI", Arial, sans-serif;
  --berta-font-brand: "Bodoni MT", Didot, Baskerville, Georgia, serif;
}

html[lang^="en"] body {
  letter-spacing: 0.005em;
}

html[lang^="en"] h1,
html[lang^="en"] h2,
html[lang^="en"] h3,
html[lang^="en"] .hero__title,
html[lang^="en"] .section-heading h2,
html[lang^="en"] .products-section__heading h2,
html[lang^="en"] .editorial-section h2,
html[lang^="en"] .newsletter-section h2,
html[lang^="en"] .generic-entry__header h1 {
  font-family: var(--berta-font-display);
  font-weight: 400;
  letter-spacing: .035em;
}

html[lang^="en"] .hero__title {
  letter-spacing: .045em;
}

html[lang^="en"] .site-brand__text {
  font-family: var(--berta-font-brand);
  font-weight: 400;
  letter-spacing: .31em;
  padding-left: .31em;
}

html[lang^="en"] .desktop-nav a,
html[lang^="en"] .button,
html[lang^="en"] .eyebrow,
html[lang^="en"] .hero__eyebrow,
html[lang^="en"] .collection-card__title,
html[lang^="en"] .text-link,
html[lang^="en"] .site-footer__column a,
html[lang^="en"] .site-footer__column h2 {
  font-family: var(--berta-font-body);
}

.language-switcher {
  direction: ltr;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-inline-end: 7px;
  color: rgba(239,227,202,.58);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
  font-size: 9px;
  line-height: 1;
  letter-spacing: .13em;
  white-space: nowrap;
}

.language-switcher a {
  padding: 8px 2px;
  opacity: .58;
  transition: opacity .3s ease, color .3s ease;
}

.language-switcher a:hover,
.language-switcher a.is-active {
  color: var(--berta-cream);
  opacity: 1;
}

.language-switcher span {
  opacity: .25;
}

.language-switcher--overlay {
  margin: 0 14px 0 auto;
  font-size: 10px;
}

html[dir="rtl"] .language-switcher--overlay {
  margin: 0 auto 0 14px;
}

@media (max-width: 768px) {
  .site-header__right > .language-switcher {
    margin-inline-end: 2px;
    gap: 3px;
    font-size: 8px;
  }

  .site-header__right > .language-switcher a {
    padding-inline: 1px;
  }
}

/* EN: keep the clean stacked editorial rhythm introduced with bilingual mode. */
html[lang^="en"] .hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

html[lang^="en"] .hero__eyebrow {
  margin: 0 0 16px !important;
  line-height: 1.35;
}

html[lang^="en"] .hero__title {
  margin: 0 0 28px !important;
  line-height: 1.02;
}

html[lang^="en"] .hero__content .button {
  align-self: flex-start;
  margin: 0;
}

/* FA: restore the exact pre-bilingual v1.3.8 spacing/alignment behavior. */
html[lang^="fa"] .hero__content {
  display: block;
  text-align: right;
}

html[lang^="fa"] .hero__eyebrow {
  margin: 0 0 18px !important;
  font-size: clamp(11px, .9vw, 13px);
  line-height: 1.7;
  font-weight: 500;
}

html[lang^="fa"] .hero__title {
  margin: 0 0 24px !important;
  line-height: 1.08;
  letter-spacing: 0;
}

html[lang^="fa"] .hero__content .button {
  margin: 0;
  min-height: 46px;
  padding: 13px 28px;
}

/* Collection heading now follows the same text hierarchy as New Arrivals. */
.collections-section__heading {
  align-items: flex-end;
}

.collections-section__heading > div {
  min-width: 0;
}

html[dir="ltr"] .collections-section__heading > div {
  text-align: left;
}

html[dir="rtl"] .collections-section__heading > div {
  text-align: right;
}

/* Header language control must never flip with RTL/LTR. */
.site-header__right {
  direction: ltr;
}

.site-header__right > .language-switcher {
  direction: ltr;
  order: -1;
  margin: 0 8px 0 0;
}

@media (max-width: 768px) {
  html[lang^="fa"] .hero__eyebrow {
    margin-bottom: 14px !important;
  }

  html[lang^="fa"] .hero__title {
    margin-bottom: 20px !important;
    line-height: 1.12;
  }

  .site-header__right > .language-switcher {
    position: absolute;
    top: 7px;
    left: 12px;
    right: auto;
    margin: 0;
    z-index: 8;
  }
}

@media (max-width: 480px) {
  .site-header__right > .language-switcher {
    display: inline-flex;
    top: 6px;
    left: 8px;
    font-size: 7.5px;
  }
}

/* v1.4.3 — Hero content shares one exact vertical axis in both languages. */
html[lang^="en"] .hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

html[lang^="en"] .hero__eyebrow,
html[lang^="en"] .hero__title,
html[lang^="en"] .hero__content .button {
  align-self: flex-start;
}

html[lang^="fa"] .hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

html[lang^="fa"] .hero__eyebrow,
html[lang^="fa"] .hero__title,
html[lang^="fa"] .hero__content .button {
  align-self: flex-end;
}

/* Persian hero slider controls live on the bottom-left; EN keeps the original right position. */
html[lang^="fa"] .hero__controls {
  left: 28px;
  right: auto;
  direction: ltr;
}

@media (max-width: 768px) {
  html[lang^="fa"] .hero__controls {
    left: 18px;
    right: auto;
  }
}

/* v1.4.5 — deterministic hero item placement by language. */
html[lang^="en"] .hero__content {
  left: max(28px, calc((100vw - var(--container)) / 2 + 20px)) !important;
  right: auto !important;
  width: auto;
  max-width: min(760px, calc(100vw - 56px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  direction: ltr;
}

html[lang^="en"] .hero__eyebrow,
html[lang^="en"] .hero__title,
html[lang^="en"] .hero__content .button {
  width: fit-content;
  max-width: 100%;
  margin-left: 0 !important;
  margin-right: auto !important;
  align-self: flex-start !important;
  text-align: left;
}

html[lang^="fa"] .hero__content {
  right: max(28px, calc((100vw - var(--container)) / 2 + 20px)) !important;
  left: auto !important;
  width: auto;
  max-width: min(760px, calc(100vw - 56px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  direction: rtl;
}

html[lang^="fa"] .hero__eyebrow,
html[lang^="fa"] .hero__title,
html[lang^="fa"] .hero__content .button {
  width: fit-content;
  max-width: 100%;
  margin-right: 0 !important;
  margin-left: auto !important;
  align-self: flex-end !important;
  text-align: right;
}

html[lang^="fa"] .hero__controls {
  left: 28px !important;
  right: auto !important;
  direction: ltr;
}

@media (max-width: 768px) {
  html[lang^="en"] .hero__content {
    left: 20px !important;
    right: auto !important;
    max-width: calc(100vw - 40px);
  }

  html[lang^="fa"] .hero__content {
    right: 20px !important;
    left: auto !important;
    max-width: calc(100vw - 40px);
  }

  html[lang^="fa"] .hero__controls {
    left: 18px !important;
    right: auto !important;
  }
}

/* v1.5.4 — Persian header typography follows the same Persian family as the site. */
html[lang^="fa"] .desktop-nav a,
html[lang^="fa"] .overlay-nav__list a {
  font-family: var(--berta-font-body);
  font-weight: 600;
  letter-spacing: 0;
}
