/*
Theme Name: Obsidian Noir
Author: @bruuhim
Description: Premium dark anime fansub theme - Production Ready
Version: 1.0.26
Text Domain: obsidian-noir
*/

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=Zain:wght@400;700&display=swap");

:root {
  --bg-main: #0a0a0a;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --bg-input: #1f1f1f;

  --accent: #e6c9a8;
  --accent-hover: #f2e3d0;
  --accent-dim: #c4a484;
  --accent-glow: rgba(230, 201, 168, 0.3);
  --accent-subtle: rgba(230, 201, 168, 0.1);

  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-muted: #718096;

  --glass-bg: rgba(10, 10, 10, 0.92);
  --glass-border: rgba(255, 255, 255, 0.1);

  --font-primary: "Inter", sans-serif;
  --font-display: "Outfit", sans-serif;
  --font-arabic: "Zain", sans-serif;

  --container-max: 1400px;
  --gap: 32px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-card);
}

html::-webkit-scrollbar {
  width: 8px;
}
html::-webkit-scrollbar-track {
  background: var(--bg-card);
}
html::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: var(--radius-pill);
}

body {
  font-family: var(--font-primary);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[dir="rtl"] body {
  font-family: var(--font-arabic), var(--font-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 95%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Override for Full Width */
/* Header Override for Full Width */
.site-header .container {
  max-width: 100%;
  width: 100%;
  padding: 0 60px; /* Increased from 20px for better spacing */
}

.container-wide {
  width: 95%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  flex: 1;
}

/* ============================================
   3-COLUMN GRID
   ============================================ */
.releases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  direction: ltr; /* Forced LTR to ensure new EP appears on left */
}

/* Ensure card content remains readable/ltr if needed, or keep rtl for Arabic title */
.release-card {
  direction: ltr;
  text-align: right;
}

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

@media (min-width: 1024px) {
  .releases-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
  }
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 14px 0;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.logo-accent {
  color: var(--accent);
}

.main-nav {
  margin-left: auto;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 6px;
}

.main-nav a {
  display: block;
  padding: 10px 18px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.main-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
  .main-nav {
    display: block !important;
  }
}

@media (max-width: 767px) {
  .header-controls {
    display: none !important;
  }
  .header-content {
    justify-content: center;
  }
}

@media (max-width: 767px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 16px;
  }
  .main-nav.active {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.search-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-toggle svg {
  stroke: #ffffff !important;
  stroke-width: 3px !important; /* Thicker for visibility */
  width: 26px !important;
  height: 26px !important;
  display: block !important;
}

/* ============================================
   FOOTER (Glassmorphic & Premium)
   ============================================ */
.site-footer {
  padding: 60px 0 40px;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 1) 0%,
    rgba(10, 10, 10, 0.5) 100%
  );
  border-top: 2px solid transparent;
  border-image: linear-gradient(
      to right,
      transparent,
      var(--accent),
      transparent
    )
    1;
  margin-top: 100px;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 100%);
  opacity: 0.3;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-info p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.social-links {
  display: flex;
  gap: 25px;
}

.social-links a {
  color: var(--text-muted);
  font-size: 1.3rem;
  transition: all 0.3s var(--ease-out);
}

.social-links a:hover {
  color: var(--accent);
  transform: translateY(-5px);
  text-shadow: 0 0 15px var(--accent-glow);
}

.footer-attribution {
  font-size: 0.9rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.footer-attribution a {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 992px) {
  .footer-wrap {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }
}

/* ============================================
   SPOILER TAG
   ============================================ */
.spoiler {
  background: var(--text-primary);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 0 4px;
  cursor: pointer;
  filter: blur(5px);
  transition: all 0.3s ease;
  user-select: none;
}

.spoiler:hover {
  filter: blur(3px);
}

.spoiler.revealed {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  filter: none;
  user-select: text;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 10, 10, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease-out);
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay-content {
  width: 95%;
  max-width: 650px;
  padding: 20px;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-out);
}

.search-overlay.active .search-overlay-content {
  transform: scale(1);
}

.search-overlay-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s;
}

.search-overlay-close:hover {
  background: var(--accent);
  color: var(--bg-main);
}

.search-overlay-close svg {
  width: 22px;
  height: 22px;
}

.search-overlay-input {
  width: 100%;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  font-size: 1.15rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-overlay-input:focus {
  border-color: var(--accent);
}

.search-overlay-input::placeholder {
  color: var(--text-muted);
}

.search-overlay-results {
  margin-top: 20px;
  max-height: 50vh;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  color: var(--text-primary);
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--bg-elevated);
}

.search-result-thumb {
  width: 90px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.search-result-title {
  font-weight: 500;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.1) 0%,
    rgba(10, 10, 10, 0.4) 50%,
    rgba(10, 10, 10, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 20px;
  max-width: 800px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  /* Fix long titles */
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 90vw;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.hero-indicators {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
}

.hero-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.hero-indicator.active {
  background: var(--accent);
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 36px;
  text-align: center;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: var(--radius-pill);
}

.latest-releases {
  padding: 60px 0 100px; /* Added large bottom padding to prevent eating footer */
}

/* ============================================
   CARDS
   ============================================ */
.release-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.4s var(--ease-out);
}

.release-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.release-card:hover {
  transform: translateY(-10px) scale(1.02) !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border-color: var(--accent);
}

.card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: all 0.5s var(--ease-out);
}

.release-card:hover .card-image img {
  transform: scale(1.08);
  filter: brightness(1.15);
}

.card-content {
  padding: 18px 20px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.card-title a {
  color: var(--text-primary);
}

.card-title a:hover {
  color: var(--accent);
}

/* ============================================
   LOAD MORE - FIXED SPACING
   ============================================ */
.load-more-container {
  text-align: center;
  margin-top: 40px; /* 40px from cards */
  margin-bottom: 60px; /* 60px to footer */
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.load-more-btn:hover {
  background: var(--accent);
  color: var(--bg-main);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.load-more-btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.load-more-btn.loading .spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   SINGLE PAGE
   ============================================ */
.single-post-container {
  padding: 40px 0;
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 28px;
  text-align: center;
}

.post-featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
}

.post-featured-image img {
  width: 100%;
}

.downloads-container,
.comments-wrapper,
.related-episodes {
  width: 95%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}

.downloads-container {
  margin-bottom: 40px;
}

/* ============================================
   CREDITS
   ============================================ */
.credits-section {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  direction: rtl;
  text-align: right;
}

.credit-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
}

.credit-line:last-child {
  border-bottom: none;
}

.credit-role {
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.credit-role i {
  color: var(--accent);
  font-size: 1.1rem;
}

.credit-name {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ============================================
   DOWNLOAD BUTTONS
   ============================================ */
.download-section {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
}

.download-section h2 {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  margin-bottom: 10px;
  direction: rtl;
}

.download-subtitle {
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  direction: rtl;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.download-btn,
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
}

.download-btn:hover,
.btn-pill:hover {
  background: var(--accent);
  color: var(--bg-main);
}

.btn-pill.btn-filled {
  background: var(--accent);
  color: var(--bg-main);
}

/* Specific button colors (Moved below to prevent override) */

/* ============================================
   SHOW/HIDE COMMENTS TOGGLE - REMOVED (Static Site)
   ============================================ */

/* ============================================
   MOBILE BOTTOM NAV (App-like UX)
   ============================================ */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--glass-border);
  display: none;
  justify-content: space-around;
  align-items: center;
  z-index: 10000;
  padding: 0 10px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  gap: 4px;
  transition: all 0.3s;
}

.bottom-nav-item i {
  font-size: 1.2rem;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item:hover {
  color: var(--accent-hover);
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: 65px; /* Offset for nav */
  }
}

/* ============================================
   ANIMATIONS & GLOW
   ============================================ */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(230, 201, 168, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(230, 201, 168, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(230, 201, 168, 0);
  }
}

.modal-submit,
.btn-pill.btn-filled {
  animation: pulse-glow 3s infinite;
}

/* Social links hover animation handled by JS */

/* Arabic Typography */
[lang="ar"],
.download-section h2,
.download-subtitle,
.btn-subs {
  font-family: "Cairo", "Zain", sans-serif !important;
}

/* Gold Glow Download Button */
.download-btn {
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(230, 201, 168, 0.1);
  transition: all 0.3s ease;
}

/* Specific Colors - Placed after generic to override border-color */
.btn-ddl {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ddl-alt {
  border-color: var(--accent-dim);
  color: var(--accent-dim);
}
.btn-watch-ddl {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-watch-ddl-alt {
  border-color: var(--accent-dim);
  color: var(--accent-dim);
}
.btn-telegram {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.btn-subs {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* HOVER STATES - Black text for visibility */
.btn-ddl:hover,
.btn-watch-ddl:hover,
.btn-telegram:hover,
.btn-subs:hover {
  background: var(--accent) !important;
  color: #000 !important;
}

.btn-ddl-alt:hover,
.btn-watch-ddl-alt:hover {
  background: var(--accent-dim) !important;
  color: #000 !important;
}

/* Ensure no green/purple leaks */
.btn-watch-ddl,
.btn-watch-ddl-alt,
.btn-telegram,
.btn-subs {
  background: transparent;
}

.download-btn:hover {
  box-shadow: 0 0 20px rgba(230, 201, 168, 0.3);
  transform: translateY(-2px);
}

/* Spoiler Styling */
.spoiler {
  background: rgba(255, 255, 255, 0.1);
  color: transparent;
  filter: blur(4px);
  padding: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.spoiler:hover {
  background: rgba(255, 255, 255, 0.15);
}

.spoiler.revealed {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  filter: blur(0);
  user-select: text;
}

/* Custom Notifications (Toasts) */
.obsidian-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.obsidian-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.obsidian-toast.success { border-left: 3px solid #4ade80; }
.obsidian-toast.error { border-left: 3px solid #ef4444; }
.obsidian-toast.info { border-left: 3px solid var(--gold-primary); }

.obsidian-toast i {
  font-size: 1.2rem;
}

.obsidian-toast.success i { color: #4ade80; }
.obsidian-toast.error i { color: #ef4444; }
.obsidian-toast.info i { color: var(--gold-primary); }

.obsidian-toast-content {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.4;
}

.obsidian-toast.fade-out {
  opacity: 0;
  transform: translateX(30px);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
  .obsidian-toast-container {
    top: auto;
    bottom: 90px;
    left: 20px;
    right: 20px;
  }
  .obsidian-toast {
    min-width: 0;
    width: 100%;
  }
}


/* ============================================
   RELATED EPISODES
   ============================================ */
.related-episodes {
  margin-top: 10px; /* Brighter connection to comments */
  padding-top: 40px;
  margin-bottom: 80px; /* Space out from footer */
  border-top: 1px solid var(--glass-border);
}

.related-episodes > h2 {
  font-size: 1.4rem;
  margin-bottom: 28px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (max-width: 767px) {
  #back-to-top {
    display: none !important;
  }

  .related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 20px !important; /* Final edge spacing fix */
  }
}

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

.related-card {
  position: relative;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.4s var(--ease-out);
  color: var(--text-primary);
}

.related-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px) !important;
}

.related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-card-title {
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  white-space: normal;
  overflow: visible;
  line-height: 1.4;
  min-height: 60px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--glass-border);
  padding: 36px 0;
  text-align: center;
  margin-top: auto;
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent);
  color: var(--bg-main);
}

/* ============================================
   ERROR PAGE
   ============================================ */
.error-404 {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-404-number {
  font-family: var(--font-display);
  font-size: clamp(8rem, 25vw, 14rem);
  font-weight: 700;
  color: var(--accent);
  opacity: 0.15;
}

/* ============================================
   SKELETON
   ============================================ */
.skeleton {
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.04),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

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


/* ============================================
   ANIMATION CLASSES
   ============================================ */
.gsap-reveal {
  opacity: 0;
  transform: translateY(30px);
}

.split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
}
