/* ==========================================================================
   CSS Custom Properties & Base Styles
   ========================================================================== */

:root {
  /* Color Scheme - Light Mode */
  --bg-primary: #f9f9f9;
  --bg-secondary: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #eeeeee;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --accent-color: #000000;
  --accent-hover: #333333;
  --inline-code-bg: #f0f0f0;
  --inline-code-border: #e0e0e0;
  /* Component variables (unified) */
  --tag-bg: rgba(0, 0, 0, 0.05);
  --tag-text: var(--text-secondary);
  --card-bg: var(--bg-secondary);
  --hover-bg: rgba(0, 0, 0, 0.02toc);
  --active-bg: rgba(0, 0, 0, 0.05);
  --border-radius: 0.5rem;

  /* Layout */
  --header-height: 6.25rem;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #f0f0f0;
  --text-secondary: #d0d0d0;
  --border-color: #444444;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  --accent-color: #7ea8ff;
  --accent-hover: #9bbaff;
  --inline-code-bg: #2d2d2d;
  --inline-code-border: #444444;

  --tag-bg: rgba(255, 255, 255, 0.1);
  --tag-text: var(--text-secondary);
  --hover-bg: rgba(255, 255, 255, 0.05);
  --active-bg: rgba(255, 255, 255, 0.08);
}

/* --- Global Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  padding: 1.25rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.main-container {
  display: block;
  max-width: 100rem;
  margin: 0 auto;
  flex: 1;
  width: 100%;
  position: relative;
  min-height: 60vh;
}

/* ==========================================================================
   Typography & Links (unified)
   ========================================================================== */

a,
.category-link,
.post-link,
.archive-link,
.nav-bar-link,
.footer-link,
.nav-link,
.pagination-link,
.social-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover,
.category-link:hover,
.post-link:hover,
.archive-link:hover,
.nav-bar-link:hover,
.footer-link:hover,
.nav-link:hover,
.pagination-link:hover,
.social-link:hover {
  color: var(--accent-color);
}

a:focus,
.category-link:focus,
.post-link:focus,
.archive-link:focus,
.nav-bar-link:focus,
.footer-link:focus,
.nav-link:focus,
.pagination-link:focus,
.social-link:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.nav-bar-link,
.footer-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
}

.nav-bar-link:hover,
.footer-link:hover {
  background-color: var(--hover-bg);
}

.nav-bar-link.active,
.footer-link.active {
  color: var(--accent-color);
  font-weight: 500;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

.content {
  width: 100%;
  max-width: 85ch;
  margin: 0 auto;
  background: var(--bg-secondary);
  padding: 3rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: background-color 0.3s ease;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  text-align: center;
  padding: 1.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2.5rem;
}
.header-container {
  max-width: 100rem;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.site-title {
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
}
.site-title a {
    text-decoration: none;
    color: inherit;
}
.site-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.25rem;
}
.nav-bar {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.9375rem;
}
.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.625rem;
  border-radius: 50%;
  transition: background-color 0.2s;
  min-width: 44px;
  min-height: 44px;
}
.theme-toggle:hover {
  background-color: var(--hover-bg);
}

/* ==========================================================================
   Unified Card Component
   ========================================================================== */

.card,
.post-preview,
.archive-post,
.note-item,
.post-item,
.faq-item,
.contact-method {
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  transition:
    background-color 0.2s,
    transform 0.2s;
}
.card:hover,
.post-preview:hover,
.archive-post:hover,
.note-item:hover,
.post-item:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
}

.posts-list,
.archive-posts,
.notes-continuous {
  display: flex;
  flex-direction: column;
  gap: 1.875rem;
}

/* ==========================================================================
   Unified Meta & Date Styles
   ========================================================================== */

.item-meta,
.post-preview-meta,
.note-item-meta,
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.9375rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.9375rem;
}

.item-date,
.post-date,
.archive-date,
.note-item-date {
  font-style: italic;
}

/* ==========================================================================
   Unified Excerpt
   ========================================================================== */

.item-excerpt,
.post-excerpt,
.post-preview-excerpt,
.archive-excerpt {
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0.75rem 0 1rem;
}

/* ==========================================================================
   Unified Tags
   ========================================================================== */

.tag,
.note-tag,
.post-tags .tag,
.archive-tags .tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.tag:hover,
.note-tag:hover,
.post-tags .tag:hover,
.archive-tags .tag:hover {
  background: var(--accent-color);
  color: var(--bg-secondary);
  transform: translateY(-1px);
}

.archive-tags {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   Page Headers (unified)
   ========================================================================== */

.page-header,
.archive-header,
.category-header,
.notes-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.page-title,
.category-title,
.notes-header .page-title {
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.page-subtitle,
.notes-header .page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.category-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Section Title
   ========================================================================== */

.section-title {
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1.875rem;
  text-align: center;
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  width: 3.125rem;
  height: 0.1875rem;
  background: var(--accent-color);
  margin: 0.9375rem auto 0;
  border-radius: 0.125rem;
}

/* ==========================================================================
   Post Footer (categories/tags)
   ========================================================================== */

.post-footer {
  margin-top: 3.125rem;
  padding-top: 1.875rem;
  border-top: 1px solid var(--border-color);
}

.post-categories-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.875rem;
  margin-top: 1.875rem;
  padding-top: 1.875rem;
  border-top: 1px solid var(--border-color);
}

.post-categories,
.post-tags {
  flex: 1;
  min-width: 12.5rem;
}

.category-link {
  display: inline-block;
  background: var(--accent-color);
  color: var(--bg-secondary);
  padding: 0.375rem 1rem;
  border-radius: 1.25rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.category-link:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* ==========================================================================
   Categories Grid
   ========================================================================== */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  gap: 1.875rem;
  margin-bottom: 3.75rem;
}

.category-card {
  background: var(--bg-primary);
  padding: 1.875rem;
  border-radius: var(--border-radius);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border: 1px solid var(--border-color);
}
.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.category-title {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.9375rem;
}
.category-description {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Archive Year Details (toggle)
   ========================================================================== */

.archive-year {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

details > summary {
  cursor: pointer;
}

.archive-year-summary {
  padding: 1.25rem 1.5rem;
  background: var(--card-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  transition: background-color 0.2s;
}
.archive-year-summary:hover {
  background: var(--hover-bg);
}
.archive-year-summary::-webkit-details-marker {
  display: none;
}

.archive-year-title {
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.post-count {
  font-size: 0.9rem;
  font-weight: normal;
  color: var(--text-secondary);
}
.toggle-icon {
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}
.archive-year[open] .toggle-icon {
  transform: rotate(45deg);
}
.archive-year[open] .archive-year-summary {
  border-bottom: 1px solid var(--border-color);
  background: var(--hover-bg);
}
.archive-posts {
  padding: 1.5rem;
  background: var(--bg-primary);
}

/* ==========================================================================
   Inline TOC & Index
   ========================================================================== */

.inline-toc {
  margin: 2rem 0 3rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  overflow: hidden;
  max-width: 70ch;           
  margin-left: auto;         
  margin-right: auto;        
}
.inline-toc:hover {
  border-color: var(--accent-color);
}
.toc-summary {
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
}
.toc-summary:hover {
  background: var(--hover-bg);
}
.toc-summary::-webkit-details-marker {
  display: none;
}
.inline-toc h2 {
  font-size: 1.5rem;
  margin: 0;
}
.toc-toggle {
  font-size: 1.3rem;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}
.inline-toc[open] .toc-toggle {
  transform: rotate(0deg);
}
.toc-content {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border-color);
}
.toc-list {
  list-style: none;
  padding-left: 0;
}
.toc-list ul {
  padding-left: 1.5rem;
}
.toc-link {
  display: block;
  padding: 0.375rem 0.5rem 0.375rem 1rem;
  color: var(--accent-color);
  border-left: 2px solid transparent;
  border-radius: 4px;
}
.toc-link:hover {
  background: var(--hover-bg);
  border-left-color: var(--accent-color);
  padding-left: 1.25rem;
}

.inline-index {
  margin: 3rem 0 2rem;
  padding: 2rem;
  border-top: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  max-width: 70ch;         
  margin-left: auto;         
  margin-right: auto;        
}
.inline-index h2 {
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* ==========================================================================
   Context Box
   ========================================================================== */

.context-box {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Note Content Formatting (for notas-index page)
   ========================================================================== */

.note-item-content {
  line-height: 1.7;
  margin: 1.5rem 0;
}
.note-item-content p {
  margin-bottom: 1.5rem;
}
.note-item-content h2,
.note-item-content h3,
.note-item-content h4,
.note-item-content h5,
.note-item-content h6 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}
.note-item-content h2 {
  font-size: 1.6rem;
}
.note-item-content h3 {
  font-size: 1.4rem;
}
.note-item-content h4 {
  font-size: 1.2rem;
}
.note-item-content ul,
.note-item-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.note-item-content li {
  margin-bottom: 0.5rem;
}
.note-item-content blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--accent-color);
  background: var(--hover-bg);
  font-style: italic;
}
.note-item-content code {
  font-family: monospace;
  background: var(--tag-bg);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
}
.note-item-content pre {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 0.375rem;
  overflow-x: auto;
}
.note-item-content :last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Enhanced Reading Experience for Posts
   ========================================================================== */

.post-content {
  max-width: 70ch;
  margin: 0 auto;
  font-size: 1.15rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  font-weight: 400;
  color: var(--text-primary);
}
.post-content p {
  margin-bottom: 1.5em;
}
.post-content a {
  color: var(--accent-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 0.2s;
}
.post-content a:hover {
  text-decoration-thickness: 2px;
}
.post-content h2 {
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.post-content h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.post-content h4 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.post-content ul,
.post-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.75rem;
}
.post-content li {
  margin-bottom: 0.5rem;
}
.post-content code {
  background: var(--inline-code-bg);
  border: 1px solid var(--inline-code-border);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}
.post-content pre {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.75rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.post-content blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--accent-color);
  background: var(--hover-bg);
  font-style: normal;
}
.post-content blockquote p:last-child {
  margin-bottom: 0;
}
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.table-wrapper {
  overflow-x: auto;
  margin: 1.75rem 0;
}
.table-wrapper table {
  margin: 0;
}
.post-content th,
.post-content td {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: left;
}
.post-content th {
  background: var(--hover-bg);
  font-weight: 600;
}
.post-content hr {
  margin: 2rem 0;
  border: none;
  height: 1px;
  background: var(--border-color);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.875rem;
  border-top: 1px solid var(--border-color);
}
.pagination-link {
  padding: 0.625rem 1.25rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}
.pagination-link:hover {
  background-color: var(--hover-bg);
  border-color: var(--accent-color);
}
.pagination-current {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 3.75rem;
  padding: 2.5rem 0 1.25rem;
}
.footer-container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr));
  gap: 2.5rem;
  margin-bottom: 1.875rem;
}
.footer-title {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.9375rem;
}
.social-links {
  display: flex;
  gap: 0.9375rem;
}
.social-link {
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 50%;
}
.social-link:hover {
  background-color: var(--hover-bg);
}
.footer-bottom {
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */

.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--accent-color);
  color: var(--bg-secondary);
  border: none;
  border-radius: 50%;
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.mobile-menu-toggle:hover {
  background: var(--accent-hover);
}
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-secondary);
  z-index: 999;
  padding: 1.25rem;
  overflow-y: auto;
}
.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.mobile-nav-title {
  font-size: 1.5rem;
  margin: 0;
}
.close-mobile-nav {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}
.mobile-nav-links {
  list-style: none;
  padding: 0;
}
.mobile-nav-links li {
  margin-bottom: 0.75rem;
}
.mobile-nav-links a {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
}
.mobile-nav-links a:hover,
.mobile-nav-links a.active {
  background: var(--accent-color);
  color: var(--bg-secondary);
}

/* ==========================================================================
   Responsive Design (unified)
   ========================================================================== */

@media (max-width: 48rem) {
  body {
    padding: 0.75rem;
  }
  .site-header {
    padding: 1rem;
  }
  .site-title {
    font-size: 2rem;
  }
  .content {
    padding: 1.5rem;
    max-width: 100%;
    border-radius: 0;
  }
  .nav-bar {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-nav.active {
    display: block;
  }
  .theme-toggle {
    position: fixed !important;
    bottom: 5rem;
    right: 1.25rem;
    top: auto !important;
    background: var(--bg-secondary);
    box-shadow: var(--shadow);
    z-index: 99;
    width: 3rem;
    height: 3rem;
  }
  .section-title {
    font-size: 1.7rem;
  }
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .post-categories-tags {
    flex-direction: column;
    gap: 1.25rem;
  }
  .archive-post {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .archive-date {
    min-width: auto;
  }
  .archive-post-title {
    margin: 0;
  }
  .inline-toc,
  .inline-index {
    margin: 1.5rem 0;
    padding: 1rem;
  }
  .toc-summary {
    padding: 1rem;
  }
  .inline-toc h2,
  .inline-index h2 {
    font-size: 1.3rem;
  }
  .notes-continuous {
    gap: 2rem;
  }
  .note-item-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .note-permalink {
    align-self: flex-end;
  }
  /* Reading experience on mobile */
  .post-content {
    font-size: 1rem;
    line-height: 1.65;
  }
  .post-content h2 {
    font-size: 1.6rem;
  }
  .post-content h3 {
    font-size: 1.4rem;
  }
  .post-content pre,
  .post-content table {
    font-size: 0.85rem;
  }
  .post-content blockquote {
    padding: 0.75rem 1rem;
  }
  .note-item-content {
    font-size: 1rem;
    line-height: 1.65;
  }
  /* Math & code */
  .post-content pre,
  .post-content code,
  .note-item-content pre,
  .note-item-content code {
    max-width: 100%;
    overflow-x: auto;
  }
  .post-content h2 { font-weight: 700; }
  .post-content h3 { font-weight: 600; }
  .post-content h4 { font-weight: 600; }
  mjx-container {
    display: inline-grid !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }
  mjx-container[jax="CHTML"][display="true"] {
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
  }
}

@media (min-width: 48.0625rem) {
  .nav-bar {
    display: flex;
  }
}

@media (min-width: 1200px) {
  .post-content {
    max-width: 70ch;
  }
}

/* ==========================================================================
   Print & Reduced Motion
   ========================================================================== */

@media print {
  .site-footer,
  .mobile-menu-toggle,
  .theme-toggle,
  .notes-back-to-top {
    display: none !important;
  }
  .note-item {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Utility
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -2.5rem;
  left: 0.375rem;
  background: var(--bg-secondary);
  color: var(--accent-color);
  padding: 0.5rem;
  border-radius: 0.25rem;
  z-index: 1000;
}
.skip-link:focus {
  top: 0.375rem;
}
