/* Ensure media scales properly */
img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Generic body/font fixes */
body {
  font-size: 16px;
  line-height: 1.6;
  padding: 0;
  margin: 0;
  word-wrap: break-word;
  overflow-x: hidden;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Responsive grid columns */
.columns,
.row {
  display: flex;
  flex-wrap: wrap;
}

.column,
.col {
  flex: 1 1 100%;
  padding: 1rem 0;
}

/* Responsive navigation (assumes toggle menu via checkbox or JS) */
.nav,
.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav li,
.menu li {
  margin-bottom: 1rem;
}

/* Header, footer, and content padding */
.header,
.footer,
.content,
.main {
  padding: 1rem;
}

/* Buttons and links for touch usability */
button,
a.button,
input[type="submit"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Tables responsive */
table {
  width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
  display: block;
}

/* Forms */
input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

/* Responsive typography */
h1 {
  font-size: 1.8rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.3rem;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main,
  .content,
  .header,
  .footer {
    padding: 1rem;
  }

  .column,
  .col {
    width: 100% !important;
  }

  .menu-toggle {
    display: block;
    margin-bottom: 1rem;
  }

  .nav {
    display: none;
  }

  .menu-toggle:checked + .nav {
    display: block;
  }
}

@media (max-width: 768px) {
  header .container.d-flex {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  header img {
    margin-right: 0 !important;
    margin-bottom: 1rem;
    max-width: 100%;
    height: auto;
  }

  header h1.h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: left;
    word-break: break-word;
  }

  header .ml-auto.text-right {
    margin-left: 0 !important;
    text-align: left !important;
    width: 100%;
  }

  header .ml-auto.text-right a {
    word-break: break-all;
    display: inline-block;
  }
}