/* Define CSS Variables for colors */
:root {
    --text-color-light: #000;
    --background-color-light: #fff;
    --text-color-dark: #eee;
    --background-color-dark: #111;
    --blue-link-color: #4c8aff;

    /* Default to light mode colors */
    --text-color: var(--text-color-light);
    --background-color: var(--background-color-light);

    /* Default font size */
    --base-font-size: 1.1em;
}

/* Dark Mode styles */
body.dark-mode {
    color: var(--text-color-dark);
    background-color: var(--background-color-dark);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  font-weight: 400;
  max-width: 640px;
  margin: 40px auto;
  padding: 40px 20px;
  line-height: 1.8;
  color: var(--text-color); /* Use variable for main body text color */
  background-color: var(--background-color); /* Use variable for main body background */
  font-size: var(--base-font-size); /* Use variable */
  position: relative;
  min-height: 100vh;
  transition: color 0.3s ease, background-color 0.3s ease, font-size 0.3s ease; /* Smooth transitions */
}

/* Font Size Variations */
body.text-small {
    font-size: calc(var(--base-font-size) * 0.9);
}
body.text-normal {
    font-size: var(--base-font-size);
}
body.text-large {
    font-size: calc(var(--base-font-size) * 1.1);
}


h1, h2 {
    line-height: 1.3;
}

h1 {
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}

h2 {
    margin-top: 2em;
    border-top: 1px solid var(--text-color-dark); /* Adjust border for theme */
    padding-top: 1.5em;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 4px;
  margin-top: 1em;
  margin-bottom: 0;
}

figure {
    margin: 20px 0;
}

figcaption {
    font-size: 0.9em;
    color: var(--text-color); /* Adjust for theme */
    text-align: center;
    margin-top: 5px;
}

a {
  color: inherit; /* Links inherit color from parent */
  text-decoration: underline;
  text-underline-offset: 0.2em;
  position: relative;
  cursor: pointer;
}

a[target="_blank"] {
  cursor: alias;
}

.blue-link {
  color: var(--blue-link-color); /* Use variable */
  text-decoration: none;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  margin: 1.5em 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.pdf-container {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: 70vh;
    padding-bottom: 56.25%;
    overflow: hidden;
    max-width: 100vw;
    box-sizing: border-box;
    padding-left: 5px;
    padding-right: 5px;
}

.pdf-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.note {
  margin-top: 1.5em;
  font-size: 0.95em;
  border-top: 1px solid var(--text-color-dark);
  padding-top: 1.5em;

}

.image-pair-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 1em;
}

.image-pair-container img {
  width: calc(50% - 10px);
  height: 350px;
  object-fit: cover;
  margin-top: 0;
  margin-bottom: 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.gallery-grid img {
    height: 250px;
    object-fit: cover;
}

.gallery-grid-circles {
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.gallery-grid-circles img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    margin: 0;
    height: auto;
}

.full-width-gallery {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    box-sizing: border-box;
    padding-left: 5px;
    padding-right: 5px;
    grid-template-columns: repeat(3, 1fr);
}

.full-width-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.action-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 1em;
    list-style: none;
    padding-left: 0;
}

.action-items-grid li {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.95em;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.full-width-image {
    width: 90vw;
    margin-left: calc(50% - 45vw);
    margin-right: calc(50% - 45vw);
    max-width: 100vw;
    border-radius: 0;
    margin-top: 0;
    margin-bottom: 2em;
    display: block;
    box-sizing: border-box;
    padding-left: 5px;
    padding-right: 5px;
}

.logo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    justify-content: center;
}

.logo-item {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.logo-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Styles for controls container and buttons */
#controls-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    transition: none;
}

#controls-container button {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: color 0.3s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#controls-container button:hover {
    color: var(--blue-link-color);
    background-color: transparent;
}

body.dark-mode #controls-container button {
    color: #fff;
}

/* Styles for the reveal buttons and expanded content */
button.reveal {
    color: inherit;
    font-weight: normal;
    cursor: pointer;
    border: none;
    background-color: transparent;
    padding: 0 0.2em;
    font: inherit;
    border-radius: 4px;
    outline: none;
    position: relative;
    z-index: 1;
}

button.reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
    z-index: -1;
    opacity: 1;
}

.highlight-blue::before { background-color: #D6F5FF; }
.highlight-yellow::before { background-color: #FDFB8C; }
.highlight-pink::before { background-color: #FFDDEE; }
.highlight-green::before { background-color: #DDFFAA; }
.highlight-purple::before { background-color: #EEDDFF; }

body.dark-mode button.reveal:not(:disabled) {
    color: #000;
}

body.dark-mode button.reveal:disabled {
    color: var(--text-color-dark);
}

body.dark-mode span.inline-reveal {
    color: var(--text-color-dark);
}

button.reveal:disabled {
    cursor: default;
    opacity: 0.8;
}

button.reveal:disabled::before {
    opacity: 0;
}

span.inline-reveal {
    display: none;
    border-radius: 4px;
    padding: 0;
    transition: background-color 0.3s ease-in-out, padding 0.3s ease-in-out;
}

span.inline-reveal.visible {
    display: inline;
}

#random-dots-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.collected-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    position: absolute;
    opacity: 1;
}

#smiley-placeholder {
    opacity: 0;
}

#smiley-placeholder.visible {
    opacity: 1;
}


@media (max-width: 768px) {
  body {
    padding: 20px 15px;
  }
  .full-width-image,
  .pdf-container,
  .full-width-gallery {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 15px;
    padding-right: 15px;
    grid-template-columns: 1fr;
  }
  .image-pair-container {
    flex-direction: column;
    align-items: center;
  }
  .image-pair-container img {
    width: 100%;
    height: auto;
    margin-bottom: 1em;
  }
  .action-items-grid {
        grid-template-columns: 1fr;
    }
    #controls-container {
        top: 10px;
        right: 10px;
        gap: 5px;
        padding: 0;
    }
    #controls-container button {
        font-size: 1em;
        padding: 3px;
    }
}
