/* ==========================================================================
   Blog Component Styles
   ========================================================================== */

/* Import content formatting styles */
@import "content-formatting.css";

/* Blog Hero Section */
.blog-hero {
  background: linear-gradient(135deg, var(--cta) 0%, #008a7e 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,0 1000,0 1000,100"/></svg>')
    no-repeat center bottom;
  background-size: cover;
}

.blog-hero .container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.blog-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Breadcrumb Navigation */
.breadcrumb {
  background: var(--light-white);
  padding: 1rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--light-gray);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  list-style: none;
  margin: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  color: var(--gray);
  margin-left: 0.5rem;
}

.breadcrumb-link {
  color: var(--cta);
  text-decoration: none;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.breadcrumb-link:hover {
  color: var(--dark-black);
}

.breadcrumb-item:last-child {
  color: var(--gray);
  font-weight: 500;
}

/* Blog Container Layout */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.blog-main {
  min-width: 0;
}

/* Blog Statistics */
.blog-stats {
  background: linear-gradient(135deg, var(--light-white) 0%, var(--white) 100%);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 3rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--light-gray);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-item {
  padding: 1rem;
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--light-gray);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--cta);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Enhanced Blog Section */
.blogs {
  background: transparent;
  padding: 0;
}

.blogs__text {
  text-align: center;
  margin-bottom: 3rem;
}

.blogs__text h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark-black);
  margin-bottom: 1rem;
}

.blogs__text p {
  font-size: 1.125rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Enhanced Blog Grid */
.blogs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.blogs__grid .blog {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid var(--light-gray);
  position: relative;
}

.blog:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.blog .blog-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.blog__img {
  position: relative;
  overflow: hidden;
  height: 240px;
}

.blog__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog:hover .blog__img img {
  transform: scale(1.05);
}

.blog__text {
  padding: 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100% - 240px);
}

.blog__category-default,
.blog__text h5 {
  color: var(--cta);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.blog__title,
.blog__text h4 {
  color: var(--dark-black);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.blog__excerpt {
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog__excerpt p {
  margin: 0;
}

.blog__read-more {
  margin-bottom: 1.5rem;
}

.read-more-text {
  color: var(--cta);
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.blog:hover .read-more-text {
  gap: 0.75rem;
}

.read-more-text i {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.blog:hover .read-more-text i {
  transform: translateX(4px);
}

.blog__text-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--light-gray);
  margin-top: auto;
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info {
  flex-grow: 1;
}

.profile-name,
.profile-info h6 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark-black);
  margin-bottom: 0.125rem;
  margin: 0;
}

.profile-date,
.profile-info time {
  font-size: 0.75rem;
  color: var(--gray);
  display: block;
}

.reading-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--gray);
  flex-shrink: 0;
}

.reading-time i {
  font-size: 0.625rem;
}

.hidden-metadata {
  display: none !important;
}

/* No Posts State */
.no-posts {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--light-gray);
}

.no-posts-icon {
  font-size: 4rem;
  color: var(--light-gray);
  margin-bottom: 1.5rem;
}

.no-posts h3 {
  font-size: 1.5rem;
  color: var(--dark-black);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.no-posts p {
  color: var(--gray);
  margin-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* Sidebar Styles */
.blog-sidebar {
  background: var(--white);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--light-gray);
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.sidebar-section {
  margin-bottom: 2.5rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark-black);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--cta);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--white);
  transition: border-color 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--cta);
  box-shadow: 0 0 0 3px rgba(0, 204, 188, 0.1);
}

.search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  transition: color 0.3s ease;
}

.search-btn:hover {
  color: var(--cta);
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--light-gray);
  color: var(--gray);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.tag:hover {
  background: var(--cta);
  color: white;
  transform: translateY(-1px);
}

/* CTA Button */
.cta-button {
  background: var(--cta);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.cta-button:hover {
  background: #008a7e;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 204, 188, 0.3);
}

/* Categories List */
.sidebar-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-section li {
  margin-bottom: 0.75rem;
}

.sidebar-section li:last-child {
  margin-bottom: 0;
}

.sidebar-section li a {
  color: var(--gray);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.sidebar-section li a:hover {
  background: var(--light-white);
  color: var(--dark-black);
}

.sidebar-section li a span:last-child {
  background: var(--light-gray);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
  min-width: 24px;
  text-align: center;
}

/* Recent Posts */
.sidebar-section article {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--light-gray);
}

.sidebar-section article:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-section article h4 {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.sidebar-section article h4 a {
  color: var(--dark-black);
  text-decoration: none;
  transition: color 0.3s ease;
}

.sidebar-section article h4 a:hover {
  color: var(--cta);
}

.sidebar-section article time {
  font-size: 0.75rem;
  color: var(--gray);
  display: block;
}

/* Newsletter Form */
.sidebar-section form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-section input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--white);
  transition: border-color 0.3s ease;
}

.sidebar-section input[type="email"]:focus {
  outline: none;
  border-color: var(--cta);
  box-shadow: 0 0 0 3px rgba(0, 204, 188, 0.1);
}

.sidebar-section button[type="submit"] {
  width: 100%;
  background: var(--cta);
  color: white;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.sidebar-section button[type="submit"]:hover {
  background: #008a7e;
  transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 992px) {
  .blog-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .blog-sidebar {
    order: -1;
    position: static;
    padding: 1.5rem;
  }

  .blogs__grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .blog-hero h1 {
    font-size: 2.5rem;
  }

  .blog-hero p {
    font-size: 1rem;
  }

  .blog-container {
    padding: 2rem 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .stat-item:not(:last-child)::after {
    display: none;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .blogs__text h2 {
    font-size: 2rem;
  }

  .blogs__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .breadcrumb-list {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .blog-hero {
    padding: 3rem 0;
  }

  .blog-hero h1 {
    font-size: 2rem;
  }

  .blog-container {
    padding: 1.5rem 1rem;
  }

  .blog-stats {
    padding: 1.5rem;
  }

  .blog-sidebar {
    padding: 1.5rem;
  }

  .blog__text {
    padding: 1.5rem;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  .blog-hero {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  }

  .blog-stats {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
  }

  .blog-sidebar,
  .blogs__grid .blog,
  .no-posts {
    background: #2a2a2a;
    border-color: #3a3a3a;
  }
}

/* Print styles */
@media print {
  .blog-sidebar,
  .breadcrumb,
  .blog-hero {
    display: none;
  }

  .blog-container {
    grid-template-columns: 1fr;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .blogs__grid .blog {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
