/* ===============================
   Eden's Blog Styles (Refactored)
   =============================== */

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

html {
  scroll-behavior: smooth;
}

:root {
  /* layout */
  --container-max: 1200px;
  --container-pad-x: 1rem;
  --center-strip: calc(var(--container-max) + (2 * var(--container-pad-x)));

  /* pattern */
  --tile-size: 75px;
  --pattern-opacity: 0.5;

  /* colors */
  --ink: #4f4f4f;
  --link: #8a2be2;
  --link-hover: #d946ef;
  --bg-main: #faf5ff;
  --bg-gradient-1: rgba(216, 180, 254, 0.15);
  --bg-gradient-2: rgba(249, 168, 212, 0.12);
}

/* --- Body background --- */
body {
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  background: radial-gradient(
      1000px 600px at 10% 10%,
      var(--bg-gradient-1),
      transparent 60%
    ),
    radial-gradient(
      800px 400px at 90% 30%,
      var(--bg-gradient-2),
      transparent 60%
    ),
    var(--bg-main);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* --- Pattern overlay (gutters only) --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('../images/cutcube.png');
  background-repeat: repeat;
  background-size: var(--tile-size);
  opacity: var(--pattern-opacity);
}

@supports (mask-image: linear-gradient(black, black)) or
  (-webkit-mask-image: linear-gradient(black, black)) {
  body::before {
    mask-image: linear-gradient(
      to right,
      black 0,
      black calc(50% - (var(--center-strip) / 2)),
      transparent calc(50% - (var(--center-strip) / 2)),
      transparent calc(50% + (var(--center-strip) / 2)),
      black calc(50% + (var(--center-strip) / 2)),
      black 100%
    );
    -webkit-mask-image: linear-gradient(
      to right,
      black 0,
      black calc(50% - (var(--center-strip) / 2)),
      transparent calc(50% - (var(--center-strip) / 2)),
      transparent calc(50% + (var(--center-strip) / 2)),
      black calc(50% + (var(--center-strip) / 2)),
      black 100%
    );
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
  }
}

/* --- Layout container --- */
.container {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem var(--container-pad-x);
  flex: 1;
  text-align: center;
}

/* --- Reusable utilities --- */
.gradient-heading {
  background: linear-gradient(135deg, #9d4edd 0%, #d946ef 45%, #4f46e5 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.18);
}

a {
  text-decoration: none;
  transition: color 0.25s ease;
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

/* --- Header --- */
header {
  margin-bottom: 2.5rem;
}

#site-title {
  font-size: clamp(2.3rem, 6vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

/* --- Nav --- */
.nav-bar {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0 2rem;
  padding: 0;
}

.nav-bar a {
  font-weight: 600;
  color: var(--ink);
  position: relative;
}

.nav-bar a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--link);
  transition: width 0.3s ease;
}

.nav-bar a:hover::after {
  width: 100%;
}

/* --- Cat Slideshow --- */
#cat-slideshow {
  margin: 3rem 0;
}

.slideshow {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(35, 16, 56, 0.15);
}

.slides {
  display: flex;
  transition: transform 0.4s ease;
}

.slides img {
  width: 100%;
  flex-shrink: 0;
  max-width: 600px;
  max-height: 700px;
  object-fit: cover;
  border-radius: 12px;
}

/* Slide buttons */
.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.7);
  border: none;
  font-size: 1.75rem;
  padding: 0.45em 0.6em;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 2;
}

.slide-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.prev {
  left: 10px;
}
.next {
  right: 10px;
}

/* --- Intro --- */
.intro {
  margin-bottom: 3rem;
}

.intro p {
  font-size: 1.1rem;
  color: #4a4a55;
  max-width: 60ch;
  margin: 0 auto;
}

/* --- Latest posts --- */
#latest-posts {
  margin-bottom: 3rem;
}

#latest-posts h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

#latest-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#latest-posts li {
  background: #ffffffcc;
  border: 1px solid #d3b8ef;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 6px auto;
  box-shadow: 0 4px 10px rgba(35, 16, 56, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 450px;
  min-width: 240px;
}

#latest-posts li:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(35, 16, 56, 0.12);
}

/* --- Footer --- */
footer {
  font-size: 0.9rem;
  padding: 1.5rem;
  text-align: center;
  background: #f0e4ff;
  border-top: 2px solid #d3b8ef;
  color: var(--ink);
  font-family: 'Fira Code', monospace;
}

footer a {
  color: var(--link);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .nav-bar {
    flex-direction: column;
    gap: 0.8rem;
  }

  .blog-post {
    padding: 1.5rem;
  }
}

/* --- Blog Post --- */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: left;
  line-height: 1.7;
  color: var(--ink);
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.blog-post h1,
.blog-post h2,
.blog-post h3 {
  margin: 1.5rem 0 1rem;
  font-weight: 700;
}

.blog-post h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
}

.blog-post h2 {
  font-size: clamp(1.6rem, 4vw, 2rem);
}

.blog-post h3 {
  font-size: clamp(1.3rem, 3.5vw, 1.6rem);
}

.blog-post h1,
.blog-post h2 {
  background: linear-gradient(135deg, #9d4edd 0%, #d946ef 45%, #4f46e5 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.15);
}

.blog-post p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  max-width: 65ch;
  margin-inline: auto;
  text-indent: 0;
  margin-left: 0;
  margin-right: 0;
}

.blog-post code {
  font-family: 'Fira Code', monospace;
  background: #f0e4ff;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.blog-post pre {
  background: #f0e4ff;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  margin: 1.5rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.no-dot {
  list-style: none;
}

.inside-dot {
  list-style: inside;
}

/* EXTRA */

#tewhare {
  max-width: 600px;
}
