:root {
  --amp-canvas: #f8f7f3;
  --amp-surface: #fff;
  --amp-text: #18222b;
  --amp-muted: #5d6872;
  --amp-primary: #173b57;
  --amp-accent: #8b3038;
  --amp-border: #dce2e6;
  --amp-soft: #eef1f2;
  --amp-focus: #005fcc;
  --amp-shadow: 0 12px 36px rgba(24, 34, 43, 0.08);
  --amp-radius-sm: 6px;
  --amp-radius-md: 10px;
  --amp-radius-lg: 16px;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body,
button,
input,
select,
textarea {
  font-family: Vazirmatn, Tahoma, sans-serif;
}

body {
  background: var(--amp-canvas);
  color: var(--amp-text);
  font-size: 18px;
  line-height: 2;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-title {
  font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
  line-height: 1.55;
  text-wrap: balance;
}

h1 { font-size: clamp(2.35rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.35rem, 2.3vw, 1.8rem); }

a {
  text-underline-offset: 0.22em;
  text-decoration-thickness: 0.08em;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--amp-focus);
  outline-offset: 3px;
}

.ltr,
[dir="ltr"],
a[href^="mailto:"],
a[href^="tel:"],
code,
kbd,
samp {
  direction: ltr;
  unicode-bidi: embed;
}

.amp-shell {
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
}

.amp-article {
  width: min(100% - 2rem, 760px);
  margin-inline: auto;
}

.amp-article__meta,
.amp-card__meta {
  color: var(--amp-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.amp-card {
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: var(--amp-radius-md);
  padding: clamp(1rem, 3vw, 2rem);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.amp-card:hover {
  box-shadow: var(--amp-shadow);
  transform: translateY(-2px);
}

.amp-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.amp-home-hero {
  align-items: center;
  display: grid;
  gap: clamp(1.5rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.9fr);
  margin-block: clamp(2rem, 8vw, 6rem);
}

.home .content-area {
  margin-top: 0;
}

.home .content-container.site-container {
  max-width: 1200px;
}

.amp-home-hero__eyebrow,
.amp-article__topics {
  color: var(--amp-accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.amp-home-hero__roles {
  color: var(--amp-primary);
}

.amp-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.amp-button {
  border: 2px solid var(--amp-primary);
  border-radius: var(--amp-radius-sm);
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 1rem;
  text-decoration: none;
}

.amp-button--primary {
  background: var(--amp-primary);
  color: #fff;
}

.amp-button--secondary {
  background: transparent;
  color: var(--amp-primary);
}

.amp-home-section {
  border-top: 1px solid var(--amp-border);
  margin-block: clamp(3rem, 7vw, 6rem);
  padding-top: clamp(2rem, 4vw, 3rem);
}

.amp-home-section > h2 {
  margin-top: 0;
}

.amp-home-dani,
.amp-home-contact {
  background: var(--amp-soft);
  border: 1px solid var(--amp-border);
  border-radius: var(--amp-radius-lg);
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.amp-placeholder {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: var(--amp-soft);
  border: 1px solid var(--amp-border);
  border-radius: var(--amp-radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 2rem;
  position: relative;
  text-align: center;
}

.amp-placeholder::before {
  color: rgba(23, 59, 87, 0.08);
  content: "ع م";
  font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
  font-size: clamp(6rem, 18vw, 14rem);
  font-weight: 800;
  line-height: 1;
  position: absolute;
}

.amp-placeholder__name {
  background: rgba(248, 247, 243, 0.9);
  border-radius: var(--amp-radius-sm);
  color: var(--amp-primary);
  font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 800;
  padding: 0.4rem 0.8rem;
  position: relative;
}

.amp-source-box {
  background: var(--amp-soft);
  border-inline-start: 4px solid var(--amp-accent);
  margin-block: 2rem;
  padding: 1.25rem;
}

.amp-content-list {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.amp-content-list > li {
  min-width: 0;
}

.amp-book-placeholder {
  align-items: center;
  aspect-ratio: 3 / 4;
  background: var(--amp-primary);
  border: 0.5rem solid var(--amp-surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
  font-weight: 800;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 1.25rem;
  text-align: center;
}

.amp-book-placeholder--single {
  margin: 2rem auto;
  max-width: 20rem;
}

.amp-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.875rem;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.amp-breadcrumb li:not(:last-child)::after {
  color: var(--amp-muted);
  content: "‹";
  margin-inline-start: 0.4rem;
}

.amp-author-bio,
.amp-related {
  border-top: 1px solid var(--amp-border);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}

.amp-author-bio h2,
.amp-related h2,
.amp-source-box h2 {
  font-size: 1.35rem;
}

.amp-empty-state,
.amp-form-status {
  background: var(--amp-surface);
  border: 1px solid var(--amp-border);
  border-radius: var(--amp-radius-md);
  padding: 1.25rem;
}

.amp-contact-form label,
.amp-contact-form input,
.amp-contact-form textarea {
  display: block;
  width: 100%;
}

.amp-contact-form :where(input, textarea)[aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.15);
}

.amp-contact-form input[type="checkbox"] {
  display: inline-block;
  margin-inline-end: 0.5rem;
  min-height: 1.25rem;
  width: 1.25rem;
}

.amp-contact-form__checkbox-label {
  display: inline;
  width: auto;
}

.amp-form-status.is-error {
  border-inline-start: 4px solid #b42318;
}

.amp-form-status.is-success {
  border-inline-start: 4px solid #157347;
}

.amp-contact-form input,
.amp-contact-form textarea {
  background: var(--amp-surface);
  border: 1px solid var(--amp-muted);
  border-radius: var(--amp-radius-sm);
  color: var(--amp-text);
  padding: 0.75rem;
}

.amp-contact-form__honeypot {
  height: 1px;
  inset-inline-start: -10000px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.amp-pagination {
  margin-block: 2rem;
}

.amp-pagination .page-numbers {
  display: inline-flex;
  min-height: 44px;
  min-width: 44px;
  place-content: center;
  place-items: center;
}

.amp-404 {
  min-height: 50vh;
  padding-block: clamp(3rem, 10vw, 8rem);
  text-align: center;
}

/* Kadence hides this variant through its medium breakpoint; retain one title on mid/tablet viewports. */
@media (min-width: 544px) and (max-width: 1024px) {
  .site-branding .site-title.vs-md-false {
    display: block !important;
  }
}

@media (max-width: 48rem) {
  body { font-size: 17px; }
  .amp-card:hover { box-shadow: none; transform: none; }
  .amp-home-hero { grid-template-columns: 1fr; }
  .amp-home-actions .amp-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header, .site-footer, .amp-pagination { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; }
}
