/* Blog post layout */
article {
  padding: 2rem 1.5rem;
  margin: 1rem auto;
  max-width: 720px;
}

.content {
  border: 2px solid #fff;
  padding: 2rem;
  margin: 2rem;
}

/* Center header */
header hgroup h1 {
    text-align: center;
}

header hgroup {
    text-align: center;
}

body > header hgroup h1 {
  align-self: center !important;
  text-align: center !important;
  width: 100%;
}
/* Force nav centered under title */
header nav ul {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0.5rem auto !important;
  gap: 1rem !important;
  width: 100% !important;
}
header nav ul li {
  float: none !important;
  display: inline-block !important;
}

/* Override Bootstrap nav alignment */
header hgroup nav ul,
header nav ul,
nav ul {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0.5rem auto !important;
  gap: 1rem !important;
  float: none !important;
  width: 100% !important;
  text-align: center !important;
}
header nav ul li,
nav ul li {
  float: none !important;
  display: inline-flex !important;
}

/* Force header full width so grid centers correctly */
header {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
.header-inner {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Center nav links under CONSTANT */
.header-hgroup nav,
.header-hgroup nav ul {
  width: 100% !important;
  text-align: center !important;
  justify-content: center !important;
}

/* Tighten nav gap */
.header-hgroup nav ul {
  gap: 0.75rem !important;
  padding: 0 1rem !important;
}
@media (max-width: 768px) {
  .header-hgroup nav ul {
    gap: 0.4rem !important;
    font-size: 0.9rem !important;
  }
}

/* White blog post titles in list */
.post-item a {
  color: #fff !important;
  border-bottom: 1px solid #fff !important;
}

/* Center header on all screens */
.header-inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}
.header-logo {
  display: none !important;
}

/* Fix header centering on desktop */
header {
  width: 100% !important;
  max-width: 100% !important;
}
.header-inner {
  grid-template-columns: 80px 1fr 80px !important;
  max-width: 100% !important;
}
.header-hgroup {
  text-align: center !important;
  width: 100% !important;
}

/* Pill-style tags */
.button {
  padding: 0.3rem 1rem !important;
  border: 1px solid #fff !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.1em !important;
  display: inline-block !important;
}

/* Smaller pill tags */
.button {
  padding: 0.2rem 0.75rem !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: rgba(255,255,255,0.7) !important;
  text-decoration: none !important;
  font-size: 0.65rem !important;
  letter-spacing: 0.05em !important;
  display: inline-block !important;
}

/* Mobile blog list fix */
@media (max-width: 768px) {
  .post-item {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
  .post-item time {
    font-size: 0.8rem !important;
  }
}

/* Mobile fixes */
@media (max-width: 768px) {
  /* Security tags */
  .security-tags {
    grid-template-columns: 1fr !important;
  }

  /* Sound page flex layout */
  div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: center !important;
  }

  /* General overflow fix */
  * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Hide full title on mobile, show only Constant */
@media (max-width: 768px) {
  h1 a::before {
    content: "CONSTANT";
  }
  h1 a {
    font-size: 0 !important;
  }
  h1 a::before {
    font-size: 1.5rem;
  }

  /* Security tags stack to 1 column */
  div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
}

/* Fix nav links on mobile */
@media (max-width: 768px) {
  .header-hgroup nav ul {
    gap: 0.5rem !important;
  }
  .header-hgroup nav ul li a {
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }
  * {
    max-width: none !important;
  }
}

/* Mobile security tags and sound fixes */
@media (max-width: 768px) {
  /* Force security tag grid to single column */
  div[style*="repeat(3"] {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  /* Hide ouroboros on mobile for sound page */
  img[style*="width: 80px"] {
    display: none !important;
  }

  /* Fix sound page flex containers */
  div[style*="display: flex; align-items: center"] {
    flex-direction: column !important;
    padding: 0 1rem !important;
  }

  /* Fix platform buttons overflow */
  div[style*="justify-content: center"] {
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
  }

  .platform-button {
    width: 80% !important;
    text-align: center !important;
  }
}

/* Fix tutorial grid on mobile */
@media (max-width: 768px) {
  div[style*="minmax(300px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Sound page mobile fixes */
@media (max-width: 768px) {
  /* Fix button letter spacing breaking words */
  .platform-button {
    letter-spacing: 0.05em !important;
    word-spacing: normal !important;
    white-space: nowrap !important;
    padding: 0.75rem 1.5rem !important;
    width: auto !important;
  }

  /* Hide side ouroboros on mobile */
  img[style*="width: 80px; height: 80px"] {
    display: none !important;
  }

  /* Fix mixes grid to single column */
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* About page mobile image fix */
@media (max-width: 768px) {
  img[alt="A'nyo Bell"] {
    float: none !important;
    display: block !important;
    margin: 0 auto 2rem auto !important;
    width: 80% !important;
    max-width: 300px !important;
  }
}

/* Fix tutorial thumbnails on mobile */
@media (max-width: 768px) {
  .tutorial-card,
  div[style*="border-radius: 8px"],
  div[style*="border-radius: 4px"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
}

/* Final mobile fixes */
@media (max-width: 768px) {
  /* Fix BOOKING title breaking */
  h2[style*="letter-spacing: 0.3em"] {
    letter-spacing: 0.1em !important;
    font-size: 1.5rem !important;
  }

  /* Fix tutorial card overflow */
  .tutorial-grid > a,
  div[style*="grid"] > a {
    overflow: hidden !important;
    width: 100% !important;
  }

  div[style*="grid"] img {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Fix about image height */
  img[alt="A'nyo Bell"] {
    max-height: 400px !important;
    object-fit: cover !important;
    object-position: top !important;
  }
}

/* Center listen on youtube button and fix booking title */
@media (max-width: 768px) {
  /* Center listen on youtube */
  div[style*="text-align: center"] a.platform-button {
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
  }

  /* Fix BOOKING and other large titles */
  h2 {
    letter-spacing: 0.1em !important;
    font-size: 1.4rem !important;
    word-break: keep-all !important;
    white-space: nowrap !important;
  }
}

/* Hide side ouroboros on mobile sound page */
@media (max-width: 768px) {
  img[alt="Constant Logo"] {
    display: none !important;
  }
  
  /* Fix listen here title overflow */
  div[style*="display: flex; align-items: center"] h2 {
    white-space: normal !important;
    text-align: center !important;
  }

  /* Fix flex container on sound page */
  div[style*="display: flex; align-items: center; gap: 2rem"] {
    flex-direction: column !important;
    padding: 1rem !important;
  }
}

/* Center listen on youtube and full booking info buttons */
@media (max-width: 768px) {
  div[style*="text-align: center"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
}

/* Fix homepage mobile */
@media (max-width: 768px) {
  /* Fix ouroboros white background */
  img[src="/images/home.png"] {
    background: transparent !important;
    mix-blend-mode: screen !important;
  }

  /* Shrink who's behind constant heading */
  .about-text h3 {
    font-size: 1.8rem !important;
    letter-spacing: 0.05em !important;
  }
}

/* Revert mix-blend-mode on ouroboros */
@media (max-width: 768px) {
  img[src="/images/home.png"] {
    mix-blend-mode: normal !important;
    background: transparent !important;
  }
}

/* Reduce top spacing on mobile */
@media (max-width: 768px) {
  main {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  article {
    margin-top: 0.5rem !important;
    padding-top: 1rem !important;
  }

  .home-container {
    margin-top: 0 !important;
  }
}

/* Brighter borders on stay connected links mobile */
@media (max-width: 768px) {
  .connect-link {
    border: 1px solid #fff !important;
    color: #fff !important;
  }
}

/* Center about me title on mobile */
@media (max-width: 768px) {
  article header h1 {
    text-align: center !important;
  }
}

/* White border on connect links */
.connect-link {
  border: 1px solid #fff !important;
  color: #fff !important;
}
