/*
Theme Name: Pixlaris Blog Theme
Theme URI: https://pixlaris.com/blog/
Description: A custom premium minimalist blog theme designed for Pixlaris, styled like Freepik layout with light grid design and category headers.
Version: 1.5
Author: Pixlaris Team
Author URI: https://pixlaris.com
License: GNU General Public License v2 or later
Text Domain: pixlaris-blog
*/

/* --- Design Variables (Freepik-Style Light Theme) --- */
:root {
  --bg-main: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --border-light: #e5e7eb;
  --border-hover: #d1d5db;
  --color-primary: #111827;
  --color-accent: #aa3bff;
  --color-accent-hover: #8b5cf6;
  --text-main: #374151;
  --text-muted: #6b7280;
  --accent-gradient: linear-gradient(135deg, #aa3bff 0%, #436eb6 100%);
  --shadow-bento: 0 10px 30px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- Global Reset & Styles --- */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

a:hover {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

main.container {
  padding-top: 130px;
}

/* --- Header Section (Single Row with Categories - Matches Main Site Style) --- */
.site-header {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  height: 72px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: 99px; /* Matches main site pill shape */
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px; /* Matches main site padding */
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 30px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.header-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.header-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 99px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-nav a:hover, .header-nav a.active {
  color: var(--color-accent);
  background: rgba(170, 59, 255, 0.08);
}

/* --- Featured Post Layout (Freepik style) --- */
.featured-post {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow-bento);
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-post:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.featured-link {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  min-height: 400px;
}

.featured-img-container {
  overflow: hidden;
}

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-post:hover .featured-img {
  transform: scale(1.02);
}

.featured-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tag-badge {
  display: inline-block;
  background: rgba(170, 59, 255, 0.08);
  color: var(--color-accent);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  align-self: flex-start;
  margin-bottom: 16px;
}

.featured-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 12px 0;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

.featured-excerpt {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
}

/* --- Bento Post Grid (Freepik style) --- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.grid-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-bento);
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-5px);
}

.card-img-container {
  height: 220px;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-card:hover .card-img {
  transform: scale(1.03);
}

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px 0;
  color: var(--color-primary);
  letter-spacing: -0.2px;
}

.card-title a {
  color: var(--color-primary);
}

.card-title a:hover {
  color: var(--color-accent);
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 20px 0;
  flex: 1;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 60px;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.pagination a:hover {
  border-color: var(--border-hover);
  color: var(--color-primary);
}

.pagination .current {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

/* --- Single Post Detail Page --- */
.single-post-container {
  max-width: 1080px;
  margin: 130px auto 80px;
  padding: 0 24px;
}

.post-header {
  max-width: 860px;
  margin: 0 auto 32px auto;
  text-align: left;
}

.single-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -1px;
  margin: 0 0 20px 0;
  color: var(--color-primary);
}

.single-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.single-meta-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.single-meta-left .author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
}

.single-meta-left .author-name {
  color: var(--color-accent);
  font-weight: 600;
}

.single-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.single-meta-right .meta-categories a {
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.single-meta-right .meta-divider {
  color: var(--border-light);
}

.single-featured-image {
  width: 100%;
  max-width: 1080px;
  height: 550px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--border-light);
  margin-bottom: 40px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
}

/* --- Floating Share Widget (Left Side) --- */
.floating-share-buttons {
  position: fixed;
  top: 50%;
  left: 40px;
  right: auto;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 99px;
  padding: 20px 10px;
  box-shadow: var(--shadow-bento);
  z-index: 900;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-btn:hover {
  background: rgba(170, 59, 255, 0.08);
  color: var(--color-accent);
  transform: scale(1.1);
}

@media (max-width: 1120px) {
  .floating-share-buttons {
    display: none; /* Hide share widget on smaller viewports to prevent layout overlaps */
  }
}

/* --- Related Posts Section --- */
.related-posts-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border-light);
}

.related-section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

/* --- Archive/Category Header --- */
.archive-header {
  margin-bottom: 40px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.archive-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.8px;
}

.archive-description {
  color: var(--text-muted);
  font-size: 16px;
}

/* --- Rich Content Styling --- */
.post-entry-content {
  max-width: 860px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-main);
}

.post-entry-content p {
  margin-bottom: 24px;
}

.post-entry-content h2 {
  font-size: 26px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--color-primary);
}

.post-entry-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-primary);
}

.post-entry-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 4px 0 4px 20px;
  margin: 28px 0;
  font-style: italic;
  font-size: 19px;
  color: var(--text-muted);
}

.post-entry-content img {
  border-radius: 12px;
  margin: 28px 0;
  border: 1px solid var(--border-light);
}

.post-entry-content ul, .post-entry-content ol {
  margin-bottom: 24px;
  padding-left: 20px;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 60px 0 30px;
  background-color: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.footer-col a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
  .featured-link {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .blog-hero h1 {
    font-size: 38px;
  }
  .single-title {
    font-size: 32px;
  }
}

@media (max-width: 767px) {
  .site-header {
    top: 16px;
    width: 96%;
    padding: 0 12px;
    height: 64px;
  }
  .header-nav {
    max-width: 70%;
  }
  .blog-hero {
    padding-top: 120px;
  }
  .featured-content {
    padding: 24px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
