/* =======================
   BASE STYLES (Mobile First)
   ======================= */

.maxima {
  padding: 1rem;
}

/* ========== LIGHT THEME ========== */
.light .section,
.light .page-header {
  background: #ffffff;
  color: #111;
}

.light .page-header h1,
.light .page-header p {
  color: #111;
}

.light .maxima p,
.light .maxima li {
  color: #333;
}

.light .spec-table {
  background: #fff;
}

.light .spec-table th {
  background: #f8f9fa;
  color: #111;
}

.light .spec-table td,
.light .spec-table th {
  border-bottom: 1px solid #dee2e6;
}

.light .btn-primary {
  background: #0d6efd;
  color: #fff;
}

.light .btn-primary:hover {
  background: #084298;
}

.light hr {
  border-color: #dee2e6;
}

/* ========== DARK THEME ========== */
.dark .section,
.dark .page-header {
  background: #121212;
  color: #f2f2f2;
}

.dark .maxima p,
.dark .maxima li {
  color: #d0d0d0;
}

.dark .spec-table {
  background: #1a1a1a;
}

.dark .spec-table th {
  background: #252525;
  color: #f2f2f2;
}

.dark .spec-table td,
.dark .spec-table th {
  border-bottom: 1px solid #333;
}

.dark .btn-primary {
  background: #ffb703;
  color: #111;
}

.dark .btn-primary:hover {
  background: #e6a700;
}

.dark hr {
  border-color: #333;
}

/* ========== COMMON STYLES - Mobile First ========== */

.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.lead {
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.6;
}

hr {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid;
  opacity: 0.3;
}

.section {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
}

.section h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.section h4 {
  font-size: 1.35rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.section h5 {
  font-size: 1.2rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.section p {
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.section ul,
.section ol {
  margin-left: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
  list-style-position: outside;
}

.section ul li,
.section ol li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.block {
  margin-bottom: 1.5rem;
}

/* CONTENT WITH IMAGE LAYOUT - Mobile First */
.content-with-image {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.content-with-image .content {
  flex: 1;
}

.side-image,
.side-images {
  width: 100%;
}

.side-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 2px solid #ddd;
}

.dark .side-image img {
  border-color: #444;
}

.side-images {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-images .side-image {
  width: 100%;
}

/* GRID LIST - Mobile: Stack vertically */
.grid-list {
  display: block;
  margin-left: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
  list-style-type: disc;
  list-style-position: outside;
}

.grid-list li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
}

/* IMAGE GRID - Mobile: Stack vertically */
.image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.image-grid>div {
  width: 100%;
}

.image-grid img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.image-grid p {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* TABLE - Mobile: Responsive table with horizontal scroll */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.85rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spec-table thead {
  display: table;
  width: 100%;
  table-layout: auto;
}

.spec-table tbody {
  display: table;
  width: 100%;
  table-layout: auto;
}

.spec-table th,
.spec-table td {
  padding: 8px 6px;
  text-align: left;
  white-space: nowrap;
}

.spec-table th {
  font-weight: 600;
}

/* BUTTON */
.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-align: center;
}

/* FOOTER */
.footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem 0;
}

/* =======================
   TABLET (481px - 768px)
   ======================= */

@media (min-width: 481px) {
  .maxima {
    padding: 1.5rem;
  }

  .page-header {
    margin-bottom: 2rem;
  }

  .page-header h1 {
    font-size: 2.3rem;
  }

  .lead {
    font-size: 1.05rem;
    max-width: 700px;
  }

  hr {
    margin: 2rem 0;
  }

  .section {
    padding: 2rem;
    margin-bottom: 2rem;
  }

  .section h2 {
    font-size: 2rem;
  }

  /* Grid list remains vertical with bullets on tablet */
  .grid-list {
    padding-left: 2rem;
  }

  .grid-list li {
    margin-bottom: 0.7rem;
  }

  /* Content with image layout - still stacked on tablet */
  .content-with-image {
    gap: 2rem;
  }

  .side-image img {
    border-radius: 10px;
  }

  .spec-table {
    font-size: 0.9rem;
  }

  .spec-table th,
  .spec-table td {
    padding: 10px 8px;
  }
}

/* =======================
   TABLET LANDSCAPE (769px - 1024px)
   ======================= */

@media (min-width: 769px) {
  .maxima {
    padding: 2rem;
  }

  .page-header {
    margin-bottom: 2.5rem;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  .lead {
    font-size: 1.1rem;
    max-width: 850px;
  }

  .section {
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    border-radius: 12px;
  }

  .section h2 {
    font-size: 2.15rem;
  }

  /* Grid list remains vertical with bullets */
  .grid-list {
    padding-left: 2rem;
  }

  .grid-list li {
    margin-bottom: 0.8rem;
  }

  /* Content with image layout - side by side on tablet landscape */
  .content-with-image {
    flex-direction: row;
    gap: 2.5rem;
    align-items: flex-start;
  }

  .content-with-image .content {
    flex: 1;
  }

  .side-image {
    width: 280px;
    flex-shrink: 0;
  }

  .side-images {
    width: 280px;
    flex-shrink: 0;
    gap: 1.5rem;
  }

  .side-image img {
    border-radius: 12px;
  }

  /* Two column image grid */
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .spec-table {
    display: table;
    font-size: 1rem;
  }

  .spec-table th,
  .spec-table td {
    padding: 12px 10px;
    white-space: normal;
  }
}

/* =======================
   DESKTOP (1025px and up)
   ======================= */

@media (min-width: 1025px) {
  .maxima {
    padding: 2.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
  }

  .page-header {
    margin-bottom: 3rem;
  }

  .page-header h1 {
    font-size: 2.6rem;
  }

  .lead {
    max-width: 950px;
  }

  hr {
    margin: 2.5rem 0;
  }

  .section {
    padding: 2.5rem;
    border-radius: 14px;
  }

  .section h2 {
    font-size: 2.25rem;
  }

  .section h4 {
    font-size: 1.5rem;
  }

  .section h5 {
    font-size: 1.25rem;
  }

  .section p {
    font-size: 1.05rem;
  }

  .section ul li,
  .section ol li {
    font-size: 1.05rem;
  }

  /* Keep vertical bullet list */
  .grid-list {
    padding-left: 2rem;
  }

  /* Larger side images on desktop */
  .side-image {
    width: 320px;
  }

  .side-images {
    width: 320px;
  }

  /* Keep two columns for images */
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .footer {
    margin-top: 3rem;
  }
}

/* =======================
   LARGE DESKTOP (1400px and up)
   ======================= */

@media (min-width: 1400px) {
  .maxima {
    max-width: 1600px;
    padding: 3rem 3rem;
  }

  .section {
    padding: 3rem;
  }
}

/* =======================
   SMOOTH TRANSITIONS
   ======================= */

.maxima,
.section,
.page-header,
.btn-primary {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =======================
   UTILITY CLASSES
   ======================= */

/* Ensure images don't overflow */
img {
  max-width: 100%;
  height: auto;
}

/* Improve readability on very small screens */
@media (max-width: 380px) {
  .page-header h1 {
    font-size: 1.75rem;
  }

  .section h2 {
    font-size: 1.5rem;
  }

  .spec-table {
    font-size: 0.75rem;
  }

  .spec-table th,
  .spec-table td {
    padding: 6px 4px;
  }
}

/* Print styles */
@media print {
  .footer {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }
}
