body {
  max-width: 40em;
  margin: 0 auto;
  padding: 5px;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.6em;
  color: black;
}

/* ------------------------------
- this is a way to make the page scroll smoothly while respecting the user's preference for reduced motion 

Use the target pseudo-class to add a smooth scroll to the element with the id "my-target"



-----------------------------   */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

#my-target:target {
  scroll-margin-top: 100px;
  outline: 10px solid deeppink;
  transition: 1s ease-in-out outline;
}


input[type="checkbox"] {
  appearance: none;
  position: relative;
  display: inline-block;
  background: lightgray;
  height: 1.65rem; 
  width: 2.75rem;
  vertical-align: middle;
  border-radius: 2rem;
  box-shadow: 0px 1px 3px #0003 inset;
  transition: 0.25s linear background;
}

input::before {
  content: "";
  display:block; 
  width: 1.25rem; 
  height: 1.25rem; 
  background: #fff;
  border-radius: 1.2rem; 
  background: #fff; 
  position: absolute;
  top: 0.2rem; 
  left: 0.2rem; 
  transition: 0.25s linear transform;
  box-shadow: 0px 1px 3px #0003;
  transform: translateX(0rem);
}

input:checked {
  background: green;
}

input:checked::before {

  transform: translateX(1.25rem);
}

input:focus-visible {
  outline: 4px solid deeppink;
  outline-offset: 2px;
}

/* choose outline: transparent over none */
/* forced color mode - changes colors for high contrast  */
input:focus {
  /* outline: none; */  
  /* outline-color: transparent; */
}


/* ------------------------------
the details element has an open attribute that is a live DOM attribute 



-----------------------------   */


summary::marker {
  font-style: 1.5rem; 
  content: "👉";
}

summary {
  cursor: pointer;
}
[open] summary::marker {
  content: "👇";
  transition: 0.25s linear transform;
}

summary:hover {
  background: deeppink;
  cursor: pointer;
}


/* ------------------------------
Dialog is an HTML element that creates a dialog box or pop-up window on a webpage. 

When the dialog opens. it opens in the top layer is a new concept in browsers and solves a complicated problem: of chat widgets.  

Top layer is a new concept that adds a new layer between the browser and the screen 

With a form with a meta dialog 



-----------------------------   */

dialog::backdrop {
  background: #fff5;
  backdrop-filter: blur(4px);
}

dialog {
  border: none;
  border-radius: 1rem;
  box-shadow: 0px 0px 10px 0px #0003;
  padding: 1rem;
  width: 20rem;
  text-align: center;
  transform: scale(1);
  transition: all 0.5s ease-in-out;
  color:maroon;

  @starting-style {
    opacity: 0;
    transform: scale(0.5,0.5);
  }

}



button {
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
}


/* ------------------------------
Container queries are a way to query the size of a container and use that to determine the size of other elements. 

This makes where it is on the page less relevant and more dependent on the space available to it. 

-----------------------------   */
.container {
  container-type: inline-size;
}

.card {
  display: flex; 
  flex-direction: column; 
}

@container (min-width: 400px) {
  .card {
    flex-direction: row;
  }
}

/* ------------------------------
The has selector is used to style an element based on the presence of a class on an ancestor element. 

:has() allows us to add conditional logic to CSS

-----------------------------   */


form #other-text {
  display: none;
}

form:has(#other:checked) #other-text {
  display: block;
}

input, textarea {
   field-sizing: content;
}

/* ------------------------------
scroll-driven animations: 
https://scroll-driven-animations.style/

-----------------------------   */
