:root {
/* set var for mobile */
    --body-color: #0055ff;
}

/* Make box-sing default to border-box */
html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
}

/* Basic error checking on mandatory CSS properties */
html:not([lang]),html[lang=""] { border-top: 20px solid red; }
img:not([alt]),img[alt=""] { border: 5px dashed red; }
canvas:not([role]),canvas:not([aria-label]),canvas[role=""],canvas[aria-label=""] { border: 5px dashed red; }

/* Body color set to custom property. Change colour in the the :root rule */

body {
  color: var(--body-color);
}

p{
  line-height: 1.5;
  max-width: 60ch;
}

/* Centre everything in the main element */
main {
  min-height: 100vh;
  padding: 1rem;
  /*display: flex;
  justify-content: center;
  align-items: center;*/
}

.famous-people {
  column-count: 3;
  column-gap: 2rem;
  list-style-type: disc;
  padding: 1rem;
  margin: 1rem 0;
}

.famous-people li {
  margin-bottom: 0.5rem;
  break-inside: avoid;
}

.image-gallery, .mixed-gallery {
  column-count: 3;
  column-gap: 2rem;
  margin: 1rem 0;
}

.gallery-item {
  break-inside: avoid; /* Avoid breaking inside the gallery item */
  margin-bottom: 1.5rem;
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-item h3 {
  padding: 1rem;
  margin: 0;
  font-size: 1.1rem;
  color: #333;
  text-align: center;
}

h2 {
  margin: 2rem 0 1rem 0;
  color: #333;
}

header {
  font-size: 1.5rem;
  font-weight: bold;
  padding: 1rem;
  background-color: #f5f5f5;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.toggle-btn:hover {
  background-color: #0056b3;
}

/* Class to disable break-inside avoid */
.no-break-inside .famous-people li,
.no-break-inside .gallery-item {
  break-inside: auto;
}

.no-margin .gallery-item {
  margin-bottom: 0; /* 1.5rem Don't use margin-bottom for Safari */
}
