/* ===================================================================
   TOKENS (only keep one :root in your whole CSS if you already have it)
   =================================================================== */
:root {
  --primary:       #4f46e5;
  --primary-dark:  #3730a3;
  --muted:         #6b7280;
  --border:        #e5e7eb;
  --bg-soft:       #fafafa;
  --radius:        14px;
}

/* ===================================================================
   LAYOUT
   =================================================================== */
.blog-container {
  max-width: 1100px;
  margin: 0 auto 4rem;
  padding: 0.5rem 1rem 3rem;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr);
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===================================================================
   ARTICLE CARD
   =================================================================== */
.blog-article {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.06);
  padding: 1.75rem 1.9rem 2.1rem;
}

/* header */
.blog-article-header {
  margin-bottom: 1rem;
}

/* hero thumbnail INSIDE card */
.blog-hero-image {
  margin: -0.5rem -0.5rem 1.2rem;
  border-radius: 18px;
  overflow: hidden;
}
.blog-hero-image img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* categories chips */
.blog-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.blog-chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 0.75rem;
  text-decoration: none;
  font-weight: 500;
}
.blog-chip:hover {
  background: #e0e7ff;
}

/* title + meta */
.blog-title {
  font-size: 1.9rem;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}
.blog-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
}
.blog-meta-item {
  display: inline-flex;
  align-items: center;
}
.blog-meta-dot {
  color: #d1d5db;
}

/* ===================================================================
   TYPOGRAPHY
   =================================================================== */
.blog-content {
  margin-top: 1.3rem;
  font-size: 1rem;
  color: #111827;
}
.blog-content p {
  margin: 0 0 1.15rem;
}
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  margin: 1.8rem 0 0.75rem;
  line-height: 1.3;
}
.blog-content h2 { font-size: 1.4rem; }
.blog-content h3 { font-size: 1.2rem; }
.blog-content h4 { font-size: 1rem; }

.blog-content ul,
.blog-content ol {
  margin: 0 0 1.2rem 1.5rem;
  padding: 0;
}
.blog-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.blog-content a:hover {
  color: var(--primary-dark);
}

/* inline code */
.blog-content code {
  background: #f3f4f6;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.88em;
}
.blog-content pre code {
  background: none;
  padding: 0;
}

/* blockquote (quote box) */
.blog-content blockquote {
  position: relative;
  margin: 1.75rem 0;
  padding: 1.4rem 1.8rem 1.4rem 1.9rem;
  background: #f9fafb;
  border-radius: 18px;
  border-left: 4px solid #fb7185;
  color: #374151;
  font-style: italic;
}
.blog-content blockquote::before {
  content: "“";
  position: absolute;
  top: 0.8rem;
  left: 1.1rem;
  font-size: 2.4rem;
  color: #9ca3af;
  font-style: normal;
}
.blog-content blockquote p {
  margin: 0 0 0.8rem 1.2rem;
}
.blog-content blockquote cite {
  display: block;
  margin-left: 1.2rem;
  font-style: normal;
  color: #6b7280;
  font-size: 0.9rem;
}

/* ===================================================================
   CODE BLOCKS + COPY BUTTON
   =================================================================== */
.code-block {
  position: relative;
  margin: 1.4rem 0;
}
.blog-content pre {
  background: #020617;
  color: #e5e7eb;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 14px;
  font-size: 0.9rem;
  overflow-x: auto;
  margin: 0;
}
.code-copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s, transform 0.15s;
}
.code-copy-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* ===================================================================
   TABLE OF CONTENTS
   =================================================================== */
.blog-toc {
  margin: 1.8rem 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #fed7e2;
  box-shadow: 0 12px 30px rgba(248, 113, 113, 0.18);
}
.blog-toc-toggle {
  width: 100%;
  border: none;
  background: linear-gradient(90deg, #fb7185, #f97316);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.3rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.blog-toc-icon {
  font-size: 1rem;
  transition: transform 0.25s;
}
.blog-toc-body {
  background: #fff;
  padding: 0.9rem 1.3rem 1.1rem;
  display: none;
}
.blog-toc-body ol {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}
.blog-toc-body li {
  margin: 0.3rem 0;
}
.blog-toc-body a {
  text-decoration: none;
  color: #374151;
}
.blog-toc-body a:hover {
  color: var(--primary);
}

.blog-toc.is-open .blog-toc-body {
  display: block;
}
.blog-toc.is-open .blog-toc-icon {
  transform: rotate(180deg);
}

/* indent deeper levels a bit */
.blog-toc .toc-level-3 { margin-left: 0.7rem; }
.blog-toc .toc-level-4 { margin-left: 1.4rem; }

/* ===================================================================
   FOOTER: TAGS + SHARE
   =================================================================== */
.blog-article-footer {
  border-top: 1px solid var(--border);
  margin-top: 1.7rem;
  padding-top: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* tags like: #Design #Market */
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.blog-tags-label {
  font-size: 0.86rem;
  font-weight: 600;
  margin-right: 0.4rem;
}
.blog-tags a {
  background: transparent;
  color: #ef4444;
  font-size: 0.85rem;
  text-decoration: none;
}
.blog-tags a::before {
  content: "#";
  margin-right: 2px;
}
.blog-tags a:hover {
  color: #b91c1c;
}

/* share section */
.blog-share {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.blog-share-title {
  text-align: center;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.blog-share-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}
.blog-share-icons a {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  text-decoration: none;
  color: #111827;
  transition: background 0.2s, color 0.2s, transform 0.15s, border-color 0.2s;
}
.blog-share-icons a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.blog-share-copy {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.blog-share-copy-input {
  flex: 1 1 auto;
  max-width: 420px;
  display: flex;
  align-items: center;
  background: #f9fafb;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.75rem;
}
.blog-share-copy-input input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  padding: 0.25rem 0.2rem;
  outline: none;
}
.share-copy-btn {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.share-copy-btn:hover {
  background: #fecaca;
  transform: translateY(-1px);
}

/* ===================================================================
   SIDEBAR
   =================================================================== */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.sidebar-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 1.25rem 1.35rem 1.3rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}
.sidebar-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}
.sidebar-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #4b5563;
}
.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-list li {
  margin-bottom: 0.45rem;
}
.sidebar-list li a {
  text-decoration: none;
  color: #374151;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-list li a:hover {
  color: var(--primary);
}

/* ===================================================================
   COMMENTS (including captcha field)
   =================================================================== */
.blog-comments-wrapper {
  max-width: 900px;
  margin: 3rem auto 0;
}

.comments-area {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 1.75rem 1.75rem 2rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.05);
}
.comments-area > h2 {
  font-size: 1.3rem;
  margin: 0 0 1rem;
}

.comment-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.comment-list > li {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.comment-list > li:last-child {
  border-bottom: none;
}
.comment-meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.comment-content {
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

/* comment form */
.comment-respond {
  margin-top: 1rem;
}
.comment-reply-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.comment-form p {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
}
.comment-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form input[type="number"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.comment-form textarea:focus,
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.15);
}

/* math captcha field */
.comment-form-math input[type="number"] {
  max-width: 130px;
}

/* submit button */
.comment-form .submit {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.15s;
}
.comment-form .submit:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ===================================================================
   RESPONSIVE TWEAKS
   =================================================================== */
@media (max-width: 768px) {
  .blog-container {
    padding: 0.01rem 0.75rem 2.5rem;
  }
  .blog-article {
    padding: 1.4rem 1.3rem 1.7rem;
  }
  .blog-title {
    font-size: 1.55rem;
  }
  .blog-hero-image {
    margin: -0.75rem -0.75rem 1rem;
  }
  .blog-hero-image img {
    max-height: 260px;
  }
}
/* ===== Modern comment list ===== */

.comments-area {
    margin-top: 2.5rem;
}

/* reset list */
.comment-list,
.comment-list .children {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* spacing between root comments */
.comment-list > .modern-comment {
    margin-bottom: 1.25rem;
}

/* nested replies indented slightly */
.comment-list .children {
    margin-top: 0.75rem;
    margin-left: 2.25rem;
}

/* comment card layout */
.comment-body {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 0.85rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
    padding-bottom: 1rem;
}

/* avatar */
.comment-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 999px;
}

/* name + date */
.comment-header {
    grid-column: 2 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}
.comment-author-name a {
    font-weight: 600;
    color: #111827;
    text-decoration: none;
}
.comment-author-name a:hover {
    text-decoration: underline;
}
.comment-meta {
    color: var(--muted, #6b7280);
}

/* text */
.comment-text {
    grid-column: 2 / -1;
    margin-top: 0.3rem;
    font-size: 0.95rem;
}

/* reply link */
.comment-footer {
    grid-column: 2 / -1;
    margin-top: 0.35rem;
}
.comment-footer a {
    font-size: 0.85rem;
    color: var(--primary, #4f46e5);
    text-decoration: none;
    font-weight: 500;
}
.comment-footer a:hover {
    text-decoration: underline;
}

/* mobile tweak */
@media (max-width: 600px) {
    .comment-list .children {
        margin-left: 1.5rem;
    }
}
/* ===== Make comments align with left blog column (CSS-only) ===== */

/* wrapper under the post */
.blog-comments-wrapper {
    max-width: 1100px;          /* same as blog-container */
    margin: 3rem auto 0;        /* center overall container */
    padding: 0 1rem;            /* same horizontal padding as blog content */
    display: flex;              /* so we can fake the left column width */
    justify-content: flex-start;
}

/* comment card should match left column width (approx 68%) */
.blog-comments-wrapper .comments-area {
    flex: 0 0 68%;
    max-width: 60%;
    margin: 0;                  /* kill any theme margins */
}

/* on tablet/mobile, go full width again */
@media (max-width: 900px) {
    .blog-comments-wrapper {
        max-width: 100%;
        margin-top: 2rem;
        padding: 0 0.75rem;
        display: block;
    }
    .blog-comments-wrapper .comments-area {
        max-width: 100%;
    }
}

/*
 * 
 * Archive design */
/* ================== ARCHIVE CONTAINER ================== */
.blog-archive-container {
    max-width: 1100px;
    margin: 0 auto 4rem;
    padding: 2.5rem 1rem 3rem;
}

/* header (title + search) */
.blog-archive-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.8rem;
}
.archive-title-wrap {
    flex: 1 1 260px;
}
.archive-title {
    margin: 0 0 .35rem;
    font-size: 1.8rem;
}
.archive-description {
    margin: 0;
    color: var(--muted, #6b7280);
    font-size: .95rem;
}

/* search bar */
.archive-search {
    flex: 0 0 280px;
}
.archive-search-form {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 999px;
    border: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 10px 30px rgba(15,23,42,.06);
    overflow: hidden;
}
.archive-search-input {
    flex: 1 1 auto;
    border: none;
    padding: .6rem 1rem;
    font-size: .9rem;
    outline: none;
}
.archive-search-btn {
    border: none;
    padding: 0 .95rem;
    font-size: .9rem;
    font-weight: 600;
    background: var(--primary, #4f46e5);
    color: #fff;
    cursor: pointer;
    transition: background .2s, transform .15s;
}
.archive-search-btn:hover {
    background: var(--primary-dark, #3730a3);
    transform: translateY(-1px);
}

/* ================== MAIN GRID + SIDEBAR ================== */
.blog-archive-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
    gap: 2rem;
}

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

.blog-archive-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* reuse your sidebar-card / sidebar-list styles from single post */

/* ================== POST CARDS GRID ================== */
.blog-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* card */
.blog-archive-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 12px 32px rgba(15,23,42,.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* thumbnail */
.archive-card-thumb {
    display: block;
    overflow: hidden;
}
.archive-card-thumb img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.blog-archive-card:hover .archive-card-thumb img {
    transform: scale(1.05);
}

/* body */
.archive-card-body {
    padding: 1.1rem 1.25rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

/* categories chips (reuse existing .blog-chip style) */
.archive-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

/* title */
.archive-card-title {
    font-size: 1.1rem;
    margin: .15rem 0 .2rem;
    line-height: 1.35;
}
.archive-card-title a {
    text-decoration: none;
    color: #111827;
}
.archive-card-title a:hover {
    color: var(--primary, #4f46e5);
}

/* meta */
.archive-card-meta {
    font-size: .82rem;
    color: var(--muted, #6b7280);
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    align-items: center;
}
.archive-card-meta .dot {
    color: #d1d5db;
}

/* excerpt */
.archive-card-excerpt {
    margin-top: .25rem;
    font-size: .92rem;
    color: #4b5563;
}

/* footer */
.archive-card-footer {
    margin-top: .75rem;
}
.archive-read-more {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary, #4f46e5);
    text-decoration: none;
}
.archive-read-more::after {
    content: "→";
    font-size: .85rem;
}
.archive-read-more:hover {
    color: var(--primary-dark, #3730a3);
}

/* ================== PAGINATION ================== */
.blog-archive-pagination {
    margin-top: 2rem;
    text-align: center;
}
.blog-archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    margin: 0 .15rem;
    padding: 0 .4rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    font-size: .85rem;
    color: #374151;
}
.blog-archive-pagination .page-numbers.current {
    background: var(--primary, #4f46e5);
    color: #fff;
    border-color: var(--primary, #4f46e5);
}
.blog-archive-pagination .page-numbers:hover:not(.current) {
    background: #f3f4ff;
}

/* ================== RESPONSIVE ================== */
@media (max-width: 900px) {
    .blog-archive-container {
        padding: 2rem .75rem 2.75rem;
    }
    .blog-archive-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .archive-search {
        width: 100%;
        max-width: 100%;
    }
    .blog-archive-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .blog-archive-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* Fix mobile spacing around archive/search bar */
@media (max-width: 768px) {
    .blog-archive-container {
        padding-top: 1.4rem;
        padding-bottom: 2rem;
    }

    .blog-archive-header {
        margin-bottom: 1.1rem;
        gap: 0.75rem;
    }

    .archive-search {
        width: 100%;
        max-width: 100%;
    }

    .archive-search-form {
        box-shadow: 0 6px 18px rgba(15,23,42,.08);
    }
	.archive-title-wrap{
		    flex: 1 1 0px;
	}
	.archive-search {
    flex: 0 0 10px;
}
}

