/* Classic listing: the old engine's 'featured' blog style (LegacyBlogListing.astro), unchanged,
   so sites styled against it keep working. Loaded before the site's CSS, as it was. */
.blog-listing { padding: 4rem 0 6rem; }
.blog-listing .container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== HEADER ===== */
.blog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; margin-bottom: 4rem; flex-wrap: wrap; }
.header-content h1 { font-size: 3.5rem; font-weight: 800; margin: 0 0 0.5rem; line-height: 1.1; }
.blog-subtitle { font-size: 1.25rem; color: var(--text-secondary, #64748b); margin: 0; }
/* The heading sits above its text, whatever a site's own .header-content rule (often its nav bar's) says. */
.blog-header > .header-content { display: block; }
.blog-intro { font-size: 1.25rem; color: var(--text-secondary, #64748b); max-width: 65ch; }
.blog-intro > :first-child { margin-top: 0; }
.blog-intro > :last-child { margin-bottom: 0; }
.search-box { position: relative; flex: 0 1 400px; }
.search-box input { width: 100%; padding: 0.875rem 1rem 0.875rem 3rem; font-size: 1rem; border: 2px solid var(--border-color, #e2e8f0); border-radius: 12px; background: var(--bg-primary, #fff); color: var(--text-primary, #1e293b); transition: all 0.2s; }
.search-box input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(59,130,246,0.1); }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-tertiary, #94a3b8); pointer-events: none; }

/* ===== EMPTY STATE ===== */
.no-posts { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 6rem 2rem; text-align: center; color: var(--text-secondary, #64748b); }
.no-posts svg { color: var(--text-tertiary, #cbd5e1); }
.no-posts h2 { font-size: 1.5rem; font-weight: 600; color: var(--text-primary, #1e293b); margin: 0; }
.no-posts p { font-size: 1.125rem; margin: 0; }

/* ===== SHARED POST CARD STYLES ===== */
.post-card { background: var(--bg-primary, #fff); border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color, transparent); box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: transform 0.2s, box-shadow 0.2s; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0,0,0,0.12); }
.post-image { display: block; overflow: hidden; }
.post-image img { width: 100%; object-fit: cover; transition: transform 0.3s; }
.post-card:hover .post-image img { transform: scale(1.05); }
.post-content { padding: 1.75rem; }
.post-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; color: var(--text-secondary, #64748b); margin-bottom: 0.75rem; }
.post-meta time { color: inherit; }
.reading-time { color: var(--text-tertiary, #94a3b8); }
.reading-time::before { content: "•"; margin-right: 1rem; }
.post-content h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; margin: 0.75rem 0 0.875rem; }
.post-content h3 a { color: var(--text-primary, #1e293b); text-decoration: none; transition: color 0.2s; }
.post-content h3 a:hover { color: var(--color-primary); }
.post-content .excerpt { font-size: 1rem; line-height: 1.6; color: var(--text-secondary, #64748b); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--color-primary); text-decoration: none; transition: gap 0.2s; }
.read-more:hover { gap: 0.75rem; }

/* ===== FEATURED STYLE ===== */
.blog-style-featured .featured-wrapper { margin-bottom: 4rem; }
.blog-style-featured .featured-post { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-bottom: 4rem; background: var(--bg-primary, #fff); border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color, transparent); box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.2s, box-shadow 0.2s; }
.blog-style-featured .featured-post:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.blog-style-featured .featured-image { position: relative; overflow: hidden; }
.blog-style-featured .featured-image img { width: 100%; height: 100%; min-height: 400px; object-fit: cover; transition: transform 0.3s; }
.blog-style-featured .featured-post:hover .featured-image img { transform: scale(1.05); }
.blog-style-featured .featured-content { padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.featured-badge { display: inline-block; padding: 0.375rem 0.875rem; background: var(--color-primary); color: #fff; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 6px; margin-bottom: 1rem; width: fit-content; }
.featured-content h2 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; margin: 0 0 1rem; }
.featured-content h2 a { color: var(--text-primary, #1e293b); text-decoration: none; transition: color 0.2s; }
.featured-content h2 a:hover { color: var(--color-primary); }
.featured-content .excerpt { font-size: 1.125rem; line-height: 1.7; color: var(--text-secondary, #475569); margin-bottom: 1.5rem; }
.blog-style-featured .posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 2rem; }

/* ===== MAGAZINE STYLE ===== */
.blog-style-magazine .magazine-feed { display: flex; flex-direction: column; gap: 0; }
.blog-style-magazine .magazine-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; padding: 3rem 0; border-bottom: 1px solid var(--border-color, #e5e7eb); align-items: center; }
.blog-style-magazine .magazine-row:last-child { border-bottom: none; }
.blog-style-magazine .magazine-row-even { direction: rtl; }
.blog-style-magazine .magazine-row-even > * { direction: ltr; }
.blog-style-magazine .magazine-image { display: block; overflow: hidden; border-radius: 12px; }
.blog-style-magazine .magazine-image img { width: 100%; height: 360px; object-fit: cover; transition: transform 0.3s; }
.blog-style-magazine .magazine-row:hover .magazine-image img { transform: scale(1.03); }
.blog-style-magazine .magazine-content { display: flex; flex-direction: column; justify-content: center; }
.blog-style-magazine .magazine-content h2 { font-size: 2rem; font-weight: 700; line-height: 1.2; margin: 0.5rem 0 1rem; }
.blog-style-magazine .magazine-content h2 a { color: var(--text-primary, #1e293b); text-decoration: none; transition: color 0.2s; }
.blog-style-magazine .magazine-content h2 a:hover { color: var(--color-primary); }
.blog-style-magazine .magazine-content .excerpt { font-size: 1.125rem; line-height: 1.7; color: var(--text-secondary, #475569); margin-bottom: 1.5rem; }
.blog-style-magazine .post-card-magazine { background: none; border: none; border-radius: 0; box-shadow: none; }
.blog-style-magazine .post-card-magazine:hover { transform: none; box-shadow: none; }
.blog-style-magazine .post-card-magazine:hover .magazine-image img { transform: scale(1.03); }

/* ===== MINIMAL STYLE ===== */
.blog-style-minimal .minimal-feed { display: flex; flex-direction: column; }
.blog-style-minimal .post-card-minimal { background: none; border: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border-color, #e5e7eb); padding: 1.5rem 0; }
.blog-style-minimal .post-card-minimal:first-child { border-top: 1px solid var(--border-color, #e5e7eb); }
.blog-style-minimal .post-card-minimal:hover { transform: none; box-shadow: none; }
.blog-style-minimal .post-card-minimal .post-content { padding: 0; }
.blog-style-minimal .post-card-minimal h3 { font-size: 1.5rem; margin: 0.25rem 0 0.5rem; }
.blog-style-minimal .post-card-minimal .excerpt { -webkit-line-clamp: 2; margin-top: 0.5rem; }
.blog-style-minimal .post-card-minimal .post-meta { margin-bottom: 0.25rem; }

/* ===== GRID STYLE ===== */
.blog-style-grid .posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }

/* ===== SHARED (search results, load more) ===== */
.search-results-heading { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color, #e2e8f0); }
.search-results-heading h2 { font-size: 1.5rem; font-weight: 600; color: var(--text-primary, #1e293b); margin: 0; }
.search-clear-link { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary, #64748b); text-decoration: none; white-space: nowrap; border: 1px solid var(--border-color, #e2e8f0); border-radius: 6px; padding: 0.25rem 0.625rem; transition: all 0.2s; }
.search-clear-link:hover { color: var(--text-primary, #1e293b); border-color: var(--text-secondary, #64748b); text-decoration: none; }
.no-results { display: none; flex-direction: column; align-items: center; gap: 1rem; padding: 4rem 2rem; text-align: center; color: var(--text-secondary, #64748b); }
.no-results svg { color: var(--text-tertiary, #cbd5e1); }
.pagination { display: flex; justify-content: center; margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--border-color, #e5e7eb); }
.pagination-link { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.875rem 1.5rem; font-size: 1rem; font-weight: 600; color: #fff; background: var(--color-primary); border: none; border-radius: 8px; text-decoration: none; cursor: pointer; transition: all 0.2s; }
.pagination-link:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.pagination-link:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.spinner { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .blog-header { flex-direction: column; align-items: stretch; margin-bottom: 3rem; }
  .header-content h1 { font-size: 2.5rem; }
  .search-box { flex: 1 1 100%; }
  .blog-style-featured .featured-post { grid-template-columns: 1fr; }
  .blog-style-featured .featured-image img { min-height: 300px; }
  .blog-style-featured .featured-content { padding: 2rem; }
  .blog-style-featured .featured-content h2 { font-size: 1.75rem; }
  .blog-style-featured .posts-grid, .blog-style-grid .posts-grid { grid-template-columns: 1fr; }
  .blog-style-magazine .magazine-row, .blog-style-magazine .magazine-row-even { grid-template-columns: 1fr; gap: 1.5rem; direction: ltr; }
  .blog-style-magazine .magazine-image img { height: 240px; }
  .blog-style-magazine .magazine-content h2 { font-size: 1.5rem; }
}

/* Static pagination links (the old engine had one JS "Load More" button). */
.blog-listing .pagination { gap: 1rem; }
.blog-listing .pagination-link:hover { text-decoration: none; }
.blog-tag-heading { font-size: 1rem; font-weight: 600; color: var(--text-secondary, #64748b); margin: -3rem 0 2rem; }

/* Search, classic sites. The old engine had no search page; this keeps to the listing's look. */
.blog-search-form { display: flex; gap: .5rem; max-width: 40rem; margin: 0 auto 2.5rem; }
.blog-search-form input { flex: 1; min-width: 0; padding: .65rem .9rem; font: inherit; border: 1px solid currentColor; border-radius: 6px; background: transparent; color: inherit; }
.blog-search-form .btn { padding: .65rem 1.2rem; font: inherit; border: 0; border-radius: 6px; cursor: pointer; background: var(--color-primary, #111); color: #fff; }
.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; }
