/* -------------------------------------------------------- */
/* MINI BLOG STYLES */
/* -------------------------------------------------------- */

/* Utility class for hiding elements */
.blog-hidden {
  display: none !important;
}

/* -------------------------------------------------------- */
/* TAB BUTTONS */
/* -------------------------------------------------------- */

.blog-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.blog-tab-btn {
  background: var(--btn-800);
  color: var(--text);
  border: 3px solid var(--ink-900);
  border-radius: 12px;
  padding: 10px 24px;
  font-weight: 700;
  font-size: 1em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease, border-color 0.1s ease;
  box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, 0.3);
}

.blog-tab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 3px 3px 8px 2px rgba(0, 0, 0, 0.35);
  border-color: var(--ui-800);
}

.blog-tab-btn.active {
  background: var(--ui-800);
  color: #fff;
  border-color: var(--ui-900);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 2px 2px 5px 1px rgba(0, 0, 0, 0.3);
  transform: translateY(0);
}

/* -------------------------------------------------------- */
/* VIEW TOGGLE (View All / View Recent) */
/* -------------------------------------------------------- */

.blog-view-toggle {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.blog-view-toggle-btn {
  background: var(--IB-bg-alt-3);
  color: var(--IB-text-alt);
  border: 2px dashed rgba(28, 12, 1, 0.4);
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.blog-view-toggle-btn:hover {
  background: var(--btn-background-2);
  border-style: solid;
  color: #fff;
}

/* -------------------------------------------------------- */
/* Post List Container */
/* -------------------------------------------------------- */

.blog-post-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Individual Post Preview Card */
.blog-post-preview {
  background: var(--btn-background-1);
  border: 3px solid rgba(28, 12, 1, 0.6);
  border-radius: 12px;
  padding: 15px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.blog-post-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: rgba(28, 12, 1, 0.85);
}

.blog-post-preview a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-post-preview-title {
  font-family: var(--heading-font);
  font-size: 1.25em;
  font-weight: bold;
  margin: 0 0 8px 0;
  color: var(--IB-text-alt);
}

.mini-blog-title {
  color: var(--IB-text-alt);
}

.blog-post-preview:hover .blog-post-preview-title {
  color: var(--link-color-hover);
}

.blog-post-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.9em;
  color: var(--IB-text);
  margin-bottom: 8px;
}

.blog-post-preview-date,
.blog-post-preview-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.blog-post-preview-category {
  background: var(--IB-bg-alt);
  color: var(--IB-text);
  padding: 2px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85em;
}

.blog-post-preview-summary {
  margin: 0;
  color: var(--text-color);
  line-height: 1.5;
}

/* -------------------------------------------------------- */
/* TAGS DISPLAY (on posts) */
/* -------------------------------------------------------- */

.blog-post-preview-tags,
.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.blog-tag {
  display: inline-block;
  background: var(--IB-bg-alt);
  color: var(--IB-text);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 600;
}

.blog-tag-small {
  padding: 2px 8px;
  font-size: 0.75em;
}

.blog-tag-cw {
  background: var(--IB-warning-BG);
  color: var(--IB-warning);
}

/* -------------------------------------------------------- */
/* CATEGORY FILTER BUTTONS */
/* -------------------------------------------------------- */

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.blog-filter-btn {
  background: var(--btn-800);
  color: var(--text);
  border: 2px solid var(--ink-900);
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.95em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, 0.3);
}

.blog-filter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 8px 2px rgba(0, 0, 0, 0.35);
}

.blog-filter-btn.active {
  background: var(--ui-800);
  color: #fff;
}

/* -------------------------------------------------------- */
/* TAG FILTER SECTION - Side by Side Layout */
/* -------------------------------------------------------- */

.blog-tag-filters-section {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

/* -------------------------------------------------------- */
/* COLLAPSIBLE FILTER SECTIONS */
/* -------------------------------------------------------- */

.blog-filter-collapsible {
  flex: 1;
  background: var(--btn-background-1);
  border: 3px solid rgba(28, 12, 1, 0.6);
  border-radius: 12px;
  overflow: hidden;
}

.blog-filter-collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  font-size: 0.95em;
  font-weight: 700;
  color: var(--IB-text-alt);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
  list-style: none; /* Remove default marker */
}

.blog-filter-collapsible-header::-webkit-details-marker {
  display: none; /* Remove default marker in webkit */
}

.blog-filter-collapsible-header::after {
  content: '▸';
  font-size: 0.9em;
  transition: transform 0.2s ease;
}

.blog-filter-collapsible[open] > .blog-filter-collapsible-header::after {
  transform: rotate(90deg);
}

.blog-filter-collapsible-header:hover {
  background: var(--btn-background-2);
  color: #ffffff;
}

.blog-filter-collapsible-content {
  padding: 5px 15px 15px 15px;
}

/* -------------------------------------------------------- */
/* TAG FILTER BUTTONS */
/* -------------------------------------------------------- */

.blog-tag-filters,
.blog-cw-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Tag filter buttons (three-state: neutral, include, exclude) */
.blog-tag-filter,
.blog-cw-filter {
  background: var(--IB-bg-alt-3);
  color: var(--IB-text);
  border: 2px solid rgba(28, 12, 1, 0.3);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.blog-tag-filter:hover,
.blog-cw-filter:hover {
  border-color: rgba(28, 12, 1, 0.6);
}

/* Include state (green) */
.blog-tag-filter.tag-include {
  background: rgba(76, 140, 74, 0.3);
  border-color: rgba(76, 140, 74, 0.8);
  color: #2d5a2b;
}

.blog-tag-filter.tag-include::before {
  content: '✓ ';
}

/* Exclude state (red) */
.blog-tag-filter.tag-exclude {
  background: rgba(192, 114, 88, 0.3);
  border-color: rgba(192, 114, 88, 0.8);
  color: #8b3a2a;
  text-decoration: line-through;
}

.blog-tag-filter.tag-exclude::before {
  content: '✗ ';
  text-decoration: none;
  display: inline;
}

/* Content warning filter (two-state: neutral, exclude) */
.blog-cw-filter.cw-exclude {
  background: rgba(192, 119, 88, 0.3);
  border-color: rgba(192, 114, 88, 0.8);
  color: #8b3a2a;
  text-decoration: line-through;
}

.blog-no-filters {
  font-size: 0.85em;
  color: var(--IB-text);
  opacity: 0.6;
  font-style: italic;
}

/* Filter legend/help text */
.blog-filter-legend {
  font-size: 0.75em;
  color: var(--IB-text);
  opacity: 0.6;
  margin-top: 10px;
  font-style: italic;
}

/* -------------------------------------------------------- */
/* ARCHIVE LIST */
/* -------------------------------------------------------- */

.blog-archive-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Year collapsible */
.blog-archive-year {
  background: var(--btn-background-1);
  border: 3px solid rgba(28, 12, 1, 0.6);
  border-radius: 12px;
  overflow: hidden;
}

.blog-archive-year-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 1.2em;
  font-weight: 700;
  color: var(--IB-text-alt);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.15s ease;
}

.blog-archive-year-header::-webkit-details-marker {
  display: none;
}

.blog-archive-year-header::before {
  content: '▾';
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

.blog-archive-year:not([open]) > .blog-archive-year-header::before {
  transform: rotate(-90deg);
}

.blog-archive-year-header:hover {
  background: var(--btn-background-2);
  color: #fff;
}

.blog-archive-year-content {
  padding: 7.5px 15px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Month collapsible */
.blog-archive-month {
  background: var(--IB-bg-alt-3);
  border: 2px solid rgba(28, 12, 1, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.blog-archive-month-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  font-size: 1em;
  font-weight: 600;
  color: var(--IB-text);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.15s ease;
}

.blog-archive-month-header::-webkit-details-marker {
  display: none;
}

.blog-archive-month-header::before {
  content: '▸';
  font-size: 0.75em;
  transition: transform 0.2s ease;
}

.blog-archive-month[open] > .blog-archive-month-header::before {
  transform: rotate(90deg);
}

.blog-archive-month-header:hover {
  background: rgba(52, 23, 4, 0.75);
  color: #ffffff
}

.blog-archive-count {
  opacity: 0.6;
  font-weight: 400;
  font-size: 0.9em;
}

/* Post list within month */
.blog-archive-post-list {
  list-style: none;
  margin: 0;
  padding: 10px 15px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-archive-post-item {
  border-left: 3px solid rgba(28, 12, 1, 0.2);
  transition: border-color 0.15s ease;
  background-color: rgba(255, 255, 255, 0.50);
  border-radius: 0 8px 8px 0;
}

.blog-archive-post-item:hover {
  border-left-color: var(--ui-800);
}

.blog-archive-post-link {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  border-radius: 0 8px 8px 0;
  transition: background 0.15s ease;
}

.blog-archive-post-link:hover {
  background-color: rgba(255, 255, 255, 0.70);
}

.blog-archive-post-category {
  display: inline-block;
  background: var(--IB-bg-alt);
  color: var(--IB-text);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75em;
  font-weight: 600;
  margin-right: 8px;
  vertical-align: middle;
}

.blog-archive-post-title {
  font-weight: 600;
  color: var(--IB-text-alt);
  transition: color 0.15s ease;
}

.blog-archive-post-link:hover .blog-archive-post-title {
  color: var(--link-color-hover);
}

.blog-archive-post-date {
  display: block;
  font-size: 0.8em;
  color: var(--IB-text);
  opacity: 0.7;
  margin-top: 4px;
}

.blog-archive-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* -------------------------------------------------------- */
/* SINGLE POST VIEW */
/* -------------------------------------------------------- */

#blog-post-view {
  display: block;
}

.blog-post-full {
  background: var(--btn-background-1);
  border: 3px solid rgba(28, 12, 1, 0.6);
  border-radius: 12px;
  padding: 25px 30px;
}

.blog-post-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(28, 12, 1, 0.3);
}

.blog-post-title {
  font-family: var(--heading-font);
  font-size: 1.6em;
  margin: 0 0 10px 0;
}

.blog-post-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 25px;
  font-size: 0.95em;
  color: var(--IB-text);
}

.blog-post-date,
.blog-post-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.blog-post-category-tag {
  background: var(--IB-bg-alt);
  padding: 3px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.blog-post-tags {
  justify-content: center;
  margin-top: 12px;
}

/* Post Content Area */
.blog-post-content {
  line-height: 1.7;
}

.blog-post-content p {
  margin: 1em 0;
}

.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1em 0;
}

.blog-post-content blockquote {
  background: rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--IB-primary);
  padding: 15px 20px;
  margin: 1em 0;
  border-radius: 0 10px 10px 0;
  font-style: italic;
}

/* Back to Blog Link */
.blog-back-link {
  display: inline-block;
  margin-bottom: 20px;
  padding: 8px 16px;
  background: var(--btn-800);
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  border: 2px solid var(--ink-900);
  font-weight: 700;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, 0.3);
}

.blog-back-link:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 8px 2px rgba(0, 0, 0, 0.35);
  color: var(--link-color-hover);
}

/* Loading State */
.blog-loading {
  text-align: center;
  padding: 40px;
  font-size: 1.1em;
  color: var(--IB-text);
  opacity: 0.7;
}

/* Error State */
.blog-error {
  text-align: center;
  padding: 30px;
  background: rgba(192, 114, 88, 0.15);
  border: 2px solid var(--IB-warning);
  border-radius: 12px;
  color: var(--IB-warning);
}

/* Empty State */
.blog-empty {
  text-align: center;
  padding: 40px;
  color: var(--IB-text);
  opacity: 0.7;
}

/* -------------------------------------------------------- */
/* MOBILE ADJUSTMENTS */
/* -------------------------------------------------------- */

@media (max-width: 800px) {
  .blog-post-full {
    padding: 20px 15px;
  }
  
  .blog-post-preview {
    padding: 12px 15px;
  }
  
  .blog-filters {
    gap: 8px;
  }
  
  .blog-filter-btn {
    padding: 6px 12px;
    font-size: 0.9em;
  }
  
  .blog-filter-collapsible-header {
    padding: 10px 12px;
  }
  
  .blog-filter-collapsible-content {
    padding: 4px 12px 12px 12px;
  }
  
  .blog-tag-filter,
  .blog-cw-filter {
    padding: 4px 10px;
    font-size: 0.8em;
  }
  
  .blog-tabs {
    gap: 8px;
  }
  
  .blog-tab-btn {
    padding: 8px 16px;
    font-size: 0.9em;
  }
  
  .blog-archive-year-header {
    padding: 10px 15px;
    font-size: 1.1em;
  }
  
  .blog-archive-month-header {
    padding: 8px 12px;
    font-size: 0.95em;
  }
}


/* -------------------------------------------------------- */
/* Scrollbar */
/* -------------------------------------------------------- */
html {
  scrollbar-gutter: stable;
}
