/*
Theme Name: Payam Academy 2026
Theme URI: https://payam-academy.com/
Author: شرکت ستاره (setareit.ir)
Author URI: https://setareit.ir/
Description: قالب اختصاصی آکادمی پیام طاهری — بازطراحی ۱۴۰۵ بر پایه‌ی دیزاین‌سیستم «Payam Academy Design System» (زمرد + طلای شامپاینی، قاب طاقی). جایگزین payam-custom.
Version: 1.1.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: payam-2
Tags: rtl-language-support, custom-menu, e-commerce, education
*/

/* ---------------------------------------------------------------------------
   This file is the WordPress theme manifest and the LAST stylesheet loaded.
   The design system lives in assets/css/ and is enqueued ahead of this file:

     ds-fonts.css      self-hosted Vazirmatn + Markazi Text
     ds-tokens.css     colors · typography · spacing · radius · shadows
     ds-base.css       base elements + .pa-* utilities (marble, container…)
     ds-components.css 21 components ported from the DS's React source
     ds-woocommerce.css WooCommerce skin (styles Woo's own classes)

   Put only page/template-specific rules below. Never hardcode a hex value —
   always use a token from ds-tokens.css.
   ------------------------------------------------------------------------ */

/* ============================================================ 404 — NotFound
   Ported from the design system: templates/not-found/NotFound.dc.html
   "RTL 404 page — emerald marble hero with an arched photo, large gold code,
   and back-home CTAs." */

.pa-404 {
  font-family: var(--font-body);
  color: var(--cream-50);
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.pa-404__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px var(--gutter);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
  width: 100%;
}

.pa-404__mark {
  display: block;
  width: 56px;
  height: 2px;
  background: var(--gold-500);
  margin-bottom: 26px;
}

.pa-404__code {
  font-family: var(--font-display);
  font-size: 9rem;
  font-weight: var(--fw-bold);
  line-height: .9;
  color: var(--gold-500);
  letter-spacing: -.02em;
}

.pa-404__title {
  font-family: var(--font-display);
  font-size: var(--fs-display-md);
  font-weight: var(--fw-semibold);
  line-height: 1.15;
  margin: 18px 0 0;
  color: var(--cream-50);
}

.pa-404__lead {
  font-size: var(--fs-lead);
  font-weight: var(--fw-light);
  line-height: var(--lh-relaxed);
  color: var(--text-on-forest);
  max-width: 440px;
  margin: 16px 0 0;
}

.pa-404__actions {
  display: flex;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.pa-404__figure {
  max-width: 320px;
  width: 100%;
  justify-self: center;
}

/* Search fallback — not in the DS mock, but a 404 without a way forward is a
   dead end. Styled as a hairline field on the marble. */
.pa-404__search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  max-width: 440px;
  border-bottom: 1px solid var(--border-on-forest);
  padding-bottom: 8px;
}
.pa-404__search input[type="search"] {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--cream-50);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  padding: 6px 0;
}
.pa-404__search input[type="search"]::placeholder { color: var(--text-on-forest-muted); }
.pa-404__search input[type="search"]:focus { outline: none; }
.pa-404__search:focus-within { border-bottom-color: var(--gold-500); }
.pa-404__search button {
  background: transparent;
  border: 0;
  color: var(--gold-300);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  cursor: pointer;
  padding: 6px 2px;
}
.pa-404__search button:hover { color: var(--gold-500); }

@media (max-width: 860px) {
  .pa-404 { min-height: 100svh; }
  .pa-404__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 64px var(--gutter);
  }
  .pa-404__code { font-size: 6rem; }
  .pa-404__title { font-size: var(--fs-display-sm); }
  .pa-404__figure { max-width: 240px; grid-row: 1; }
}

/* ============================================== Course landing (PDP) ======
   From templates/course-landing/CourseLanding.dc.html */

.pa-pdp {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 56px var(--gutter) 96px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 56px;
  align-items: start;
}
.pa-pdp__outcomes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  margin-bottom: 52px;
}
.pa-pdp__buy { position: sticky; top: 24px; }

@media (max-width: 980px) {
  .pa-pdp { grid-template-columns: 1fr; gap: 40px; }
  .pa-pdp__buy { position: static; }
  .pa-pdp__outcomes { grid-template-columns: 1fr; }
}

/* ============================================ Media gallery (PDP) ========
   Student / instructor showcase reels. Built on the DS VideoThumbnail
   language: square-cornered-ish tiles (radius-sm), sand placeholder, gold
   emphasis in the heading. The uploaded clips are portrait phone footage
   (`tall: true`), which is the whole point of a mobileography course — so the
   tiles are portrait by default rather than letterboxed into 16:9. */

.pa-gallery { padding-block: 88px; }
.pa-gallery__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.pa-gallery .pa-heading { text-align: center; align-items: center; }
.pa-gallery__title em {
  font-style: normal;
  color: var(--gold-600);
}
.pa-gallery--on-forest .pa-gallery__title em { color: var(--gold-300); }

.pa-gallery__grid {
  display: grid;
  /* Tracks are CAPPED, not 1fr. With auto-fit + 1fr a two-item gallery
     stretches each tile to half the container — at 9:16 that renders a ~960px
     tall video. Bounding the track keeps a 2-item and a 6-item gallery the
     same visual weight; the row just centres when it doesn't fill. */
  grid-template-columns: repeat(auto-fit, minmax(190px, 260px));
  justify-content: center;
  gap: 18px;
  margin-top: 44px;
}
.pa-gallery__tile {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--sand-200);
  border: 1px solid var(--border-subtle);
}
.pa-gallery--on-forest .pa-gallery__tile {
  background: var(--green-800);
  border-color: var(--border-on-forest);
}
.pa-gallery__tile--tall { aspect-ratio: 9 / 16; }
.pa-gallery__tile video,
.pa-gallery__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pa-gallery__caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 26px 14px 12px;
  color: var(--cream-50);
  font-size: var(--fs-caption);
  /* Scrim exists to keep the caption legible over arbitrary footage; without
     it the text fails contrast on light frames. */
  background: linear-gradient(to top, rgba(22, 48, 42, .8), rgba(22, 48, 42, 0));
  pointer-events: none;
}
.pa-gallery__caption strong { display: block; font-weight: var(--fw-semibold); }
.pa-gallery__caption span { opacity: .8; }

@media (max-width: 640px) {
  .pa-gallery { padding-block: 56px; }
  .pa-gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ==================================================== About ==============*/

.pa-about__instructor {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 96px var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 900px) {
  .pa-about__instructor { grid-template-columns: 1fr; gap: 40px; padding: 64px var(--gutter); }
}

/* ==================================================== Contact ============*/

.pa-contact {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px var(--gutter) 100px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}
.pa-contact__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pa-contact__card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 22px;
}
.pa-contact__card-title {
  font-size: 12px; letter-spacing: .14em; color: var(--clay-500);
  font-weight: var(--fw-semibold); text-transform: uppercase; margin-bottom: 8px;
}
@media (max-width: 900px) {
  .pa-contact { grid-template-columns: 1fr; gap: 40px; }
  .pa-contact__row { grid-template-columns: 1fr; }
}

/* ==================================================== Auth ===============
   From templates/auth/Auth.dc.html — split screen. */

.pa-auth { min-height: 80vh; display: grid; grid-template-columns: 1fr 1fr; }
.pa-auth__form-panel { display: flex; align-items: center; justify-content: center; padding: 48px var(--gutter); }
.pa-auth__form { width: 100%; max-width: 400px; }
.pa-auth__brand-panel {
  position: relative; background: var(--green-900);
  overflow: hidden; display: flex; align-items: flex-end;
}
.pa-auth__brand-panel img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .35;
}
/* The DS mock uses a gradient scrim here. It is the one place the brand's
   no-gradient rule is relaxed, because it exists to keep the caption legible
   over an arbitrary photo — a flat overlay would either wash out the image or
   fail contrast at the bottom edge. */
.pa-auth__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(22, 48, 42, .85), rgba(22, 48, 42, .35));
}
.pa-auth__brand-copy { position: relative; padding: 56px var(--gutter); color: var(--cream-50); }

/* Digits renders its own widget markup; give it room and neutralise the
   plugin's own centring so it sits on our grid. */
.pa-auth__widget { margin-top: 8px; }
.pa-auth__widget .digits_form,
.pa-auth__widget form { width: 100%; max-width: none; margin: 0; }

@media (max-width: 900px) {
  .pa-auth { grid-template-columns: 1fr; }
  .pa-auth__brand-panel { min-height: 220px; order: -1; }
  .pa-auth__brand-copy { padding: 32px var(--gutter); }
}

/* ==================================================== Blog ==============*/

.pa-featured {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 0;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); overflow: hidden;
}
.pa-featured__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--sand-200); }
.pa-featured__media img { width: 100%; height: 100%; object-fit: cover; }
.pa-featured__body { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 860px) {
  .pa-featured { grid-template-columns: 1fr; }
  .pa-featured__body { padding: 28px 24px; }
}

/* ==================================================== Legal / policy ====*/

.pa-legal {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 56px var(--gutter) 100px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}
.pa-legal__toc-inner { position: sticky; top: 100px; }
.pa-legal__toc ul { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pa-legal__toc a { font-size: 14px; color: var(--text-secondary); }
.pa-legal__toc a:hover { color: var(--green-900); }

.pa-legal__highlight {
  display: flex; align-items: center; gap: 24px;
  background: var(--surface-sand); border: 1px solid var(--sand-300);
  border-radius: var(--radius-md); padding: 28px 32px; margin-bottom: 48px;
}
.pa-legal__highlight-num { text-align: center; line-height: 1; flex-shrink: 0; }
.pa-legal__highlight-num span {
  font-family: var(--font-display); font-size: 56px;
  font-weight: var(--fw-bold); color: var(--gold-600); display: block;
}
.pa-legal__highlight-num small { font-size: 14px; color: var(--text-secondary); }
.pa-legal__highlight p { font-size: 15px; line-height: 1.9; color: var(--ink-700); margin: 0; }

.pa-legal__section { scroll-margin-top: 100px; margin-bottom: 44px; }
.pa-legal__section h2 {
  font-family: var(--font-display); font-size: var(--fs-display-sm);
  font-weight: var(--fw-semibold); margin: 0 0 14px;
}
.pa-legal__section p { font-size: 15px; line-height: 1.9; color: var(--ink-700); margin-bottom: 12px; }
.pa-legal__section ul { padding-inline-start: 1.3em; color: var(--ink-700); font-size: 15px; line-height: 1.9; }
.pa-legal__section li + li { margin-top: 6px; }

.pa-legal__steps { list-style: none; padding: 0; margin: 16px 0 0; counter-reset: step; }
.pa-legal__steps li {
  display: flex; gap: 16px; padding: 16px 0;
  border-top: 1px solid var(--border-subtle); font-size: 15px; line-height: 1.9; color: var(--ink-700);
}
.pa-legal__step-when {
  flex-shrink: 0; font-weight: var(--fw-semibold);
  color: var(--gold-600); min-width: 56px;
}

.pa-legal__callout {
  background: var(--surface-sand); border-inline-start: 3px solid var(--gold-500);
  border-radius: var(--radius-sm); padding: 16px 20px; margin-top: 16px;
  font-size: 15px; line-height: 1.9; color: var(--ink-700);
}

.pa-legal__contact { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 15px; }
.pa-legal__contact dt { color: var(--text-muted); }
.pa-legal__contact dd { margin: 0; color: var(--ink-700); font-weight: var(--fw-medium); }

.pa-legal__cta {
  margin-top: 56px; padding: 36px 32px; text-align: center;
  background: var(--surface-sand); border: 1px solid var(--sand-300); border-radius: var(--radius-md);
}
.pa-legal__cta h2 { font-family: var(--font-display); font-size: var(--fs-display-sm); font-weight: var(--fw-semibold); margin: 0 0 8px; }
.pa-legal__cta p { font-size: 15px; color: var(--text-secondary); margin: 0 0 20px; }

@media (max-width: 900px) {
  .pa-legal { grid-template-columns: 1fr; gap: 32px; }
  .pa-legal__toc-inner { position: static; }
  .pa-legal__highlight { flex-direction: column; text-align: center; }
}
