/*
Theme Name: Meed UI
Theme URI: https://webwrd.com
Author: Meed UI Team (ported to WordPress)
Author URI: https://webwrd.com
Description: قالب عربي احترافي متكامل - Meed UI مُحوَّل لووردبريس. متوافق مع RTL، السيو، الهواتف، الوضع المظلم وخفيف الوزن.
Version: 3.2.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: meed-ui
Tags: rtl-language, blog, custom-colors, custom-logo, dark-mode, responsive-layout, seo-friendly, fast, arabic
*/

/* ================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
================================================ */
:root {
  /* Brand Colors */
  --primary:       #482dff;
  --primary-dark:  #3520cc;
  --primary-light: #ede9ff;

  /* Text Colors */
  --heading-color: #08102b;
  --body-color:    #08102b;
  --body-alt:      #989b9f;
  --link-color:    #482dff;

  /* Background */
  --bg-main:   #fdfcff;
  --bg-card:   #ffffff;
  --bg-nav:    #ffffff;
  --bg-footer: #0f1628;

  /* Surface & Borders */
  --border:        #e5e7eb;
  --border-radius: 10px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 20px rgba(72,45,255,0.10);
  --shadow-lg:     0 8px 40px rgba(72,45,255,0.16);

  /* Header */
  --header-height: 60px;
  --header-bg:     #ffffff;
  --header-border: 1px solid var(--border);

  /* Typography */
  --font-head: 'Cairo', 'Tajawal', Arial, sans-serif;
  --font-body: 'Cairo', 'Tajawal', Arial, sans-serif;
  --font-size-base: 15px;
  --line-height: 1.7;

  /* Notification */
  --notif-bg:    #e8f0fe;
  --notif-color: #01579b;

  /* Button */
  --btn-radius: 6px;

  /* Transition */
  --t: 0.25s ease;
}

/* Dark Mode */
[data-mode="dark"] {
  --heading-color: #f0f2f8;
  --body-color:    #c8ccd8;
  --body-alt:      #7a7f9a;
  --bg-main:       #0f1117;
  --bg-card:       #1a1d2e;
  --bg-nav:        #1a1d2e;
  --border:        #2c2f45;
  --header-bg:     #1a1d2e;
  --notif-bg:      #1a2744;
  --notif-color:   #90caf9;
}

/* ================================================
   RESET & BASE
================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--body-color);
  background-color: var(--bg-main);
  direction: rtl;
  text-align: right;
  transition: background-color var(--t), color var(--t);
  -webkit-font-smoothing: antialiased;
}

body.ltr-content {
  direction: ltr;
  text-align: left;
}

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

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--t);
}
a:hover { color: var(--primary-dark); }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--heading-color);
  font-weight: 700;
  line-height: 1.35;
}

/* ================================================
   UTILITY CLASSES
================================================ */
.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.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;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 8px 20px;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; color: #fff; }

/* ================================================
   NOTIFICATION BAR
================================================ */
.site-notification {
  background: var(--notif-bg);
  color: var(--notif-color);
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid rgba(72,45,255,0.12);
  display: none;
}
.site-notification.active { display: block; }
.site-notification a { color: inherit; text-decoration: underline; }

/* ================================================
   HEADER
================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: var(--header-border);
  box-shadow: var(--shadow-sm);
  transition: background var(--t), box-shadow var(--t);
}

.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-height);
  gap: 12px;
}

/* Logo */
.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
}
.site-logo .logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  color: var(--heading-color);
  white-space: nowrap;
}
.site-logo .logo-text span { color: var(--primary); }

/* Nav */
.main-navigation {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.main-navigation ul {
  display: flex;
  align-items: center;
  gap: 2px;
}
.main-navigation li { position: relative; }
.main-navigation > ul > li > a {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--body-color);
  border-bottom: 3px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.main-navigation > ul > li > a:hover,
.main-navigation > ul > li.current-menu-item > a {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Dropdown */
.main-navigation .sub-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
  z-index: 100;
}
.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-navigation .sub-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--body-color);
  border-bottom: 1px solid var(--border);
  transition: background var(--t), color var(--t);
}
.main-navigation .sub-menu li:last-child a { border-bottom: 0; }
.main-navigation .sub-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-search-form {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.header-search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.header-search-form input[type="search"] {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--body-color);
  width: 180px;
  outline: none;
  direction: rtl;
}
.header-search-form button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px 12px;
  color: var(--body-alt);
  display: flex;
  align-items: center;
}
.header-search-form button:hover { color: var(--primary); }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--body-color);
  transition: background var(--t), color var(--t);
}
.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Dark Mode Toggle */
#dark-mode-toggle .icon-moon { display: block; }
#dark-mode-toggle .icon-sun  { display: none; }
[data-mode="dark"] #dark-mode-toggle .icon-moon { display: none; }
[data-mode="dark"] #dark-mode-toggle .icon-sun  { display: block; }

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--heading-color);
  transition: transform var(--t), opacity var(--t);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================================================
   LAYOUT: MAIN CONTENT & SIDEBAR
================================================ */
.site-main {
  padding: 32px 0 48px;
}

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

.content-area.full-width {
  grid-template-columns: 1fr;
}

/* ================================================
   BREADCRUMB
================================================ */
.breadcrumb {
  padding: 12px 0;
  font-size: 13px;
  color: var(--body-alt);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--body-alt); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* ================================================
   POST CARD
================================================ */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
  position: relative;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card-thumbnail {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-thumbnail img { transform: scale(1.04); }

.post-card-cat {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.post-card-body {
  padding: 16px;
}

.post-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-title a { color: var(--heading-color); }
.post-card-title a:hover { color: var(--primary); }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--body-alt);
  flex-wrap: wrap;
}
.post-card-meta svg { width: 14px; height: 14px; vertical-align: middle; margin-left: 3px; }

.post-card-excerpt {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--body-alt);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  padding: 6px 14px;
  background: var(--primary-light);
  border-radius: var(--btn-radius);
  transition: background var(--t), color var(--t);
}
.read-more:hover {
  background: var(--primary);
  color: #fff;
}

/* ================================================
   POST GRID
================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.posts-grid.list-view {
  grid-template-columns: 1fr;
}
.posts-grid.list-view .post-card {
  display: grid;
  grid-template-columns: 240px 1fr;
}
.posts-grid.list-view .post-card-thumbnail {
  aspect-ratio: unset;
  height: 100%;
}

/* ================================================
   FEATURED / HERO POSTS
================================================ */
.featured-section {
  margin-bottom: 32px;
}
.featured-section .section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--heading-color);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
}

.hero-post {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/8;
  background: #000;
}
.hero-post img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.75;
}
.hero-post-info {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  padding: 24px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  color: #fff;
}
.hero-post-info .cat-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.hero-post-info h2 {
  font-size: 22px;
  color: #fff;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-post-info .meta {
  font-size: 12px;
  opacity: 0.8;
  display: flex;
  gap: 12px;
}

/* ================================================
   PAGINATION
================================================ */
.posts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.posts-pagination a,
.posts-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--body-color);
  background: var(--bg-card);
  transition: all var(--t);
}
.posts-pagination a:hover,
.posts-pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ================================================
   SINGLE POST
================================================ */
.single-post-header {
  margin-bottom: 24px;
}
.single-post-header .cat-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.single-post-header h1 {
  font-size: clamp(22px, 4vw, 32px);
  color: var(--heading-color);
  margin-bottom: 14px;
  line-height: 1.3;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--body-alt);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.post-meta svg { width: 15px; height: 15px; margin-left: 4px; vertical-align: middle; }
.post-meta a { color: var(--body-alt); }
.post-meta a:hover { color: var(--primary); }

.post-featured-image {
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 28px;
  aspect-ratio: 16/9;
}
.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-content {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--body-color);
}
.entry-content h2, .entry-content h3 { margin: 28px 0 12px; }
.entry-content h2 { font-size: 22px; }
.entry-content h3 { font-size: 18px; }
.entry-content p { margin-bottom: 18px; }
.entry-content ul, .entry-content ol {
  padding-right: 24px;
  margin-bottom: 18px;
}
.entry-content li { margin-bottom: 8px; list-style: disc; }
.entry-content ol li { list-style: decimal; }
.entry-content blockquote {
  border-right: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--primary-dark);
}
.entry-content pre, .entry-content code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  direction: ltr;
  text-align: left;
}
.entry-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
  position: relative;
}
.entry-content code {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
}
.entry-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.entry-content th, .entry-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: right;
}
.entry-content th {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.entry-content tr:nth-child(even) { background: var(--bg-main); }
.entry-content img {
  border-radius: 10px;
  margin: 16px auto;
}
.entry-content a { color: var(--primary); text-decoration: underline; }
.entry-content a:hover { color: var(--primary-dark); }

/* Tags */
.post-tags {
  margin: 28px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.post-tags .tag-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--body-alt);
}
.post-tags a {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--body-color);
  transition: all var(--t);
}
.post-tags a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Share */
.post-share {
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.post-share .share-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--body-alt);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--btn-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: #fff;
  transition: opacity var(--t);
}
.share-btn:hover { opacity: 0.85; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.facebook { background: #1877F2; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.copy    { background: var(--primary); }

/* Author Box */
.author-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 32px 0;
}
.author-box .author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--primary-light);
}
.author-box .author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-box .author-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 4px;
}
.author-box .about-label {
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}
.author-box .author-bio {
  font-size: 13.5px;
  color: var(--body-alt);
  line-height: 1.7;
}

/* Related Posts */
.related-posts { margin: 40px 0; }
.related-posts .section-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
}
.related-posts .posts-grid { grid-template-columns: repeat(3, 1fr); }

/* ================================================
   COMMENTS
================================================ */
.comments-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.comments-section .section-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 24px;
}
.comment-list { list-style: none; }
.comment-item {
  display: flex;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item .comment-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.comment-item .comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-author-name { font-weight: 700; font-size: 14px; color: var(--heading-color); }
.comment-date { font-size: 12px; color: var(--body-alt); margin-top: 2px; }
.comment-content { font-size: 14px; color: var(--body-color); margin-top: 10px; line-height: 1.7; }
.comment-reply-link {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
}
.comment-reply-link:hover { color: var(--primary-dark); }

/* Comment Form */
.comment-form { margin-top: 32px; }
.comment-form h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.comment-form .form-group { margin-bottom: 16px; }
.comment-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--body-alt);
  margin-bottom: 6px;
}
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-main);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--body-color);
  direction: rtl;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.comment-form textarea { height: 130px; resize: vertical; }
.comment-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.comment-form .submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t), transform 0.1s;
}
.comment-form .submit-btn:hover { background: var(--primary-dark); transform: scale(1.02); }

/* ================================================
   SIDEBAR
================================================ */
.widget-area {
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.widget-title {
  font-size: 14px;
  font-weight: 800;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.widget-content { padding: 16px; }

/* Widget: Recent Posts */
.widget-posts-list { display: flex; flex-direction: column; gap: 14px; }
.widget-post-item { display: flex; gap: 12px; align-items: flex-start; }
.widget-post-thumb {
  width: 70px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.widget-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-post-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--heading-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  margin-bottom: 4px;
}
.widget-post-title:hover { color: var(--primary); }
.widget-post-date { font-size: 11.5px; color: var(--body-alt); }

/* Widget: Categories */
.widget-categories li {
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.widget-categories li:last-child { border-bottom: 0; }
.widget-categories a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--body-color);
  flex: 1;
}
.widget-categories a:hover { color: var(--primary); }
.widget-categories .count {
  font-size: 11px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

/* Widget: Tags Cloud */
.widget-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.widget-tags a {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--body-color);
  transition: all var(--t);
}
.widget-tags a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Widget: Social */
.widget-social { display: flex; flex-wrap: wrap; gap: 10px; }
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  transition: transform var(--t), opacity var(--t);
}
.social-link:hover { transform: translateY(-2px); opacity: 0.85; color: #fff; }
.social-link.facebook  { background: #1877F2; }
.social-link.twitter   { background: #1DA1F2; }
.social-link.instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.social-link.youtube   { background: #FF0000; }
.social-link.telegram  { background: #229ED9; }
.social-link.whatsapp  { background: #25D366; }

/* ================================================
   FOOTER
================================================ */
.site-footer {
  background: var(--bg-footer);
  color: rgba(255,255,255,0.75);
  padding-top: 52px;
}

.footer-widgets {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-widget-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.footer-logo {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  display: block;
}
.footer-logo span { color: var(--primary); }

.footer-about {
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(255,255,255,0.6);
  margin-bottom: 16px;
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  font-size: 13.5px;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t);
}
.footer-links a::before {
  content: '←';
  color: var(--primary);
  font-size: 11px;
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  padding: 18px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
}
.footer-bottom a { color: rgba(255,255,255,0.65); }
.footer-bottom a:hover { color: var(--primary); }

/* ================================================
   SPECIAL PAGES: 404, SEARCH, ARCHIVE
================================================ */
.page-404 {
  text-align: center;
  padding: 80px 20px;
}
.page-404 .error-code {
  font-size: clamp(80px, 15vw, 150px);
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 16px;
}
.page-404 h2 { font-size: 26px; margin-bottom: 12px; }
.page-404 p { color: var(--body-alt); margin-bottom: 28px; font-size: 15px; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-weight: 700;
  transition: background var(--t);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.archive-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 32px;
  border-radius: 16px;
  margin-bottom: 28px;
}
.archive-header h1 { color: #fff; font-size: 24px; }
.archive-header p { color: rgba(255,255,255,0.8); font-size: 14px; margin-top: 6px; }

/* ================================================
   MOBILE MENU OVERLAY
================================================ */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  transition: all var(--t);
}
.mobile-menu.open {
  visibility: visible;
  opacity: 1;
}
.mobile-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.mobile-menu-inner {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: var(--bg-card);
  padding: 20px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--t);
}
.mobile-menu.open .mobile-menu-inner {
  transform: translateX(0);
}
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-list { display: flex; flex-direction: column; }
.mobile-nav-list a {
  display: block;
  padding: 13px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--body-color);
  border-bottom: 1px solid var(--border);
  transition: color var(--t);
}
.mobile-nav-list a:hover { color: var(--primary); }

/* ================================================
   BACK TO TOP
================================================ */
#back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--t);
  z-index: 500;
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ================================================
   LOADING SKELETON
================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-main) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================
   READING PROGRESS BAR
================================================ */
#reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
}
#reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to left, var(--primary), #9b79ff);
  transition: width 0.1s linear;
}

/* ================================================
   RESPONSIVE
================================================ */
@media (max-width: 1024px) {
  .footer-widgets { grid-template-columns: 1fr 1fr; }
  .related-posts .posts-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 900px) {
  .content-area { grid-template-columns: 1fr; }
  .widget-area { position: static; }
  .main-navigation { display: none; }
  .menu-toggle { display: flex; }
}

@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .posts-grid.list-view .post-card { grid-template-columns: 1fr; }
  .posts-grid.list-view .post-card-thumbnail { height: 200px; }
  .footer-widgets { grid-template-columns: 1fr; }
  .related-posts .posts-grid { grid-template-columns: 1fr; }
  .comment-form .form-row { grid-template-columns: 1fr; }
  .header-search-form input[type="search"] { width: 130px; }
  .author-box { flex-direction: column; }
}

@media (max-width: 400px) {
  :root { --header-height: 54px; }
  .header-search-form { display: none; }
}

/* ================================================
   PRINT STYLES
================================================ */
@media print {
  .site-header, .widget-area, .site-footer,
  .post-share, #back-to-top, #reading-progress { display: none !important; }
  .content-area { grid-template-columns: 1fr; }
  body { font-size: 12pt; color: #000; background: #fff; }
}
