/*
Theme Name: Behzad Studio
Description: پوستهٔ استودیو بهزاد برای درس‌ها و مقاله‌ها.
Version: 0.4.6
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: behzad-studio
*/
:root {
  --ink: #10283b;
  --muted: #475c6c;
  --blue: #006681;
  --nav: #102b3f;
  --line: #d9e6eb;
  --content: min(1200px, calc(100% - clamp(2rem, 8vw, 7rem)));
}
body { margin: 0; }
.studio-main, .studio-header, .studio-nav-inner, .studio-footer {
  width: var(--content);
  margin-inline: auto;
  direction: rtl;
}
.studio-header {
  min-height: 77px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.studio-header .wp-block-site-title { margin: 0; font-size: 1.55rem; font-weight: 850; }
.studio-header .wp-block-site-title a { color: var(--ink); text-decoration: none; }
.studio-header .wp-block-site-title a::after { content: "."; color: var(--blue); }
.studio-header p { color: var(--muted); margin: 0; font-size: .9rem; }
.studio-nav { background: var(--nav); }
.studio-nav-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0 clamp(.75rem, 2.5vw, 2rem); }
.studio-nav a { color: white; text-decoration: none; font-size: .95rem; padding-block: .75rem; }
.studio-nav a:hover { color: #a3eaf4; }
.studio-nav-search { margin-inline-start: auto; }
.studio-hero {
  box-sizing: border-box;
  width: min(100vw, 1600px);
  position: relative;
  inset-inline-start: 50%;
  transform: translateX(50%);
  min-height: clamp(420px, 47vw, 660px);
  display: flex;
  align-items: center;
  background: #f3f6f6 url("images/studio-hero-v4.jpg") center 46% / cover no-repeat;
}
.hero-copy {
  box-sizing: border-box;
  margin-inline: max(calc((100% - 1200px) / 2), clamp(1rem, 4vw, 3.5rem)) 0;
  width: min(50%, 650px);
  padding-block: 3rem;
}
.hero-copy > p:first-child { color: var(--blue); font-weight: 800; margin: 0; }
.studio-hero h1, .studio-section h1, .studio-article h1 {
  color: var(--ink); font-weight: 850; line-height: 1.22; margin-block: .35em;
}
.studio-hero h1 { font-size: clamp(2.4rem, 5.4vw, 5.6rem); }
.studio-section h1, .studio-article h1 { font-size: clamp(2rem, 5vw, 4rem); }
.hero-copy > p:nth-of-type(2) { max-width: 32ch; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.22rem); }
.studio-primary, .studio-secondary, .wp-block-search__button {
  display: inline-block; box-sizing: border-box; border: 1px solid var(--blue); border-radius: .4rem;
  padding: .65rem 1rem; margin-block: .25rem; font: inherit; font-weight: 700; text-decoration: none;
}
.studio-primary, .wp-block-search__button { background: var(--blue); color: white; }
.studio-primary:hover, .wp-block-search__button:hover { background: #004e64; }
.studio-secondary { background: white; color: var(--blue); }
.studio-secondary:hover { background: #e9f5f8; }
.studio-section { margin-block: 2.75rem 4rem; }
.studio-section h2 { color: var(--ink); font-size: clamp(1.6rem, 3vw, 2.65rem); line-height: 1.25; }
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.topic-grid > .topic-card {
  margin-block: 0; padding: 1.15rem; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: .65rem; background: white;
}
.topic-grid > .topic-card:hover { border-color: #7bb6c5; }
.topic-symbol {
  display: block;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: .85rem;
  background: #e9f6f8 var(--topic-icon) center / 2.45rem no-repeat;
}
.topic-symbol--russian { --topic-icon: url("images/topics/russian.svg"); }
.topic-symbol--persian { --topic-icon: url("images/topics/persian.svg"); }
.topic-symbol--management { --topic-icon: url("images/topics/management.svg"); }
.topic-symbol--marketing { --topic-icon: url("images/topics/marketing.svg"); }
.topic-card h3, .material-card h3 { font-size: 1.22rem; line-height: 1.3; margin-block: .6rem .35rem; }
.topic-card p, .material-card p { color: var(--muted); margin-block: .45rem; }
.topic-card a, .material-card a, .studio-article a { text-underline-offset: .2em; }
.material-card { border-top: 1px solid var(--line); padding-block: 1rem; height: 100%; box-sizing: border-box; }
.wp-block-post-terms { color: var(--blue); font-size: .875rem; }
.studio-search { max-width: 760px; margin-block: 1.5rem; }
.wp-block-search__input { min-width: 0; border: 1px solid #8babb8; border-radius: .4rem; padding: .65rem .85rem; }
.wp-block-search__button { cursor: pointer; margin-block: 0; }
.studio-article { max-width: 760px; margin: clamp(2rem, 6vw, 5rem) auto; overflow-wrap: anywhere; }
.studio-article .wp-block-post-content { margin-block: 2rem; font-size: 1.125rem; }
.studio-pagination, .wp-block-query-pagination { display: flex; flex-wrap: wrap; gap: 1rem; margin-block: 2rem; }
.studio-pagination { justify-content: space-between; }
.wp-block-details { padding: 1rem 1.25rem; background: #e5f4f7; }
.wp-block-details summary { cursor: pointer; font-weight: 700; }
.studio-footer { border-top: 1px solid var(--line); margin-block-start: 4rem; padding-block: 1rem; }
:focus-visible { outline: 3px solid #1385a1; outline-offset: 4px; }
@media (max-width: 850px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) {
  .studio-header { min-height: 65px; }
  .studio-header p { display: none; }
  .studio-nav a { font-size: .875rem; padding-block: .55rem; }
  .studio-hero { align-items: end; min-height: 0; padding-block-start: 58vw; background-size: 100% auto; background-position: left top; }
  .hero-copy { width: 100%; margin: 0; padding: 1.75rem 1rem 2.2rem; background: #f3f6f6; }
  .studio-hero h1 { font-size: clamp(2.05rem, 8vw, 3.4rem); }
  .studio-hero h1 br { display: none; }
  .studio-main .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr; }
}
.wp-site-blocks { overflow-x: clip; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: studio-intro 550ms cubic-bezier(.2,.7,.3,1) both; }
  .hero-copy > h1 { animation-delay: 70ms; }
  .hero-copy > p:nth-of-type(2) { animation-delay: 140ms; }
  .hero-copy > a { animation-delay: 210ms; }

  .studio-primary, .studio-secondary, .wp-block-search__button {
    transition: background-color 180ms ease, box-shadow 180ms ease, translate 180ms ease;
  }
  .studio-nav a { transition: color 180ms ease; }
  .topic-grid > .topic-card {
    transition: border-color 220ms ease, box-shadow 220ms ease, translate 220ms ease;
  }
  .topic-symbol { transition: background-color 220ms ease, color 220ms ease, scale 220ms ease; }
  .topic-card:focus-within .topic-symbol {
    background-color: #ccebf0; scale: 1.08;
  }

  @media (hover: hover) {
    .studio-primary:hover, .studio-secondary:hover, .wp-block-search__button:hover {
      translate: 0 -2px;
      box-shadow: 0 .3rem .75rem #10283b20;
    }
    .topic-grid > .topic-card:hover {
      translate: 0 -4px;
      box-shadow: 0 .65rem 1.25rem #10283b14;
    }
    .topic-card:hover .topic-symbol {
      background-color: #ccebf0; scale: 1.08;
    }
  }

}

@keyframes studio-intro {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes studio-scroll-in {
  from { opacity: .65; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.studio-info {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #f4fafb;
  scroll-margin-block-start: 1.5rem;
}
.studio-info h2 { margin-block-start: 0; }
.studio-info p { color: var(--muted); max-width: 60ch; }
.studio-nav-inner { display: block; }
.studio-nav-desktop { display: flex; align-items: center; gap: clamp(.75rem, 2.5vw, 2rem); }
.studio-nav-desktop a:last-child { margin-inline-start: auto; }
.studio-nav-mobile { display: none; }
.topic-card { display: flex; flex-direction: column; }
.topic-card a { display: inline-block; margin-block-start: auto; padding-block-start: .5rem; }
.material-card { border: 1px solid var(--line); border-radius: .75rem; padding: 1.5rem; background: #fff; }
.material-card h3 { font-size: 1.4rem; margin-block: .7rem; }
.material-card h3 a { color: var(--ink); text-decoration: none; }
.material-card h3 a:hover { color: var(--blue); text-decoration: underline; }
.material-card .wp-block-post-terms a { font-size: .85rem; font-weight: 700; text-decoration: none; }
.studio-info#downloads { background: #eaf7f9; border-color: #c9e4e9; }
.studio-info#about-me { border: 0; border-inline-start: 4px solid var(--blue); border-radius: 0; background: #f6f8f9; }
@media (max-width: 760px) {
  .studio-nav-desktop { display: none; }
  .studio-nav-mobile { display: block; }
  .studio-nav-mobile summary { color: #fff; cursor: pointer; padding: .7rem 0; font-weight: 700; }
  .studio-nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block-end: .75rem; }
  .studio-nav-links a { padding: .5rem; }
}.topic-card > p:last-child { margin-block-start: auto; }
