/*
Theme Name: Kalam - Multilingual Urdu, Arabic & English
Theme URI: https://kalamtheme.com
Author: Google AI Studio Build Team
Author URI: https://ai.studio/build
Description: A lightweight, fast, modern, and SEO/AdSense-friendly WordPress theme designed primarily for Urdu, Arabic, and English editorial publications with native RTL & LTR typography.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kalam
Tags: rtl-language-support, translation-ready, accessibility-ready, blog, news, custom-colors, custom-menu, featured-images, flexible-header, full-width-template, theme-options, threaded-comments, wide-blocks
*/

:root {
  --kalam-primary: #0f766e;
  --kalam-primary-hover: #115e59;
  --kalam-secondary: #b45309;
  --kalam-bg: #fafaf9;
  --kalam-card-bg: #ffffff;
  --kalam-text: #292524;
  --kalam-heading: #1c1917;
  --kalam-border: #e7e5e4;
  --kalam-font-urdu: 'Noto Nastaliq Urdu', serif;
  --kalam-font-arabic: 'Noto Naskh Arabic', 'Amiri', serif;
  --kalam-font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --kalam-content-width: 760px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--kalam-bg);
  color: var(--kalam-text);
  font-family: var(--kalam-font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* RTL Language Defaults */
html[dir="rtl"] body {
  font-family: var(--kalam-font-urdu);
  line-height: 2.1;
  text-align: right;
}

html[lang="ar"] body {
  font-family: var(--kalam-font-arabic);
  line-height: 1.85;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--kalam-heading);
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 {
  line-height: 1.75;
}

/* Gutenberg Core Elements & Single Post Prose */
.kalam-prose {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--kalam-text);
  max-width: 100%;
}

.kalam-prose p {
  margin-top: 1.4em;
  margin-bottom: 1.4em;
}

.wp-block-quote, blockquote {
  border-left: 4px solid var(--kalam-primary);
  padding: 0.75rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  background-color: var(--kalam-surface);
  border-radius: 0 0.5rem 0.5rem 0;
}

.kalam-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  overflow-x: auto;
  display: block;
}

.kalam-prose table th, .kalam-prose table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--kalam-border);
}

.kalam-prose table th {
  background-color: var(--kalam-surface);
  font-weight: 600;
}

/* Single Post Breadcrumbs */
.kalam-breadcrumbs-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.25rem;
  column-gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--kalam-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  max-width: 100%;
}

.kalam-breadcrumbs-nav a {
  color: var(--kalam-muted);
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.kalam-breadcrumbs-nav a:hover {
  color: var(--kalam-primary);
}

.kalam-breadcrumbs-nav .breadcrumb-sep {
  flex-shrink: 0;
  user-select: none;
  font-size: 0.75rem;
  opacity: 0.7;
}

.kalam-breadcrumbs-nav .current-crumb {
  color: var(--kalam-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Single Post Header & Meta */
.kalam-single-article .entry-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 0;
  margin-bottom: 1rem;
}

.entry-excerpt.post-intro-lead {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--kalam-muted);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--kalam-muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--kalam-border);
  margin-bottom: 2rem;
}

.entry-meta .byline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--kalam-heading);
}

.entry-meta .author-avatar-img {
  border-radius: 9999px;
}

.featured-image-wrapper {
  margin: 0 0 2rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
}

.featured-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

.featured-image-caption {
  font-size: 0.8125rem;
  color: var(--kalam-muted);
  text-align: center;
  padding-top: 0.5rem;
}

/* Tags */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--kalam-border);
}

.entry-tags .tags-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--kalam-heading);
}

.entry-tags .tag-pills a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--kalam-surface);
  border: 1px solid var(--kalam-border);
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: var(--kalam-text);
  text-decoration: none;
  transition: all 0.15s ease;
}

.entry-tags .tag-pills a:hover {
  background-color: var(--kalam-primary);
  color: #fff;
  border-color: var(--kalam-primary);
}

/* Author Bio Box */
.kalam-author-bio-box {
  background-color: var(--kalam-surface);
  border: 1px solid var(--kalam-border);
  border-radius: 0.75rem;
  padding: 1.75rem;
  margin: 2.5rem 0;
}

.author-bio-inner {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.author-bio-avatar {
  border-radius: 9999px;
}

.author-header-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.author-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.author-badge {
  font-size: 0.75rem;
  background-color: rgba(15, 118, 110, 0.1);
  color: var(--kalam-primary);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.author-description {
  font-size: 0.9375rem;
  color: var(--kalam-text);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.author-archive-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--kalam-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Post Navigation */
.kalam-post-navigation {
  margin: 2.5rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--kalam-border);
  border-bottom: 1px solid var(--kalam-border);
}

.nav-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.nav-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background-color: var(--kalam-surface);
  border: 1px solid var(--kalam-border);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.nav-card:hover {
  border-color: var(--kalam-primary);
}

.nav-subtitle {
  font-size: 0.75rem;
  color: var(--kalam-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.nav-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--kalam-heading);
  line-height: 1.4;
}

/* Related Posts Grid */
.kalam-related-posts-section {
  margin: 3rem 0;
}

.related-section-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.related-post-card {
  background-color: var(--kalam-surface);
  border: 1px solid var(--kalam-border);
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.related-thumb-wrapper img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.related-post-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.related-post-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.35rem 0;
  line-height: 1.4;
}

.related-post-title a {
  color: var(--kalam-heading);
  text-decoration: none;
}

.related-post-date {
  font-size: 0.75rem;
  color: var(--kalam-muted);
  margin-top: auto;
}

/* Pre-reserved AdSense Layout Slots */
.kalam-ad-slot {
  min-height: 100px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--kalam-border);
  margin: 2rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
