/*
Theme Name:   Simorgh Kids (Blocksy Child)
Theme URI:    https://simorghkids.ir/
Description:  Blocksy child theme that makes the Simorgh Kids blog match the main app/site design (Vazirmatn, orange kids palette, rounded cards, pill buttons, RTL).
Author:       Simorgh Kids
Template:     blocksy
Version:      1.0.0
Text Domain:  simorgh-kids-child
*/

/* ==========================================================================
   1. Fonts (same family name + weights as the Next.js app)
   ========================================================================== */
@font-face {
  font-family: 'Vazir';
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazir';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   2. Design tokens (copied from theme.css "kids" theme + Tailwind grays)
   ========================================================================== */
:root {
  --brand-50:  #fff7ed;
  --brand-100: #ffedd5;
  --brand-200: #fed7aa;
  --brand-300: #fdba74;
  --brand-400: #fb923c;
  --brand-500: #f97316;
  --brand-600: #ea580c;
  --brand-700: #c2410c;
  --brand-800: #9a3412;
  --brand-900: #7c2d12;
  --brand-950: #431407;

  --sk-gray-50:  #f9fafb;
  --sk-gray-100: #f3f4f6;
  --sk-gray-200: #e5e7eb;
  --sk-gray-600: #4b5563;
  --sk-gray-700: #374151;
  --sk-gray-800: #1f2937;
  --sk-gray-900: #111827;

  --sk-radius-xl:  0.75rem;   /* Tailwind rounded-xl  */
  --sk-radius-2xl: 1rem;      /* Tailwind rounded-2xl */
  --sk-radius-3xl: 1.5rem;    /* Tailwind rounded-3xl */
  --sk-shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
  --sk-shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --sk-shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --sk-font: 'Vazir', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

/* ==========================================================================
   3. Map tokens onto Blocksy's variables
      (html:root beats Blocksy's inline ":root" rules regardless of order)
   ========================================================================== */
html:root {
  /* Blocksy palette: 1 accent, 2 accent hover, 3 text, 4 headings, 5 border, 6/7 soft bg, 8 white */
  --theme-palette-color-1: #c2410c;
  --theme-palette-color-2: #9a3412;
  --theme-palette-color-3: #374151;
  --theme-palette-color-4: #111827;
  --theme-palette-color-5: #e5e7eb;
  --theme-palette-color-6: #fff7ed;
  --theme-palette-color-7: #f9fafb;
  --theme-palette-color-8: #ffffff;

  --theme-text-color: #374151;
  --theme-headings-color: #111827;
  --theme-link-initial-color: #c2410c;
  --theme-link-hover-color: #9a3412;
  --theme-border-color: #e5e7eb;

  --theme-font-family: var(--sk-font);

  --theme-button-background-initial-color: #c2410c;
  --theme-button-background-hover-color: #9a3412;
  --theme-button-text-initial-color: #ffffff;
  --theme-button-text-hover-color: #ffffff;
  --theme-button-border-radius: 9999px;
  --theme-button-min-height: 44px;

  --theme-form-field-border-radius: 0.75rem;
  --theme-form-field-border-focus-color: #ea580c;

  --theme-normal-container-max-width: 1280px;
  --theme-narrow-container-max-width: 760px;
}

/* ==========================================================================
   4. Base typography / RTL readability
   ========================================================================== */
html { scroll-behavior: smooth; }

body,
button, input, select, textarea,
h1, h2, h3, h4, h5, h6,
.ct-menu-link, .site-title, .entry-title, .ct-button, .wp-block-button__link {
  font-family: var(--sk-font) !important;
}

body { color: var(--sk-gray-700); background: #fff; }

::selection { background: var(--brand-200); color: var(--brand-950); }

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--sk-gray-900); line-height: 1.5; }

/* Persian body copy needs more air than Latin */
.entry-content,
.entry-content p,
.entry-content li { line-height: 2; }

.entry-content h2 { margin-block: 2.2em 0.6em; font-size: 1.75rem; }
.entry-content h3 { margin-block: 1.8em 0.5em; font-size: 1.4rem; }

:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* ==========================================================================
   5. Header (white, sticky shadow-sm, gray links, orange pill CTA)
   ========================================================================== */
#header [data-row*="middle"],
#header [data-row*="top"] {
  background: #fff;
  box-shadow: var(--sk-shadow-sm);
  border-bottom: 0;
}

#header .site-title a,
#header .site-title {
  font-weight: 700;
  color: var(--brand-800);
}

#header [data-id="menu"] > ul > li > a,
#header [data-id="menu"] .ct-menu-link {
  color: var(--sk-gray-600);
  font-weight: 400;
  --theme-link-initial-color: #4b5563;
  --theme-link-hover-color: #9a3412;
}
#header [data-id="menu"] > ul > li:hover > a,
#header [data-id="menu"] > ul > li.current-menu-item > a,
#header [data-id="menu"] > ul > li > a:hover {
  color: var(--brand-800);
}

/* Header "Button" element = the site's "start chat" pill */
#header .ct-header-cta .ct-button,
#header .ct-header-cta a {
  background: var(--brand-700);
  color: #fff;
  border-radius: 9999px;
  padding-inline: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color .15s ease-in-out;
}
#header .ct-header-cta .ct-button:hover,
#header .ct-header-cta a:hover { background: var(--brand-800); color: #fff; }

/* ==========================================================================
   6. Buttons & forms
   ========================================================================== */
.ct-button,
.wp-block-button__link,
button[type="submit"],
input[type="submit"],
.wp-element-button {
  border-radius: 9999px;
  font-weight: 500;
  transition: background-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.wp-block-button__link:not(.has-background),
.wp-element-button:not(.has-background) {
  background: var(--brand-700);
  color: #fff;
  box-shadow: 0 10px 15px -3px var(--brand-200), 0 4px 6px -4px var(--brand-200);
}
.wp-block-button__link:not(.has-background):hover,
.wp-element-button:not(.has-background):hover { background: var(--brand-800); color: #fff; }

input[type="text"], input[type="email"], input[type="search"], input[type="url"],
input[type="tel"], input[type="password"], textarea, select {
  border-radius: var(--sk-radius-xl);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand-600) !important;
  box-shadow: 0 0 0 3px var(--brand-100);
}

/* ==========================================================================
   7. Blog archive cards (rounded-2xl, soft border, shadow-sm -> md on hover)
   ========================================================================== */
.entries .entry-card,
.entries article.entry-card {
  background: #fff;
  border: 1px solid var(--sk-gray-100);
  border-radius: var(--sk-radius-2xl);
  box-shadow: var(--sk-shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.entries .entry-card:hover { box-shadow: var(--sk-shadow-md); transform: translateY(-2px); }
.entries .entry-card .ct-media-container,
.entries .entry-card .ct-media-container img { border-radius: 0; }
.entries .entry-card .entry-title a { color: var(--sk-gray-900); }
.entries .entry-card .entry-title a:hover { color: var(--brand-700); }
.entries .entry-card .entry-excerpt { color: var(--sk-gray-600); }

/* Category pills */
.entry-meta .meta-categories a,
.ct-meta-element-categories a {
  background: var(--brand-100);
  color: var(--brand-800);
  border-radius: 9999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}
.entry-meta .meta-categories a:hover,
.ct-meta-element-categories a:hover { background: var(--brand-200); color: var(--brand-900); }

/* Pagination */
.ct-pagination .page-numbers { border-radius: 9999px; }
.ct-pagination .page-numbers.current,
.ct-pagination .page-numbers:hover { background: var(--brand-700); color: #fff; border-color: var(--brand-700); }

/* ==========================================================================
   8. Single post content
   ========================================================================== */
.single .entry-header .page-title,
.single .entry-title { color: var(--sk-gray-900); font-weight: 700; line-height: 1.6; }

.entry-content a:not(.wp-block-button__link):not(.ct-button):not(.sk-btn) {
  text-decoration: underline;
  text-decoration-color: var(--brand-300);
  text-underline-offset: 4px;
}
.entry-content a:not(.wp-block-button__link):not(.ct-button):not(.sk-btn):hover {
  text-decoration-color: var(--brand-700);
}

.entry-content img { border-radius: var(--sk-radius-2xl); }

.entry-content blockquote,
.wp-block-quote {
  background: var(--brand-50);
  border: 0;
  border-inline-start: 4px solid var(--brand-400);
  border-radius: var(--sk-radius-xl);
  padding: 1.25rem 1.5rem;
  color: var(--sk-gray-800);
}

.entry-content ul li::marker { color: var(--brand-500); }

.entry-content table, .wp-block-table table { border-collapse: separate; border-spacing: 0; width: 100%; }
.wp-block-table thead th, .entry-content table thead th {
  background: var(--brand-50); color: var(--brand-900); border-bottom: 2px solid var(--brand-200);
}
.wp-block-table td, .wp-block-table th, .entry-content table td, .entry-content table th {
  border: 0; border-bottom: 1px solid var(--sk-gray-100); padding: 0.75rem 1rem; text-align: start;
}

/* FAQ: use the Gutenberg "Details" block */
.entry-content details {
  background: var(--sk-gray-50);
  border: 1px solid var(--sk-gray-100);
  border-radius: var(--sk-radius-xl);
  padding: 0.9rem 1.25rem;
  margin-block: 0.6rem;
}
.entry-content details > summary { font-weight: 700; color: var(--sk-gray-900); cursor: pointer; }
.entry-content details[open] { background: var(--brand-50); border-color: var(--brand-200); }

/* ==========================================================================
   9. Sidebar, footer, back-to-top
   ========================================================================== */
.ct-sidebar .ct-widget {
  background: var(--sk-gray-50);
  border-radius: var(--sk-radius-2xl);
  padding: 1.5rem;
}
.ct-sidebar .widget-title { color: var(--sk-gray-900); font-weight: 700; }

#footer [data-row*="bottom"],
#footer [data-row*="middle"] { background: var(--sk-gray-50); }
#footer a:hover { color: var(--brand-800); }

.ct-back-to-top { border-radius: 9999px; background: var(--brand-700); color: #fff; }
.ct-back-to-top:hover { background: var(--brand-800); }

/* ==========================================================================
   10. Reusable blocks for hub / leaf / blog content (add as "Additional CSS class")
       .sk-hero  .sk-grid  .sk-card  .sk-icon  .sk-cta  .sk-btn  .sk-callout
   ========================================================================== */
.sk-hero {
  background: linear-gradient(to right, var(--brand-50), var(--brand-100));
  border-radius: var(--sk-radius-3xl);
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}
html[dir="rtl"] .sk-hero { background: linear-gradient(to left, var(--brand-50), var(--brand-100)); }
.sk-hero h1, .sk-hero h2 { color: var(--brand-900); }
.sk-hero p { color: var(--sk-gray-700); font-size: 1.125rem; }

.sk-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px)  { .sk-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .sk-grid { grid-template-columns: repeat(3, 1fr); } }

.sk-card {
  background: var(--brand-50);
  border-radius: var(--sk-radius-2xl);
  box-shadow: var(--sk-shadow-sm);
  padding: 2rem;
  transition: box-shadow .2s ease;
}
.sk-card:hover { box-shadow: var(--sk-shadow-md); }
.sk-card h3 { margin-top: 0; font-size: 1.25rem; }
.sk-card p { color: var(--sk-gray-600); margin-bottom: 0; }

.sk-icon {
  width: 3.5rem; height: 3.5rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-100);
  border-radius: var(--sk-radius-xl);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.sk-cta {
  background: linear-gradient(to right, var(--brand-700), var(--brand-600));
  color: #fff;
  border-radius: var(--sk-radius-3xl);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}
html[dir="rtl"] .sk-cta { background: linear-gradient(to left, var(--brand-700), var(--brand-600)); }
.sk-cta h2, .sk-cta h3, .sk-cta p { color: #fff; }
.sk-cta p { opacity: .92; }

.sk-btn {
  display: inline-block;
  background: var(--brand-700);
  color: #fff !important;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 500;
  text-decoration: none !important;
  box-shadow: var(--sk-shadow-lg);
  transition: background-color .15s ease-in-out;
}
.sk-btn:hover { background: var(--brand-800); }
.sk-cta .sk-btn { background: #fff; color: var(--brand-800) !important; font-weight: 700; }
.sk-cta .sk-btn:hover { background: var(--sk-gray-100); }

.sk-callout {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--sk-radius-2xl);
  padding: 1.25rem 1.5rem;
  margin-block: 1.5rem;
}
.sk-callout > :first-child { margin-top: 0; }
.sk-callout > :last-child  { margin-bottom: 0; }

/* ==========================================================================
   11. Footer: when the main site's footer is embedded, hide Blocksy's native one
   ========================================================================== */
body.sk-embed-footer #footer.ct-footer { display: none; }
#sk-footer-host { display: block; }

/* ==========================================================================
   12. LTR language pages (English etc.): flip the pieces of the page templates that assume RTL.
       The templates set dir="ltr" on the .skh wrapper for these languages (done by the pipeline).
   ========================================================================== */
.skh[dir="ltr"] { text-align: left; }
.skh[dir="ltr"] .skh-hero { direction: rtl; }                       /* image (first child) on the right, text on the left */
.skh[dir="ltr"] .skh-hero-text { direction: ltr; text-align: left; }
.skh[dir="ltr"] button.skh-chip { text-align: left !important; }
.skh[dir="ltr"] .skh-cta { background: linear-gradient(to right, #c2410c, #ea580c); }
.skh[dir="ltr"] .skh-sticky { direction: ltr; }
