/*
 * SmokePDF Premium Blog Stylesheet
 * Path: blog/wp-content/themes/hostinger-ai-theme/assets/css/blog-custom.css
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

/* Global Reset & Styling */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #f5f3ff;
  --primary-mid: #c7d2fe;
  --accent: #06b6d4;
  --bg: #f8fafc;
  --white: #ffffff;
  --dark: #0f172a;
  --dark2: #334155;
  --gray: #64748b;
  --gray-light: #f1f5f9;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px -2px rgba(79,70,229,0.06);
  --shadow-md: 0 10px 30px -4px rgba(79,70,229,0.1);
  --shadow-lg: 0 20px 50px -6px rgba(79,70,229,0.14);
  --transition: all .25s cubic-bezier(.16,1,.3,1);
}

body {
  font-family: 'Cairo', sans-serif !important;
  background: var(--bg) !important;
  color: var(--dark) !important;
  line-height: 1.7 !important;
}

.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER ===== */
.header {
  background: var(--white);
  box-shadow: 0 1px 0 var(--border), 0 2px 16px rgba(0,0,0,0.05);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 300;
  width: 100%;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  height: 64px;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
}
.logo {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(79,70,229,.3);
  color: #fff;
}
.logo-text {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-family: 'Cairo', sans-serif;
  color: var(--dark);
}
.logo-text span {
  color: var(--primary);
}
.nav {
  display: flex;
  gap: 2px;
}
.nav-link {
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  color: var(--gray) !important;
  cursor: pointer;
  transition: .2s;
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  background: var(--primary-light);
  color: var(--primary) !important;
  border-color: var(--primary-mid);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-switch {
  display: flex;
  align-items: center;
  background: #f0f2f5;
  padding: 3px;
  border-radius: 40px;
  gap: 2px;
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  transition: .2s;
  font-family: inherit;
  color: var(--gray);
}
.lang-switch button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(229,57,53,.35);
}
.lang-globe-icon {
  width: 15px;
  height: 15px;
  color: #6c757d;
  flex-shrink: 0;
  margin: 0 5px;
  display: inline-block;
}

/* RTL / LTR overrides */
body.en .logo-text {
  flex-direction: row;
}

/* Hide wordpress default admin bar gap if logged out */
html {
  margin-top: 0 !important;
}

/* ===== ARTICLES LIST / GRID ===== */
.wp-block-group.hostinger-ai-menu {
  display: none !important; /* Hide old Gutenberg header */
}

.site-header {
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

main.wp-block-group {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 40px 20px !important;
}

h1.wp-block-heading {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}
h1.wp-block-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* Ensure the query loop expands to full container width instead of 700px constraint */
main.wp-block-group > .wp-block-query {
  max-width: 1200px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Modern card grid style for post template */
ul.wp-block-post-template, .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important; /* Force 3 columns on desktop */
  gap: 28px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: 1200px !important;
  width: 100% !important;
}

li.wp-block-post, .wp-block-post {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  padding: 0 !important;
  box-shadow: var(--shadow) !important;
  transition: var(--transition) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
  margin-top: 0 !important; /* Fix vertical alignment/offset bug */
  margin-bottom: 0 !important;
}

/* Responsive grid overrides */
@media (max-width: 991px) {
  ul.wp-block-post-template, .wp-block-post-template {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  ul.wp-block-post-template, .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
}

li.wp-block-post:hover, .wp-block-post:hover {
  transform: translateY(-8px) !important;
  border-color: var(--primary-mid) !important;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.08) !important;
}

li.wp-block-post > *:not(.wp-block-post-featured-image) {
  padding-left: 24px !important;
  padding-right: 24px !important;
}

/* Post Card Elements styling */
.wp-block-post-title {
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
}
.wp-block-post-title a {
  color: var(--dark) !important;
  text-decoration: none !important;
  transition: color 0.2s !important;
}
.wp-block-post-title a:hover {
  color: var(--primary) !important;
}

.wp-block-post-featured-image {
  margin: 0 !important;
  width: 100% !important;
}
.blog-card-img-wrapper {
  height: 180px !important;
  overflow: hidden !important;
  position: relative !important;
  border-bottom: 1px solid var(--border) !important;
  width: 100% !important;
}
.blog-card-img-holder {
  width: 100% !important;
  height: 100% !important;
  background-size: cover !important;
  background-position: center !important;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.wp-block-post:hover .blog-card-img-holder {
  transform: scale(1.05) !important;
}
.blog-card-img-holder.fallback-img {
  background: linear-gradient(135deg, var(--primary-light), #fff5f5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--primary) !important;
}
.blog-card-img-holder.fallback-img svg {
  width: 48px !important;
  height: 48px !important;
  stroke-width: 1.5px !important;
}

/* Post Meta (date, category) styling */
.blog-meta {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 24px !important;
  margin-bottom: 8px !important;
  flex-wrap: wrap !important;
  font-size: 12px !important;
  color: var(--gray) !important;
  font-weight: 600 !important;
}
.blog-cat {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  border: 1px solid var(--primary-mid) !important;
}
.blog-read-time {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.blog-date {
  white-space: nowrap !important;
}

.wp-block-post-excerpt {
  margin-bottom: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  flex-grow: 1 !important;
}
.wp-block-post-excerpt p {
  font-size: 13px !important;
  color: #64748b !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  height: 3.2em !important;
}

/* More link style */
.blog-read-more {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--primary) !important;
  transition: var(--transition) !important;
  margin-top: 4px !important;
  text-decoration: none !important;
}
.blog-read-more .arrow {
  display: inline-block !important;
  transition: transform 0.3s ease !important;
}
.wp-block-post:hover .blog-read-more {
  color: var(--primary-dark) !important;
}
body.en .wp-block-post:hover .blog-read-more .arrow {
  transform: translateX(4px) !important;
}
body:not(.en) .wp-block-post:hover .blog-read-more .arrow {
  transform: translateX(-4px) !important;
}

/* Pagination container styling */
.wp-block-query-pagination {
  margin-top: 40px !important;
  padding: 10px 0 !important;
  border-top: 1px solid var(--border) !important;
  font-weight: 700 !important;
}
.wp-block-query-pagination a {
  color: var(--primary) !important;
  text-decoration: none !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  border: 1.5px solid transparent !important;
  transition: all 0.2s !important;
}
.wp-block-query-pagination a:hover {
  background: var(--primary-light) !important;
  border-color: var(--primary-mid) !important;
}

/* ===== SINGLE POST PAGE ===== */
.wp-block-post-content {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 40px 30px !important;
  box-shadow: var(--shadow) !important;
  max-width: 800px !important;
  margin: 0 auto !important;
}
.wp-block-post-content h2 {
  font-size: 24px !important;
  font-weight: 800 !important;
  color: var(--dark) !important;
  margin-top: 30px !important;
  margin-bottom: 16px !important;
}
.wp-block-post-content p {
  font-size: 16px !important;
  color: var(--dark2) !important;
  margin-bottom: 20px !important;
  line-height: 1.8 !important;
}
.wp-block-post-content ul, .wp-block-post-content ol {
  margin-bottom: 20px !important;
  padding-left: 20px !important;
}
.wp-block-post-content li {
  margin-bottom: 8px !important;
  font-size: 15px !important;
}

/* ===== FOOTER STYLING (matching homepage) ===== */
footer, .site-footer, [role="contentinfo"] {
  background: var(--dark) !important;
  color: #94a3b8 !important;
  padding: 56px 0 28px !important;
  margin-top: 60px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  font-family: 'Cairo', sans-serif !important;
  display: block !important;
}
footer .container, .site-footer .container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  box-sizing: border-box !important;
}
footer .footer-inner, .site-footer .footer-inner {
  display: grid !important;
  grid-template-columns: 1.2fr 2fr !important;
  gap: 48px !important;
  align-items: start !important;
  margin-bottom: 40px !important;
}
footer .footer-brand .logo, .site-footer .footer-brand .logo {
  margin-bottom: 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  color: #fff !important;
}
footer .logo-text, .site-footer .logo-text {
  color: #fff !important;
}
footer .logo-text span, .site-footer .logo-text span {
  color: var(--primary) !important;
}
footer .footer-brand p, .site-footer .footer-brand p {
  font-size: 13px !important;
  line-height: 1.7 !important;
  max-width: 320px !important;
  color: #94a3b8 !important;
  margin: 0 !important;
}
footer .footer-cols, .site-footer .footer-cols {
  display: grid !important;
  grid-template-columns: 1.2fr 1fr !important;
  gap: 32px !important;
  width: 100% !important;
}
footer .footer-col h4, .site-footer .footer-col h4 {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  margin-bottom: 16px !important;
  position: relative !important;
  padding-bottom: 8px !important;
  letter-spacing: 0.5px !important;
}
footer .footer-col h4::after, .site-footer .footer-col h4::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 24px !important;
  height: 2px !important;
  background: var(--primary) !important;
}
body.en footer .footer-col h4::after, body.en .site-footer .footer-col h4::after {
  right: auto !important;
  left: 0 !important;
}
footer .footer-links, .site-footer .footer-links {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  text-align: right !important; /* Default RTL (Arabic) */
}
body.en footer .footer-links, body.en .site-footer .footer-links {
  text-align: left !important; /* LTR (English) */
}
footer .footer-links a, .site-footer .footer-links a {
  font-size: 13px !important;
  color: #94a3b8 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  font-weight: 600 !important;
}
footer .footer-links a:hover, .site-footer .footer-links a:hover {
  color: #fff !important;
}
footer .footer-bottom, .site-footer .footer-bottom {
  border-top: 1px solid #1e293b !important;
  padding-top: 24px !important;
  text-align: center !important;
  font-size: 13px !important;
  color: #64748b !important;
}
footer .footer-bottom strong, .site-footer .footer-bottom strong {
  color: var(--primary) !important;
}

@media(max-width: 768px) {
  footer .footer-inner, .site-footer .footer-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  footer .footer-brand, .site-footer .footer-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  footer .footer-cols, .site-footer .footer-cols {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  footer .footer-links, .site-footer .footer-links {
    text-align: center !important;
    align-items: center !important;
  }
  body.en footer .footer-links, body.en .site-footer .footer-links {
    text-align: center !important;
    align-items: center !important;
  }
}

