/*
Theme Name: مهدیه رحمتی
Theme URI: https://mahdierahmati.com
Author: Mahdieh Rahmati
Description: Minimalist, RTL, typography-first personal theme for the poet and translator Mahdieh Rahmati. Self-hosted Vazirmatn, solid crimson header, and custom post types for poems (شعر), translations (ترجمه) and articles (مقاله).
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mahdierahmati
*/

/* =========================================================
   مهدیه رحمتی — WordPress classic theme
   ========================================================= */

/* ---------- Fonts (self-hosted, theme /assets/fonts) ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #f7f3ea;
  --paper: #fcf9f2;
  --ink: #1f1c19;
  --muted: #6f6a63;
  --faint: #a49d92;
  --line: #e6ddcd;
  --accent: #a63a2b;
  --accent-soft: #c65642;
  --ok: #2f7d4f;
  --crimson: #902020;  /* deep red accent — header line, nav hover */

  --maxw: 42rem;
  --pad: clamp(1.25rem, 5vw, 2.5rem);

  --step-sm: clamp(0.86rem, 0.8rem + 0.25vw, 0.98rem);
  --step-0:  clamp(1rem, 0.96rem + 0.25vw, 1.12rem);
  --step-1:  clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem);
  --step-2:  clamp(1.7rem, 1.3rem + 1.8vw, 2.4rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: var(--step-0);
  line-height: 1.95;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
/* neutralize stray top padding some host/onboarding plugins add to <body> */
html body { padding-top: 0 !important; padding-block-start: 0 !important; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 0.28em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.page { padding-block: clamp(2.25rem, 5vw, 3.5rem) clamp(4rem, 10vw, 7rem); }

/* ---------- Header / nav (white, dark text, deep-red accent line) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--crimson);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.35); }
.nav {
  max-width: 66rem; margin-inline: auto;
  padding: 0.55rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
/* text wordmark brand */
.brand {
  display: inline-flex; align-items: center;
  font-weight: 700; font-size: 1.3rem; line-height: 1;
  color: var(--ink); white-space: nowrap;
}
.brand:hover { color: var(--crimson); text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: clamp(0.9rem, 2.3vw, 1.7rem); list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: 0; }
.nav-links a {
  color: var(--ink);
  font-size: var(--step-sm); font-weight: 500;
  padding-block: 0.35rem; position: relative;
  transition: color 0.18s ease;
}
.nav-links a:hover { color: var(--crimson); text-decoration: none; }
.nav-links a[aria-current="page"],
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a { color: var(--crimson); }
.nav-links a[aria-current="page"]::after,
.nav-links .current-menu-item > a::after,
.nav-links .current_page_item > a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px;
  background: var(--crimson); border-radius: 2px;
}
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 2.4rem; height: 2.4rem; padding: 0; color: var(--ink);
}
.nav-toggle svg { width: 1.5rem; height: 1.5rem; }

/* ---------- Home ---------- */
body.home { min-height: 100svh; display: flex; flex-direction: column; }
body.home .site-main { flex: 1; display: flex; flex-direction: column; }
.home-center {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: clamp(0.75rem, 2.5vw, 1.4rem);
  padding: clamp(1.5rem, 5vw, 3rem) var(--pad);
}
.home-title {
  margin: 0; color: var(--ink); font-weight: 700;
  font-size: clamp(2.4rem, 9vw, 4.6rem); line-height: 1.2;
}
.hero-sub { color: var(--muted); font-size: var(--step-1); margin: 0; }

/* ---------- Responsive nav (hamburger) ---------- */
@media (max-width: 760px) {
  .nav { position: relative; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute; top: 100%; inset-inline: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--crimson);
    padding: 0.25rem var(--pad) 0.85rem;
    box-shadow: 0 14px 26px -22px rgba(0, 0, 0, 0.4);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; width: 100%; padding-block: 0.72rem; font-size: 1rem; }
  .nav-links a[aria-current="page"]::after,
  .nav-links .current-menu-item > a::after,
  .nav-links .current_page_item > a::after { display: none; }
}

/* ---------- Content typography ---------- */
.page-title {
  font-size: var(--step-2); font-weight: 700; line-height: 1.35;
  margin: 0 0 1.4rem; color: var(--ink);
}
.page-lead { color: var(--muted); font-size: var(--step-1); margin: 0 0 2.5rem; line-height: 1.8; }

/* content coming from the WP editor */
.entry-content > :first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.5rem; }
.entry-content h2 { font-size: var(--step-1); font-weight: 700; margin: 2.2rem 0 1rem; }
.entry-content h3 { font-weight: 700; margin: 1.8rem 0 0.8rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1.5rem; padding-inline-start: 1.5rem; }
.entry-content blockquote { margin: 1.5rem 0; padding-inline-start: 1.1rem; border-inline-start: 3px solid var(--accent); color: var(--muted); }
.entry-content img { border-radius: 10px; margin-block: 1.2rem; }
.entry-content a { text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- Coming-soon (empty archives/pages) ---------- */
.soon { padding-block: clamp(1.5rem, 6vw, 3.5rem); }
.soon-tag { color: var(--muted); font-size: var(--step-1); margin: 0; }

/* ---------- Poetry ---------- */
.poem-list { display: flex; flex-direction: column; gap: clamp(3rem, 8vw, 5rem); }
.poem { text-align: center; }
.poem-title { font-size: var(--step-1); font-weight: 700; color: var(--ink); margin: 0 0 1.4rem; }
.poem-title a { color: inherit; text-decoration: none; }
.poem-title a:hover { color: var(--accent); }
.poem-body { color: var(--ink); line-height: 2.4; font-size: 1.06rem; }
.poem-body p { margin: 0 0 1.2rem; }
.poem-body p:last-child { margin-bottom: 0; }
.poem-meta { color: var(--faint); font-size: var(--step-sm); margin-top: 1.4rem; }
.poem + .poem { border-top: 1px solid var(--line); padding-top: clamp(3rem, 8vw, 5rem); }

/* ---------- Translations / Articles list ---------- */
.works { display: flex; flex-direction: column; gap: clamp(2.5rem, 7vw, 4rem); }
.work + .work { border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 7vw, 4rem); }
.work-title { font-size: var(--step-1); font-weight: 700; margin: 0 0 0.3rem; color: var(--ink); }
.work-title a { color: inherit; text-decoration: none; }
.work-title a:hover { color: var(--accent); }
.work-author { color: var(--accent); font-size: var(--step-sm); font-weight: 500; margin: 0 0 1.1rem; }
.work-excerpt { color: var(--ink); line-height: 2.15; }
.work-excerpt p { margin: 0 0 1rem; }

/* ---------- Contact form (Contact Form 7) ---------- */
.contact-form-wrap { max-width: 32rem; }
.wpcf7-form p { margin: 0 0 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; }
.wpcf7-form label { font-size: var(--step-sm); color: var(--muted); font-weight: 500; }
.wpcf7-form-control {
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  width: 100%;
  transition: border-color 0.18s ease;
}
.wpcf7-form textarea.wpcf7-form-control { resize: vertical; min-height: 8.5rem; line-height: 1.95; }
.wpcf7-form-control:focus { outline: none; border-color: var(--accent); }
.wpcf7-submit {
  align-self: flex-start; width: auto;
  font: inherit; font-weight: 700;
  color: #fff; background: var(--accent);
  border: 0; border-radius: 999px;
  padding: 0.7rem 2rem; cursor: pointer;
  transition: background 0.18s ease, transform 0.05s ease;
}
.wpcf7-submit:hover { background: var(--accent-soft); }
.wpcf7 .wpcf7-response-output {
  margin: 1rem 0 0; border-radius: 10px; padding: 0.7rem 1rem;
  font-size: var(--step-sm);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
