/* HaiPhongAPP Blog SEO Styles — CTAS Life Design System */

.blog-main {
  padding-bottom: 72px;
}

.blog-hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 42px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 12% 18%, rgba(91, 75, 224, 0.12), transparent 46%),
    radial-gradient(circle at 86% 12%, rgba(14, 159, 142, 0.10), transparent 42%),
    var(--bg);
}

.blog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brandSoft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--text);
}

.blog-hero p {
  max-width: 720px;
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text2);
}

.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 24px;
}

.blog-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.blog-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.blog-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.blog-chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.blog-search {
  position: relative;
  min-width: 240px;
  flex: 1 1 260px;
  max-width: 360px;
}

.blog-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.blog-search input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.blog-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text3);
  pointer-events: none;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: #d2cbf8;
  box-shadow: var(--shadow);
}

.blog-card-media {
  aspect-ratio: 16 / 9;
  background: var(--surface2);
  overflow: hidden;
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
  gap: 10px;
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text3);
}

.blog-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brandSoft);
  color: var(--brand);
  font-weight: 700;
  font-size: 11.5px;
}

.blog-card h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
}

.blog-card h2 a {
  color: inherit;
  text-decoration: none;
}

.blog-card h2 a:hover {
  color: var(--brand);
}

.blog-card p {
  margin: 0;
  color: var(--text2);
  font-size: 14.5px;
  line-height: 1.65;
  flex: 1;
}

.blog-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.blog-empty {
  margin-top: 24px;
  padding: 40px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text2);
}

/* Single Article Page */
.article-wrap {
  padding-top: 28px;
  padding-bottom: 72px;
}

.article-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text3);
  margin-bottom: 18px;
}

.article-breadcrumb a {
  color: var(--text2);
  text-decoration: none;
}

.article-breadcrumb a:hover {
  color: var(--brand);
}

.article-header {
  max-width: 820px;
  margin-bottom: 28px;
}

.article-header h1 {
  margin: 12px 0 14px;
  font-size: clamp(26px, 3.8vw, 40px);
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--text);
}

.article-lead {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text2);
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  color: var(--text3);
}

.article-share-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.article-share-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.article-cover {
  margin: 0 0 32px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  max-height: 460px;
}

.article-cover img {
  width: 100%;
  height: 100%;
  max-height: 460px;
  object-fit: cover;
  display: block;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 36px;
  align-items: start;
}

.article-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 34px;
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
}

.article-content h2 {
  margin: 30px 0 12px;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  scroll-margin-top: 96px;
}

.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  margin: 22px 0 8px;
  font-size: 19px;
  line-height: 1.35;
  scroll-margin-top: 96px;
}

.article-content p {
  margin: 0 0 16px;
  color: var(--text2);
}

.article-content ul,
.article-content ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--text2);
}

.article-content li {
  margin-bottom: 8px;
}

.article-content strong {
  color: var(--text);
}

.article-content a {
  color: var(--brand);
  font-weight: 600;
}

.article-content blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--brand);
  border-radius: 0 12px 12px 0;
  background: var(--brandSoft);
  color: var(--text);
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--brandSoft);
  border: 1px solid #d5cef8;
}

.article-callout-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 14.5px;
}

.article-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.toc-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.toc-box h2 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-list a {
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text2);
  text-decoration: none;
}

.toc-list a:hover {
  color: var(--brand);
}

.toc-list li.depth-3 {
  padding-left: 14px;
}

.related-apps-section {
  margin-top: 40px;
  padding: 28px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.related-apps-section h2 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.related-apps-section > p {
  margin: 0 0 20px;
  color: var(--text2);
  font-size: 14.5px;
}

.related-apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.related-app-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.related-app-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.related-app-card img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
}

.related-app-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text);
}

.related-app-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.45;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.article-tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 600;
}

/* Dark theme harmony with site-header.js */
html[data-theme="dark"] .blog-hero {
  background: radial-gradient(circle at 12% 18%, rgba(123, 108, 246, 0.22), transparent 46%),
    radial-gradient(circle at 86% 12%, rgba(25, 194, 174, 0.14), transparent 42%),
    #0b1020;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .blog-card,
html[data-theme="dark"] .article-content,
html[data-theme="dark"] .toc-box,
html[data-theme="dark"] .related-apps-section,
html[data-theme="dark"] .blog-search input,
html[data-theme="dark"] .blog-chip:not([aria-pressed="true"]),
html[data-theme="dark"] .article-share-btn {
  background: #131a30;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f3f4fa;
}

html[data-theme="dark"] .blog-hero h1,
html[data-theme="dark"] .blog-card h2,
html[data-theme="dark"] .article-header h1,
html[data-theme="dark"] .article-content strong,
html[data-theme="dark"] .related-app-card h3 {
  color: #f8f9ff;
}

html[data-theme="dark"] .blog-hero p,
html[data-theme="dark"] .blog-card p,
html[data-theme="dark"] .article-lead,
html[data-theme="dark"] .article-content p,
html[data-theme="dark"] .article-content li,
html[data-theme="dark"] .toc-list a,
html[data-theme="dark"] .related-app-card p {
  color: #b7bdd6;
}

html[data-theme="dark"] .related-app-card,
html[data-theme="dark"] .article-tag {
  background: #1a2340;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .blog-badge,
html[data-theme="dark"] .blog-eyebrow,
html[data-theme="dark"] .article-callout,
html[data-theme="dark"] .article-content blockquote {
  background: rgba(123, 108, 246, 0.16);
  border-color: rgba(123, 108, 246, 0.35);
  color: #d7d1ff;
}

/* Tet 2027 Festive Theme harmony */
html[data-theme="tet"] .blog-hero {
  background:
    radial-gradient(circle at 14% 20%, rgba(246, 200, 100, 0.28), transparent 46%),
    radial-gradient(circle at 86% 14%, rgba(180, 35, 24, 0.12), transparent 44%),
    linear-gradient(135deg, #FFFDF7, #F9EBD4);
  border-bottom-color: rgba(201, 138, 28, 0.35);
}
html[data-theme="tet"] .blog-badge,
html[data-theme="tet"] .blog-eyebrow,
html[data-theme="tet"] .article-callout,
html[data-theme="tet"] .article-content blockquote {
  background: #FDF2DA;
  border-color: rgba(201, 138, 28, 0.45);
  color: #8A1710;
}
html[data-theme="tet"] .blog-card:hover {
  border-color: #DFB562;
}

@media (max-width: 1020px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 680px) {
  .blog-grid,
  .related-apps-grid {
    grid-template-columns: 1fr;
  }
  .article-content {
    padding: 22px 18px;
  }
  .article-share-btn {
    margin-left: 0;
  }
}
