/* ==========================================================
   Udaipur Software Developer — alignment fixes (static build)
   Theme (GeneratePress + GenerateBlocks) unchanged; only layout
   alignment corrected. Loaded last on every page.
   ========================================================== */

/* 1. Empty right sidebar removed -> content was stuck at 70% width, left-aligned.
      Posts / archives: full width but centred at a readable measure. */
.no-sidebar .site-content .content-area { width: 100%; }
.single .site-content .content-area,
.archive .site-content .content-area,
.blog .site-content .content-area,
.search .site-content .content-area { max-width: 900px; margin-left: auto; margin-right: auto; float: none; }
.single .site-content, .archive .site-content { justify-content: center; }

/* 2. Home — "Recent Projects" (latest posts) : proper 3-column card grid */
.wp-block-latest-posts.is-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
}
.wp-block-latest-posts.is-grid > li {
  margin: 0 !important; width: auto !important;
  background: #fff; border: 1px solid #e6e6e6; border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 4px 18px rgba(0,0,0,.05);
  transition: transform .25s ease, box-shadow .25s ease;
}
.wp-block-latest-posts.is-grid > li:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.10); }
.wp-block-latest-posts.is-grid .wp-block-latest-posts__featured-image { margin: 0; aspect-ratio: 789 / 660; overflow: hidden; background: #f3f3f3; }
.wp-block-latest-posts.is-grid .wp-block-latest-posts__featured-image a { display: block; height: 100%; }
.wp-block-latest-posts.is-grid .wp-block-latest-posts__featured-image img {
  width: 100%; height: 100%; max-width: 100%; object-fit: cover; object-position: top center; display: block;
}
.wp-block-latest-posts.is-grid .wp-block-latest-posts__post-title {
  display: block; padding: 16px 18px 20px; font-size: 17px; line-height: 1.45; font-weight: 500;
  color: #222; text-decoration: none; text-align: left;
}
.wp-block-latest-posts.is-grid .wp-block-latest-posts__post-title:hover { color: #e3342f; }

/* 3. GenerateBlocks grids (services cards, blog query loop) — equal heights, top-aligned */
.gb-grid-wrapper { align-items: stretch !important; }
.gb-grid-wrapper > .gb-grid-column > .gb-container { height: 100%; }
.gb-query-loop-wrapper .gb-block-image { margin: 0 0 14px; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; background: #f3f3f3; }
.gb-query-loop-wrapper .gb-block-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gb-query-loop-wrapper .gb-headline a { text-decoration: none; }

/* 4. Images inside content never overflow their column */
.entry-content img, .wp-block-image img { max-width: 100%; height: auto; }

/* 5. Long words / e-mail addresses break instead of causing horizontal scroll on mobile */
.entry-content, .gb-headline, .gb-container p, .site-info { overflow-wrap: anywhere; word-break: normal; }
html, body { overflow-x: hidden; }

/* 6. Table of contents box — centred with content */
#ez-toc-container { margin-left: auto; margin-right: auto; max-width: 100%; }

/* 7. Contact form (replaces Contact Form 7) */
.usd-contact-form .cf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.usd-contact-form input[type=text], .usd-contact-form input[type=email],
.usd-contact-form input[type=tel], .usd-contact-form textarea { width: 100%; box-sizing: border-box; }
.usd-contact-form label { font-weight: 500; }
.usd-contact-form .cf-status { margin-top: 10px; font-weight: 500; }
.usd-contact-form .cf-status.ok { color: #1a7f37; }
.usd-contact-form .cf-status.err { color: #c62828; }

/* 8. Related posts thumbnails — even grid */
.crp_related.crp-thumbs-grid ul { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.crp_related.crp-thumbs-grid ul li { margin: 0 !important; width: auto !important; }
.crp_related.crp-thumbs-grid ul li a.crp_link { width: 100% !important; }
.crp_related .crp_thumb { width: 100% !important; height: 100% !important; object-fit: cover; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .wp-block-latest-posts.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
}
@media (max-width: 768px) {
  .wp-block-latest-posts.is-grid { grid-template-columns: 1fr; gap: 20px; }
  .single .site-content .content-area, .archive .site-content .content-area { max-width: 100%; }
  .crp_related.crp-thumbs-grid ul { grid-template-columns: repeat(2, 1fr); }
}

/* 9. Blog page — empty space left above heading after Table of Contents removal */
.gb-container-c62c2eac { padding-top: 30px !important; }
