/* snapSHOT Theme — Ghost Edition */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --snap-red: #d2232a;
  --art-black: #1a1a1a;
  --warm-gray-50: #fafaf9;
  --warm-gray-100: #f5f5f4;
  --neutral-400: #a3a3a3;
  --zinc-800: #27272a;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--warm-gray-100);
  color: var(--art-black);
  line-height: 1.5;
  font-weight: 400;
}

/* Background dot pattern */
main::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
}

/* Navigation */
#sticky-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--warm-gray-50);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.nav-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .nav-container {
    grid-template-columns: 1fr auto;
  }
}

/* Logo */
.logo-svg {
  min-width: 10rem;
  height: auto;
}

@media (max-width: 1024px) {
  .logo-svg {
    display: none;
  }
}

.logo-svg path {
  fill: var(--snap-red);
}

.logo-png {
  display: none;
  max-width: 10rem;
  height: auto;
}

@media (max-width: 1024px) {
  .logo-png {
    display: block;
  }
}

/* Search */
#search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#search-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: var(--art-black);
  stroke-width: 2;
}

#search-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
}

#search-modal.active {
  display: flex;
}

#search-modal.active {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#search-box {
  width: 100%;
  max-width: 42rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
  max-height: 40vh;
  display: flex;
  flex-direction: column;
}

#search-box .search-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  gap: 0.75rem;
}

#search-box .search-header svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: #9ca3af;
}

#search-input {
  flex: 1;
  font-size: 1rem;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
}

#search-input::placeholder {
  color: #d1d5db;
}

#search-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-link {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--art-black);
  text-transform: uppercase;
  font-size: 0.875rem;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.search-result-link:hover {
  background-color: #f3f4f6;
}

/* Category Navigation Bar */
.category-nav {
  display: none;
  grid-column: 1 / -1;
  justify-content: center;
  border-top: 2px solid var(--art-black);
  border-bottom: 2px solid var(--art-black);
  padding: 0.75rem 0;
}

@media (min-width: 1024px) {
  .category-nav {
    display: flex;
  }
}

.category-nav-item {
  list-style: none;
  margin: 0 1.25rem;
}

.category-nav-item a {
  text-decoration: none;
  color: var(--art-black);
  text-transform: uppercase;
  font-size: 1.25rem;
  font-weight: 600;
  transition: color 0.2s;
  display: block;
  padding: 0.75rem 0;
}

.category-nav-item a:hover {
  color: var(--snap-red);
}

.category-nav-item a.active {
  color: var(--snap-red);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2.5rem 0;
}

@media (max-width: 768px) {
  main {
    padding: 1.25rem;
  }
}

/* Page Header (for category/tag pages) */
.page-header {
  margin: 1.25rem 0 2.5rem;
  text-align: center;
}

.page-header h3 {
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--snap-red);
  font-weight: 700;
}

@media (min-width: 1024px) {
  .page-header h3 {
    font-size: 2.25rem;
  }
}

/* Post Grid */
.post-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  padding: 1.25rem 0 2.5rem;
  margin: 0;
}

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-left: 1.25rem;
    margin-right: 1.25rem;
  }
}

/* Post Card */
.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--zinc-800);
  border: 8px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
}

.post-card:hover {
  border-color: var(--snap-red);
}

.post-card a {
  text-decoration: none;
  color: inherit;
}

.post-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 65%;
  overflow: hidden;
}

.post-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-content {
  padding: 0.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .post-content {
    padding: 0.75rem;
  }
}

.post-content h2 {
  margin-top: 0.5rem;
  font-size: 1.25rem;
  color: white;
  font-weight: 600;
  line-height: 1.4;
}

.post-author {
  color: var(--neutral-400);
  font-size: 1.125rem;
  margin-top: auto;
}

/* Single Post */
article {
  max-width: 100%;
  padding: 1.25rem 0;
}

article .entry-header {
  margin-bottom: 1.25rem;
}

article .entry-category {
  text-transform: uppercase;
  font-size: 0.875rem;
  color: var(--snap-red);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

article .entry-title {
  margin: 0.75rem 0;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
}

@media (min-width: 1024px) {
  article .entry-title {
    font-size: 2.25rem;
  }
}

article .entry-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  font-size: 1rem;
}

article .entry-author {
  color: var(--snap-red);
  font-weight: 600;
  text-decoration: none;
}

article .entry-author:hover {
  text-decoration: underline;
}

article .entry-date {
  color: var(--art-black);
}

article .entry-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
}

article .entry-content {
  max-width: 100%;
  margin: 2rem 0;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.5;
}

@media (min-width: 1024px) {
  article .entry-content {
    max-width: 66.666%;
  }
}

article .entry-content p {
  margin-bottom: 1.5rem;
}

article .entry-content img {
  max-width: 100%;
  height: auto;
}

/* Tags */
.tags-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.tags-list li {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--snap-red);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.tags-list a {
  text-decoration: none;
  color: var(--art-black);
}

.tags-list a:hover {
  color: var(--snap-red);
}

/* Author */
.author-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 8px;
}

.author-avatar {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.author-info p {
  color: var(--neutral-400);
  font-size: 1rem;
}

.author-posts {
  columns: 1;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .author-posts {
    columns: 2;
  }
}

@media (min-width: 1024px) {
  .author-posts {
    columns: 3;
  }
}

.author-post-item {
  break-inside: avoid;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.author-post-item:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.author-post-item h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.author-post-item a {
  color: var(--snap-red);
  text-decoration: none;
}

.author-post-item a:hover {
  text-decoration: underline;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 3rem 0;
  font-size: 1rem;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
}

.pagination a {
  background: white;
  color: var(--snap-red);
  border: 1px solid var(--snap-red);
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--snap-red);
  color: white;
}

.pagination .page-number.current {
  background: var(--snap-red);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

/* Footer */
footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  margin-top: 3rem;
  border-top: 1px solid #e5e7eb;
}

footer p {
  font-size: 1rem;
  color: var(--art-black);
  text-align: center;
}

footer a {
  color: var(--art-black);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--snap-red);
}

/* Page */
.page-content {
  max-width: 800px;
  margin: 2rem auto;
}

.page-content h1 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

.page-content p {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Error Pages */
.error-container {
  max-width: 600px;
  margin: 4rem auto;
  text-align: center;
  padding: 2rem;
}

.error-container h1 {
  font-size: 3rem;
  color: var(--snap-red);
  margin-bottom: 1rem;
}

.error-container p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.error-container a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--snap-red);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: opacity 0.2s;
}

.error-container a:hover {
  opacity: 0.9;
}

/* Mobile Menu */
#menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 40;
}

#menu-overlay.active {
  display: block;
}

#side-menu {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  max-width: 300px;
  height: 100%;
  background: var(--warm-gray-50);
  padding: 1rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 41;
}

#menu-overlay.active #side-menu {
  transform: translateX(0);
}

.side-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.side-menu-close svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: var(--art-black);
}

/* Responsive Typography */
@media (max-width: 640px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  article .entry-content {
    font-size: 1rem;
  }
}

/* Koenig Editor Card Widths */
.kg-width-wide {
  width: 85vw;
  max-width: 1000px;
  margin: 1rem auto;
}

.kg-width-full {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
