/* =================================================
   TGL Blog – Dark Theme Override for Tailwind Theme
   ================================================= */

/* ---- Base ---- */
body.tgl-blog,
body.tgl-blog.dark,
html.dark body.tgl-blog {
  background: #0d0d0d !important;
  color: #e0e0e0 !important;
  font-family: 'Inter', sans-serif;
}

/* Force dark on key Tailwind containers */
body.tgl-blog .dark\:bg-gray-950,
body.tgl-blog .dark\:bg-gray-900,
body.tgl-blog .bg-white {
  background-color: #0d0d0d !important;
}

body.tgl-blog .dark\:text-white,
body.tgl-blog .dark\:text-gray-100,
body.tgl-blog .text-gray-900 {
  color: #f0f0f0 !important;
}

/* ---- Site Header (inherited from /css/style.css) ---- */
/* header/footer already styled by main site CSS – no overrides needed */

/* ---- Page wrapper ---- */
.tgl-page-wrap {
  padding: 40px 0 60px;
  background: #0d0d0d;
  min-height: 60vh;
}

.tgl-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Two-column grid ---- */
.tgl-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .tgl-grid {
    grid-template-columns: 1fr;
  }
  .tgl-sidebar {
    order: -1;
  }
}

/* ---- Main column ---- */
.tgl-main {
  min-width: 0;
}

/* Remove tailwind's own max-width wrappers inside main column */
.tgl-main section.mx-auto,
.tgl-main .max-w-3xl,
.tgl-main .max-w-5xl {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ---- Blog Intro ---- */
.tgl-blog-intro {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid #222;
}

.tgl-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e63946;
  margin-bottom: 10px;
}

.tgl-blog-intro h1 {
  font-size: 1.9rem;
  font-weight: 800;
  color: #f0f0f0;
  margin: 0 0 10px;
  line-height: 1.25;
}

.tgl-blog-intro p {
  font-size: 1rem;
  color: #999;
  margin: 0;
  line-height: 1.6;
}

/* ---- Post list (index items) ---- */
/* The tailwind theme renders each post inside <li> with divide-y */
.tgl-post-list ul,
.tgl-post-list .divide-y {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tgl-post-list li.py-12,
.tgl-post-list li.py-8 {
  padding-top: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid #1e1e1e;
}

/* Post title links */
.tgl-post-list h2 a,
.tgl-post-list .text-gray-900 a,
.tgl-post-list .dark\:text-gray-100 a,
body.tgl-blog .prose h1,
body.tgl-blog .prose h2,
body.tgl-blog .prose h3 {
  color: #f0f0f0 !important;
}

body.tgl-blog .prose h1:hover,
body.tgl-blog .prose h2 a:hover,
.tgl-post-list h2 a:hover {
  color: #e63946 !important;
}

/* Meta text (date, category, etc.) */
.tgl-post-list .text-gray-500,
.tgl-post-list .dark\:text-gray-400,
body.tgl-blog .text-gray-500,
body.tgl-blog .text-gray-400 {
  color: #777 !important;
}

/* Tags in posts */
body.tgl-blog .text-primary-500,
body.tgl-blog a.text-primary-500 {
  color: #e63946 !important;
}

body.tgl-blog a.text-primary-500:hover {
  color: #ff6b74 !important;
}

/* Prose (single post body) */
body.tgl-blog .prose,
body.tgl-blog .dark\:prose-invert {
  color: #ccc !important;
}

body.tgl-blog .prose p,
body.tgl-blog .prose li,
body.tgl-blog .prose td {
  color: #ccc !important;
}

body.tgl-blog .prose a {
  color: #e63946 !important;
}

body.tgl-blog .prose a:hover {
  color: #ff6b74 !important;
}

/* Read more link */
body.tgl-blog a.read-more {
  color: #e63946 !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

body.tgl-blog a.read-more:hover {
  color: #ff6b74 !important;
}

/* Divide lines (post separators) */
body.tgl-blog .divide-y > * + * {
  border-color: #1e1e1e !important;
}

/* ---- Sidebar ---- */
.tgl-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 900px) {
  .tgl-sidebar {
    position: static;
  }
}

.tgl-widget {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 18px 20px;
}

.tgl-widget-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e63946;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #222;
}

/* Featured Posts rows */
.tgl-fp-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid #1a1a1a;
  transition: opacity 0.2s;
}

.tgl-fp-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tgl-fp-row:hover {
  opacity: 0.8;
}

.tgl-fp-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
  display: block;
}

.tgl-fp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

/* Rounded corners on all post images */
body.tgl-blog .prose img,
body.tgl-blog article img,
body.tgl-blog .tgl-main img {
  border-radius: 8px;
}

.tgl-fp-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tgl-fp-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ddd;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tgl-fp-date {
  font-size: 0.72rem;
  color: #666;
}

/* Search widget */
.tgl-search {
  display: flex;
  gap: 8px;
}

.tgl-search-input {
  flex: 1;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 0.85rem;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s;
}

.tgl-search-input:focus {
  border-color: #e63946;
}

.tgl-search-btn {
  background: #e63946;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.tgl-search-btn:hover {
  background: #c72f3b;
}

/* Categories widget */
.tgl-cats ul,
.tgl-cats .category {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 2;
}

.tgl-cats li,
.tgl-cats .category {
  line-height: 2 !important;
}

.tgl-cats a {
  color: #bbb !important;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.tgl-cats a:hover {
  color: #e63946 !important;
}

/* Tags cloud widget */
.tgl-tags-cloud a,
.tgl-tags-cloud .tags a {
  display: inline-block;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: #aaa !important;
  font-size: 0.75rem;
  padding: 3px 9px;
  margin: 0 4px 6px 0;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.tgl-tags-cloud a:hover,
.tgl-tags-cloud .tags a:hover {
  background: #e63946;
  border-color: #e63946;
  color: #fff !important;
}

/* ---- Toolbar (admin bar) override ---- */
body.tgl-blog #htmly-toolbar {
  top: 0;
  z-index: 9999;
}

/* ---- Pagination ---- */
body.tgl-blog .pagination a,
body.tgl-blog .pagination span {
  background: #111;
  border: 1px solid #222;
  color: #ccc;
  border-radius: 4px;
  padding: 4px 12px;
  margin: 0 3px;
  text-decoration: none;
}

body.tgl-blog .pagination .current,
body.tgl-blog .pagination a:hover {
  background: #e63946;
  border-color: #e63946;
  color: #fff;
}
