/* =============================================
   حاسبة الحمل — Global Styles
   Feminine: Soft Pink + Soft Purple + White
   Font: Tajawal (Arabic)
============================================= */

/* ── Global overflow & image safety ── */
html { overflow-x: hidden; }
body { overflow-x: hidden; }
img, video, iframe, embed, object { max-width: 100%; height: auto; }

:root {
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-300: #f9a8d4;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;
  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --rose-100: #ffe4e6;
  --rose-500: #f43f5e;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;

  --gradient-hero: linear-gradient(135deg, #fdf2f8 0%, #faf5ff 50%, #fce7f3 100%);
  --gradient-card: linear-gradient(135deg, #fff0f9 0%, #f8f0ff 100%);
  --gradient-btn: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  --shadow-soft: 0 4px 20px rgba(236, 72, 153, 0.12);
  --shadow-card: 0 8px 32px rgba(168, 85, 247, 0.10);
  --shadow-hover: 0 16px 48px rgba(236, 72, 153, 0.18);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--white);
  color: var(--gray-700);
  direction: rtl;
  line-height: 1.75;
  font-size: 16px;
}

/* CONTAINER */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===================== HEADER ===================== */
.site-header {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pink-100);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(236,72,153,0.08);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--pink-600);
  white-space: nowrap;
}

.logo-icon { font-size: 1.6rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 50px;
  transition: all 0.25s;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--pink-100);
  color: var(--pink-600);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--pink-500);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===================== HERO ===================== */
.hero {
  background: var(--gradient-hero);
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(248,187,208,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(209,196,233,0.3) 0%, transparent 50%),
    radial-gradient(circle at 60% 80%, rgba(248,187,208,0.2) 0%, transparent 40%);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  margin-bottom: 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pink-100);
  color: var(--pink-600);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid var(--pink-200);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--gray-900);
  margin-bottom: 16px;
  background: linear-gradient(135deg, #be185d, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto;
}

/* ===================== CALCULATOR ===================== */
.calculator-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--pink-100);
  overflow: hidden;
  max-width: 780px;
  margin: 0 auto;
}

.calc-header {
  background: linear-gradient(135deg, #fce7f3, #f3e8ff);
  padding: 28px 32px 20px;
  text-align: center;
  border-bottom: 1px solid var(--pink-100);
}

.calc-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.calc-header p {
  color: var(--gray-500);
  font-size: 0.9rem;
}

.calc-body {
  padding: 28px 32px;
  display: grid;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
}

.date-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--pink-200);
  border-radius: var(--radius);
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  color: var(--gray-700);
  background: var(--white);
  transition: border-color 0.25s, box-shadow 0.25s;
  direction: rtl;
  cursor: pointer;
}

.date-input:focus {
  outline: none;
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(236,72,153,0.12);
}

.calc-btn {
  width: 100%;
  padding: 16px;
  background: var(--gradient-btn);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: 'Tajawal', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(236,72,153,0.3);
}

.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(236,72,153,0.4);
}

.calc-btn:active { transform: translateY(0); }

/* RESULTS */
.results-section {
  border-top: 1px solid var(--pink-100);
  padding: 28px 32px;
  background: linear-gradient(135deg, #fdf2f8, #faf5ff);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  border: 1px solid var(--pink-100);
  box-shadow: 0 2px 8px rgba(236,72,153,0.07);
}

.result-card.highlight {
  border-color: var(--pink-300);
  background: linear-gradient(135deg, #fff0f9, #f8f0ff);
  box-shadow: 0 4px 16px rgba(236,72,153,0.12);
  grid-column: span 2;
}

.result-icon { font-size: 1.6rem; margin-bottom: 6px; }

.result-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 6px;
}

.result-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gray-900);
}

.result-card.highlight .result-value {
  font-size: 1.5rem;
  color: var(--pink-600);
}

/* PROGRESS */
.progress-section { margin-bottom: 20px; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.progress-bar {
  height: 10px;
  background: var(--pink-100);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-btn);
  border-radius: 50px;
  transition: width 1s ease;
}

.trimester-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.disclaimer-box {
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* ===================== TOOLS SECTION ===================== */
.tools-section {
  padding: 70px 0;
  background: var(--white);
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.section-header p {
  color: var(--gray-500);
  font-size: 1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--gradient-card);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--pink-200);
}

.tool-card.active-tool {
  border-color: var(--pink-300);
  box-shadow: var(--shadow-soft);
}

.tool-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.6;
  flex: 1;
}

.tool-btn {
  display: inline-block;
  color: var(--pink-600);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 6px;
  transition: gap 0.2s;
}

/* ===================== CONTENT ===================== */
.content-section {
  padding: 70px 0;
  background: var(--gray-50);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}

.content-article h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 32px 0 14px;
  padding-right: 14px;
  border-right: 4px solid var(--pink-400);
}

.content-article h2:first-child { margin-top: 0; }

.content-article p {
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.85;
}

.content-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.content-list li {
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius);
  border-right: 3px solid var(--pink-300);
  color: var(--gray-600);
  font-size: 0.93rem;
}

.content-list strong { color: var(--gray-900); }

/* FAQ */
.faq-section {
  margin-top: 50px;
}

.faq-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 24px;
}

.faq-list { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
  background: var(--white);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  text-align: right;
  gap: 12px;
}

.faq-question:hover { background: var(--pink-50); }

.faq-arrow {
  font-size: 0.7rem;
  color: var(--pink-400);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.faq-question.active .faq-arrow { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
}

.faq-answer.open {
  max-height: 300px;
  padding: 0 20px 18px;
}

.faq-answer p {
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.8;
}

/* SIDEBAR */
.sidebar { position: sticky; top: 90px; }

.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-widget h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pink-100);
}

.widget-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.widget-links a {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: 8px;
  display: block;
  transition: all 0.2s;
}

.widget-links a:hover {
  background: var(--pink-50);
  color: var(--pink-600);
}

.disclaimer-widget { background: var(--purple-50); border-color: var(--purple-200); }
.disclaimer-widget p { font-size: 0.85rem; color: var(--gray-600); line-height: 1.7; }

/* ===================== BLOG PREVIEW ===================== */
.blog-preview {
  padding: 70px 0;
  background: var(--white);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  text-align: right;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
}

.see-all {
  color: var(--pink-500);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.blog-card {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-100);
  background: var(--white);
  transition: all 0.3s;
  display: block;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.blog-img {
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.blog-img-text {
  font-family: 'Tajawal', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  text-align: center;
  line-height: 1.5;
}

.blog-img-site {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pink-600);
  background: rgba(255,255,255,0.85);
  padding: 2px 8px;
  border-radius: 50px;
}

.blog-card-body { padding: 20px; }

.blog-card-body h3 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  line-height: 1.5;
}

.blog-card-body p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 12px;
  line-height: 1.6;
}

.read-more {
  color: var(--pink-500);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ===================== FOOTER ===================== */
.site-footer {
  background: linear-gradient(135deg, #1a1025, #2d1b3d);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-desc {
  font-size: 0.88rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.6);
}

.footer-col h3 {
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.footer-col ul a {
  text-decoration: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  transition: color 0.2s;
}

.footer-col ul a:hover { color: var(--pink-300); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-bottom p { font-size: 0.85rem; color: rgba(255,255,255,0.5); }

.footer-disclaimer { font-size: 0.78rem !important; }

/* ===================== BLOG PAGE ===================== */
.page-hero {
  background: var(--gradient-hero);
  padding: 50px 0;
  text-align: center;
  border-bottom: 1px solid var(--pink-100);
}

.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.page-hero p {
  color: var(--gray-500);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--gray-500);
  padding: 16px 0;
}

.breadcrumb a { color: var(--pink-500); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--gray-400); }

/* ===================== ARTICLE PAGE ===================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
  padding: 50px 0;
}

.article-header { margin-bottom: 32px; }

.article-category {
  display: inline-block;
  background: var(--pink-100);
  color: var(--pink-600);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.article-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--gray-900);
  line-height: 1.4;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--gray-500);
  font-size: 0.85rem;
}

.article-featured-img {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-lg);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.article-featured-img .img-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-800);
  text-align: center;
  padding: 20px;
  line-height: 1.5;
  z-index: 1;
}

.article-featured-img .img-site {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(255,255,255,0.9);
  color: var(--pink-600);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

.toc {
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 30px;
}

.toc h2, .toc h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--purple-600);
  margin-bottom: 14px;
}

.toc ol {
  padding-right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc a {
  color: var(--gray-600);
  font-size: 0.88rem;
  text-decoration: none;
}

.toc a:hover { color: var(--pink-500); }

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 32px 0 14px;
  padding-right: 14px;
  border-right: 4px solid var(--pink-400);
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 24px 0 10px;
}

.article-body p {
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.85;
}

.article-body ul, .article-body ol {
  padding-right: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-body li { color: var(--gray-600); line-height: 1.7; }

.info-box {
  background: var(--pink-50);
  border: 1px solid var(--pink-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}

/* AUTHOR BOX */
.author-box {
  background: var(--gradient-card);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-avatar {
  width: 56px;
  height: 56px;
  background: var(--gradient-btn);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.author-info p { font-size: 0.85rem; color: var(--gray-500); }

/* MEDICAL DISCLAIMER */
.medical-disclaimer {
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--gray-600);
  display: flex;
  gap: 10px;
}

/* SOURCES */
.sources-section {
  margin-top: 30px;
}

.sources-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sources-list li {
  font-size: 0.85rem;
  color: var(--gray-500);
  padding-right: 16px;
  position: relative;
}

.sources-list li::before {
  content: '📚';
  position: absolute;
  right: 0;
}

/* RELATED ARTICLES */
.related-articles { margin-top: 50px; }

.related-articles h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.related-card {
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.25s;
}

.related-card:hover {
  border-color: var(--pink-300);
  box-shadow: var(--shadow-soft);
}

.related-card h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.5;
}

/* ===================== 404 PAGE ===================== */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  padding: 60px 20px;
}

.error-content {
  text-align: center;
  max-width: 500px;
}

.error-emoji { font-size: 4rem; margin-bottom: 20px; }

.error-content h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.error-content p {
  color: var(--gray-500);
  margin-bottom: 30px;
}

.error-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.error-link {
  background: var(--gradient-btn);
  color: white;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s;
}

.error-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236,72,153,0.35);
}

.error-link.secondary {
  background: none;
  color: var(--pink-500);
  border: 2px solid var(--pink-300);
}

/* ===================== STATIC PAGES ===================== */
.static-page {
  padding: 60px 0;
  max-width: 780px;
  margin: 0 auto;
}

.static-page h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gray-900);
  margin-bottom: 24px;
}

.static-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 28px 0 12px;
}

.static-page p {
  color: var(--gray-600);
  line-height: 1.85;
  margin-bottom: 14px;
}

/* CONTACT FORM */
.contact-form {
  background: var(--white);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 30px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border: 2px solid var(--pink-200);
  border-radius: var(--radius);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  color: var(--gray-700);
  transition: border-color 0.25s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--pink-400);
}

.form-group textarea { min-height: 140px; resize: vertical; }

.submit-btn {
  background: var(--gradient-btn);
  color: white;
  border: none;
  padding: 13px 28px;
  border-radius: 50px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
}

.submit-btn:hover { box-shadow: 0 6px 20px rgba(236,72,153,0.35); transform: translateY(-2px); }

/* ===================== CALCULATOR PAGES ===================== */
.calc-page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  padding: 50px 0;
  align-items: start;
}

/* ===================== BLOG INDEX ===================== */
.blog-index { padding: 50px 0; }

.blog-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-section { animation: fadeIn 0.5s ease; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .calc-page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 200;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    font-size: 1.2rem;
    padding: 12px 24px;
  }

  .hero { padding: 40px 0 60px; }

  .calc-header, .calc-body { padding: 20px; }

  .results-grid { grid-template-columns: 1fr 1fr; }
  .result-card.highlight { grid-column: span 2; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }

  .blog-grid { grid-template-columns: 1fr; }

  .tools-grid { grid-template-columns: 1fr; }

  .section-header { flex-direction: column; text-align: center; gap: 12px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .result-card.highlight { grid-column: auto; }
  .error-links { flex-direction: column; }
}

/* ── v2 additions ─────────────────────────────────────── */

/* Hijri date under due date */
.result-hijri {
  font-size: 0.78rem;
  color: var(--purple-500);
  margin-top: 4px;
  font-weight: 500;
  min-height: 1.2em;
}

/* Smaller result value for longer text */
.result-value--sm {
  font-size: 1rem !important;
  line-height: 1.4;
}

/* Share button */
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px auto 0;
  padding: 10px 28px;
  background: transparent;
  border: 2px solid var(--pink-300);
  border-radius: 50px;
  color: var(--pink-600);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.share-btn:hover {
  background: var(--pink-50);
  border-color: var(--pink-500);
}

/* Advice box (weight calculator) */
.advice-box {
  background: linear-gradient(135deg, var(--pink-50), var(--purple-50));
  border: 1px solid var(--pink-200);
  border-radius: 14px;
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.7;
  min-height: 0;
}
.advice-box:empty { display: none; }

/* Table styles for blog articles */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.88rem;
  overflow-x: auto;
  display: block;
}
.article-body th {
  background: linear-gradient(135deg, var(--pink-100), var(--purple-100));
  padding: 12px;
  border: 1px solid var(--purple-100);
  font-weight: 700;
  text-align: center;
}
.article-body td {
  padding: 10px 12px;
  border: 1px solid #f3f4f6;
  text-align: center;
}
.article-body tr:nth-child(even) td { background: var(--pink-50); }

/* noscript fallback banner */
.noscript-banner {
  background: #fef3c7;
  border-bottom: 2px solid #fbbf24;
  padding: 12px 20px;
  text-align: center;
  font-size: 0.9rem;
  color: #92400e;
  font-weight: 600;
}

/* Contact info box */
.contact-info-box {
  margin-top: 30px;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 0.88rem;
  color: var(--gray-600);
}

/* ── Table wrapper (replaces inline overflow-x:auto;margin:20px 0) ── */
.table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  -webkit-overflow-scrolling: touch;
}

/* ── Blog card gradient backgrounds ── */
.blog-bg-1 { background: linear-gradient(135deg,#fce4ec,#f8bbd0); }
.blog-bg-2 { background: linear-gradient(135deg,#e1bee7,#ce93d8); }
.blog-bg-3 { background: linear-gradient(135deg,#f3e5f5,#e1bee7); }
.blog-bg-4 { background: linear-gradient(135deg,#fce4ec,#f48fb1); }
.blog-bg-5 { background: linear-gradient(135deg,#fff3e0,#ffe0b2); }
.blog-bg-6 { background: linear-gradient(135deg,#e8f5e9,#c8e6c9); }
.blog-bg-7 { background: linear-gradient(135deg,#e3f2fd,#bbdefb); }
.blog-bg-8 { background: linear-gradient(135deg,#fdf3f8,#f8e1f4); }
.blog-bg-9 { background: linear-gradient(135deg,#fff8e1,#ffe082); }
.blog-bg-10 { background: linear-gradient(135deg,#f9fbe7,#f0f4c3); }
.blog-bg-11 { background: linear-gradient(135deg,#e0f7fa,#b2ebf2); }
.blog-bg-12 { background: linear-gradient(135deg,#fce4ec,#ffcdd2); }
.blog-bg-13 { background: linear-gradient(135deg,#f3e5f5,#f8bbd0); }
.blog-bg-14 { background: linear-gradient(135deg,#ede7f6,#d1c4e9); }
.blog-bg-15 { background: linear-gradient(135deg,#e8eaf6,#c5cae9); }

/* ── Comparison table header ── */
.tbl-header { background: linear-gradient(135deg,#fce7f3,#f3e8ff); }

/* ── Footer column headings (used where h3→p conversion was done) ── */
.footer-col-h {
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.justify-center { justify-content: center; }

/* ── Table cell utility classes (replaced inline styles) ── */
.tbl-cell-right { padding: 12px; border: 1px solid #fce7f3; text-align: right; }
.tbl-cell       { padding: 12px; border: 1px solid #fce7f3; }
.tbl-cell-purple { padding: 12px; border: 1px solid #f3e8ff; }
.tbl-cell-sm    { padding: 10px; border: 1px solid #f3f4f6; }
.tbl-cell-center { padding: 10px; border: 1px solid #f3f4f6; text-align: center; }
.tbl-cell-center-purple { text-align: center; padding: 12px; border: 1px solid #f3e8ff; }
.tbl-bg-pink    { background: linear-gradient(135deg,#f3e5f5,#f8bbd0); }
.tbl-bg-purple  { background: linear-gradient(135deg,#f3e5f5,#e1bee7); }

.tbl-bg-light       { background: #fdf2f8; }
.tools-widget-inline { margin-top: 40px; background: linear-gradient(135deg,#fdf2f8,#faf5ff); }
.tbl-cell-bold      { padding: 10px; border: 1px solid #f3f4f6; font-weight: 600; }
.tbl-cell-purple-text  { padding: 10px; border: 1px solid #f3f4f6; color: #7c3aed; }
.tbl-cell-purple-text2 { padding: 10px; border: 1px solid #f3f4f6; color: #9333ea; }
.tbl-cell-pink-text    { padding: 10px; border: 1px solid #f3f4f6; color: #db2777; }

/* ── Screen reader only (visually hidden but accessible) ── */
.sr-only, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Blog article inline tools widget ── */
.article-tools-widget {
  margin-top: 40px;
  background: linear-gradient(135deg, #fdf2f8, #faf5ff);
}

/* ── Featured image gradient: pink/purple ── */
.article-featured-gradient-pink {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0, #e1bee7);
}

/* ── Weight gain breakdown list ── */
.weight-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.weight-breakdown-item {
  background: white;
  border: 1px solid #fce7f3;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Toast Notification ── */
.app-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  border-radius: 50px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  pointer-events: none;
}
