/*-----------------------------------*\
  #THEME STYLES
\*-----------------------------------*/

/**
 * Light theme colors
 */
[data-theme="light"] {
  /* gradients */
  --bg-gradient-onyx: linear-gradient(
    to bottom right,
    hsl(240, 1%, 85%) 3%,
    hsl(0, 0%, 92%) 97%
  );
  --bg-gradient-jet: linear-gradient(
    to bottom right,
    hsla(240, 1%, 90%, 0.251) 0%,
    hsla(240, 2%, 95%, 0) 100%
  ), hsl(240, 2%, 93%);
  --bg-gradient-yellow-1: linear-gradient(
    to bottom right,
    hsl(45, 100%, 71%) 0%,
    hsla(36, 100%, 69%, 0) 50%
  );
  --bg-gradient-yellow-2: linear-gradient(
    135deg,
    hsla(45, 100%, 71%, 0.251) 0%,
    hsla(35, 100%, 68%, 0) 59.86%
  ), hsl(240, 2%, 93%);
  --border-gradient-onyx: linear-gradient(
    to bottom right,
    hsl(0, 0%, 75%) 0%,
    hsla(0, 0%, 75%, 0) 50%
  );

  /* solid colors */
  --jet: hsl(0, 0%, 75%);
  --onyx: hsl(240, 1%, 93%);
  --eerie-black-1: hsl(240, 2%, 96%);
  --eerie-black-2: hsl(240, 2%, 98%);
  --smoky-black: hsl(0, 0%, 100%);
  --white-1: hsl(0, 0%, 15%);
  --white-2: hsl(0, 0%, 20%);
  --orange-yellow-crayola: hsl(45, 100%, 55%);
  --vegas-gold: hsl(45, 54%, 45%);
  --light-gray: hsl(0, 0%, 40%);
  --light-gray-70: hsla(0, 0%, 40%, 0.7);
  --bittersweet-shimmer: hsl(0, 43%, 51%);

  /* shadows */
  --shadow-1: -4px 8px 24px hsla(0, 0%, 0%, 0.1);
  --shadow-2: 0 16px 30px hsla(0, 0%, 0%, 0.1);
  --shadow-3: 0 16px 40px hsla(0, 0%, 0%, 0.1);
  --shadow-4: 0 25px 50px hsla(0, 0%, 0%, 0.08);
  --shadow-5: 0 24px 80px hsla(0, 0%, 0%, 0.1);
}

/**
 * Theme toggle button
 */
.theme-toggle-btn {
  position: relative;
  background: var(--border-gradient-onyx);
  width: 60px;
  height: 30px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  padding: 3px;
  box-shadow: var(--shadow-2);
  transition: var(--transition-1);
  z-index: 1;
  margin: 16px 0;
}

.theme-toggle-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-jet);
  border-radius: inherit;
  z-index: -1;
  transition: var(--transition-1);
}

.theme-toggle-btn:hover {
  background: var(--bg-gradient-yellow-1);
}

.theme-toggle-btn:hover::before {
  background: var(--bg-gradient-yellow-2);
}

.theme-toggle-icon {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.theme-toggle-icon ion-icon {
  font-size: 14px;
  color: var(--orange-yellow-crayola);
  transition: var(--transition-1);
}

.theme-toggle-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--orange-yellow-crayola);
  border-radius: 50%;
  box-shadow: 0 2px 4px hsla(0, 0%, 0%, 0.2);
  transition: transform 0.3s ease;
  z-index: -1;
}

.theme-toggle-btn.light-mode .theme-toggle-icon::before {
  transform: translateX(30px);
}

.sun-icon {
  opacity: 1;
}

.moon-icon {
  opacity: 0.5;
}

.theme-toggle-btn.light-mode .sun-icon {
  opacity: 0.5;
}

.theme-toggle-btn.light-mode .moon-icon {
  opacity: 1;
}

/**
 * Smooth theme transition
 */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition: background-color 0.3s ease,
              border-color 0.3s ease,
              color 0.3s ease,
              box-shadow 0.3s ease !important;
}

/**
 * Blog specific light theme styles
 */
[data-theme="light"] .blog-post-item > a {
  background: var(--border-gradient-onyx);
}

[data-theme="light"] .blog-post-item > a::before {
  background: var(--eerie-black-1);
}

[data-theme="light"] .blog-tag,
[data-theme="light"] .post-tag {
  background: var(--onyx);
  color: var(--white-2);
  border: 1px solid var(--jet);
}

[data-theme="light"] code {
  background: var(--onyx);
  color: var(--white-2);
}

[data-theme="light"] pre {
  background: var(--onyx);
  border: 1px solid var(--jet);
}

[data-theme="light"] .search-wrapper input {
  background: var(--eerie-black-1);
  color: var(--white-2);
  border-color: var(--jet);
}

[data-theme="light"] .search-wrapper input::placeholder {
  color: var(--light-gray-70);
}

/**
 * Responsive theme toggle
 */
@media (min-width: 580px) {
  .theme-toggle-btn {
    width: 70px;
    height: 35px;
  }

  .theme-toggle-icon::before {
    width: 25px;
    height: 25px;
  }

  .theme-toggle-btn.light-mode .theme-toggle-icon::before {
    transform: translateX(35px);
  }

  .theme-toggle-icon ion-icon {
    font-size: 16px;
  }
}

@media (min-width: 1250px) {
  .theme-toggle-btn {
    margin: 20px auto;
  }
}

/**
 * Blog search and filters
 */
.blog-search-container {
  margin-bottom: 30px;
}

.search-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.search-wrapper input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  background: var(--eerie-black-2);
  border: 1px solid var(--jet);
  border-radius: 14px;
  color: var(--white-2);
  font-size: var(--fs-6);
  outline: none;
  transition: var(--transition-1);
}

.search-wrapper input:focus {
  border-color: var(--orange-yellow-crayola);
}

.search-wrapper input::placeholder {
  color: var(--light-gray-70);
}

.search-wrapper ion-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--light-gray-70);
  pointer-events: none;
}

/**
 * Blog tags
 */
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.blog-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--border-gradient-onyx);
  border-radius: 8px;
  font-size: var(--fs-8);
  color: var(--light-gray);
  transition: var(--transition-1);
}

.blog-tag:hover {
  color: var(--orange-yellow-crayola);
}

/**
 * Blog pagination
 */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  padding: 20px 0;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--border-gradient-onyx);
  border-radius: 12px;
  color: var(--orange-yellow-crayola);
  font-size: 20px;
  transition: var(--transition-1);
  position: relative;
  z-index: 1;
}

.pagination-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-jet);
  border-radius: inherit;
  z-index: -1;
  transition: var(--transition-1);
}

.pagination-btn:not(:disabled):hover {
  background: var(--bg-gradient-yellow-1);
}

.pagination-btn:not(:disabled):hover::before {
  background: var(--bg-gradient-yellow-2);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--light-gray);
  font-size: var(--fs-6);
}

/**
 * Blog post detail
 */
.blog-post-detail {
  width: 100%;
}

.post-article {
  width: 100%;
}

.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--light-gray);
  font-size: var(--fs-6);
  margin-bottom: 20px;
  transition: var(--transition-1);
}

.back-to-blog:hover {
  color: var(--orange-yellow-crayola);
}

.back-to-blog ion-icon {
  font-size: 20px;
}

.post-header {
  margin-bottom: 30px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.post-meta .dot {
  width: 4px;
  height: 4px;
  background: var(--light-gray-70);
  border-radius: 50%;
}

.post-category {
  color: var(--orange-yellow-crayola);
  font-size: var(--fs-6);
  font-weight: var(--fw-500);
}

.post-meta time,
.read-time {
  color: var(--light-gray-70);
  font-size: var(--fs-6);
}

.post-title {
  color: var(--white-2);
  font-size: var(--fs-1);
  font-weight: var(--fw-600);
  margin-bottom: 15px;
  line-height: 1.3;
}

.post-author {
  color: var(--light-gray);
  font-size: var(--fs-6);
  margin-bottom: 20px;
}

.post-banner {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 30px;
}

.post-banner img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.post-content {
  color: var(--light-gray);
  font-size: var(--fs-6);
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--white-2);
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: var(--fw-600);
}

.post-content h1 { font-size: var(--fs-1); }
.post-content h2 { font-size: var(--fs-2); }
.post-content h3 { font-size: var(--fs-3); }
.post-content h4 { font-size: var(--fs-4); }

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

.post-content ul,
.post-content ol {
  margin: 15px 0;
  padding-left: 25px;
}

.post-content li {
  margin-bottom: 10px;
}

.post-content code {
  background: var(--border-gradient-onyx);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--orange-yellow-crayola);
}

.post-content pre {
  background: var(--border-gradient-onyx);
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 20px 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--light-gray);
}

.post-content blockquote {
  border-left: 3px solid var(--orange-yellow-crayola);
  padding-left: 20px;
  margin: 20px 0;
  font-style: italic;
  color: var(--light-gray-70);
}

.post-content a {
  color: var(--orange-yellow-crayola);
  text-decoration: underline;
  transition: var(--transition-1);
}

.post-content a:hover {
  color: var(--vegas-gold);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 20px 0;
}

.post-footer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--jet);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.post-tag {
  display: inline-block;
  padding: 8px 16px;
  background: var(--border-gradient-onyx);
  border-radius: 10px;
  font-size: var(--fs-7);
  color: var(--light-gray);
  transition: var(--transition-1);
}

.post-tag:hover {
  color: var(--orange-yellow-crayola);
}

.post-share p {
  color: var(--white-2);
  font-size: var(--fs-6);
  margin-bottom: 15px;
}

.share-buttons {
  display: flex;
  gap: 15px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: var(--border-gradient-onyx);
  border-radius: 12px;
  color: var(--orange-yellow-crayola);
  font-size: 20px;
  transition: var(--transition-1);
  position: relative;
  z-index: 1;
}

.share-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-jet);
  border-radius: inherit;
  z-index: -1;
  transition: var(--transition-1);
}

.share-btn:hover {
  background: var(--bg-gradient-yellow-1);
  transform: translateY(-3px);
}

.share-btn:hover::before {
  background: var(--bg-gradient-yellow-2);
}

/**
 * Blog empty states
 */
.blog-empty-state,
.blog-post-not-found,
.blog-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  min-height: 300px;
}

.blog-post-not-found ion-icon {
  font-size: 80px;
  color: var(--light-gray-70);
  margin-bottom: 20px;
}

.blog-post-not-found h3 {
  color: var(--white-2);
  font-size: var(--fs-2);
  margin-bottom: 10px;
}

.blog-post-not-found p {
  color: var(--light-gray);
  margin-bottom: 20px;
}

.btn-back {
  display: inline-block;
  padding: 12px 24px;
  background: var(--border-gradient-onyx);
  color: var(--orange-yellow-crayola);
  border-radius: 12px;
  font-size: var(--fs-6);
  transition: var(--transition-1);
  position: relative;
  z-index: 1;
}

.btn-back::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-jet);
  border-radius: inherit;
  z-index: -1;
  transition: var(--transition-1);
}

.btn-back:hover {
  background: var(--bg-gradient-yellow-1);
}

.btn-back:hover::before {
  background: var(--bg-gradient-yellow-2);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--jet);
  border-top-color: var(--orange-yellow-crayola);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/**
 * Responsive blog styles
 */
@media (min-width: 580px) {
  .post-title {
    font-size: calc(var(--fs-1) * 1.2);
  }

  .post-banner {
    height: 400px;
  }

  .post-banner img {
    height: 100%;
  }
}

@media (min-width: 768px) {
  .post-content {
    font-size: var(--fs-5);
  }

  .search-wrapper {
    max-width: 600px;
  }
}
