/* WordPress extras — tokens match the amirreza design */
:root {
  --paper: #f6f4f0;
  --ink: #161513;
  --mute: #7a756c;
  --line: #e4dfd6;
  --accent: #9a3b1c;
  --soft: #f3e6df;
  --site-topbar-h: 0px;
}

.skip-link {
  position: absolute;
  right: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.skip-link:focus {
  top: 1rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1.35rem;
  margin: 0 0 0.85rem;
  color: rgb(255 255 255 / 0.55);
}

.site-footer-links a {
  color: inherit;
  text-decoration: none;
  padding: 0 0.15rem;
}

.site-footer-links a:hover {
  color: var(--soft);
}

.site-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 51;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.site-topbar__inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

.site-topbar__inner > *:first-child {
  margin-top: 0;
}

.site-topbar__inner > *:last-child {
  margin-bottom: 0;
}

.site-topbar p {
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: clamp(0.75rem, 2.6vw, 0.9rem);
  line-height: 1.5;
}

.site-topbar img,
.site-topbar video,
.site-topbar svg,
.site-topbar canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin-inline: auto;
}

.site-topbar iframe,
.site-topbar embed,
.site-topbar object {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  min-height: 0;
}

.site-topbar table {
  max-width: 100%;
}

@media (max-width: 640px) {
  .site-topbar {
    font-size: 0.8rem;
  }

  .site-topbar iframe,
  .site-topbar embed,
  .site-topbar object {
    max-height: 7.5rem;
  }
}

body.has-site-topbar .nav-blur {
  top: var(--site-topbar-h);
}

body.has-site-topbar #content {
  padding-top: var(--site-topbar-h);
}

body.admin-bar .nav-blur {
  top: 32px;
}

body.admin-bar .site-topbar {
  top: 32px;
}

body.admin-bar.has-site-topbar .nav-blur {
  top: calc(32px + var(--site-topbar-h));
}

@media (max-width: 782px) {
  body.admin-bar .nav-blur {
    top: 46px;
  }

  body.admin-bar .site-topbar {
    top: 46px;
  }

  body.admin-bar.has-site-topbar .nav-blur {
    top: calc(46px + var(--site-topbar-h));
  }
}

.nav-link {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--mute);
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--soft);
  color: var(--ink);
}

a.bg-ink,
a.text-paper,
a.nav-cta,
a.mobile-drawer__cta {
  color: var(--paper);
}

a.bg-ink:hover,
a.nav-cta:hover,
a.mobile-drawer__cta:hover {
  color: var(--paper);
}

.nav-cta {
  margin-inline-start: 0.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--paper);
}

.nav-burger {
  position: relative;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(-45deg);
}

.nav-burger.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(45deg);
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgb(22 21 19 / 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(86vw, 22rem);
  height: 100%;
  padding: 1.25rem 1.1rem 2rem;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgb(22 21 19 / 0.12);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.38s;
}

.mobile-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.mobile-drawer__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.mobile-drawer__close {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-drawer__nav a {
  display: block;
  padding: 0.85rem 0.9rem;
  border-radius: 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.mobile-drawer__nav a:hover,
.mobile-drawer__nav a[aria-current="page"] {
  background: var(--soft);
}

.mobile-drawer__cta {
  margin-top: 0.5rem;
  background: var(--ink) !important;
  color: var(--paper) !important;
  text-align: center;
}

body.menu-open {
  overflow: hidden;
}

body.admin-bar .mobile-drawer {
  top: 46px;
  height: calc(100% - 46px);
}

@media (min-width: 783px) {
  body.admin-bar .mobile-drawer {
    top: 32px;
    height: calc(100% - 32px);
  }
}

@media (min-width: 768px) {
  .mobile-overlay,
  .mobile-drawer,
  .nav-burger {
    display: none !important;
  }
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  max-width: 72rem;
  margin: 0 auto;
  padding: 5.5rem 1.25rem 0;
  font-size: 0.78rem;
  color: var(--mute);
}

.entry-wrap .breadcrumbs {
  max-width: none;
  padding: 0 0 1.25rem;
}

.breadcrumbs + .page-hero {
  padding-top: 1.25rem;
}

.breadcrumbs a {
  color: var(--mute);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--line);
}

.related-posts {
  max-width: 72rem;
  margin: 0 auto 4rem;
  padding: 0 1.25rem;
}

.related-posts h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.1rem;
}

/* Page / blog hero */
.page-hero {
  max-width: 72rem;
  margin: 0 auto;
  padding: 8rem 1.25rem 3.5rem;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / 0.6);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--mute);
  margin-bottom: 1.25rem;
}

.page-kicker span {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--accent);
}

.page-hero p.lead {
  margin-top: 1rem;
  max-width: 36rem;
  color: var(--mute);
  font-size: 0.95rem;
  line-height: 2;
}

/* Post cards */
.posts-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color 0.2s;
}

.post-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.post-card:hover {
  border-color: var(--ink);
}

.post-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--soft);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.post-card:hover .post-card__media img {
  transform: scale(1.04);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.15rem 1.25rem;
  flex: 1;
}

.post-card__meta {
  font-size: 0.7rem;
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-card__title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.55;
}

.post-card__excerpt {
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--mute);
}

.post-card__more {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

/* Layout shell */
.site-main-pad {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 1.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  background: #fff;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.empty-state p {
  margin-top: 0.75rem;
  color: var(--mute);
  font-size: 0.9rem;
  line-height: 2;
}

/* Pagination */
.nav-links,
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 3rem;
}

.nav-links a,
.nav-links span,
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.85rem;
  text-decoration: none;
}

.nav-links a:hover,
.pagination a:hover {
  border-color: var(--ink);
}

.nav-links .current,
.pagination .current {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* Single / page */
.entry-wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 7.5rem 1.25rem 5rem;
}

.entry-hero-img {
  border-radius: 1.4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  margin: 1.5rem 0 2rem;
}

.entry-hero-img img {
  width: 100%;
  display: block;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  color: var(--mute);
  font-size: 0.8rem;
  margin-top: 0.85rem;
}

.entry-meta a {
  color: var(--accent);
}

.entry-title {
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.3;
}

.entry-cats a {
  display: inline-block;
  background: var(--soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Gutenberg / classic content */
.entry-content {
  margin-top: 2rem;
  font-size: 1rem;
  line-height: 2.05;
  color: rgb(22 21 19 / 0.88);
}

.entry-content > * + * {
  margin-top: 1.15rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: DoranFaNum, IRANSansXFaNum, Tahoma, sans-serif;
  color: var(--ink);
  line-height: 1.4;
  margin-top: 2.25rem;
}

.entry-content h2 { font-size: 1.5rem; font-weight: 800; }
.entry-content h3 { font-size: 1.2rem; font-weight: 700; }

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content ul,
.entry-content ol {
  padding-right: 1.4rem;
}

.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

.entry-content li + li { margin-top: 0.35rem; }

.entry-content blockquote {
  border-right: 3px solid var(--accent);
  background: var(--soft);
  padding: 1rem 1.15rem;
  border-radius: 0 0.75rem 0.75rem 0;
  color: var(--ink);
}

.entry-content img,
.entry-content figure {
  border-radius: 1rem;
  max-width: 100%;
  height: auto;
}

.entry-content pre,
.entry-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

.entry-content pre {
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 1.15rem;
  border-radius: 0.9rem;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}

.entry-content :not(pre) > code {
  background: var(--soft);
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  color: var(--accent);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  text-align: right;
}

.entry-content .wp-caption-text,
.entry-content figcaption {
  font-size: 0.8rem;
  color: var(--mute);
  margin-top: 0.4rem;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.entry-tags a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  background: #fff;
}

.entry-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.post-nav {
  display: grid;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

@media (min-width: 640px) {
  .post-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.post-nav a {
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 1rem;
  padding: 1rem 1.15rem;
}

.post-nav span {
  display: block;
  font-size: 0.7rem;
  color: var(--mute);
  margin-bottom: 0.35rem;
}

.post-nav strong {
  font-size: 0.9rem;
  font-weight: 700;
}

/* Comments */
.comments-area {
  max-width: 46rem;
  margin: 0 auto 5rem;
  padding: 0 1.25rem;
}

.comments-area h2,
.comments-area h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.comments-avg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mute);
  vertical-align: middle;
}

.comment-list {
  list-style: none;
}

.comment-list .comment {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.75rem;
}

.comment-body {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.comment-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #e4dfd6;
}

.comment-main {
  min-width: 0;
  flex: 1;
}

.comment-list .children {
  list-style: none;
  margin-right: 1.25rem;
  margin-top: 0.75rem;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
}

.comment-author {
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink);
}

.comments-area a[href^="mailto:"],
.comments-area .comment-author-email,
.comments-area .says {
  display: none !important;
}

.comment-metadata {
  font-size: 0.75rem;
  color: var(--mute);
  margin: 0.25rem 0 0.75rem;
}

.comment-content p {
  font-size: 0.9rem;
  line-height: 1.9;
}

.comment-reply-link {
  font-size: 0.75rem;
  color: var(--accent);
}

.comment-notes {
  font-size: 0.85rem;
  color: var(--mute);
  margin: 0 0 1.1rem;
}

.comment-form-url,
.comment-form-cookies-consent {
  display: none !important;
}

.comment-form .comment-form-author,
.comment-form .comment-form-email {
  margin: 0;
}

@media (min-width: 640px) {
  .comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.9rem;
  }

  .comment-form > p,
  .comment-form .comment-stars,
  .comment-form .form-submit,
  .comment-form .comment-notes,
  .comment-form .comment-form-comment {
    grid-column: 1 / -1;
  }

  .comment-form .comment-form-author {
    grid-column: 1;
  }

  .comment-form .comment-form-email {
    grid-column: 2;
  }
}

.comment-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  margin-bottom: 0.95rem;
}

.comment-form textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.comment-stars {
  margin: 0 0 1.1rem;
}

.comment-stars__label {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}

.comment-stars__hint {
  font-weight: 500;
  color: var(--mute);
}

.comment-stars__row {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.2rem;
  width: max-content;
}

.comment-stars__row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.comment-stars__row label {
  display: grid;
  place-items: center;
  width: 2.85rem;
  height: 2.85rem;
  margin: 0;
  cursor: pointer;
  border-radius: 0.65rem;
}

.comment-stars__row label::before {
  content: "★";
  font-size: 2.2rem;
  line-height: 1;
  color: #ddd6cc;
  transition: color 0.12s ease, transform 0.12s ease;
}

.comment-stars__row label:hover::before,
.comment-stars__row label:hover ~ label::before,
.comment-stars__row input:checked ~ label::before,
.comment-stars__row input:focus-visible + label::before {
  color: #e0a106;
}

.comment-stars__row label:hover::before,
.comment-stars__row input:focus-visible + label::before {
  transform: scale(1.12);
}

.comment-stars-view {
  display: inline-flex;
  gap: 0.05rem;
  letter-spacing: 0.04em;
  font-size: 1rem;
  line-height: 1;
}

.comment-stars-view .is-on {
  color: #e0a106;
}

.comment-stars-view .is-off {
  color: #ddd6cc;
}

.comment-form .submit,
.search-submit {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.comment-form .submit:hover,
.search-submit:hover {
  background: var(--accent);
}

.search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 28rem;
  margin-top: 1.25rem;
}

.search-form .search-field {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-size: 0.9rem;
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

/* Search widget in header of blog */
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.blog-toolbar .search-form {
  margin-top: 0;
}
