/*
Theme Name: کودک و مادر (KoodakMadar)
Theme URI: https://koodakmadar.ir
Author: KoodakMadar Custom Theme
Description: قالب اختصاصی، فوق‌سبک و بهینه‌شده برای سئو، رپورتاژ آگهی، بک‌لینک و تبلیغات بنری مجله کودک و مادر
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: koodakmadar
*/

@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --pink: #E8A0B4;
  --pink-d: #C9697F;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --peach: #FFD9C7;
  --mint: #D5EDE6;
  --text: #2F2A2D;
  --muted: #7A6F75;
  --line: #F1E4E4;
  --ad: #FBF1F3;
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', Tahoma, system-ui, -apple-system, sans-serif;
  line-height: 1.9;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

button, input, textarea, select {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--pink-d);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -120px;
  right: 16px;
  background: var(--pink-d);
  color: #fff;
  padding: 8px 16px;
  border-radius: 99px;
  z-index: 100;
  font-size: 14px;
  font-weight: 700;
}
.skip-link:focus {
  top: 12px;
}

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}

.bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 66px;
}

.logo {
  flex: none;
  display: inline-flex;
  align-items: center;
}

.logo img {
  height: 46px;
  width: auto;
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 99px;
  white-space: nowrap;
  font-weight: 500;
  font-size: 14px;
  transition: background .15s;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-category-ancestor > a {
  background: var(--peach);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  flex: none;
}
.menu-toggle .icon-close {
  display: none;
}
.menu-toggle[aria-expanded="true"] .icon-open {
  display: none;
}
.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.search-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 99px;
  padding: 6px 16px;
  min-height: 40px;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  transition: border-color .15s, color .15s;
}
.search-btn:hover {
  border-color: var(--pink);
  color: var(--text);
}

.search-drawer {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  background: var(--bg);
}
.search-drawer.is-open {
  display: block;
}
.search-form {
  display: flex;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}
.search-form input[type="search"] {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 9px 18px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 44px;
}
.search-form button {
  background: var(--pink-d);
  color: #fff;
  border: 0;
  border-radius: 99px;
  padding: 0 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}

/* Cards & Tags */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(201, 105, 127, .08);
  transition: box-shadow .2s, transform .2s;
}
.card-hover:hover {
  box-shadow: 0 6px 18px rgba(201, 105, 127, .16);
  transform: translateY(-2px);
}

.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tag {
  position: relative;
  z-index: 2;
  display: inline-block;
  background: var(--pink);
  color: #2F2A2D;
  border-radius: 99px;
  padding: 1px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
}
.tag:hover {
  background: var(--peach);
}

.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--peach);
}
.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bg-peach { background: var(--peach); }
.bg-mint { background: var(--mint); }
.bg-ad { background: var(--ad); }

/* Hero */
.home-h1 {
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.7;
  margin: 18px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.home-h1::before {
  content: "";
  width: 6px;
  height: 20px;
  border-radius: 4px;
  background: var(--pink);
  flex: none;
}
.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin: 14px 0 22px;
}

.big {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(160deg, var(--peach), var(--pink));
}
.big .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.big .emo {
  position: absolute;
  top: 20px;
  left: 24px;
  font-size: 80px;
  opacity: .85;
}
.big .t {
  position: relative;
  z-index: 2;
  padding: 46px 26px 24px;
  background: linear-gradient(transparent, rgba(47, 42, 45, .78));
  width: 100%;
  color: #fff;
}
.big h1,
.big h2 {
  font-size: 25px;
  line-height: 1.55;
  margin: 8px 0 4px;
  font-weight: 800;
}
.big small {
  font-size: 13px;
  opacity: .92;
}

.smalls {
  display: grid;
  gap: 14px;
  align-content: stretch;
}
.sm {
  display: flex;
  gap: 12px;
  padding: 10px;
  align-items: center;
}
.sm .ph {
  width: 90px;
  height: 90px;
  aspect-ratio: 1;
  border-radius: 12px;
  font-size: 28px;
  flex: none;
}
.sm h2,
.sm h3 {
  font-size: 14.5px;
  line-height: 1.7;
  font-weight: 700;
}

/* Chips */
.chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 18px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chips a {
  flex: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 18px;
  font-weight: 500;
  font-size: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s;
}
.chips a:hover {
  background: var(--pink);
  border-color: var(--pink);
  color: #2F2A2D;
}

/* Main Layout */
.layout {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 26px;
}

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.sec-more {
  font-size: 13.5px;
  color: var(--pink-d);
  font-weight: 700;
  white-space: nowrap;
}
.sec-more:hover {
  text-decoration: underline;
}

h2.sec {
  font-size: 19px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
h2.sec::before {
  content: "";
  width: 6px;
  height: 22px;
  border-radius: 4px;
  background: var(--pink);
  flex: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.post .post-meta-top {
  padding: 12px 14px 0;
}
.post h3 {
  font-size: 15.5px;
  line-height: 1.75;
  padding: 8px 14px 4px;
  font-weight: 700;
}
.post p {
  font-size: 13.5px;
  color: var(--muted);
  padding: 0 14px 14px;
  line-height: 1.75;
}

/* Ad Slots */
.slot {
  background: var(--ad);
  border: 1px dashed var(--pink);
  border-radius: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}
.slot-filled {
  border: 0;
  background: transparent;
}
.slot-filled img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}
.ad-wide {
  min-height: 90px;
  margin: 26px 0;
}
.ad-box {
  min-height: 250px;
}
.ad-inline {
  min-height: 90px;
  margin: 22px 0;
}
.house-ad {
  width: 100%;
  min-height: 250px;
  padding: 24px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, var(--peach) 0%, var(--ad) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--text);
}
.house-ad-badge {
  background: var(--card);
  color: var(--pink-d);
  border-radius: 99px;
  padding: 2px 12px;
  font-size: 12px;
  font-weight: 700;
}
.house-ad strong {
  font-size: 16px;
  line-height: 1.65;
  font-weight: 800;
}
.house-ad p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* Topics */
.topic {
  margin: 30px 0;
}
.row4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* Sidebar */
aside.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}
.box {
  padding: 16px;
}
.box h3,
.box h4 {
  font-size: 15.5px;
  margin-bottom: 10px;
  font-weight: 800;
}

.kw {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.kw a {
  font-size: 13.5px;
  color: var(--pink-d);
  border-bottom: 1px dotted var(--pink-d);
  padding: 2px 0;
}
.kw a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.pop {
  list-style: none;
  padding: 0;
  counter-reset: n;
}
.pop li {
  counter-increment: n;
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.7;
}
.pop li:last-child {
  border-bottom: 0;
}
.pop li::before {
  content: counter(n);
  color: var(--pink-d);
  font-weight: 800;
  flex: none;
}
.pop a:hover {
  color: var(--pink-d);
}

.tool {
  background: var(--mint);
  text-align: center;
  padding: 18px;
}
.tool b {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pink-d);
  color: #fff;
  border: 0;
  border-radius: 99px;
  padding: 8px 20px;
  min-height: 40px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.btn:hover {
  opacity: .9;
}

/* Single Article & Inner Pages */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 14px;
}
.breadcrumbs a:hover {
  color: var(--pink-d);
}
.breadcrumbs .sep {
  opacity: .55;
}

.single-article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(201, 105, 127, .06);
}

.single-header h1 {
  font-size: 26px;
  line-height: 1.55;
  font-weight: 800;
  margin: 10px 0 14px;
}

.post-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.badge-reportage {
  background: var(--mint);
  color: var(--text);
  border-radius: 99px;
  padding: 1px 11px;
  font-size: 12px;
  font-weight: 700;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.single-cover {
  margin: 0 0 20px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ad);
}
.single-cover img {
  width: 100%;
  height: auto;
  display: block;
}
.single-cover figcaption {
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 12px;
  text-align: center;
}

.toc-box {
  background: var(--ad);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 0 0 22px;
}
.toc-box summary {
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toc-box ul {
  margin: 10px 0 0;
  padding-right: 18px;
  font-size: 14px;
}
.toc-box li {
  padding: 3px 0;
}
.toc-box li.toc-h3 {
  margin-right: 16px;
  font-size: 13.5px;
  color: var(--muted);
}
.toc-box a:hover {
  color: var(--pink-d);
}

.entry-content {
  font-size: 16px;
  line-height: 2;
  color: var(--text);
}
.entry-content > * + * {
  margin-top: 16px;
}
.entry-content h2 {
  font-size: 20px;
  font-weight: 800;
  margin-top: 28px;
  padding-right: 12px;
  border-right: 4px solid var(--pink);
  line-height: 1.6;
}
.entry-content h3 {
  font-size: 17.5px;
  font-weight: 700;
  margin-top: 22px;
  line-height: 1.65;
}
.entry-content h4 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 18px;
}
.entry-content a {
  color: var(--pink-d);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.entry-content ul,
.entry-content ol {
  padding-right: 22px;
}
.entry-content li {
  margin: 6px 0;
}
.entry-content blockquote {
  background: var(--ad);
  border-right: 4px solid var(--pink-d);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text);
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  overflow-x: auto;
  display: block;
}
.entry-content th,
.entry-content td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: right;
}
.entry-content th {
  background: var(--ad);
  font-weight: 700;
}
.entry-content img {
  border-radius: 12px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  align-items: center;
}
.post-tags span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.post-tags a {
  background: var(--ad);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 12px;
  font-size: 12.5px;
}
.post-tags a:hover {
  background: var(--peach);
}

.author-box {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--ad);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 24px;
}
.author-box img {
  border-radius: 50%;
  width: 64px;
  height: 64px;
  flex: none;
}
.author-box h3 {
  font-size: 15px;
  margin-bottom: 4px;
}
.author-box p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
}

.related-sec {
  margin-top: 28px;
}

/* Comments */
.comments-area {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.comment-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.comment-list .children {
  list-style: none;
  padding-right: 22px;
  margin-top: 12px;
}
.comment-body {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg);
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.comment-author img {
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 6px;
}
.comment-reply-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--pink-d);
  font-weight: 700;
}
.comment-respond {
  margin-top: 18px;
}
.comment-form label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin: 10px 0 4px;
}
.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);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg);
}
.comment-form .submit {
  margin-top: 14px;
  background: var(--pink-d);
  color: #fff;
  border: 0;
  border-radius: 99px;
  padding: 10px 24px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}

/* Archive & Pagination */
.archive-head {
  background: var(--ad);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 24px;
  margin: 20px 0 22px;
}
.archive-head h1 {
  font-size: 22px;
  font-weight: 800;
}
.archive-desc {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 26px 0 10px;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
}
.pagination .page-numbers.current,
.pagination a.page-numbers:hover {
  background: var(--pink-d);
  border-color: var(--pink-d);
  color: #fff;
}

/* Due Date Calculator Modal */
.km-modal {
  position: fixed;
  inset: 0;
  background: rgba(47, 42, 45, .5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 90;
}
.km-modal.is-open {
  display: flex;
}
.km-modal-card {
  background: var(--bg);
  border-radius: 18px;
  padding: 22px;
  max-width: 420px;
  width: 100%;
  border: 1px solid var(--line);
  position: relative;
}
.km-modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 99px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.km-calc-row {
  margin: 12px 0;
}
.km-calc-row label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.km-calc-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  min-height: 42px;
}
.km-calc-result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--mint);
  font-size: 14px;
  display: none;
}

/* Footer */
footer.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 28px 0 30px;
  color: var(--muted);
  font-size: 13.5px;
}
.site-footer h4 {
  color: var(--text);
  font-size: 15.5px;
  margin-bottom: 10px;
  font-weight: 800;
}
.site-footer p {
  margin-bottom: 8px;
}
.site-footer ul {
  list-style: none;
  padding: 0;
}
.site-footer li {
  padding: 4px 0;
}
.site-footer li a:hover {
  color: var(--pink-d);
}
.fgrid {
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 1fr;
  gap: 34px;
}
.copy {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }
  .bar {
    justify-content: space-between;
    gap: 10px;
  }
  .main-nav {
    display: none;
    position: fixed;
    top: 67px;
    right: 0;
    left: 0;
    max-height: calc(100vh - 67px);
    overflow-y: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(47, 42, 45, .12);
    padding: 12px 18px 18px;
    z-index: 39;
    flex-direction: column;
    align-items: stretch;
  }
  .main-nav.is-open {
    display: flex;
  }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .main-nav a {
    width: 100%;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 15px;
  }
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
  .big {
    min-height: 290px;
  }
  .big h1,
  .big h2 {
    font-size: 21px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .row4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .fgrid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .single-article {
    padding: 16px;
  }
  .single-header h1 {
    font-size: 22px;
  }
}

@media (max-width: 520px) {
  .row4 {
    grid-template-columns: 1fr;
  }
  .search-btn span {
    display: none;
  }
  .search-btn {
    padding: 6px 12px;
  }
}
