/*
 * 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.
 */

html {
  height: 100%;
  font-family: sans-serif;
}

/* Full-height column: navbar on top, .page fills the rest. The page only
   scrolls if the content is taller than the viewport. */
body {
  background-color: #121212;
  color: oklch(55.1% 0.027 264.364);
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.posts {
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

.post-container {
  display: flex;
  align-items: center;       /* Centers vertically */
  justify-content: center;   /* Centers horizontally (optional) */
  flex: 1;                   /* Fills the space left under the navbar */
  width: 100%;
  box-sizing: border-box;
}

/* Fluid: up to 550px wide (the widest a tweet embed gets), shrinking with the screen. */
.post {
  margin-bottom: 4rem;
  width: 100%;
  max-width: 550px;
  overflow-wrap: anywhere;  /* some tweets are a single very long URL */
}

a:link { color: rgb(107, 201, 251); }
a:visited { color: #6d4b8d; }
a:hover { color: #ffffff; }
a:active { color: #ff4040; text-decoration:none; font-weight:normal; }

/* Navbar container setup */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #222; /* Dark background */
  padding: 15px 15px;
  position: sticky;       /* Stays at the top while scrolling */
  top: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
}

/* Remove list bullets and align horizontally */
.nav-links {
  list-style: none;
  display: flex;
  gap: 20px; /* Spacing between links */
  padding-inline-start: unset;

}

/* Style individual link items */
.nav-links a {
  color: #efefef;
  text-decoration: none; /* Removes underline */
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 2px;
  transition: all 0.3s ease; /* Smooth hover effect */
}

/* Hover state for links */
.nav-links a:hover {
  background-color: #444;
}

/* Highlight style for the current/active page */
.nav-links a.active {
  background-color: #4B4038;
  color: #fff;
}

.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  width: 100%;
}

.marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 15s linear infinite;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }  /* -100% of the text's own width (padding included) */
}

@media (prefers-reduced-motion: reduce) {
  .marquee-text {
    animation: none;
    padding-left: 0;
  }
}

.about {
  max-width: 600px;
  line-height: 2.2rem;  
  font-size: 24px;
}

/* ---- Navbar hamburger (mobile only; hidden on wide screens) ---- */

.nav-toggle {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: #efefef;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
}

.nav-toggle-icon { flex-shrink: 0; }  /* keep the icon full size next to long search text */
.nav-toggle .icon-close { display: none; }
.navbar.open .nav-toggle .icon-menu { display: none; }
.navbar.open .nav-toggle .icon-close { display: inline; }

/* The label of the current page, styled like the active link in the desktop nav. */
.nav-current {
  min-width: 0;             /* let long search text shrink and get an ellipsis */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 2px;
  background-color: #4B4038;
  color: #fff;
}

/* ---- Small screens ---- */

@media (max-width: 768px) {
  .navbar {
    justify-content: flex-start;
    padding: 8px 12px;
  }

  .nav-toggle { display: inline-flex; }
  .nav-toggle:hover { background-color: #444; }

  /* The link row becomes a dropdown under the bar, closed until the hamburger is tapped. */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 8px 12px 16px;
    background-color: #222;
    border-top: 1px solid #333;
    box-shadow: 0 12px 16px rgba(0, 0, 0, 0.6);
  }

  .navbar.open .nav-links { display: flex; }

  .nav-links a {
    display: block;
    padding: 12px;
  }

  .nav-links input {
    box-sizing: border-box;
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    font-size: 16px;  /* 16px+ stops iOS Safari zooming in when the field is focused */
  }

  .marquee-container {
    margin: 0.5rem 0;
    font-size: 1.25rem;
  }
}

@media (max-width: 640px) {
  /* Side gutters so posts and text don't touch the screen edges. */
  .posts,
  .post-container,
  .about {
    padding-inline: 16px;
    box-sizing: border-box;
  }

  .about {
    font-size: 18px;
    line-height: 1.7;
  }
}

.refresh-icon {
  display: inline-block;
  margin-left: 0.4em;
}
