/* ═══════════════════════════════════════════════════════════════════════
   TravelTeachings — Blog styles (public pages + admin blog editor)
   Uses the design tokens defined in main.css
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Listing ───────────────────────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--grey-100);
  display: flex; flex-direction: column; transition: var(--transition); min-width: 0;
}
.blog-card:hover { box-shadow: var(--shadow); border-color: var(--gold-light); transform: translateY(-2px); }
.blog-card-img { display: block; aspect-ratio: 16/9; background: var(--grey-100); overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2.4rem; color: var(--gold); background: linear-gradient(135deg, #fff0d6, #ffe0a0); }
.blog-card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card-meta { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.blog-card h3 { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.3; color: var(--navy); }
.blog-card h3 a:hover { color: var(--gold); }
.blog-card p { font-size: .9rem; color: var(--text-muted); line-height: 1.65; }
.blog-readmore { margin-top: auto; font-size: .85rem; font-weight: 600; color: var(--navy); }
.blog-readmore i { color: var(--gold); margin-left: 4px; transition: var(--transition); }
.blog-readmore:hover i { transform: translateX(4px); }

.blog-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 48px; }
.blog-pagination a, .blog-pagination .current {
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600;
  background: var(--white); border: 1px solid var(--grey-300); color: var(--navy);
}
.blog-pagination a:hover { border-color: var(--gold); color: var(--gold); }
.blog-pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Single post ───────────────────────────────────────────────────────── */
.blog-h1 { max-width: 900px; line-height: 1.2; }
.blog-post-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-size: .85rem; color: rgba(255,255,255,.7); }
.blog-post-meta i { color: var(--gold); margin-right: 6px; }
.blog-article { max-width: 800px; margin: 0 auto; }
.blog-featured { margin: 0 0 32px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.blog-featured img { width: 100%; height: auto; aspect-ratio: 1200/630; object-fit: cover; }

.blog-toc { background: var(--white); border: 1px solid var(--grey-100); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 32px; }
.blog-toc strong { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--navy); margin-bottom: 10px; }
.blog-toc ol { list-style: none; counter-reset: toc; display: grid; gap: 6px; }
.blog-toc li { font-size: .92rem; }
.blog-toc li.toc-l3 { padding-left: 20px; font-size: .86rem; }
.blog-toc a { color: var(--text-muted); }
.blog-toc a:hover { color: var(--gold); text-decoration: underline; }

.blog-content { font-size: 1.05rem; line-height: 1.85; color: var(--text); overflow-wrap: break-word; }
.blog-content h2 { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.25; color: var(--navy); margin: 44px 0 16px; scroll-margin-top: calc(var(--header-h) + 16px); }
.blog-content h3 { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.3; color: var(--navy-mid); margin: 32px 0 12px; scroll-margin-top: calc(var(--header-h) + 16px); }
.blog-content h4 { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: 24px 0 8px; }
.blog-content > :first-child { margin-top: 0; }
.blog-content p { margin-bottom: 18px; }
.blog-content a { color: #8a6d1f; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.blog-content a:hover { color: var(--navy); }
.blog-content ul, .blog-content ol { margin: 0 0 20px 1.4em; }
.blog-content ul { list-style: disc; }
.blog-content ol { list-style: decimal; }
.blog-content li { margin-bottom: 8px; padding-left: 4px; }
.blog-content li::marker { color: var(--gold); font-weight: 700; }
.blog-content img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 8px 0 24px; box-shadow: var(--shadow-sm); }
.blog-content blockquote { margin: 24px 0; padding: 16px 22px; background: var(--white); border-left: 4px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-muted); font-style: italic; }
.blog-content blockquote p:last-child { margin-bottom: 0; }
.blog-content hr { border: 0; border-top: 2px solid var(--grey-100); margin: 36px 0; }
.blog-content .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 28px; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--grey-100); }
.blog-content table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .94rem; line-height: 1.55; min-width: 520px; }
.blog-content th { background: var(--navy); color: var(--white); text-align: left; font-weight: 600; padding: 12px 16px; font-size: .85rem; letter-spacing: .3px; }
.blog-content td { padding: 12px 16px; border-bottom: 1px solid var(--grey-100); vertical-align: top; }
.blog-content tr:nth-child(even) td { background: var(--grey-50); }
.blog-content tr:last-child td { border-bottom: 0; }

.blog-faq { margin-top: 48px; }
.blog-faq > h2 { font-family: var(--font-display); font-size: 1.75rem; color: var(--navy); margin-bottom: 20px; }
.blog-faq-item { background: var(--white); border: 1px solid var(--grey-100); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.blog-faq-item h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.blog-faq-item p { color: var(--text-muted); line-height: 1.75; }

.blog-cta { margin-top: 48px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); border-radius: var(--radius-lg); padding: 40px; text-align: center; box-shadow: var(--shadow-lg); }
.blog-cta h2 { font-family: var(--font-display); font-size: 1.6rem; color: var(--white); margin-bottom: 12px; }
.blog-cta p { color: rgba(255,255,255,.8); max-width: 560px; margin: 0 auto 24px; line-height: 1.75; }

.blog-related { max-width: 1200px; margin: 72px auto 0; }
.blog-related > h2 { font-family: var(--font-display); font-size: 1.6rem; color: var(--navy); margin-bottom: 24px; }

.blog-admin-bar { background: #fff4d6; border-bottom: 1px solid var(--gold-light); padding: 10px 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: var(--navy); }
.blog-admin-bar a { font-weight: 700; color: #8a6d1f; }

/* ── Admin: blog editor ────────────────────────────────────────────────── */
.blog-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.blog-card-box { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 20px; border: 1px solid var(--grey-100); }
.blog-card-box > h3 { font-family: var(--font-display); font-size: 1.05rem; color: var(--navy); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.blog-card-box > h3 i { color: var(--gold); font-size: .95rem; }
.blog-card-box .form-group:last-child { margin-bottom: 0; }
.blog-hint { display: block; font-size: .78rem; color: var(--text-muted); margin-top: 5px; line-height: 1.5; }
.blog-counter { float: right; font-weight: 500; font-size: .75rem; color: var(--text-muted); }
.blog-counter.ok { color: var(--success); } .blog-counter.bad { color: var(--danger); }
.slug-row { display: flex; align-items: center; border: 2px solid var(--grey-100); border-radius: var(--radius); background: var(--grey-50); overflow: hidden; }
.slug-row span { padding: 0 0 0 14px; font-size: .85rem; color: var(--text-muted); white-space: nowrap; }
.slug-row input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 2px !important; }

.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--grey-100); border: 2px solid var(--grey-100); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: var(--header-h); z-index: 5; }
.rte-toolbar button { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid transparent; background: var(--white); border-radius: 6px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--navy); font-family: var(--font-body); }
.rte-toolbar button:hover { border-color: var(--gold); color: var(--gold); }
.rte-toolbar button.on { background: var(--navy); color: var(--white); }
.rte-sep { width: 1px; background: var(--grey-300); margin: 4px 4px; }
.rte-area {
  min-height: 460px; max-height: 80vh; overflow-y: auto; padding: 24px 28px; background: var(--white);
  border: 2px solid var(--grey-100); border-radius: 0 0 var(--radius) var(--radius); outline: none;
  font-size: 1rem; line-height: 1.8; color: var(--text);
}
.rte-area:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,.15); }
.rte-area h2 { font-family: var(--font-display); font-size: 1.6rem; color: var(--navy); margin: 28px 0 12px; }
.rte-area h3 { font-family: var(--font-display); font-size: 1.25rem; color: var(--navy-mid); margin: 22px 0 10px; }
.rte-area h4 { font-size: 1.05rem; margin: 18px 0 8px; }
.rte-area p { margin-bottom: 14px; }
.rte-area ul, .rte-area ol { margin: 0 0 16px 1.4em; } .rte-area ul { list-style: disc; } .rte-area ol { list-style: decimal; }
.rte-area a { color: #8a6d1f; text-decoration: underline; }
.rte-area img { max-width: 100%; height: auto; border-radius: 8px; }
.rte-area blockquote { border-left: 4px solid var(--gold); padding: 8px 18px; margin: 16px 0; color: var(--text-muted); font-style: italic; }
.rte-area table { border-collapse: collapse; width: 100%; margin-bottom: 18px; }
.rte-area th, .rte-area td { border: 1px solid var(--grey-300); padding: 8px 12px; min-width: 60px; }
.rte-area th { background: var(--grey-100); text-align: left; }
.rte-source { display: none; width: 100%; min-height: 460px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.6; padding: 16px; border: 2px solid var(--grey-100); border-radius: 0 0 var(--radius) var(--radius); background: #0f1b2a; color: #d6e2f0; resize: vertical; }
.rte-wrap.source .rte-area { display: none; } .rte-wrap.source .rte-source { display: block; }

.faq-row { background: var(--grey-50); border: 1px solid var(--grey-100); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; position: relative; }
.faq-row .form-group { margin-bottom: 10px; } .faq-row textarea { min-height: 80px !important; }
.faq-row .faq-del { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--danger); cursor: pointer; font-size: .9rem; }

.serp { border: 1px solid var(--grey-100); border-radius: var(--radius); padding: 14px 16px; background: var(--white); margin-bottom: 18px; }
.serp-url { font-size: .78rem; color: #1e6b3a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { font-size: 1.1rem; color: #1a0dab; line-height: 1.3; margin: 2px 0; font-family: Arial, sans-serif; }
.serp-desc { font-size: .85rem; color: #4d5156; line-height: 1.5; font-family: Arial, sans-serif; }

.seo-check { list-style: none; display: grid; gap: 7px; font-size: .84rem; }
.seo-check li { display: flex; gap: 8px; align-items: flex-start; color: var(--text-muted); }
.seo-check li i { margin-top: 3px; font-size: .8rem; }
.seo-check li.pass i { color: var(--success); } .seo-check li.fail i { color: var(--danger); } .seo-check li.pass { color: var(--text); }
.seo-score { font-family: var(--font-display); font-weight: 800; color: var(--navy); }

.blog-save-row { display: flex; gap: 10px; flex-wrap: wrap; }
.blog-save-row .btn { flex: 1; justify-content: center; }
.btn-ghost { background: var(--grey-100); color: var(--navy); border-color: var(--grey-100); }
.btn-ghost:hover { background: var(--grey-300); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.badge-pub { background: #d1fae5; color: #065f46; } .badge-draft { background: #fef3c7; color: #92400e; }
.img-preview { max-width: 100%; border-radius: var(--radius-sm); margin-bottom: 10px; border: 1px solid var(--grey-100); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { display: inline; }
.table-scroll { overflow-x: auto; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1199px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } .blog-editor-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-content { font-size: 1rem; }
  .blog-content h2 { font-size: 1.45rem; } .blog-content h3 { font-size: 1.15rem; }
  .blog-cta { padding: 28px 20px; }
  .rte-area { padding: 16px; }
}
