/*
 * Brendon Ely
 * 11ty Site Styles
 *
 * Recreated from the original WordPress/Ashe design.
 */


/* =========================================================
   1. RESET
   ========================================================= */

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
}

article,
aside,
footer,
header,
main,
nav,
section {
  display: block;
}

figure {
  margin: 0;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

iframe,
embed {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: "Open Sans", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  line-height: normal;
}

p {
  margin: 0 0 20px;
}

a {
  background-color: transparent;
  text-decoration: none;
}


/* =========================================================
   2. SITE VARIABLES
   ========================================================= */

:root {

  --site-width: 1200px;
  --content-width: 800px;      /* narrower for comfortable reading */
  --sidebar-width: 300px;

  --body-font: "Open Sans", sans-serif;
  --heading-font: "Playfair Display", Georgia, serif;

  --body-size: clamp(1rem, 1.5vw + 0.5rem, 1.125rem);  /* fluid typography: 16-18px */
  --body-line-height: 1.7;

  --heading-weight: 400;

  --text-color: #333333;
  --heading-color: #1a1a1a;
  --muted-color: #6b6b6b;
  --border-color: #e5e5e5;
  --background-color: #ffffff;
  --light-background: #fafafa;

  /* Accent colors from original WP theme */
  --accent: #ca9b52;
  --accent-hover: #b8894a;
  --accent-light: #f5ebdc;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}


/* =========================================================
   3. GENERAL
   ========================================================= */

body {
  background: var(--background-color);
  color: var(--text-color);

  font-family: var(--body-font);
  font-size: var(--body-size);
  line-height: var(--body-line-height);

  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  height: 1px;
  margin: 2.5rem 0;
}

/* Selection */
::selection {
  background: var(--accent);
  color: #fff;
}

::-moz-selection {
  background: var(--accent);
  color: #fff;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 8px 8px;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 0;
}


/* =========================================================
   4. TYPOGRAPHY
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-weight: var(--heading-weight);
  line-height: 1.25;
}

h1 { font-size: clamp(2.5rem, 4vw + 1rem, 3.5rem); }
h2 { font-size: clamp(2rem, 3vw + 0.5rem, 2.5rem); }
h3 { font-size: clamp(1.5rem, 2vw + 0.5rem, 1.875rem); }
h4 { font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem); }
h5 { font-size: clamp(1.125rem, 1vw + 0.5rem, 1.25rem); }
h6 { font-size: clamp(1rem, 0.5vw + 0.75rem, 1.125rem); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--accent-hover);
  opacity: 1;
  text-decoration-thickness: 2px;
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}


/* =========================================================
   5. SITE CONTAINER
   ========================================================= */

.boxed-wrapper {
  width: 100%;
  max-width: var(--site-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}


/* =========================================================
   6. TOP BAR
   ========================================================= */

#top-bar {
  width: 100%;
  background: var(--top-bar-bg, var(--background-color));
  color: var(--top-bar-text, var(--text-color));
  padding: 8px 0;
  font-size: 0.75rem;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

#top-bar .boxed-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.top-bar-socials {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar-socials a {
  color: var(--top-bar-text, var(--text-color));
  text-decoration: none;
  transition: color var(--transition-fast);
}

.top-bar-socials a:hover {
  color: var(--accent);
}

/* Dark Mode Toggle in Top Bar */
#top-bar .dark-mode-toggle {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

#top-bar .dark-mode-toggle svg {
  width: 18px;
  height: 18px;
}

/* =========================================================
   7. HEADER
   ========================================================= */

#page-header {
  padding: 60px 0 50px;
}

.entry-header {
  position: relative;
  overflow: hidden;
}

.header-logo {
  text-align: center;
}

.header-logo a {
  display: block;
  margin: 0 auto;
  color: var(--heading-color);
  font-size: clamp(3rem, 6vw + 1rem, 5rem);
  line-height: 1;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color var(--transition-base);
}

.header-logo a:hover {
  color: var(--accent);
}

.header-logo img {
  margin: 0 auto;
  max-height: 120px;
}

.site-description {
  display: inline-block;
  margin-top: 12px;
  margin-bottom: 0;
  color: var(--muted-color);
  font-size: clamp(1rem, 1.5vw + 0.5rem, 1.125rem);
  line-height: 1.4;
  font-style: italic;
}


/* =========================================================
   8. MAIN NAVIGATION
   ========================================================= */

#main-nav {
  width: 100%;
  background: var(--background-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  position: sticky;
  top: 44px; /* height of top-bar */
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

#main-nav > div {
  max-width: var(--site-width);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

#main-menu {
  display: inline-block;
}

#main-menu > li {
  display: inline-block;
  position: relative;
}

#main-menu li a {
  display: block;

  padding: 0 18px;

  font-size: 15px;
  line-height: 60px;

  letter-spacing: 1px;
  font-weight: 600;
}


/* =========================================================
   9. MAIN CONTENT
   ========================================================= */

.main-content {
  padding-top: 50px;
  padding-bottom: 50px;
}

.main-container {
  width: 100%;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}


/* =========================================================
   10. POSTS
   ========================================================= */

.post {
  margin-bottom: 40px;
}

.post-card {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  margin-bottom: 24px;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-media {
  position: relative;
  overflow: hidden;
}

.post-media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-media img {
  transform: scale(1.02);
}

.post-header {
  padding: 24px;
  text-align: center;
}

.post-categories {
  margin-bottom: 10px;
}

.post-categories a {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 10px;
  background: var(--accent-light);
  border-radius: 20px;
  transition: all var(--transition-fast);
}

.post-categories a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.post-title {
  margin-bottom: 14px;
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-size: clamp(1.75rem, 3vw + 1rem, 2.25rem);
  line-height: 1.3;
  letter-spacing: 0.3px;
  font-weight: 400;
}

.post-title a {
  color: inherit;
  text-decoration: none;
}

.post-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.post-meta {
  margin-bottom: 16px;
  color: var(--muted-color);
  font-family: var(--heading-font);
  font-style: italic;
  font-size: 0.9rem;
}

.post-content {
  padding: 0 24px 24px;
  overflow: hidden;
}

.post-content > p {
  text-align: left;
}

.post-content > p.has-text-align-left {
  text-align: left;
}

.post-content > p.has-text-align-right {
  text-align: right;
}

.post-content > p.has-text-align-center {
  text-align: center;
}


/* =========================================================
   11. ARTICLE CONTENT
   ========================================================= */

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  color: var(--heading-color);
  scroll-margin-top: 100px; /* Account for sticky header */
}

.post-content h2 {
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 0.5rem;
}

.post-content h3 {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.post-content ul,
.post-content ol {
  margin: 1.5rem 0 1.5rem 1.5rem;
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.post-content li::marker {
  color: var(--accent);
}

.post-content blockquote {
  margin: 2.5rem 0;
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--accent);
  background: var(--light-background);
  color: var(--muted-color);
  font-family: var(--heading-font);
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content img {
  margin: 2rem auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.post-content figure {
  margin: 2rem 0;
}

.post-content figcaption {
  margin-top: 0.75rem;
  color: var(--muted-color);
  font-size: 0.85rem;
  text-align: center;
  font-style: italic;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.post-content th,
.post-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.post-content th {
  background: var(--light-background);
  font-weight: 600;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--light-background);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.post-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}


/* =========================================================
   12. READ MORE
   ========================================================= */

.read-more {
  margin: 2rem 0 1.5rem;
  text-align: center;
}

.read-more a {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 50px;
  text-decoration: none;
  transition: all var(--transition-base);
}

.read-more a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.read-more a {
  display: inline-block;

  padding: 0 25px;

  border: 1px solid currentColor;

  font-size: 13px;
  line-height: 40px;

  font-weight: bold;

  letter-spacing: 2px;

  text-transform: uppercase;
}


/* =========================================================
   13. POST FOOTER
   ========================================================= */

/* =========================================================
   13b. POST NAVIGATION
   ========================================================= */

.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.post-navigation-prev,
.post-navigation-next {
  padding: 1.5rem;
  background: var(--light-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all var(--transition-base);
}

.post-navigation-prev:hover,
.post-navigation-next:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-navigation a {
  display: block;
  color: var(--heading-color);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
  transition: color var(--transition-fast);
}

.post-navigation a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.nav-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-color);
}

.post-navigation-next {
  text-align: right;
}

@media screen and (max-width: 640px) {
  .post-navigation {
    grid-template-columns: 1fr;
  }
  .post-navigation-next {
    text-align: left;
  }
}

/* =========================================================
   13c. RELATED POSTS
   ========================================================= */

.related-posts {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-posts h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  text-align: center;
}

.related-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media screen and (max-width: 979px) {
  .related-post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 640px) {
  .related-post-grid {
    grid-template-columns: 1fr;
  }
}

.post-footer {
  position: relative;
  overflow: hidden;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--light-background);
  margin: 0 -24px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.post-tags a {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-color);
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.post-tags a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.post-author {
  font-size: 0.875rem;
  font-style: italic;
  color: var(--muted-color);
  line-height: 1.5;
}

.post-author a {
  color: var(--accent);
  text-decoration: none;
  font-style: normal;
  font-weight: 600;
}

.post-author a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.post-comments {
  display: block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--muted-color);
}

.post-author {
  float: left;

  font-size: 14px;

  font-style: italic;

  letter-spacing: 0.5px;

  line-height: 30px;
}


/* =========================================================
   14. SIDEBAR
   ========================================================= */

.main-grid {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 40px;
  align-items: start;
}

@media screen and (max-width: 979px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.sidebar-left {
  order: -1;
}

.sidebar-right {
  order: 1;
}

.widget {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-light);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--heading-color);
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget li {
  margin-bottom: 0.5rem;
}

.widget li:last-child {
  margin-bottom: 0;
}

.widget a {
  display: block;
  padding: 0.5rem 0;
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: color var(--transition-fast);
}

.widget li:last-child a {
  border-bottom: none;
}

.widget a:hover {
  color: var(--accent);
  padding-left: 0.5rem;
}

.widget .count {
  float: right;
  color: var(--muted-color);
  font-weight: 400;
  font-size: 0.875rem;
}

.widget_search .search-form {
  display: flex;
  gap: 0.5rem;
}

.widget_search input[type="search"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
}

.widget_search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.widget_search button {
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.widget_search button:hover {
  background: var(--accent-hover);
}

.sidebar-right {
  float: right;
}

.sidebar-left-wrap,
.sidebar-right-wrap {
  width: 100%;
}


/* =========================================================
   15. FOOTER
   ========================================================= */

.page-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  background: var(--light-background);
}

.page-footer-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 60px 20px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-widget {
  margin-bottom: 0;
}

.footer-widget-title {
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--heading-color);
}

.footer-copyright {
  grid-column: 1 / -1;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-color);
}

.credit a {
  color: var(--muted-color);
  text-decoration: none;
}

.credit a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.page-footer-inner {
  max-width: var(--site-width);

  margin: 0 auto;

  padding-top: 40px;
  padding-bottom: 40px;
}

.copyright-info {
  font-size: 13px;

  text-align: center;
}


/* =========================================================
   16. PAGINATION
   ========================================================= */

.pagination {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  margin: 0 4px;
  padding: 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pagination .current {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  cursor: default;
}

.pagination .prev,
.pagination .next {
  padding: 0 16px;
}

.pagination a {
  display: inline-block;

  margin: 0 10px;

  font-size: 13px;

  letter-spacing: 1px;

  text-transform: uppercase;
}


/* =========================================================
   17. SCREEN READER
   ========================================================= */

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: polygon(0 0, 0 0, 0 0, 0 0);
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

/* Print styles */
@media print {
  #top-bar,
  #main-nav,
  .sidebar-left,
  .sidebar-right,
  .pagination,
  .read-more,
  .video-wrapper {
    display: none !important;
  }
  .main-container {
    max-width: none;
  }
  .post-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}


/* =========================================================
   18. RESPONSIVE
   ========================================================= */

@media screen and (max-width: 1200px) {
  .boxed-wrapper {
    max-width: 100%;
  }
}

@media screen and (max-width: 979px) {
  #top-bar > div,
  #main-nav > div,
  .main-content,
  .page-footer-inner {
    padding-left: 30px;
    padding-right: 30px;
  }

  #main-menu {
    display: none;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-left,
  .sidebar-right {
    width: 100%;
  }

  .header-logo a {
    font-size: clamp(2.5rem, 6vw + 1rem, 4rem);
  }

  .site-description {
    font-size: 1rem;
  }

  #main-nav {
    position: static;
  }
}

@media screen and (max-width: 768px) {
  .post-title {
    font-size: clamp(1.5rem, 3vw + 1rem, 2rem);
  }

  .post-header {
    padding: 20px;
  }

  .post-content {
    padding: 0 20px 20px;
  }

  .page-footer-inner {
    padding-top: 40px;
    padding-bottom: 30px;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-copyright {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
  }
}

@media screen and (max-width: 640px) {
  #page-header {
    padding-top: 40px;
    padding-bottom: 30px;
  }

  .header-logo a {
    font-size: clamp(2rem, 6vw + 1rem, 3rem);
  }

  .site-description {
    font-size: 0.9rem;
  }

  .main-content {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .post-footer {
    text-align: center;
  }

  .post-author {
    text-align: center;
  }

  .post-tags {
    justify-content: center;
  }
}

@media screen and (max-width: 480px) {
  #top-bar > div,
  #main-nav > div,
  .main-content,
  .page-footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header-logo a {
    font-size: clamp(1.75rem, 6vw + 1rem, 2.25rem);
  }

  .post-title {
    font-size: clamp(1.375rem, 4vw + 0.5rem, 1.75rem);
    line-height: 1.35;
  }

  .read-more a {
    padding: 0.625rem 1.5rem;
    font-size: 0.7rem;
  }

  .pagination a,
  .pagination span {
    min-width: 40px;
    height: 40px;
    font-size: 0.8rem;
  }
}


@media screen and (max-width: 768px) {

  .post-title {
    font-size: 34px;
    line-height: 38px;
  }

  .post-content > p {
    text-align: left;
  }

  .page-footer-inner {
    padding-top: 30px;
    padding-bottom: 30px;
  }

}


@media screen and (max-width: 640px) {

  #page-header {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .header-logo a {
    font-size: 55px;
  }

  .site-description {
    font-size: 12px;
  }

  .main-content {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .post-title {
    font-size: 30px;
    line-height: 34px;
  }

  .post-footer {
    text-align: center;
  }

  .post-author {
    float: none;
  }

}


@media screen and (max-width: 480px) {

  #top-bar > div,
  #main-nav > div,
  .main-content,
  .page-footer-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header-logo a {
    font-size: 42px;
  }

  .post-title {
    font-size: 27px;
    line-height: 32px;
  }

}

/* =========================================================
   19. PAGE HEADER BACKGROUND
   ========================================================= */

#page-header {
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

#page-header .entry-header {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#page-header .entry-header .boxed-wrapper {
  width: 100%;
}

@media screen and (max-width: 979px) {
  #page-header {
    min-height: 300px;
  }
}

@media screen and (max-width: 768px) {
  #page-header {
    min-height: 250px;
  }
}

@media screen and (max-width: 640px) {
  #page-header {
    min-height: 200px;
  }
}

@media screen and (max-width: 480px) {
  #page-header {
    min-height: 180px;
  }
}

#page-header .entry-header {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#page-header .entry-header .boxed-wrapper {
  width: 100%;
}

@media screen and (max-width: 979px) {
  #page-header {
    min-height: 300px;
  }
}

@media screen and (max-width: 768px) {
  #page-header {
    min-height: 250px;
  }
}

@media screen and (max-width: 640px) {
  #page-header {
    min-height: 200px;
  }
}

@media screen and (max-width: 480px) {
  #page-header {
    min-height: 180px;
  }
}

/* =========================================================
   20. RESPONSIVE VIDEO EMBEDS
   ========================================================= */

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 2rem 0;
  border-radius: 8px;
  background: #000;
}

.video-wrapper iframe,
.video-wrapper object,
.video-wrapper embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

@media screen and (max-width: 768px) {
  .video-wrapper {
    margin: 1.5rem 0;
  }
}

/* =========================================================
   20b. JAVASCRIPT COMPONENTS
   ========================================================= */

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  width: 0%;
  z-index: 1000;
  transition: width 0.1s linear;
  display: none;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 100;
}

.back-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(0) scale(1.1);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Table of Contents */
.table-of-contents {
  background: var(--light-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.table-of-contents h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted-color);
}

.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.table-of-contents li {
  margin-bottom: 0.5rem;
}

.table-of-contents li.h2 {
  font-weight: 600;
}

.table-of-contents li.h3 {
  margin-left: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted-color);
}

.table-of-contents a {
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.table-of-contents a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media screen and (max-width: 768px) {
  .table-of-contents {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--background-color);
  color: var(--text-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dark-mode-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.dark-mode-toggle svg {
  width: 20px;
  height: 20px;
}

.dark-mode-toggle .sun-icon {
  display: none;
}

.dark-mode .dark-mode-toggle .sun-icon {
  display: block;
}

.dark-mode .dark-mode-toggle .moon-icon {
  display: none;
}

/* Mobile Menu */
.main-nav-sidebar {
  display: none;
}

@media screen and (max-width: 979px) {
  .main-nav-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
  }

  .main-nav-sidebar span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all var(--transition-base);
  }

  .main-nav-sidebar[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .main-nav-sidebar[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .main-nav-sidebar[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

.mobile-menu-container {
  display: none;
}

@media screen and (max-width: 979px) {
  .mobile-menu-container.is-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    z-index: 99;
  }

  .mobile-menu-container #mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-menu-container #mobile-menu li a {
    display: block;
    padding: 1rem;
    border-radius: 4px;
    color: var(--text-color);
    font-weight: 500;
  }

  .mobile-menu-container #mobile-menu li a:hover {
    background: var(--accent-light);
    color: var(--accent);
  }
}

/* Post Navigation (if not already styled) */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.post-navigation-prev,
.post-navigation-next {
  padding: 1.5rem;
  background: var(--light-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all var(--transition-base);
}

.post-navigation-prev:hover,
.post-navigation-next:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-navigation a {
  display: block;
  color: var(--heading-color);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
  transition: color var(--transition-fast);
}

.post-navigation a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.nav-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-color);
}

.post-navigation-next {
  text-align: right;
}

@media screen and (max-width: 640px) {
  .post-navigation {
    grid-template-columns: 1fr;
  }
  .post-navigation-next {
    text-align: left;
  }
}

/* Related Posts Grid */
.related-posts {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-posts h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  text-align: center;
}

.related-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media screen and (max-width: 979px) {
  .related-post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 640px) {
  .related-post-grid {
    grid-template-columns: 1fr;
  }
}


   ========================================================= */

@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #e0e0e0;
    --heading-color: #f5f5f5;
    --muted-color: #9ca3af;
    --border-color: #374151;
    --background-color: #111827;
    --light-background: #1f2937;
    --accent: #d4a85a;
    --accent-hover: #e8c57a;
    --accent-light: #3d2f1a;
  }

  .post-card {
    background: #1f2937;
    border-color: #374151;
  }

  .post-media img {
    opacity: 0.95;
  }

  .post-categories a {
    background: var(--accent-light);
    color: var(--accent);
  }

  .post-categories a:hover {
    background: var(--accent);
    color: #111827;
  }

  .post-title a:hover {
    color: var(--accent);
  }

  .post-footer {
    background: #1f2937;
    border-color: #374151;
  }

  .post-tags a {
    background: #1f2937;
    border-color: #374151;
    color: var(--muted-color);
  }

  .post-tags a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #111827;
  }

  .widget {
    background: #1f2937;
    border-color: #374151;
  }

  .widget-title {
    border-color: var(--accent-light);
  }

  .widget a {
    border-color: #374151;
  }

  .widget_search input[type="search"] {
    background: #111827;
    border-color: #374151;
    color: var(--text-color);
  }

  .widget_search input[type="search"]:focus {
    border-color: var(--accent);
  }

  .page-footer {
    background: #111827;
    border-color: #374151;
  }

  .footer-copyright {
    border-color: #374151;
  }

  .pagination a,
  .pagination span {
    background: #1f2937;
    border-color: #374151;
    color: var(--text-color);
  }

  .pagination a:hover {
    background: var(--accent-light);
    border-color: var(--accent);
  }

  .pagination .current {
    background: var(--accent);
    border-color: var(--accent);
  }

  .read-more a {
    border-color: var(--accent);
    color: var(--accent);
  }

  .read-more a:hover {
    background: var(--accent);
    color: #111827;
  }

  #top-bar,
  #main-nav {
    background: #111827;
    border-color: #374151;
  }

  .top-bar-socials a {
    background: #1f2937;
    color: var(--muted-color);
  }

  .top-bar-socials a:hover {
    background: var(--accent);
    color: #111827;
  }

  .video-wrapper {
    background: #000;
  }

  ::selection {
    background: var(--accent);
    color: #111827;
  }
}

/* Force dark mode class for manual toggle */
.dark-mode {
  --text-color: #e0e0e0;
  --heading-color: #f5f5f5;
  --muted-color: #9ca3af;
  --border-color: #374151;
  --background-color: #111827;
  --light-background: #1f2937;
  --accent: #d4a85a;
  --accent-hover: #e8c57a;
  --accent-light: #3d2f1a;
}

.dark-mode .post-card,
.dark-mode .post-footer,
.dark-mode .widget,
.dark-mode .page-footer,
.dark-mode #top-bar,
.dark-mode #main-nav,
.dark-mode .top-bar-socials a,
.dark-mode .video-wrapper,
.dark-mode .pagination a,
.dark-mode .pagination span,
.dark-mode .widget_search input[type="search"] {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: var(--text-color) !important;
}