/* ================================
   MTL Transit Theme CSS - Fixed Footer
   ================================ */

/* ===== Google Font Fallback ===== */
body, h1, h2, h3, h4, h5, h6, p, a, button, input {
  font-family: 'Lato', sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== CSS Variables for Theme ===== */
:root {
  --primary-color: #f4f4f4;
  --secondary-color: #ffffff;
  --card-color: rgba(255,255,255,0.9);
  --text-color: #1c1c1e;
  --muted-text: #555;
  --accent-color: #0077ff;
  --border-color: rgba(0,0,0,0.1);
  --bg-overlay: rgba(255,255,255,0.6);
  --transition-speed: 0.3s;
}

/* ===== Layout for Sticky Footer ===== */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--primary-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: all var(--transition-speed) ease-in-out;
  opacity: 1;
}

/* Make main take remaining space */
main {
  flex: 1;
  padding: 2rem;
}

/* ===== Header ===== */
header {
  padding: 1rem 2rem;
  background: var(--secondary-color);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0 0 12px 12px;
  transition: background var(--transition-speed);
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

header .tagline {
  font-size: 1rem;
  color: var(--muted-text);
}

/* ===== Navigation ===== */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--secondary-color);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-speed);
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background var(--transition-speed), color var(--transition-speed);
}

nav a:hover {
  background: var(--accent-color);
  color: #fff;
}

/* ===== Mobile Menu Toggle ===== */
.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 999;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

nav.active {
  display: flex;
  flex-direction: column;
}

/* ===== Main Sections ===== */
section {
  margin-bottom: 2rem;
}

.blog-list, .intro, .upload-container {
  max-width: 800px;
  margin: 0 auto;
}

/* ===== Blog Posts / Cards ===== */
.blog-post {
  background: var(--card-color);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transition: transform var(--transition-speed), opacity var(--transition-speed);
  opacity: 0;
}

.blog-post.active {
  opacity: 1;
  transform: translateY(0);
}

.blog-post h3 {
  margin-bottom: 0.75rem;
}

.blog-post p {
  color: var(--muted-text);
}

/* ===== Buttons ===== */
button, #uploadBtn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  transition: background var(--transition-speed), color var(--transition-speed);
}

button {
  background: var(--accent-color);
  color: #fff;
  padding: 0.5rem 1rem;
}

button:hover:not(:disabled) {
  opacity: 0.9;
}

button:disabled {
  background: var(--border-color);
  cursor: not-allowed;
}

/* ===== Inputs ===== */
input[type="text"], input[type="file"], .upload-input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--secondary-color);
  color: var(--text-color);
  transition: border var(--transition-speed), background var(--transition-speed);
}

input:focus, .upload-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* ===== Image Previews ===== */
img, #preview {
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 1rem;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 1rem 0;
  background: var(--secondary-color);
  border-top: 1px solid var(--border-color);
  transition: background var(--transition-speed);
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.5rem;
  border-radius: 50%;
  border: none;
  font-size: 1.25rem;
  color: var(--accent-color);
  background: var(--bg-overlay);
  transition: all var(--transition-speed);
}

/* ===== Links ===== */
a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav {
    display: none;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: 4rem;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    z-index: 998;
  }

  nav a {
    padding: 1rem;
    width: 100%;
  }
}
