/* 
 * Mobile-First CSS for Asher's FLC Journey
 * Optimized for performance, accessibility, and consistency
 */

/* Base styling and CSS variables */
:root {
  /* Color scheme variables */
  --primary-color: #02a0bb;
  --secondary-color: #f34213;
  --accent-color: #0d3b66;
  --accent-color2: #31a354;
  --dark-color: #2a9249;
  --light-color: #f7f3e3;
  --bg-color: #000000;

  /* Spacing variables - using rem for consistency */
  --space-unit: 1rem;
  --space-xs: calc(0.25 * var(--space-unit));
  --space-sm: calc(0.5 * var(--space-unit));
  --space-md: var(--space-unit);
  --space-lg: calc(2 * var(--space-unit));
  --space-xl: calc(3 * var(--space-unit));

  /* Typography (using fluid type scaling) */
  --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --line-height-base: 1.5;
  --font-family-sans: system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-family-display: "Squartiqa Solid", var(--font-family-sans);
  --font-family-accent: "Squartiqa", var(--font-family-sans);
  --letter-spacing-tight: -0.05em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.05em;
}

/* Font declarations - with proper font-display for performance */
@font-face {
  font-family: "Squartiqa";
  src: url("../Assets/fonts/Squartiqa4FInline.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Squartiqa Solid";
  src: url("../Assets/fonts/Squartiqa4F.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--light-color);
  background-color: var(--bg-color);
  width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animation definitions */
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(calc(-1 * var(--space-sm)));
  }
  60% {
    transform: translateY(calc(-0.5 * var(--space-sm)));
  }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* Header and Navigation */
.header {
  background-color: var(--light-color);
  position: relative;
}

.neonText {
  color: var(--primary-color);
  text-shadow: 0 0 7px var(--primary-color), 0 0 10px var(--primary-color),
    0 0 21px var(--primary-color), 0 0 42px var(--accent-color),
    0 0 82px var(--accent-color);
}

/* Typography styles */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
}

h1 {
  font-family: var(--font-family-display);
  font-size: clamp(1.75rem, 1.3rem + 2.25vw, 3.5rem);
  letter-spacing: 0.5em;
  margin-bottom: 0;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h3 {
  font-family: var(--font-family-accent);
  font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  line-height: 1.3;
}

h5 {
  font-family: var(--font-family-accent);
}

h6 {
  font-family: var(--font-family-accent);
  font-size: clamp(0.5rem, 0.5rem + 0.75vw, 1.75rem);
  color: var(--primary-color);
  margin-bottom: 0;
}

p {
  margin-bottom: var(--space-md);
}

.outlineFont {
  font-family: var(--font-family-accent);
}

/* Layout containers */
.container {
  margin-top: 10px;
  padding: 0;
  width: 100%;
}

.container-fluid {
  padding: 0;
  margin: 0;
  width: 100%;
}

.row {
  margin-left: 0;
  margin-right: 0;
}

/* Grid columns */
.col-12,
.col-md-6,
.col-lg-4 {
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Custom carousel */
.carousel-container {
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.custom-carousel {
  width: 100%;
  height: 50vh;
}

.carousel-inner,
.carousel-item {
  height: 100%;
  width: 100%;
}

.carousel-item img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  max-width: none;
}

.title-image-container {
  position: absolute;
  bottom: 0;
  width: 100%;
  left: 0;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Custom navigation */
.custom-nav {
  position: absolute;
  padding: var(--space-sm) 0;
  top: 5px;
  right: 15px;
  z-index: 10;
}

.nav-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  /* position: relative; */
  width: 44px;
  height: 44px;
  /* display: inline-block; */
}

.nav-toggle-icon-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
}

.nav-toggle-icon,
.hamburger-icon {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

/* Animation for toggle icons */
@keyframes fadeHamburger {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes fadeCustom {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

.hamburger-icon {
  animation: fadeHamburger 2s infinite ease;
}

.nav-toggle-icon {
  animation: fadeCustom 2s infinite ease;
}

/* Stop animations when menu is open */
.nav-toggle-btn[aria-expanded="true"] .hamburger-icon,
.nav-toggle-btn[aria-expanded="true"] .nav-toggle-icon {
  animation: none;
}

.nav-toggle-btn[aria-expanded="true"] .nav-toggle-icon {
  opacity: 0;
}

/* Navigation menu */
.nav-menu {
  position: absolute;
  margin-top: var(--space-sm);
  top: 100%;
  right: 0;
  background-color: var(--secondary-color);
  border: 1px solid var(--light-color);
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-list {
  list-style: none;
  padding: var(--space-sm);
  margin: 0;
  white-space: nowrap;
}

.nav-item {
  margin: 5px 0;
  padding: var(--space-xs) 0;
}

.nav-link {
  display: block;
  padding: var(--space-xs) var(--space-md);
  text-decoration: none;
  color: var(--light-color);
  font-family: var(--font-family-accent);
  line-height: normal;
  min-height: 44px;
  align-items: center;
}

.nav-link:hover {
  color: var(--dark-color);
}

.green {
  color: var(--dark-color);
}

/* Cards */
.card {
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 0.5rem;
  overflow: hidden;
}

.card-body {
  background-color: var(--secondary-color);
  color: var(--light-color);
  padding: var(--space-md);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card .btn {
  background-color: var(--accent-color);
  color: var(--light-color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  transition: background-color 0.3s ease;
  display: inline-block;
  text-align: center;
}

.card .btn:hover {
  background-color: var(--primary-color);
}

/* Accessibility */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.visually-hidden-focusable:focus {
  position: absolute !important;
  left: 0;
  top: 0;
  z-index: 1050;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background-color: var(--light-color);
  color: var(--dark-color);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--dark-color);
}

/* Touch-friendly elements */
a,
button,
.btn,
input[type="button"],
input[type="submit"] {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Focus styling for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* Footer */
footer {
  background-color: var(--bg-color);
  color: var(--light-color);
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.accordion-item {
  background-color: var(--light-color);
  border: 1px solid var(--dark-color);
  border-radius: 0.25rem;
  margin-bottom: var(--space-sm);
}

.accordion-button {
  background-color: var(--secondary-color);
  color: var(--light-color);
  font-family: var(--font-family-accent);
}

.accordion-button:not(.collapsed) {
  background-color: var(--primary-color);
  color: var(--light-color);
}

.accordion-body {
  background-color: var(--bg-color);
  color: var(--light-color);
  padding: var(--space-md);
}

.lead {
  color: var(--light-color);
}

/*mosaic*/
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.mosaic-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

/* Only make items with popup or link behavior clickable */
.mosaic-item[data-behavior="popup"],
.mosaic-item[data-behavior="link"] {
  cursor: pointer;
}

.mosaic-item[data-behavior="popup"]:hover,
.mosaic-item[data-behavior="link"]:hover {
  transform: scale(1.05);
  z-index: 10;
}

.mosaic-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.mosaic-item[data-behavior="popup"]:hover .mosaic-img,
.mosaic-item[data-behavior="link"]:hover .mosaic-img {
  filter: brightness(0.7);
}

.mosaic-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 1rem 0.5rem 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mosaic-item:hover .mosaic-overlay {
  opacity: 1;
}

.mosaic-name {
  font-size: 0.8rem;
  font-weight: bold;
  display: block;
}

/* Style for the link in type 2 */
.mosaic-link {
  color: inherit !important; /* Keep the same color as other names */
  text-decoration: none !important; /* Remove underline */
}

.mosaic-link:hover {
  color: var(
    --primary-color
  ) !important; /* Change color on hover to indicate it's clickable */
  text-decoration: underline !important; /* Add underline on hover */
}

/* Dark modal styles for type 1 */
.dark-modal {
  background-color: #1a1a1a; /* Dark background */
  color: #fff;
  border: 1px solid #333;
}

.dark-modal .modal-header {
  border-bottom: 1px solid #333;
}

.dark-modal .modal-footer {
  border-top: 1px solid #333;
}

/* Responsive breakpoints */
@media (min-width: 576px) {
  /* Small devices and up */
}

@media (min-width: 768px) {
  /* Medium devices and up */
  .title-image-container {
    padding: var(--space-md) 0;
  }
}

@media (min-width: 992px) {
  /* Large devices and up */
  .custom-carousel {
    height: 80vh;
  }

  .nav-link {
    position: relative;
  }

  .nav-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
  }

  .nav-link:hover::after,
  .nav-link.active::after {
    width: 100%;
  }
}

@media (min-width: 1200px) {
  /* Extra large devices and up */
  h1 {
    letter-spacing: 0.6em;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-bounce,
  .hamburger-icon,
  .nav-toggle-icon,
  .card,
  * {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto !important;
  }
}

/* Print styles */
@media print {
  body {
    background-color: #fff;
    color: #000;
  }

  .no-print {
    display: none !important;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }

  img {
    max-width: 100% !important;
  }

  @page {
    margin: 2cm;
  }
}
