/* ==========================================================================
   1. Document Reset & Core Variables
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #f7f9fa;
  padding: 24px;
  max-width: 1300px;
  margin: 0 auto;
}

/* ==========================================================================
   2. Unified Hero Header Elements
   ========================================================================== */
.hero-header {
  background-color: #111111;
  color: #ffffff;
  padding: 40px 30px;
  border-radius: 8px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.logo {
  font-size: 2.4rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: #ffffff;
}

.hero-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #e50914; /* Crimson accent */
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.subtitle {
  color: #cccccc;
  font-size: 1rem;
  font-style: italic;
}

/* ==========================================================================
   3. Technique Demo Explanations (Viewer Guidance)
   ========================================================================== */
.demo-explanation-zone {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.explanation-card {
  background-color: #ffffff;
  padding: 16px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #4a5568;
  border-left: 4px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.explanation-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

/* Color codes mapping structural instructions visually */
.tech-grid { border-left-color: #e50914; background-color: #fff5f5; color: #9b2c2c; }
.tech-media { border-left-color: #3182ce; background-color: #ebf8ff; color: #2b6cb0; }
.tech-flex { border-left-color: #38a169; background-color: #f0fff4; color: #276749; }

/* ==========================================================================
   4. Gallery Main Layout (CSS Grid System)
   ========================================================================== */
.gallery-grid {
  display: grid;
  /* Auto-fit container tracks expand or wrap dynamically based on 320px boundary rules */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.grid-item {
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column; /* Allows internal components to stretch evenly */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   5. Fluid Media Engine & Components
   ========================================================================== */
.img-placeholder {
  width: 100%;
  background-color: #000000;
  position: relative;
  overflow: hidden;
}

.fluid-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; /* Enforces clean media uniform bounds across files */
  object-fit: cover;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Pushes content sections down into identical line heights */
}

.badge {
  align-self: flex-start;
  background-color: #e50914;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.label {
  font-size: 0.95rem;
  color: #4a5568;
  line-height: 1.6;
  text-align: justify;
}

/* Decorator Bar Line separating the footer zone */
.accent-block {
  height: 4px;
  background: linear-gradient(to right, #e50914, #3182ce, #38a169);
  margin-bottom: 24px;
  border-radius: 2px;
}

/* ==========================================================================
   6. Footer Grid Block (Flexbox System)
   ========================================================================== */
.main-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allows text blocks to split neatly on compression wrapping */
  gap: 16px;
  background-color: #ffffff;
  padding: 24px 30px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  font-size: 0.9rem;
  color: #718096;
}

.footer-info {
  flex: 1;
  min-width: 280px;
}

.footer-copyright {
  text-align: right;
  white-space: nowrap;
}

/* ==========================================================================
   7. Device Layout Breakpoints (Media Queries)
   ========================================================================== */
@media screen and (max-width: 768px) {
  body {
    padding: 16px;
  }

  .logo {
    font-size: 1.8rem;
  }

  .hero-header {
    padding: 30px 16px;
  }

  .card-body {
    padding: 16px;
  }

  /* Transition the horizontal flex footer into center-stacked layout rows */
  .main-footer {
    flex-direction: column;
    text-align: center;
  }

  .footer-copyright {
    text-align: center;
    white-space: normal;
  }
}
