/*
Theme Name: Mahan Catalog
Template: blocksy
Description: Mahansco editorial styles and block patterns for Blocksy.
Version: 1.2.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: mahan-catalog
License: GPL-2.0-or-later
*/
@font-face {
  font-family: Vazirmatn;
  src: url("assets/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

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

:root {
  --mahan-ink: #19333e;
  --mahan-paper: #f7f8f4;
  --mahan-accent: #d0e6a1;
  --mahan-muted: #4e6568;
  --mahan-line: #dce1d9;
  --mahan-font: Vazirmatn, Tahoma, Arial, sans-serif;
  --mahan-wide: 78rem;
  --mahan-deep: #112b32;
  --mahan-reading: 47rem;
}

body,
.editor-styles-wrapper {
  background-color: var(--mahan-paper);
  color: var(--mahan-ink);
  font-family: var(--mahan-font);
}

[data-header] {
  --theme-font-family: var(--mahan-font);
  --theme-link-initial-color: var(--mahan-ink);
}

[data-header] .menu .mahan-quote > a {
  background-color: var(--mahan-accent);
  color: var(--mahan-ink);
  border-radius: .5rem;
  align-self: center;
  height: 44px;
  min-height: 44px;
  padding-inline: .9rem;
}

.entry-header .page-title,
.hero-section .page-title {
  color: var(--mahan-ink);
  font: 700 clamp(2.5rem, 6vw, 5rem)/1.13 var(--mahan-font);
  text-wrap: balance;
}

:where(.entry-content, .editor-styles-wrapper) {
  font-size: 1.0625rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

:where(.entry-content, .editor-styles-wrapper) :is(h2, h3) {
  color: var(--mahan-ink);
  font-family: var(--mahan-font);
  line-height: 1.35;
  text-wrap: balance;
}

:where(.entry-content, .editor-styles-wrapper) :is(p, li) a {
  color: #305047;
  text-decoration: underline;
  text-underline-offset: .18em;
}

:where(.entry-content, .editor-styles-wrapper) .mahan-intro {
  color: var(--mahan-muted);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.65;
  max-inline-size: 42ch;
  margin-inline: 0 auto;
}

.entry-content > .mahan-intro {
  margin-inline-start: 0 !important;
}

:where(.entry-content, .editor-styles-wrapper) .mahan-panel {
  background: #fff;
  border: 1px solid var(--mahan-line);
  border-radius: 1.125rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.mahan-language + .mahan-language {
  border-block-start: 1px solid var(--mahan-line);
  margin-block-start: 3rem;
  padding-block-start: 2rem;
}

.mahan-media img {
  aspect-ratio: 3 / 2;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 1.125rem;
}

.mahan-product-media img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-button .wp-block-button__link {
  color: var(--mahan-ink);
  background: var(--mahan-accent);
  border-radius: .5rem;
  font-weight: 700;
  min-height: 44px;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-button .wp-block-button__link:hover {
  background: #e1efc2;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.mahan-footer {
  background: var(--mahan-ink);
  color: #f8f9f5;
}

.mahan-footer-inner {
  width: min(var(--mahan-wide), calc(100% - 2.5rem));
  margin-inline: auto;
  padding-block: clamp(2.75rem, 6vw, 5rem);
}

.mahan-footer-inner .wp-block-columns {
  column-gap: clamp(1.25rem, 5vw, 4rem);
  margin-block: 0;
}

.mahan-footer-inner h2 {
  color: inherit;
  font: 700 1.125rem/1.4 var(--mahan-font);
  margin-block: 0 .8rem;
}

.mahan-footer-inner .mahan-footer-brand {
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -.04em;
}

.mahan-footer-inner p { max-inline-size: 30ch; }
.mahan-footer-inner ul { list-style: none; margin: 0; padding: 0; }
.mahan-footer-inner li + li { margin-block-start: .55rem; }
.mahan-footer-inner a { color: var(--mahan-accent); text-underline-offset: .2em; }
.mahan-footer-inner a:hover { text-decoration: underline; }
.mahan-footer-inner a:focus-visible { outline-color: var(--mahan-accent); }

/* The WordPress interiors have their own editorial grid and navigation. */
#header [data-row="middle"] {
  --height: 76px;
  border-block-end: 1px solid var(--mahan-line);
}

#header .site-title a {
  font-weight: 700;
  letter-spacing: -.04em;
  font-size: 1.55rem;
  text-transform: lowercase;
}

#header .site-title a::after {
  content: ".";
  color: #526e27;
}

#header .menu > li > a {
  font-weight: 700;
  font-size: .83rem;
  text-transform: none;
}

#header .menu > .current-menu-item:not(.mahan-quote) > a,
#header .menu > .current-menu-ancestor > a {
  color: #345a3a;
  text-decoration: underline;
  text-underline-offset: .5em;
  text-decoration-thickness: 2px;
}

.mahan-page {
  --mahan-gutter: clamp(1.25rem, 4.8vw, 4.5rem);
}

.mahan-container {
  width: min(var(--mahan-wide), calc(100% - 2 * var(--mahan-gutter)));
  margin-inline: auto;
}

.mahan-masthead {
  padding-block: clamp(2.5rem, 5.75vw, 5.25rem) clamp(1.85rem, 4.5vw, 4rem);
}

.mahan-page--collection .mahan-masthead {
  padding-block-end: clamp(1.5rem, 3.25vw, 2.75rem);
}

.mahan-masthead--company {
  background: var(--mahan-deep);
  color: white;
  padding-block-end: clamp(3rem, 9vw, 7rem);
}

.mahan-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--mahan-muted);
  margin-block-end: clamp(1.1rem, 2.4vw, 2rem);
}

.mahan-crumb > * + *::before {
  content: "/";
  display: inline-block;
  opacity: .55;
  margin-inline-end: .55rem;
}

.mahan-crumb a { color: inherit; }
.mahan-crumb a:hover { text-decoration: underline; }

.mahan-title {
  max-inline-size: 14ch;
  margin: 0;
  color: inherit;
  font: 700 clamp(3rem, 7.4vw, 7rem)/.99 var(--mahan-font);
  letter-spacing: -.055em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.mahan-title:lang(fa) {
  letter-spacing: normal;
  line-height: 1.18;
}

.mahan-masthead--company .mahan-crumb {
  color: var(--mahan-accent);
}

.mahan-deck {
  margin-block: 1.6rem 0;
  max-inline-size: 48ch;
  font-size: clamp(1.15rem, 2.25vw, 1.65rem);
  line-height: 1.5;
  color: inherit;
}

.mahan-article-meta {
  display: flex;
  gap: .9rem;
  align-items: center;
  flex-wrap: wrap;
  margin-block-start: 1.75rem;
  color: var(--mahan-muted);
  font-size: .9rem;
}

.mahan-article-meta a {
  color: var(--mahan-ink);
  background: #e8efde;
  font-weight: 700;
  border-radius: 2rem;
  padding: .35rem .9rem;
}

.mahan-cover {
  position: relative;
  margin-block-end: 0;
}

.mahan-masthead--company + .mahan-cover {
  margin-block-start: clamp(-3.25rem, -4vw, -1.5rem);
}

.mahan-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.35;
  object-fit: cover;
  object-position: center 46%;
  border-radius: .75rem;
}

.mahan-body {
  padding-block: clamp(1rem, 3.3vw, 3rem) clamp(4rem, 8vw, 7rem);
}

.mahan-body--reading .entry-content {
  max-width: var(--mahan-reading);
}

.mahan-body .entry-content > .mahan-intro {
  font-size: clamp(1.2rem, 2.4vw, 1.85rem);
  max-inline-size: 47ch;
}

.mahan-body .entry-content > .wp-block-columns {
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: flex-start !important;
}

.mahan-body .entry-content > .wp-block-columns > .wp-block-column > .mahan-panel {
  border: 0;
  border-radius: 0;
  border-block-start: 1px solid var(--mahan-ink);
  background: transparent;
  padding-inline: 0;
}

.mahan-body .entry-content h2 {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  letter-spacing: -.025em;
}

.mahan-page :is(h2, h3):lang(fa) {
  letter-spacing: normal;
}

.mahan-body .entry-content :is(.mahan-language, .mahansco-language) {
  max-inline-size: var(--mahan-reading);
}

.mahan-body .entry-content .mahan-bilingual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 6vw, 5rem);
}

.mahan-body .mahan-bilingual .mahan-language + .mahan-language {
  border: 0;
  margin: 0;
  padding: 0;
}

.mahan-product-index {
  margin-block-start: 0;
}

.mahan-product-index > h2 {
  margin-block-end: 1.5rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.mahan-product-card {
  border-block-start: 1px solid var(--mahan-line);
  display: grid;
  align-items: start;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(1.5rem, 4vw, 3rem);
}

.mahan-product-card:has(.mahan-product-card__image) {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}

.mahan-product-card__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #edf0e8;
  border-radius: .75rem;
}

.mahan-product-card__details h3 {
  margin-block: 0 .75rem;
  font-size: clamp(1.7rem, 3.5vw, 3rem);
  letter-spacing: -.035em;
}

.mahan-product-card__details p {
  max-inline-size: 45ch;
}

.mahan-text-link {
  display: inline-flex;
  gap: .65rem;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .35em;
}

.mahan-body .wp-block-query .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.75rem);
  margin-block-start: 2rem;
}

.mahan-body .wp-block-query .mahan-panel {
  background: transparent;
  border: 0;
  border-block-start: 1px solid var(--mahan-line);
  border-radius: 0;
  padding: 0;
  padding-block-start: .9rem;
}

.mahan-body .wp-block-query .wp-block-post-featured-image img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: .75rem;
  transition: filter .2s ease-in-out;
}

.mahan-body .wp-block-query .wp-block-post-featured-image a:hover img {
  filter: brightness(.88);
}

.mahan-footer {
  background: var(--mahan-deep);
}

@media (max-width: 700px) {
  .mahan-body .entry-content .mahan-bilingual,
  .mahan-product-card:has(.mahan-product-card__image),
  .mahan-body .wp-block-query .wp-block-post-template {
    grid-template-columns: 1fr;
  }

  .mahan-cover img {
    aspect-ratio: 3 / 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mahan-body .wp-block-query .wp-block-post-featured-image img {
    transition: none;
  }
}

.mahan-resource-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-block-end: 1.75rem;
  padding-block-end: 1rem;
  border-block-end: 1px solid var(--mahan-line);
}

.mahan-resource-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 1rem;
  color: var(--mahan-deep);
  border: 1px solid var(--mahan-line);
  border-radius: .45rem;
  font-weight: 700;
}

.mahan-resource-nav a:hover {
  border-color: var(--mahan-deep);
}

.mahan-resource-nav a[aria-current] {
  background: var(--mahan-deep);
  color: white;
}

.mahan-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
}

.mahan-resource-card figure {
  margin: 0 0 1rem;
}

.mahan-resource-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: .75rem;
}

.mahan-resource-card h2 {
  font-size: clamp(1.65rem, 3vw, 2.6rem);
}

.mahan-legacy-content .content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
}

.mahan-legacy-content [lang="en"] + [lang="fa"],
.mahan-legacy-content [lang="fa"] + [lang="en"] {
  margin-block-end: 1.25rem;
}

.mahan-legacy-content .document > [lang] + [lang] {
  padding-block-start: 2rem;
  border-block-start: 1px solid var(--mahan-line);
}

.mahan-legacy-content .info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-block-end: 2rem;
}

.mahan-legacy-content .info-grid > *,
.mahan-legacy-content .side-card {
  border: 1px solid var(--mahan-line);
  border-radius: .75rem;
  padding: 1.3rem;
}

.mahan-legacy-content .side-card { align-self: start; }

@media (max-width: 700px) {
  .mahan-legacy-content .content-grid,
  .mahan-legacy-content .info-grid {
    grid-template-columns: 1fr;
  }
}
