/* Premier Custom Storage — blog styles
   Used by /blog/index.html, the per-article pages in /blog/, and the
   "From the blog" section embedded on the homepage. Pairs with site.css —
   pulls navy/blue palette + Playfair/DM Sans tokens from there. */

/* ── BLOG INDEX ── */
.blog-page {
  background: var(--bg);
  min-height: 60vh;
  padding: 64px 5% 96px;
}
.blog-page-inner { max-width: 1140px; margin: 0 auto; }

.blog-filters {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 32px 0 40px;
}
.blog-filter {
  font-family: var(--bd); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  background: var(--white); color: var(--text2);
  border: 1px solid var(--border);
  padding: 9px 20px; border-radius: 30px;
  cursor: pointer; transition: all 0.15s;
}
.blog-filter:hover { border-color: var(--blue); color: var(--blue); }
.blog-filter.active {
  background: var(--blue); color: #fff; border-color: var(--blue);
}

.blog-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.blog-card {
  background: var(--white); border-radius: var(--r);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow); transition: all 0.25s;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
}
.blog-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.blog-card-img {
  height: 200px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, #1a2a4a 100%);
  display: flex; align-items: center; justify-content: center;
}
.blog-card-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.blog-card-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(37,99,235,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.blog-card-img .placeholder-icon { font-size: 3.6rem; color: rgba(96,165,250,0.6); }

.blog-card-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-tag {
  display: inline-block; align-self: flex-start;
  background: var(--blue-lt); color: var(--blue);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 4px 10px; border-radius: 20px;
  margin-bottom: 12px;
}
.blog-card h3 {
  font-family: var(--hd); font-size: 1.18rem; line-height: 1.3;
  color: var(--text); margin-bottom: 10px;
}
.blog-card p {
  color: var(--text2); font-size: 0.88rem; line-height: 1.6;
  flex: 1; margin-bottom: 16px;
}
.blog-card-meta {
  display: flex; gap: 14px; align-items: center;
  font-size: 0.75rem; color: var(--muted);
  padding-top: 14px; border-top: 1px solid var(--border);
}
.blog-card-meta .dot {
  width: 3px; height: 3px; border-radius: 50%; background: var(--muted);
  display: inline-block;
}

.blog-empty {
  text-align: center; padding: 80px 20px; color: var(--muted);
}
.blog-empty .icon { font-size: 3rem; opacity: 0.4; display: block; margin-bottom: 14px; }

/* ── ARTICLE PAGE ── */
.article-page {
  background: var(--white);
  padding: 56px 5% 80px;
}
.article-wrap { max-width: 760px; margin: 0 auto; }

.article-breadcrumb {
  font-size: 0.78rem; color: var(--muted); margin-bottom: 22px;
  letter-spacing: 0.4px;
}
.article-breadcrumb a { color: var(--text2); text-decoration: none; }
.article-breadcrumb a:hover { color: var(--blue); }

.article-tag {
  display: inline-block; background: var(--blue-lt); color: var(--blue);
  font-size: 0.65rem; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; padding: 5px 12px; border-radius: 20px;
  margin-bottom: 20px;
}
.article-title {
  font-family: var(--hd); font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15; color: var(--navy); margin-bottom: 18px;
}
.article-subtitle {
  font-size: 1.18rem; color: var(--text2); line-height: 1.55;
  margin-bottom: 28px; font-weight: 400;
}
.article-meta {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--text2);
  padding: 16px 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); margin-bottom: 36px;
}
.article-meta .author {
  font-weight: 600; color: var(--text);
}
.article-meta .dot {
  width: 3px; height: 3px; border-radius: 50%; background: var(--muted);
  display: inline-block;
}

.article-cover {
  width: 100%; aspect-ratio: 16/8; background: linear-gradient(135deg, var(--navy), #1a2a4a);
  border-radius: var(--r); margin-bottom: 36px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-cover .placeholder-icon { font-size: 5rem; color: rgba(96,165,250,0.5); }

/* TOC */
.article-toc {
  background: var(--bg); border-left: 3px solid var(--blue);
  padding: 18px 22px; margin-bottom: 36px; border-radius: 4px;
}
.article-toc-title {
  font-size: 0.7rem; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--blue); font-weight: 700; margin-bottom: 12px;
}
.article-toc ol {
  list-style: decimal; padding-left: 20px; margin: 0;
}
.article-toc li {
  padding: 4px 0; font-size: 0.92rem; color: var(--text2);
}
.article-toc li a { color: var(--text2); text-decoration: none; }
.article-toc li a:hover { color: var(--blue); text-decoration: underline; }

/* Body */
.article-body {
  font-size: 1.05rem; line-height: 1.75; color: var(--text);
}
.article-body h2 {
  font-family: var(--hd); font-size: 1.7rem; line-height: 1.25;
  color: var(--navy); margin: 48px 0 16px;
  scroll-margin-top: 100px;
}
.article-body h3 {
  font-family: var(--hd); font-size: 1.25rem; color: var(--navy);
  margin: 28px 0 10px;
}
.article-body p {
  margin-bottom: 18px;
}
.article-body ul, .article-body ol {
  margin: 14px 0 22px 24px; padding: 0;
}
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 4px solid var(--blue);
  background: var(--bg); padding: 18px 22px;
  margin: 24px 0; font-style: italic; color: var(--text2);
  border-radius: 0 6px 6px 0;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body strong { color: var(--text); font-weight: 700; }
.article-body a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.article-body a:hover { color: var(--blue2); }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 24px 0; }
.article-body table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  padding: 10px 14px; border: 1px solid var(--border); text-align: left;
}
.article-body th { background: var(--bg); font-weight: 700; }

.article-body .callout {
  background: var(--blue-lt); border-radius: 8px;
  padding: 18px 22px; margin: 24px 0; border-left: 4px solid var(--blue);
  font-size: 0.95rem; color: var(--navy);
}
.article-body .callout strong { color: var(--blue2); }

/* End-of-article CTA */
.article-cta {
  margin-top: 52px; padding: 32px;
  background: linear-gradient(135deg, var(--navy) 0%, #1a2a4a 100%);
  border-radius: var(--r); color: #fff; text-align: center;
}
.article-cta h3 { font-family: var(--hd); font-size: 1.5rem; margin-bottom: 10px; color: #fff; }
.article-cta p { color: #cbd5e1; font-size: 0.95rem; margin-bottom: 20px; max-width: 480px; margin-left: auto; margin-right: auto; }
.article-cta .btn-primary { background: var(--blue); }

/* Related */
.article-related {
  margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border);
}
.article-related-title {
  font-family: var(--hd); font-size: 1.4rem; margin-bottom: 24px;
  text-align: center;
}

/* From the blog (homepage section) */
.blog-home-section {
  background: var(--white); padding: 80px 5%;
}
.blog-home-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; max-width: 1100px; margin: 48px auto 0;
}

/* ── ADMIN BLOG LIST ── */
.admin-blog-table .blog-status {
  text-transform: uppercase; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 1px; padding: 3px 9px; border-radius: 12px;
}
.admin-blog-table .blog-status.published { background: var(--green-lt); color: #047857; }
.admin-blog-table .blog-status.draft     { background: var(--amber-lt); color: #92400e; }
.admin-blog-table .blog-status.archived  { background: var(--bg2);      color: var(--text2); }

/* ── ADMIN EDITOR ── */
.editor-grid {
  display: grid; grid-template-columns: 1fr 320px; gap: 24px;
  max-width: 1280px; margin: 0 auto;
}
.editor-main { min-width: 0; }
.editor-side { min-width: 0; }

.editor-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.editor-card h3 {
  font-family: var(--hd); font-size: 0.95rem; margin-bottom: 12px;
  color: var(--navy);
}

.editor-input, .editor-textarea, .editor-select {
  width: 100%; font-family: var(--bd); font-size: 0.92rem;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--white); color: var(--text);
  transition: border-color 0.15s;
}
.editor-input:focus, .editor-textarea:focus, .editor-select:focus {
  outline: none; border-color: var(--blue);
}
.editor-textarea {
  font-family: 'Menlo', 'Consolas', monospace; font-size: 0.86rem;
  line-height: 1.55; min-height: 360px; resize: vertical;
}
.editor-textarea.title-input {
  font-family: var(--hd); font-size: 1.4rem; padding: 12px;
  min-height: auto;
}
.editor-label {
  display: block; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text2); margin-bottom: 6px;
}
.editor-help {
  font-size: 0.75rem; color: var(--muted); margin-top: 5px;
}

.editor-tabs {
  display: flex; gap: 0; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.editor-tab {
  background: none; border: none; cursor: pointer;
  font-family: var(--bd); font-size: 0.82rem; font-weight: 600;
  padding: 10px 18px; color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.editor-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.editor-preview {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 22px; min-height: 360px; background: var(--white);
  font-family: var(--bd); font-size: 1rem; line-height: 1.7;
}
.editor-preview h2 { font-family: var(--hd); font-size: 1.4rem; margin: 18px 0 10px; color: var(--navy); }
.editor-preview h3 { font-family: var(--hd); font-size: 1.1rem; margin: 14px 0 6px; color: var(--navy); }
.editor-preview p  { margin-bottom: 14px; }
.editor-preview ul { margin: 12px 0 14px 24px; }
.editor-preview a  { color: var(--blue); }

.editor-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}

/* Mobile */
@media (max-width: 900px) {
  .editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .blog-page { padding: 48px 4% 64px; }
  .article-meta { font-size: 0.78rem; gap: 10px; }
  .article-body { font-size: 1rem; }
  .article-body h2 { font-size: 1.45rem; margin-top: 38px; }
}
