/* ============================================
   NIKITAMORE.COM - OPTIMIZED V3
   Psychopath-level perfection
   ============================================ */

:root {
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 32px;
  --space-xl: 48px;
}

/* === FOUNDATION === */

.wp-site-blocks,
.site-content,
body > .wp-block-group {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-xl) 20px;
}

.wp-block-query,
.wp-block-post-template {
  display: block !important;
}

body {
  background: #f5f3ed;
  color: #2a2520;
}

/* === CARD CONTAINERS === */

article.post,
article.entry,
article[class*="post-"],
.wp-block-post,
.entry {
  background: #ffffff;
  border: 1px solid #d6d0c4;
  border-radius: 8px;
  padding: 16px 20px 20px 20px !important;
  margin-bottom: var(--space-xl);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 
              0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

article.post:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 
              0 8px 32px rgba(0, 0, 0, 0.08);
  border-color: #c9bfb0;
}

/* === CATEGORY ACCENT BARS === */

article[class*="category-"] {
  padding-left: 23px !important;
}

article.category-reads::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #5a614d;
  border-radius: 8px 0 0 8px;
}

article.category-music::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #c67d5f;
  border-radius: 8px 0 0 8px;
}

article.category-events::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #8b6f4a;
  border-radius: 8px 0 0 8px;
}

/* === TYPOGRAPHY === */

.entry-title,
.wp-block-post-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #2a2520 !important;
  margin-bottom: 24px;
  margin-top: 0;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.entry-title a {
  color: #2a2520 !important;
  text-decoration: none;
}

.entry-title a:hover {
  color: #5a614d !important;
}

.entry-content,
.wp-block-post-content {
  color: #2a2520;
  line-height: 1.65;
  font-size: 15px;
  font-weight: 400;
}

.entry-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #5a614d !important;
  margin-top: var(--space-lg) !important;
  margin-bottom: var(--space-sm) !important;
}

/* === VERTICAL RHYTHM === */

.entry-content > * + * {
  margin-top: var(--space-md) !important;
}

.entry-content p + p {
  margin-top: var(--space-sm) !important;
}

.entry-content > *:first-child {
  margin-top: 0 !important;
}

.entry-content > *:last-child {
  margin-bottom: 0 !important;
}

/* === LINKS === */

.entry-content a {
  color: #5a614d;
  text-decoration: none;
  border-bottom: 1px solid #5a614d;
  transition: all 0.2s ease;
}

.entry-content a:hover {
  color: #3d4436;
  border-bottom-color: #3d4436;
}

.entry-content a[href^="http"]::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.4;
  margin-left: 2px;
}

/* === LISTS === */

.entry-content ol {
  list-style: none;
  counter-reset: item;
  padding-left: 0;
  margin: var(--space-md) 0;
}

.entry-content ol li {
  counter-increment: item;
  position: relative;
  padding-left: 32px;
  margin-bottom: 20px;
}

.entry-content ol li::before {
  content: counter(item) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: #8b6f4a;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.6;
}

/* CRITICAL: Article links must be visually prominent */
.entry-content ol li a {
  font-weight: 700 !important;
  font-size: 17px !important;
  color: #1a1614 !important;
  border-bottom: 2px solid #8b6f4a !important;
  padding-bottom: 2px;
  display: inline;
  line-height: 1.6;
}

.entry-content ol li a:hover {
  color: #8b6f4a !important;
  border-bottom-color: #1a1614 !important;
}

.entry-content ul {
  padding-left: 24px;
  margin: var(--space-md) 0;
}

.entry-content li {
  line-height: 1.6;
}

/* === IMAGES === */

.entry-content img,
.wp-block-image img {
  border-radius: 8px;
  margin: var(--space-md) 0;
  max-width: 100%;
  height: auto;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Gallery - perfectly centered */
.wp-block-gallery {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: var(--space-md) auto !important;
  gap: 16px !important;
  max-width: fit-content !important;
}

.wp-block-gallery .wp-block-image {
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
}

/* === EMBEDS === */

.entry-content .wp-block-embed {
  margin: var(--space-lg) 0 !important;
}

.entry-content iframe {
  border-radius: 8px;
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

/* Spotify - ultra compact */
.entry-content iframe[src*="spotify"] {
  height: 80px !important;
  border-radius: 8px !important;
  margin: var(--space-md) 0 !important;
  width: 100%;
}

/* YouTube - controlled height */
.entry-content iframe[src*="youtube"],
.entry-content .wp-block-embed-youtube iframe {
  max-height: 320px !important;
  aspect-ratio: 16/9;
  width: 100%;
}

/* Posts with ONLY video embeds - tighter */
article.post:has(.entry-content > .wp-block-embed:only-child) iframe[src*="youtube"] {
  max-height: 280px !important;
}

/* === HORIZONTAL RULES === */

.entry-content hr {
  border: none;
  border-top: 1px solid #e8e4db;
  margin: var(--space-lg) 0;
}

/* === BUTTONS === */

.entry-content .wp-block-button__link {
  background: #8b6f4a !important;
  color: #ffffff !important;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  margin: var(--space-sm) 0;
  border: none !important;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.entry-content .wp-block-button__link:hover {
  background: #6f5a3a !important;
  transform: translateY(-1px);
}

/* === BLOCKQUOTES === */

.entry-content blockquote {
  border-left: 3px solid #8b6f4a;
  padding-left: 20px;
  margin: var(--space-md) 0;
  font-style: italic;
  color: #5a5045;
}

/* === METADATA === */

.entry-footer,
.entry-meta {
  margin-top: var(--space-md);
  padding-top: 16px;
  border-top: 1px solid #e8e4db;
  font-size: 12px;
  color: #7a7165;
}

.tags-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.tags-links a {
  color: #c67d5f !important;
  font-size: 12px;
  text-decoration: none;
  opacity: 0.7;
  border: none !important;
  padding: 0 !important;
}

.tags-links a::before {
  content: "#";
  opacity: 0.5;
}

.tags-links a:hover {
  opacity: 1;
}

/* === MOBILE === */

@media (max-width: 768px) {
  .wp-site-blocks {
    padding: var(--space-lg) 16px;
  }

  article.post {
    padding: 14px 16px 16px 16px !important;
    margin-bottom: var(--space-lg);
  }

  .entry-title {
    font-size: 20px !important;
  }

  .entry-content iframe[src*="youtube"] {
    max-height: 240px !important;
  }
}

@media (max-width: 480px) {
  article.post {
    padding: 12px 14px 14px 14px !important;
  }

  .entry-title {
    font-size: 19px !important;
  }
}

/* === CLEANUP === */

.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 100% !important;
}


/* ========================================
   GALLERY HORIZONTAL CAROUSEL
   ======================================== */
.wp-block-gallery.has-nested-images {
  justify-content: flex-start !important;
  align-items: flex-start !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  gap: 10px !important;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
  padding-bottom: 8px;
  padding-left: 0 !important;
  scroll-padding-left: 0;
}
.wp-block-gallery.has-nested-images .wp-block-image {
  flex: 0 0 70% !important;
  width: 70% !important;
  max-width: 70%;
  scroll-snap-align: start;
}
.wp-block-gallery.has-nested-images .wp-block-image img {
  height: 350px;
  width: 100% !important;
  max-width: none;
  object-fit: cover;
  border-radius: 4px;
}
.wp-block-gallery.has-nested-images::-webkit-scrollbar {
  height: 6px;
}
.wp-block-gallery.has-nested-images::-webkit-scrollbar-track {
  background: transparent;
}
.wp-block-gallery.has-nested-images::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}