/*
  Blog pages added on top of the Velotrax template.

  blog.css already styles the card shell (.single-blog-box, .single-blog-details,
  .generic-btn2) and the sub-banner, so this file only covers what it has no
  rules for: the Bootstrap-grid card layout used instead of the template's
  fixed two-column grid, the markdown-rendered post body, pagination, hero
  attribution, tags and the footer credit line.

  Colours come from the theme variables declared in style.css.
*/

/* ---------- LIST PAGE ---------- */

/* The template's .single-blog-outer-con is a hard-coded 2-column grid. The list
   page uses Bootstrap columns instead, so cards need their own bottom gap and
   equal-height behaviour. */
.blog-tabs-section .row > [class*="col-"] {
  margin-bottom: 30px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--secondary--color);
  overflow: hidden;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 3px 12px 32px rgb(0 0 0 / 12%);
}

/* Fixed-ratio thumbnail box: hero images arrive from arbitrary hosts at
   arbitrary sizes, so crop them to a consistent 1.91:1 instead of letting each
   card set its own height. */
.blog-card__figure {
  margin: 0;
  aspect-ratio: 1.91 / 1;
  overflow: hidden;
}

.blog-card__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Push the "ვრცლად" button to a common baseline across a row. */
.blog-card .single-blog-details {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.blog-card .single-blog-details .generic-btn2 {
  margin-top: auto;
}

/* Clamp titles and excerpts so uneven Hub copy doesn't skew card heights. */
.blog-card .text-size-26 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card .single-blog-details p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-empty {
  padding: 80px 20px;
  border: 1px dashed var(--border--color);
  border-radius: 20px;
  color: var(--text--color);
}

.blog-empty .text-size-26 {
  color: var(--accent--color);
  margin-bottom: 12px;
}

/* ---------- PAGINATION ---------- */

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.blog-pagination__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 30px;
  background: var(--accent--color);
  color: var(--secondary--color);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
}

.blog-pagination__link:hover {
  background: var(--primary--color);
  color: var(--accent--color);
  text-decoration: none;
}

.blog-pagination__status {
  color: var(--text--color);
  font-size: 15px;
}

/* ---------- POST PAGE ---------- */

/* Post titles are editor-written and can be long; the banner's 100px display
   size is meant for one or two words. */
.blog-post__title {
  max-width: 20ch;
}

.blog-post {
  max-width: 820px;
  margin: 0 auto;
}

.blog-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-bottom: 28px;
  padding: 0;
}

.blog-post__meta li {
  font-size: 15px;
  line-height: 18px;
  color: var(--text--color);
}

.blog-post__meta li i {
  margin-right: 8px;
  color: var(--primary--color);
}

.blog-post__hero {
  margin-bottom: 36px;
}

.blog-post__hero img {
  width: 100%;
  height: auto;
}

.blog-post__attribution {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text--color);
  text-align: right;
}

/* ---------- MARKDOWN BODY ---------- */

/* react-markdown emits bare tags, so every element is styled here. */
.blog-post__body {
  color: var(--text--color);
  font-size: 17px;
  line-height: 30px;
}

.blog-post__body > *:first-child {
  margin-top: 0;
}

.blog-post__body h2,
.blog-post__body h3,
.blog-post__body h4 {
  color: var(--accent--color);
  font-weight: 700;
  margin: 40px 0 16px;
  line-height: 1.3;
}

.blog-post__body h2 {
  font-size: 30px;
}

.blog-post__body h3 {
  font-size: 24px;
}

.blog-post__body h4 {
  font-size: 20px;
}

.blog-post__body p {
  margin-bottom: 20px;
}

.blog-post__body a {
  color: var(--accent--color);
  font-weight: 600;
  text-decoration: underline;
}

.blog-post__body a:hover {
  color: var(--primary--color);
}

.blog-post__body ul,
.blog-post__body ol {
  margin: 0 0 22px;
  padding-left: 22px;
}

.blog-post__body li {
  margin-bottom: 10px;
}

.blog-post__body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 12px 0 24px;
}

.blog-post__body blockquote {
  margin: 28px 0;
  padding: 18px 26px;
  border-left: 4px solid var(--primary--color);
  background: var(--grey--bg--color);
  border-radius: 0 12px 12px 0;
  color: var(--accent--color);
}

.blog-post__body blockquote p:last-child {
  margin-bottom: 0;
}

.blog-post__body code {
  background: var(--grey--bg--color);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 15px;
  color: var(--accent--color);
}

.blog-post__body pre {
  background: var(--accent--color);
  color: var(--secondary--color);
  padding: 20px 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.blog-post__body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* GFM tables. Wrapped in its own scroll container so a wide table never makes
   the page scroll sideways on a phone. */
.blog-post__body .blog-table-scroll {
  overflow-x: auto;
  margin-bottom: 24px;
}

.blog-post__body table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.blog-post__body th,
.blog-post__body td {
  border: 1px solid var(--border--color);
  padding: 12px 14px;
  text-align: left;
}

.blog-post__body th {
  background: var(--grey--bg--color);
  color: var(--accent--color);
  font-weight: 700;
}

/* GFM task lists */
.blog-post__body input[type="checkbox"] {
  margin-right: 8px;
}

.blog-post__body hr {
  border: 0;
  border-top: 1px solid var(--border--color);
  margin: 36px 0;
}

/* ---------- TAGS / BACK LINK ---------- */

.blog-post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 36px 0 0;
  padding: 0;
}

.blog-post__tags li {
  padding: 7px 16px;
  border-radius: 30px;
  background: var(--grey--bg--color);
  color: var(--accent--color);
  font-size: 14px;
}

.blog-post__back {
  margin-top: 36px;
}

/* ---------- FOOTER CREDIT ---------- */

.footer-credit {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.85;
}

.footer-credit__link {
  color: var(--primary--color);
  font-weight: 600;
}

.footer-credit__link:hover {
  text-decoration: underline;
}

/* ---------- PHONE ---------- */

@media (max-width: 767px) {
  .blog-post__body {
    font-size: 16px;
    line-height: 28px;
  }

  .blog-post__body h2 {
    font-size: 24px;
  }

  .blog-post__body h3 {
    font-size: 20px;
  }

  .blog-pagination {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* The banner's display type is desktop-scaled; keep long titles readable. */
  .blog-post__title {
    font-size: 32px;
    line-height: 1.25;
    max-width: none;
  }
}
