/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps.
 * You can still include application-wide styles in this file, but keep in mind
 * that CSS precedence will follow the standard cascading order, meaning styles
 * declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ======================================== */
/* 1) IMPORTS & ROOT VARIABLES             */
/* ======================================== */

/* Import Bulma */
@import "https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css";

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:ital,wght@0,100..900;1,100..900&display=swap');

/* Root font variables */
:root {
  --bulma-family-primary: "Lexend Mega", sans-serif;
  --bulma-family-secondary: "Public Sans", sans-serif;
}

/* ======================================== */
/* 2) GLITCH ANIMATIONS                    */
/* ======================================== */

@keyframes glitch-fade-out {
  0% {
    filter: url(#glitch-effect);
    opacity: 1;
  }
  100% {
    filter: none;
    opacity: 1;
  }
}

@keyframes glitch-animation {
  0% {
    filter: url(#glitch-effect-1);
  }
  33% {
    filter: url(#glitch-effect-2);
  }
  66% {
    filter: url(#glitch-effect-3);
  }
  100% {
    filter: url(#glitch-effect-1);
  }
}

/* Apply glitch hover to h1.glitch and .post-card if desired */
h1.glitch:hover,
.post-card:hover {
  animation: glitch-animation 0.5s infinite steps(2, jump-none);
}

/* ======================================== */
/* 3) ILLUSTRATIONS                        */
/* ======================================== */

.illustration {
  max-width: 40%;
  height: auto;
  float: right;
  margin: 10px 0 10px 20px;
  border: 3px solid black;
  box-shadow: 6px 6px 0px black;
}

.illustration:nth-of-type(odd) {
  float: left;
  margin: 10px 20px 10px 0;
}

/* MOBILE: make illustrations full-width */
@media (max-width: 768px) {
  .illustration {
    float: none;
    display: block;
    max-width: 100%;
    margin: 20px auto;
  }
}

/* ======================================== */
/* 4) RICH TEXT (BLOG CONTENT)             */
/* ======================================== */

.rich-text {
  font-family: var(--bulma-family-secondary, "Public Sans", sans-serif);
  font-size: 1.2rem;
  line-height: 1.8;
  color: #333;
  padding: 20px;
}

.rich-text p {
  margin-bottom: 20px;
}

.rich-text h1,
.rich-text h2,
.rich-text h3 {
  font-weight: bold;
  margin: 20px 0 10px;
}

.rich-text blockquote {
  font-style: italic;
  border-left: 5px solid #00FF66;
  padding-left: 15px;
  margin: 20px 0;
  color: #555;
}

.rich-text ul {
  padding-left: 20px;
  list-style: disc;
}

.rich-text ol {
  padding-left: 20px;
  list-style: decimal;
}

.rich-text li {
  margin-bottom: 8px;
}

.rich-text a {
  color: #00FF66;
  text-decoration: underline;
}

.rich-text a:hover {
  color: #00CC55;
}

.rich-text strong {
  font-weight: bold;
}

.rich-text em {
  font-style: italic;
}

.rich-text pre {
  background: #191919;
  color: white;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
}

/* ======================================== */
/* 5) POST-CALLOUT (HIGHLIGHTED BOX)       */
/* ======================================== */

.post-callout {
  background: #ff007f;
  color: #191919;
  padding: 20px;
  font-size: 1.2em;
  font-weight: bold;
  border: 2px solid black;
  box-shadow: 6px 6px 0px black;
  margin: 30px 0;
}

/* ======================================== */
/* 6) DESKTOP GRID LAYOUT                  */
/* ======================================== */

.post-grid {
  /* For desktop/tablet: a responsive grid of cards */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 1200px; /* Limit overall width */
  margin: 0 auto;    /* Center the grid container */
  justify-items: center;
}

.post-grid p {
  color: #FF00FF; 
}

/* Desktop .post-card: uniform 400px height. */
@media (min-width: 769px) {
  .post-card {
    width: 100%;
    max-width: 400px;
    height: 400px; /* All cards uniform at desktop */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border: 3px solid black;
    box-shadow: 6px 6px 0px black;
    overflow: hidden;
  }

  .post-card img {
    width: 100%;
    height: auto;
    max-width: 1024px;
    object-fit: cover;
  }

  .post-title {
    font-size: clamp(1rem, 2vw, 1.5rem);
    line-height: 1.3;
    max-height: 3.6em;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    font-weight: bold;
  }
}

/* ======================================== */
/* 7) MOBILE LAYOUT (< 769px)              */
/* ======================================== */

@media (max-width: 768px) {
  .post-grid {
    /* Single-column “list” layout */
    display: block;
    max-width: 100%;
    margin: 0 auto;
  }

  .post-card {
    /* Row-style card: image on left, text on right */
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: 120px;       /* Smaller uniform row height */
    margin-bottom: 16px; /* Spacing between rows */
    padding: 10px;
    border: 3px solid black;
    box-shadow: 6px 6px 0px black;
    overflow: hidden;
  }

  /* Ensure smaller "thumbnail" image fits entirely */
  .post-card img {
    max-width: 120px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-right: 10px;
  }

  .post-title {
    font-size: 1rem;
    line-height: 1.3;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Up to 2 lines, then truncate */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    font-weight: bold;
  }
}

/* ======================================== */
/* 8) NAVIGATION (MOBILE & DESKTOP)         */
/* ======================================== */

/* MOBILE NAV & OVERLAYS */
@media (max-width: 768px) {
  .navbar {
    display: none !important;
  }

  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid black;
    box-shadow: 0 -6px 0 black;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    z-index: 1000;
  }

  .mobile-nav__item {
    text-decoration: none;
    color: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--bulma-family-primary, sans-serif);
    font-size: 0.9rem;
    width: 20%;
  }

  .mobile-nav__icon {
    font-size: 1.4rem;
    line-height: 1.2;
  }

  .overlay-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    transition: opacity 0.3s ease;
  }

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

  .overlay-menu__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000;
    color: #fff;
    border-top: 3px solid #ff007f;
    box-shadow: 0 -6px 0 black;
    padding: 2rem;
    animation: slideUp 0.3s ease forwards;
  }

  .overlay-menu__close-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    cursor: pointer;
  }

  .overlay-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.5rem;
    line-height: 2.2rem;
  }

  .overlay-menu__list li a {
    color: #fff;
    text-decoration: none;
  }

  @keyframes slideUp {
    0% {
      transform: translateY(100%);
    }
    100% {
      transform: translateY(0);
    }
  }

  body {
    /* Prevent the bottom nav from overlapping content */
    padding-bottom: 4.5rem;
  }
}

/* DESKTOP NAV (>= 769px) */
@media (min-width: 769px) {
  .navbar.is-hidden-mobile {
    position: sticky;
    top: 0;
    z-index: 999;
    background: white;
    border-bottom: 3px solid black;
    box-shadow: 0 6px 0 black;
  }

  .navbar.is-hidden-mobile .container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
  }

  .navbar.is-hidden-mobile .navbar-menu {
    display: flex;
    flex: 1;
    justify-content: center;
  }

  .navbar.is-hidden-mobile .navbar-start {
    display: flex;
    gap: 1rem;
    justify-content: center;
  }

  .navbar.is-hidden-mobile .navbar-item {
    font-family: var(--bulma-family-primary, sans-serif);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: black;
    border-bottom: 3px solid transparent;
    transition: 0.2s ease;
  }

  .navbar.is-hidden-mobile .navbar-item:hover {
    background: #FF00FF;
    color: white;
    border-bottom-color: black;
  }

  .hero {
    position: sticky;
    background: white;
  }
}

/* ======================================== */
/* 9) HERO: SHRINKING HEADER               */
/* ======================================== */

.hero {
  top: 0;
  z-index: 999;
  transition: all 0.3s ease;
}

.hero-body {
  transition: padding 0.3s ease, font-size 0.3s ease;
}

.hero.shrunken .hero-body {
  padding: 0.5rem 1rem;
}

.hero.shrunken h1.title {
  font-size: 1.25rem;
}

.hero.shrunken nav.navbar {
  height: 48px;
  line-height: 48px;
}

.rich-text a {
  font-weight: bold;
  text-decoration: underline;
  transition: color 0.2s ease-in-out;
}

.rich-text a:hover {
  text-decoration: none; /* Removes underline on hover */
}

/* H2 - Bigger, Bolder, and More Spaced Out */
.rich-text h2 {
  font-size: 2rem; /* Larger size */
  font-weight: bold;
  color: black;
  text-transform: uppercase; /* Makes it more distinct */
  border-bottom: 4px solid black; /* Adds a clear divider */
  padding-bottom: 5px;
  margin: 40px 0 20px;
}

/* H3 - Smaller but Still Noticeable */
.rich-text h3 {
  font-size: 1.5rem; /* Slightly smaller than H2 */
  font-weight: bold;
  color: #333; /* Slightly lighter than H2 */
  text-transform: none;
  margin: 30px 0 15px;
}

/* Optional: Add Background for Extra Visibility */
.rich-text h2::after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  background: #00FF66; /* Neon Green Accent */
  margin-top: 5px;
}

/* Fix Large Gap at the Top on Mobile */
@media (max-width: 768px) {
  .post-hero {
    padding-top: 20px !important; /* Reduce padding on mobile */
  }

  h1.title {
    margin-top: 10px !important; /* Adjust title spacing */
  }
}

/* Adjust Title Sizes for Mobile */
@media (max-width: 768px) {
  .post-title {
    font-size: 1.2rem !important; /* Shrinks titles on mobile */
    line-height: 1.4 !important; /* Prevents text from taking up too much space */
  }

  h1.title {
    font-size: 2rem !important; /* Adjusts blog title */
  }
}

/* ======================================== */
/* 10) DARK MODE OVERRIDES                 */
/* ======================================== */

@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #ffffff;
  }

  .hero,
  .section,
  .container {
    background-color: #121212;
    color: #ffffff;
  }

  .hero h1,
  .hero h1 a {
    color: #ffffff;
  }

  .navbar.is-hidden-mobile {
    background-color: #121212;
  }
  .navbar.is-hidden-mobile .navbar-item {
    color: #ffffff;
  }
  .navbar.is-hidden-mobile .navbar-item:hover {
    background: #222;
  }

  .mobile-nav {
    background-color: #121212;
    border-top: 3px solid #ffffff;
  }
  .mobile-nav__item {
    color: #ffffff;
  }

  .overlay-menu {
    background: rgba(0, 0, 0, 0.8);
  }
  .overlay-menu__content {
    background: #121212;
    color: #ffffff;
  }
  .overlay-menu__close-button {
    color: #ffffff;
  }
  .overlay-menu__list li a {
    color: #ffffff;
  }

  .rich-text,
  .rich-text p,
  .rich-text h1,
  .rich-text h2,
  .rich-text h3,
  .post-content {
    color: #ffffff;
  }

  .post-thumbnail {
    filter: invert(1);
  }

  /* Force .has-text-black to be white in dark mode */
  .hero-body .has-text-black {
    color: #ffffff !important;
  }
  .hero-body .has-text-black:hover {
    color: #ffffff !important;
  }
  .navbar.is-hidden-mobile .navbar-item:hover {
    background: #00FF66;
    color: black;
    border-bottom-color: black;
  }
  .post-card p {
 color: #00FF66;
  }
  .mobile-nav img {
    filter: invert(1);;
  }
}