/* -----------------------------------------------------
   Global Reset & Base
----------------------------------------------------- */
@import "swiper/swiper-bundle.css";

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

html, body {
  height: 100%;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  background: #fdfdfd;
  color: #333;
  line-height: 1.6;
}

.homepage-container {
  max-width: 1200px;   /* limit the width */
  margin: 0 auto;      /* center horizontally */
  padding: 0 2rem;     /* space on left/right */
}


/* -----------------------------------------------------
   Page Wrapper & Sticky Footer
----------------------------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* full viewport height */
}

main {
  flex: 1; /* grows with content, pushes footer down if short */
}

footer {
  margin-top: auto; /* footer at bottom when content is short */
}

/* -----------------------------------------------------
   Header & Footer
----------------------------------------------------- */
header, footer {
  background: #C25100; /* Django Girls orange */
  color: white;
  padding: 1rem;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.logo a {
  text-decoration: none;
  color: white;
}

/* -----------------------------------------------------
   Layout Container (Desktop)
----------------------------------------------------- */
.container {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 120px); /* header + footer height */
}

/* -----------------------------------------------------
   Sidebar
----------------------------------------------------- */
.sidebar {
  width: 250px;
  padding: 1rem;
  background: #f4f4f4;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Sidebar carousel */
.sidebar swiper-container {
  width: 220px;
  height: 200px;
  margin-bottom: 1rem;
}

.sidebar swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Sidebar menu */
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar details {
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

.sidebar summary {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: bold;
  list-style: none;
}

.sidebar summary.active {
  background: #C25100;
  color: white;
}

.sidebar ul {
  list-style: none;
  padding: 0.5rem 1rem;
}

.sidebar a {
  color: #333;
  text-decoration: none;
}

.sidebar a:hover {
  text-decoration: underline;
}

/* -----------------------------------------------------
   Main Content
----------------------------------------------------- */
p {
  margin: 1rem 0; /* adds vertical space above and below */
  line-height: 1.6; /* improves readability */
}

pre code {
  background: #f4f4f4; /* light gray */
  color: #333;         /* dark text */
}

/* Global image styling */
img {
  max-width: 100%;   /* never exceed the container width */
  height: auto;      /* maintain aspect ratio */
  display: block;    /* removes inline spacing issues */
  margin: 0 auto;    /* optional: center images */
}

.content {
  flex: 1;
  padding: 2rem;
  max-width: 100ch; 
  margin: 0 auto;        /* center on page */
  word-wrap: break-word; /* prevent overflow */
}

.content h1, .content h2, .content h3 {
  margin-bottom: 1rem;
  color: #222;
}

.content code {
  background: #eee;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}

.content pre {
  background: #272822;
  color: #f8f8f2;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

.content a {
  color: #C25100;
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

/* Language selector */
.language-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.language-selector button {
  padding: 0.75rem;
  border: 1px solid #ccc;
  background: #f9f9f9;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}

/* -----------------------------------------------------
   Mobile Sidebar & Toggle
----------------------------------------------------- */
.menu-toggle {
  display: none;
  background: #C25100;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1100;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  z-index: 900;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* -----------------------------------------------------
   Responsive: Mobile Layout
----------------------------------------------------- */
@media (max-width: 768px) {

  .menu-toggle {
    display: inline-block;
  }

  .container {
    display: flex;
    flex-direction: column;
  }

  /* Slide-in Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    border-right: 1px solid #ddd;
    padding: 1rem;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar swiper-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    margin-bottom: 1rem;
  }

  .sidebar details {
    width: 100%;
  }

  .content {
    padding: 1rem;
  }
}
