/*
Theme Name:  Newgen Blog
Theme URI:   https://newgen.drawihg.com
Author:      Drawihg
Author URI:  https://drawihg.com
Description: A clean blog theme matching the Newgen art gallery system. Uses CSS custom properties for one-click color theming via the WordPress Customizer.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: newgen-blog
Tags:        blog, dark-mode, custom-colors, custom-logo, featured-images, threaded-comments
*/

/* ==========================================================================
   1. CSS Custom Properties (Theme Colors)
   — Change primary/accent in WP Admin > Appearance > Customize > Colors
   ========================================================================== */

:root {
  /* Brand colors */
  --clr-primary:        #4f46e5;   /* indigo-600  */
  --clr-primary-hover:  #4338ca;   /* indigo-700  */
  --clr-primary-light:  #eef2ff;   /* indigo-50   */
  --clr-primary-dark:   #312e81;   /* indigo-900  */

  --clr-accent:         #059669;   /* emerald-600 */
  --clr-accent-hover:   #047857;   /* emerald-700 */

  /* Gradient (used on buttons / badges) */
  --clr-grad-from:      #059669;
  --clr-grad-to:        #4f46e5;

  /* Neutral surface */
  --clr-bg:             #f3f4f6;   /* gray-100    */
  --clr-card:           #ffffff;
  --clr-border:         #e5e7eb;   /* gray-200    */

  /* Typography */
  --clr-text:           #111827;   /* gray-900    */
  --clr-text-muted:     #6b7280;   /* gray-500    */
  --clr-text-light:     #9ca3af;   /* gray-400    */

  /* Shadows */
  --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-md:   0 4px 6px -1px rgb(0 0 0 / .10), 0 2px 4px -2px rgb(0 0 0 / .10);
  --shadow-lg:   0 10px 15px -3px rgb(0 0 0 / .10), 0 4px 6px -4px rgb(0 0 0 / .10);

  /* Radius */
  --radius-sm:   0.375rem;  /* 6px  */
  --radius-md:   0.75rem;   /* 12px */
  --radius-lg:   1rem;      /* 16px */
  --radius-xl:   1.25rem;   /* 20px */

  /* Spacing */
  --container:   80rem;     /* max-w-7xl = 1280px */
}

/* Dark mode — toggled via .dark class on <html> */
html.dark {
  --clr-bg:          #111827;   /* gray-900 */
  --clr-card:        #1f2937;   /* gray-800 */
  --clr-border:      #374151;   /* gray-700 */
  --clr-text:        #f9fafb;   /* gray-50  */
  --clr-text-muted:  #9ca3af;   /* gray-400 */
  --clr-text-light:  #6b7280;   /* gray-500 */
  --clr-primary-light: rgba(79, 70, 229, .15);
}

/* System dark mode fallback (if JS hasn't run yet) */
@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --clr-bg:          #111827;
    --clr-card:        #1f2937;
    --clr-border:      #374151;
    --clr-text:        #f9fafb;
    --clr-text-muted:  #9ca3af;
    --clr-text-light:  #6b7280;
    --clr-primary-light: rgba(79, 70, 229, .15);
  }
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Figtree', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.625;
  color: var(--clr-text);
  background-color: var(--clr-bg);
  transition: background-color .2s, color .2s;
}

img, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color .15s;
}
a:hover { color: var(--clr-primary-hover); }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-weight: 700;
  line-height: 1.25;
  color: var(--clr-text);
}

p { margin: 0 0 1rem; }

ul, ol { margin: 0 0 1rem; padding-left: 1.5rem; }

/* ==========================================================================
   3. Layout Helpers
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px)  { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2rem; } }

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  padding-block: 2rem;
}

/* Two-column layout */
.content-sidebar-wrap {
  display: grid;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .content-sidebar-wrap {
    grid-template-columns: 1fr 320px;
  }
}

/* ==========================================================================
   4. Site Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--clr-card);
  border-bottom: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

/* Logo */
.site-header__brand { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.site-header__brand a { display: flex; align-items: center; gap: .75rem; color: var(--clr-text); }
.site-header__brand a:hover { color: var(--clr-primary); }

.custom-logo { height: 2.25rem; width: auto; }

.site-title-text {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--clr-grad-from), var(--clr-grad-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Primary nav */
.site-header__nav { display: none; }
@media (min-width: 768px) {
  .site-header__nav { display: flex; align-items: center; gap: .25rem; }
}

.site-header__nav a {
  display: inline-flex;
  align-items: center;
  padding: .375rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--clr-text-muted);
  transition: color .15s, background-color .15s;
}
.site-header__nav a:hover,
.site-header__nav .current-menu-item > a,
.site-header__nav .current_page_item > a {
  color: var(--clr-primary);
  background-color: var(--clr-primary-light);
}

/* Header right: search + dark toggle + hamburger */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--clr-text-muted);
  transition: background-color .15s, color .15s;
}
.btn-icon:hover { background: var(--clr-border); color: var(--clr-text); }
.btn-icon svg { width: 1.125rem; height: 1.125rem; }

/* Mobile menu toggle */
.menu-toggle { display: flex; }
@media (min-width: 768px) { .menu-toggle { display: none; } }

/* Mobile dropdown menu */
.mobile-menu {
  display: none;
  border-top: 1px solid var(--clr-border);
  background: var(--clr-card);
  padding: .75rem 1rem 1rem;
}
.mobile-menu.is-open { display: block; }
.mobile-menu ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.mobile-menu a {
  display: block;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--clr-text-muted);
  transition: color .15s, background-color .15s;
}
.mobile-menu a:hover { color: var(--clr-primary); background: var(--clr-primary-light); }

/* Search bar in header */
.header-search-form {
  display: none;
  padding: .75rem 1rem;
  border-top: 1px solid var(--clr-border);
  background: var(--clr-card);
}
.header-search-form.is-open { display: flex; gap: .5rem; }
.header-search-form input {
  flex: 1;
  padding: .5rem .875rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: .875rem;
  outline: none;
  transition: border-color .15s;
}
.header-search-form input:focus { border-color: var(--clr-primary); }

/* ==========================================================================
   5. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--clr-grad-from), var(--clr-grad-to));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  opacity: .9;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  border: 1px solid var(--clr-border);
  background: transparent;
  color: var(--clr-text-muted);
}
.btn-outline:hover { border-color: var(--clr-primary); color: var(--clr-primary); background: var(--clr-primary-light); }

.btn-sm { padding: .375rem .875rem; font-size: .8125rem; }

/* ==========================================================================
   6. Post Cards
   ========================================================================== */

.posts-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 640px)  { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .posts-grid--sidebar { grid-template-columns: 1fr; } }
@media (min-width: 1280px) { .posts-grid--full { grid-template-columns: repeat(3, 1fr); } }

/* Featured post (first on home) */
.post-card--featured {
  grid-column: 1 / -1;
  display: grid;
  gap: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--clr-card);
  box-shadow: var(--shadow-md);
  transition: box-shadow .2s, transform .2s;
}
@media (min-width: 768px) {
  .post-card--featured { grid-template-columns: 1fr 1fr; }
  .post-card--featured .post-card__thumb { height: 100%; }
}
.post-card--featured:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* Regular card */
.post-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--clr-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.post-card__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--clr-border);
}
.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.post-card:hover .post-card__thumb img,
.post-card--featured:hover .post-card__thumb img { transform: scale(1.04); }

.post-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--clr-primary-light), var(--clr-border));
}
.post-card__thumb-placeholder svg { width: 2.5rem; height: 2.5rem; opacity: .35; }

.post-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  flex: 1;
}
.post-card--featured .post-card__body { padding: 2rem; justify-content: center; }

.post-card__cats {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: .1875rem .625rem;
  border-radius: 9999px;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.cat-badge:hover { background: var(--clr-primary); color: #fff; }

.post-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--clr-text);
  transition: color .15s;
}
.post-card--featured .post-card__title { font-size: 1.5rem; }
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--clr-primary); }

.post-card__excerpt {
  font-size: .875rem;
  color: var(--clr-text-muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8125rem;
  color: var(--clr-text-light);
  margin-top: auto;
  padding-top: .625rem;
  border-top: 1px solid var(--clr-border);
}
.post-card__meta svg { width: .875rem; height: .875rem; flex-shrink: 0; }
.post-card__meta-item { display: flex; align-items: center; gap: .3rem; }

/* Read more link */
.post-card__readmore {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--clr-primary);
  margin-top: .5rem;
}
.post-card__readmore:hover { gap: .625rem; }
.post-card__readmore svg { width: .875rem; height: .875rem; transition: transform .15s; }
.post-card__readmore:hover svg { transform: translateX(3px); }

/* ==========================================================================
   7. Single Post
   ========================================================================== */

.single-post__hero {
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16/6;
  background: var(--clr-border);
  margin-bottom: 2rem;
}
.single-post__hero img { width: 100%; height: 100%; object-fit: cover; }

.single-post__header {
  margin-bottom: 2rem;
}
.single-post__cats { margin-bottom: .875rem; }
.single-post__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}
.single-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: .875rem;
  color: var(--clr-text-muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--clr-border);
}
.single-post__meta-item { display: flex; align-items: center; gap: .375rem; }
.single-post__meta svg { width: 1rem; height: 1rem; }

/* Author chip */
.author-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.author-chip__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--clr-grad-from), var(--clr-grad-to));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}

/* Post content typography */
.entry-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--clr-text);
}
.entry-content h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: .875rem; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.75rem; margin-bottom: .75rem; }
.entry-content h4 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: .625rem; }
.entry-content p   { margin-bottom: 1.25rem; }
.entry-content ul, .entry-content ol { margin-bottom: 1.25rem; }
.entry-content li  { margin-bottom: .375rem; }
.entry-content a   { color: var(--clr-primary); text-decoration: underline; text-underline-offset: .2em; }
.entry-content a:hover { color: var(--clr-primary-hover); }
.entry-content blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--clr-primary);
  background: var(--clr-primary-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--clr-text-muted);
}
.entry-content blockquote p { margin: 0; }
.entry-content pre {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: .875rem;
  margin-bottom: 1.25rem;
}
.entry-content code {
  background: var(--clr-border);
  padding: .15em .4em;
  border-radius: .25rem;
  font-size: .875em;
}
.entry-content pre code { background: none; padding: 0; }
.entry-content img {
  border-radius: var(--radius-md);
  margin-block: 1.5rem;
  box-shadow: var(--shadow-md);
}
.entry-content hr {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: 2.5rem 0;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: .9375rem;
}
.entry-content th, .entry-content td {
  padding: .625rem .875rem;
  border: 1px solid var(--clr-border);
  text-align: left;
}
.entry-content th {
  background: var(--clr-primary-light);
  font-weight: 600;
  color: var(--clr-primary);
}

/* Post tags */
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.tag-link {
  display: inline-flex;
  padding: .25rem .75rem;
  border-radius: 9999px;
  font-size: .8125rem;
  font-weight: 500;
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  background: var(--clr-card);
  transition: all .15s;
}
.tag-link:hover { border-color: var(--clr-primary); color: var(--clr-primary); background: var(--clr-primary-light); }

/* Post navigation */
.post-navigation {
  display: grid;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--clr-border);
}
@media (min-width: 640px) { .post-navigation { grid-template-columns: 1fr 1fr; } }
.nav-link-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
  background: var(--clr-card);
  transition: all .2s;
}
.nav-link-card:hover { border-color: var(--clr-primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.nav-link-card--next { text-align: right; }
.nav-link-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--clr-text-light); }
.nav-link-title { font-size: .9375rem; font-weight: 600; color: var(--clr-text); }
.nav-link-card:hover .nav-link-title { color: var(--clr-primary); }

/* ==========================================================================
   8. Sidebar & Widgets
   ========================================================================== */

.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.widget {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
}
.widget-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 1rem;
  padding-bottom: .625rem;
  border-bottom: 2px solid var(--clr-primary-light);
  position: relative;
}
.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--clr-grad-from), var(--clr-grad-to));
  border-radius: 1px;
}

/* Recent posts widget */
.widget ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .625rem; }
.widget ul li { border-bottom: 1px solid var(--clr-border); padding-bottom: .625rem; }
.widget ul li:last-child { border-bottom: none; padding-bottom: 0; }
.widget ul a { color: var(--clr-text); font-size: .875rem; font-weight: 500; line-height: 1.4; }
.widget ul a:hover { color: var(--clr-primary); }

/* Categories widget */
.widget_categories ul li, .widget_archive ul li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.widget_categories ul li a, .widget_archive ul li a { flex: 1; }

/* Search widget */
.widget_search .search-form { display: flex; gap: .5rem; }
.widget_search .search-field {
  flex: 1;
  padding: .5rem .875rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: .875rem;
  outline: none;
}
.widget_search .search-field:focus { border-color: var(--clr-primary); }
.widget_search .search-submit { @apply btn btn-primary btn-sm; }

/* ==========================================================================
   9. Pagination
   ========================================================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .375rem;
  margin-top: 3rem;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding-inline: .625rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid var(--clr-border);
  background: var(--clr-card);
  color: var(--clr-text-muted);
  transition: all .15s;
}
.pagination .page-numbers:hover { border-color: var(--clr-primary); color: var(--clr-primary); background: var(--clr-primary-light); }
.pagination .page-numbers.current { background: linear-gradient(135deg, var(--clr-grad-from), var(--clr-grad-to)); color: #fff; border-color: transparent; }
.pagination .page-numbers.dots { border: none; background: none; }

/* ==========================================================================
   10. Comments
   ========================================================================== */

.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--clr-border);
}
.comments-title, .comment-reply-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }

.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .children { list-style: none; padding-left: 2rem; margin-top: 1rem; }

.comment {
  padding: 1.25rem;
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}
.comment-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.comment-author .fn { font-weight: 600; font-size: .9375rem; }
.comment-metadata a { font-size: .8125rem; color: var(--clr-text-light); }
.comment-content p { font-size: .9375rem; margin-bottom: .5rem; }
.reply a { font-size: .8125rem; font-weight: 600; color: var(--clr-primary); }

/* Comment form */
.comment-form { margin-top: 2rem; }
.comment-form p { margin-bottom: 1rem; }
.comment-form label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: .9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--clr-primary); }
.comment-form textarea { min-height: 7rem; resize: vertical; }
.comment-form .form-submit input {
  background: linear-gradient(135deg, var(--clr-grad-from), var(--clr-grad-to));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .625rem 1.5rem;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.comment-form .form-submit input:hover { opacity: .9; }

/* ==========================================================================
   11. Page Hero (Category / Archive / Search headings)
   ========================================================================== */

.page-hero {
  background: linear-gradient(135deg, var(--clr-grad-from), var(--clr-grad-to));
  color: #fff;
  padding: 3rem 0;
  margin-bottom: 2.5rem;
}
.page-hero__title { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 800; margin: 0 0 .375rem; color: #fff; }
.page-hero__sub { font-size: 1rem; opacity: .85; margin: 0; }

/* ==========================================================================
   12. 404 Page
   ========================================================================== */

.error-404 { text-align: center; padding: 5rem 1rem; }
.error-404__code { font-size: clamp(5rem, 15vw, 10rem); font-weight: 900; background: linear-gradient(135deg, var(--clr-grad-from), var(--clr-grad-to)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; margin-bottom: .5rem; }
.error-404__msg { font-size: 1.25rem; font-weight: 600; margin-bottom: .625rem; }
.error-404__sub { color: var(--clr-text-muted); margin-bottom: 2rem; }

/* ==========================================================================
   13. Footer
   ========================================================================== */

.site-footer {
  background: var(--clr-card);
  border-top: 1px solid var(--clr-border);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.site-footer__grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 640px)  { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-brand__desc { font-size: .9375rem; color: var(--clr-text-muted); margin-top: .75rem; line-height: 1.6; }
.footer-col__title { font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--clr-text-light); margin-bottom: .875rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.footer-col ul a { font-size: .9375rem; color: var(--clr-text-muted); transition: color .15s; }
.footer-col ul a:hover { color: var(--clr-primary); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--clr-border);
  font-size: .875rem;
  color: var(--clr-text-light);
}
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.25rem; }
.footer-nav a { color: var(--clr-text-light); transition: color .15s; font-size: .875rem; }
.footer-nav a:hover { color: var(--clr-primary); }

/* ==========================================================================
   14. Reading Progress Bar
   ========================================================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-grad-from), var(--clr-grad-to));
  z-index: 100;
  transition: width .1s linear;
}

/* ==========================================================================
   15. Back to Top
   ========================================================================== */

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--clr-grad-from), var(--clr-grad-to));
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(.5rem);
  transition: opacity .2s, transform .2s;
  z-index: 40;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top svg { width: 1.125rem; height: 1.125rem; }

/* ==========================================================================
   16. Utility
   ========================================================================== */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.divider { border: none; border-top: 1px solid var(--clr-border); margin-block: 2rem; }
.section-title { font-size: 1.375rem; font-weight: 700; margin-bottom: 1.5rem; display: flex; align-items: center; gap: .75rem; }
.section-title::after { content: ''; flex: 1; height: 2px; background: var(--clr-border); border-radius: 1px; }
