/* Blog-specific styles: layout grid, hero, sidebar widgets, post grid, and pagination */

/* Page hero */
.page-hero {
  padding: 3.5rem 0;
  text-align: center;
  background: linear-gradient(180deg, rgba(47,63,159,0.05), rgba(255,255,255,0));
  margin-bottom: 1.5rem;
}
.page-hero .page-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.5px;
  font-family: Oswald, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif;
  font-size: clamp(1.85rem, 3.5vw, 3.25rem);
  line-height: 1.05;
}
.page-hero .page-subtitle {
  margin-top: .5rem;
  color: var(--bs-secondary-color);
  font-size: 1rem;
}

/* Hero headline lines */
.page-title .hero-line { display: block; }
.page-title .hero-accent { color: var(--bs-primary); font-weight: 700; }

@media (max-width: 575.98px) {
  .page-title { font-size: 1.6rem; }
  .page-title .hero-accent { display: block; }
}

/* Layout grid for main + sidebar */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.main-col {
  min-width: 0; /* keep grid children from overflowing */
}

.side-col {
  width: 100%;
}

/* Post feed grid: 3 columns desktop, 2 columns medium, 1 column small */
.post-feed.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Medium screens (tablet / small desktop) */
@media (max-width: 1199.98px) {
  .post-feed.grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small screens: stack posts and sidebar */
@media (max-width: 991.98px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
  .post-feed.grid {
    grid-template-columns: 1fr;
  }
  .side-col {
    order: 2;
  }
  .main-col {
    order: 1;
  }
}

/* Extra small phones: tighten gaps */
@media (max-width: 575.98px) {
  .post-feed.grid { gap: 1rem; }
}

/* Widgets */
.widget {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  padding: 1rem;
  margin-bottom: 1.25rem;
  border-radius: .5rem;
}
.widget-title {
  margin: 0 0 .75rem 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget ul li {
  margin: .4rem 0;
}
.widget a {
  color: var(--bs-link-color);
  text-decoration: none;
}
.widget a:hover {
  text-decoration: underline;
}

/* Tag cloud widget */
.tag-cloud-widget { margin-top: 1rem; }
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .5rem;
}
.tag-cloud .tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .6rem;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  border-radius: .375rem;
  text-decoration: none;
  font-size: .9rem;
  border: 1px solid transparent;
}
.tag-cloud .tag:hover {
  background: rgba(var(--bs-primary-rgb), .06);
  border-color: rgba(var(--bs-primary-rgb), .12);
}
.tag-cloud .tag .tag-count {
  color: var(--bs-secondary-color);
  font-size: .8rem;
  opacity: .8;
}

/* Navigation font and niceties */
/* Uses Inter (loaded in default.hbs). Placed here so it overrides theme defaults. */
.navbar .nav-link,
.offcanvas .nav-link,
#bsb-tpl-navbar .nav-link {
  font-family: 'Inter', var(--bs-body-font-family);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: rgba(var(--bs-body-color-rgb), 0.95);
  transition: color .12s ease, transform .12s ease;
  text-transform: none;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus,
.offcanvas .nav-link:hover,
.offcanvas .nav-link:focus {
  color: var(--bs-primary);
  transform: translateY(-1px);
}

/* Make hamburger icon slightly larger and give focus outline for accessibility */
.navbar-toggler {
  padding: .45rem .6rem;
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .12);
}

/* Search form */
.search-form {
  display: flex;
  gap: .5rem;
}
.search-form input[type="search"] {
  flex: 1 1 auto;
  padding: .5rem .75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
}
.search-form button {
  padding: .45rem .75rem;
  border-radius: .375rem;
  border: 1px solid var(--bs-primary);
  background: var(--bs-primary);
  color: #fff;
}

/* Newsletter */
.newsletter-form input[type="email"] {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
  margin-bottom: .5rem;
}
.newsletter-form button {
  width: 100%;
  padding: .6rem .75rem;
  border-radius: .375rem;
  border: 0;
  background: var(--bs-primary);
  color: #fff;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.75rem;
}
.pagination a {
  color: var(--bs-link-color);
  text-decoration: none;
  padding: .5rem .75rem;
  border-radius: .375rem;
  border: 1px solid transparent;
}
.pagination a:hover {
  background: rgba(var(--bs-primary-rgb), .06);
  border-color: rgba(var(--bs-primary-rgb), .12);
}

/* Small utilities */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Minor responsive tweaks */
@media (max-width: 575.98px) {
  .page-hero { padding: 2rem 0; }
  .post-feed.grid { gap: 1rem; }
}

/* Post card: equal-height cards, image aspect ratio, hover effects */
.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:focus-within,
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* Ensure the link wrapping the image becomes a fixed-ratio box */
.post-card-image-link {
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bs-tertiary-bg);
}
.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.post-card-header { margin-bottom: .5rem; }
.post-card-title { font-size: 1.05rem; margin: 0; line-height: 1.25; }
.post-card-excerpt { color: var(--bs-secondary-color); margin-top: .5rem; }
.post-card-meta { margin-top: auto; color: var(--bs-secondary-color); font-size: .875rem; }

/* Make sure grid children stretch to match heights */
.post-feed.grid > * { align-self: stretch; }

/* List layout: horizontal post rows (thumbnail left, content right) */
.post-feed.list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.post-feed.list .post-card {
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}
.post-feed.list .post-card-image-link {
  width: 42%;
  flex: 0 0 42%;
  aspect-ratio: 4/3;
}
.post-feed.list .post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-feed.list .post-card-content {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.post-feed.list .post-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: .4rem;
}

/* Make titles slightly larger and bolder for better hierarchy */
.post-card .post-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: .35rem;
  line-height: 1.15;
}
.post-feed.list .post-card-excerpt {
  color: var(--bs-secondary-color);
  margin-top: .25rem;
}

/* Ensure the main clickable area doesn't underline text */
.post-card-content-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.post-card-content-link:hover,
.post-card-content-link:focus {
  text-decoration: none;
}

/* Make sure links inside excerpts or titles don't show underlines */
.post-card .post-card-title a,
.post-card .post-card-excerpt a {
  text-decoration: none;
  color: inherit;
}

/* Ensure the block-level post link doesn't underline its child text
   but preserve underlines for any intentional inner links */
.post-card .post-card-content-link,
.post-card .post-card-content-link * {
  text-decoration: none !important;
}
.post-card .post-card-content-link a {
  /* if there are real links inside the excerpt/title, keep them underlined */
  text-decoration: underline !important;
}
.post-feed.list .post-card-meta { margin-top: .75rem; }

@media (max-width: 991.98px) {
  .post-feed.list .post-card { flex-direction: column; }
  .post-feed.list .post-card-image-link { width: 100%; flex: 0 0 auto; aspect-ratio: 16/9; }
  .post-feed.list .post-card-content { padding: 1rem; }
}

/* Post page (article) styles */
.article-image {
  margin-bottom: 2rem;
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-image img,
.gh-canvas .article-image img {
  display: block;
  width: 100% !important;
  /* Match the blog hero height across breakpoints: mobile < tablet < desktop */
  height: 280px !important; /* default (mobile) */
  max-height: 280px !important;
  object-fit: cover !important;
  object-position: center !important;
}

.article-image figcaption {
  background: var(--bs-light);
  color: var(--bs-secondary-color);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-style: italic;
  border-top: 1px solid var(--bs-border-color);
}

/* Article header styling */
.article-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: none;
}

.article-header h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 1.5rem 0 1rem 0;
  letter-spacing: -0.5px;
}

.article-excerpt {
  font-size: 1.125rem;
  color: var(--bs-secondary-color);
  font-weight: 500;
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Tag styling on post */
.article-tag {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.post-card-primary-tag a,
.post-card-featured {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.post-card-primary-tag a {
  background: var(--bs-primary);
  color: white;
  text-decoration: none;
}

.post-card-primary-tag a:hover {
  background: var(--bs-primary-rgb);
  opacity: 0.85;
  transform: translateY(-2px);
}

.post-card-featured {
  background: #fff3cd;
  color: #856404;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.post-card-featured svg {
  width: 16px;
  height: 16px;
}

/* Style the tag inside post-cards to match the sidebar tag look */
.post-card .tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .5rem;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  border-radius: .375rem;
  text-decoration: none;
  font-size: .85rem;
  border: 1px solid transparent;
}
.post-card .tag:hover {
  background: rgba(var(--bs-primary-rgb), .06);
  border-color: rgba(var(--bs-primary-rgb), .12);
}

/* Author byline */
.article-byline {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.article-byline-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-list {
  display: flex;
  gap: 0.75rem;
  margin: 0;
}

.author-list-item {
  list-style: none;
}

.author-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bs-light);
  border: 2px solid var(--bs-border-color);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.2s ease;
}

.author-avatar:hover {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

.author-profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.byline-meta-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
}

.byline-meta-date,
.byline-reading-time {
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.bull {
  margin: 0 0.25rem;
}

/* Article content typography */
.gh-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--bs-body-color);
}

.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-content h5,
.gh-content h6 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.gh-content h2 {
  font-size: 1.75rem;
  padding-bottom: 0.5rem;
}

.gh-content h3 {
  font-size: 1.4rem;
}

.gh-content h4 {
  font-size: 1.2rem;
}

.gh-content p {
  margin-bottom: 1.25rem;
}

.gh-content a {
  color: var(--bs-primary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.gh-content a:hover {
  color: var(--bs-primary-dark);
  text-decoration-color: transparent;
}

.gh-content blockquote {
  border-left: 4px solid var(--bs-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bs-light);
  font-style: italic;
  color: var(--bs-secondary-color);
}

.gh-content code {
  background: var(--bs-light);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.95rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

.gh-content pre {
  background: #f5f5f5;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.gh-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.gh-content img,
.gh-content figure {
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
}

.gh-content figure figcaption {
  background: var(--bs-light);
  color: var(--bs-secondary-color);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-style: italic;
  text-align: center;
}

.gh-content ul,
.gh-content ol {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
}

.gh-content li {
  margin-bottom: 0.5rem;
}

@media (max-width: 991.98px) {
  .article-header h1 {
    font-size: 1.75rem;
  }
  .gh-content {
    font-size: 1rem;
  }
  .article-byline-content {
    flex-direction: column;
    align-items: flex-start;
  }
  /* Slightly reduce featured image height on small screens */
  .article-image img,
  .gh-canvas .article-image img {
    height: 240px !important;
    max-height: 240px !important;
  }
}

@media (min-width: 768px) {
  /* Tablet / small desktop: show more of the image (approx hero height) */
  .article-image img,
  .gh-canvas .article-image img {
    height: 420px !important;
    max-height: 420px !important;
  }
}

@media (min-width: 1200px) {
  /* Desktop: match larger hero spacing */
  .article-image img,
  .gh-canvas .article-image img {
    height: 520px !important;
    max-height: 520px !important;
  }
}
