:root {
  --primary: #ff6b97;
  --secondary: #6b4ce6;
  --dark: #1a1a2e;
  --light: #e8e1ff;
  --sidebar-width: 320px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background: linear-gradient(160deg, #101c2c 0%, #212b3d 100%);
  color: var(--light);
  min-height: 100vh;
}

/* ===============================
   NAVBAR & HEADER
=============================== */
.top-bar {
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}



/* ===============================
   MOBILE SEARCH
=============================== */


/* ===============================
   TAG SIDEBAR
=============================== */
.tags-sidebar {
  position: fixed;
  right: -100%;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--dark);
  z-index: 1050;
  transition: right 0.3s ease;
  border-left: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
}
.tags-sidebar.active {
  right: 0;
  box-shadow: -5px 0 25px rgba(0,0,0,0.3);
}
@media (max-width: 576px) {
  .tags-sidebar { width: 100%; }
}
.tags-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tags-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.tag-search-wrapper { position: relative; margin-bottom: 1rem; }
.tag-search {
  width: 100%;
  padding: 0.75rem 2.5rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--light);
  transition: var(--transition);
}
.tag-search:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255,255,255,0.15);
}
.search-icon,
.search-loader {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.search-icon { left: 1rem; color: var(--light); opacity: 0.7; }
.search-loader { right: 1rem; display: none; }
.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--dark);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  margin-top: 0.5rem;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tag-suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.tag-suggestion-item:hover,
.tag-suggestion-item.active {
  background: var(--primary);
  color: #fff;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
  color: var(--light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}
.tag-badge:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}
.tag-badge .tag-count {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  min-width: 40px;
  display: inline-block;
  text-align: center;
  transition: all 0.25s ease-in-out;
}
.story-card .tag-badge { display: none; }
.tags-sidebar .tag-badge { display: inline-flex; }

.mobile-tag-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1049;
  transition: var(--transition);
}
.mobile-tag-btn:hover { transform: scale(1.1); }

.tags-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1048;
  display: none;
}

/* ===============================
   CATEGORY EXPLORER
=============================== */
.category-explorer {
  position: fixed;
  left: -320px;
  top: 0;
  width: 320px;
  height: 100%;
  background: var(--dark);
  z-index: 1060;
  transition: left 0.3s ease;
  border-right: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
}
.category-explorer.active { left: 0; }
.category-explorer-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.category-explorer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.category-explorer-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1059;
  display: none;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  transition: transform 0.3s ease;
}
.category-card:hover { transform: translateY(-5px); color: #fff; }
.category-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.category-name {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}
.category-link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--light);
  text-decoration: none;
  border-radius: 6px;
  transition: var(--transition);
}
.category-link:hover,
.category-link.active {
  background: rgba(255,255,255,0.1);
  color: var(--primary);
  transform: translateX(5px);
}
@media (max-width: 576px) {
  .category-explorer { width: 100%; left: -100%; }
}

/* ===============================
   FEATURED SECTION
=============================== */
.featured-carousel {
  padding: 2rem 0;
  background: rgba(0,0,0,0.2);
  margin: -1rem 0 2rem;
}
.section-title {
  color: var(--light);
  font-size: 1.5rem;
  font-weight: 600;
}
.featured-card {
  background: var(--dark);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
  height: 100%;
  border: 1px solid rgba(255,255,255,0.1);
}
.featured-card:hover { transform: translateY(-5px); }
.featured-image {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
}
.featured-image img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.featured-card:hover .featured-image img { transform: scale(1.05); }
.featured-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 193, 7, 0.9);
  color: #000;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.featured-content { padding: 1.5rem; }
.featured-title { margin-bottom: 0.75rem; line-height: 1.4; }
.featured-title a {
  color: var(--light);
  text-decoration: none;
  transition: color 0.2s ease;
}
.featured-title a:hover { color: var(--primary); }
.featured-excerpt {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 768px) {
  .featured-carousel { padding: 1rem 0; }
  .featured-content { padding: 1rem; }
  .featured-title { font-size: 1.1rem; }
}

/* ===============================
   MAGAZINE LAYOUT & STORY CARDS
=============================== */
.magazine-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
}
@media (max-width: 991px) {
  .magazine-layout { grid-template-columns: 1fr; }
}
.magazine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.story-tile {
  background: #1b1b1d;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: auto; 
  color: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}
.story-tile:hover { transform: translateY(-5px); box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
.story-tile img { width: 100%; height: 220px; object-fit: cover; transition: transform 0.3s ease; }
.story-tile:hover img { transform: scale(1.05); }
.story-tile .content { padding: 18px; flex-grow: 1; }
.story-tile .category { font-size: 0.8rem; text-transform: uppercase; color: var(--primary); font-weight: 600; margin-bottom: 6px; }
.story-tile h5 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.story-tile h5 a { color: #fff; text-decoration: none; }
.story-tile h5 a:hover { color: #ff3366; }
.story-tile .meta { font-size: 0.8rem; color: #aaa; margin: 8px 0 12px; }
.story-tile .tags a {
  background: #2b2b2d; color: #ff6699; padding: 4px 10px;
  border-radius: 25px; font-size: 0.7rem; margin: 2px;
  text-decoration: none; display: inline-block;
  transition: all 0.2s;
}
.story-tile .tags a:hover { background: #ff6699; color: #fff; }
.story-tile .read-btn { font-size: 0.8rem; color: var(--primary); text-decoration: none; font-weight: 600; }
.story-tile .read-btn:hover { text-decoration: underline; }

@media (min-width: 992px) {
  .story-tile:nth-child(4n+1) img { height: 320px; }
  .story-tile:nth-child(5n+3) img { height: 260px; }
}
@media (max-width: 768px) {
  .magazine-grid { grid-template-columns: 1fr; }
  .story-tile img { height: 200px; }
}

/* ===============================
   SIDEBAR WIDGETS
=============================== */
.sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}
.sidebar-widget {
  background: #111;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  color: #eee;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}
.sidebar-widget h5 {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
  margin-bottom: 14px;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.tag-pill {
  display: inline-block;
  background: #2c2c2e;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  margin: 4px;
  text-decoration: none;
  transition: all 0.2s;
}
.tag-pill:hover { background: var(--primary); color: #fff; }
.popular-post {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.popular-post img {
  width: 70px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 10px;
}
.popular-post a {
  font-size: 0.85rem;
  color: #eee;
  line-height: 1.3;
  text-decoration: none;
}
.popular-post a:hover { color: var(--primary); }
.selected-tag-badge {
    display: block;
    background: #0a58ca;
    color: #fff;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 1.6rem;
    margin-bottom: 15px;
    text-align: center;
}
.selected-tag-badge i { margin-right: 5px; }

/* ===============================
   STORY CARD BASE STYLE
=============================== */
.story-card {
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
}
.story-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}