/*THEME VARIABLES*/
:root {
  --bg1: rgb(245, 245, 245);       /*main background color*/
  --bg2: rgb(0, 0, 0);             /*background dot color*/
  --bg3: rgb(245, 245, 245);       /*box color*/
  --text: rgb(0, 0, 0);
  --text-box-bg: rgb(245, 245, 245);
  --link-hover: rgb(97, 97, 97);
  --chat-timestamp: rgb(100, 100, 100);
  --border: rgb(0, 0, 0);
  --img-tint-light: rgb(255, 255, 255, 0);
  --img-tint-dark: rgba(255, 255, 255, 0);
  --invert-image-color: 0;
}

body.dark {
  --bg1: rgb(66, 66, 66);
  --bg2: rgb(0, 0, 0);  
  --bg3: rgb(48, 48, 48);
  --text: rgb(255, 255, 255);
  --text-box-bg: rgb(66, 66, 66);
  --link-hover: rgb(143, 143, 143);
  --chat-timestamp: rgb(100, 100, 100);
  --border: rgb(0, 0, 0);
  --img-tint-light: rgba(255, 252, 252, 0);
  --img-tint-dark: rgba(255, 255, 255, 0);
  --invert-image-color: 0;
}

body.strawberry {
  --bg1: rgb(255, 103, 129);
  --bg2: rgb(255, 193, 193);         
  --bg3: rgb(255, 63, 95);        
  --text: rgb(255, 255, 255);
  --text-box-bg: rgb(255, 103, 129);
  --link-hover: rgb(255, 193, 193);
  --chat-timestamp: rgb(255, 166, 166);
  --border: rgb(255, 193, 193);
  --img-tint-light: rgb(255, 255, 255);
  --img-tint-dark: rgba(255, 0, 43, 0.5);
  --invert-image-color: 0;
}

body.sunset {
  --bg1: rgb(247, 196, 108);
  --bg2: rgb(255, 0, 0);         
  --bg3: rgb(250, 166, 47);        
  --text: rgb(255, 255, 255);
  --text-box-bg: rgb(255, 183, 82);
  --link-hover: rgb(228, 52, 20);
  --chat-timestamp: rgb(228, 52, 20);
  --border: rgb(228, 52, 20);
  --img-tint-light: rgb(245, 176, 79);
  --img-tint-dark: rgb(228, 51, 20);
  --invert-image-color: 0;
}

body.oceanside {
  --bg1: rgb(154, 209, 255);
  --bg2: rgb(255, 255, 255);         
  --bg3: rgb(84, 163, 252);        
  --text: rgb(255, 255, 255);
  --text-box-bg: rgb(107, 188, 255);
  --link-hover: rgb(175, 219, 255);
  --chat-timestamp: rgb(154, 209, 255);
  --border: rgb(255, 255, 255);
  --img-tint-light: rgb(255, 255, 255);
  --img-tint-dark: rgba(31, 162, 255, 0.809);
  --invert-image-color: 0;
}

/*STRUCTURE*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg1);
  background-image: radial-gradient(var(--bg2) 1px, transparent 1px);
  background-size: 5px 5px; 
  background-attachment: fixed;

  color: var(--text);
  font-family: josefin-sans, sans-serif;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1.8rem;

  width: 100%;
  max-width: 710px;
  margin: 4.5rem auto 2rem;
}

.main-sidebar-wrapper {
  display: flex;
  flex: 1;
  gap: 1.5rem;

  width: 100%; 
  max-width: 1265px;
  margin: 4.5rem auto 2rem;
}

.main-sidebar-wrapper > main {
  width: auto;
  max-width: none;
  margin: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  flex: 0 1 20%;
}

header {
  display: flex;
  position: fixed;
  z-index: 100;
  width: 100%;
  justify-content: space-between;

  padding: .45rem 1rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg3);

  font-size: 1.2rem;
  letter-spacing: .5px;
  font-family: sysfont;
}

footer {
  display: flex;
  justify-content: center;

  padding: .5rem 0;
  font-family: sysfont;
}

/*NAVIGATION*/
header a {
  text-decoration: none;
  color: var(--text);
}

header a:hover,
nav li:hover {
  text-decoration: underline;
  cursor: pointer;
  color: var(--text);
}

nav > ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav > ul > li {
  position: relative;
}

nav > ul > li:last-child {
  /* margin-left: 2rem; */
  text-decoration: none;
}

nav > ul > li > ul {
  background-color: var(--bg3);
  box-shadow: .25rem .25rem var(--border);
  border: 1px solid var(--border);
  min-width: 5rem;
  width: max-content;
  position: absolute;

  top: 120%;

  padding: .5em;  
  line-height: 1.7em;
  visibility: hidden;

  list-style: none;
}

nav > ul > li > ul::before {
  content: "";
  position: absolute;
  top: -25px; 
  left: 0;
  width: 100%;
  height: 25px; 
  z-index: -1;
}

nav > ul > li:hover > ul
/*nav ul li:focus-within ul*/ {
  visibility: visible;
}

nav > ul > li:last-child > ul {
  right: 0;
}

/*ITEM WRAPPER*/
.flex-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.flex-wrapper.unequal {
  flex-wrap: nowrap;
}

.flex-item {
  flex: 1 1 15rem;
}

.flex-wrapper.unequal > .flex-item {
  flex: 1 1 fit-content;
  min-width: 8rem;
}

/*BOX*/
.box {
  background-color: var(--bg3);     
  box-shadow: .25rem .25rem var(--border);
  border: 1px solid var(--border) ;
}

.box > h2 {
  border-bottom: 1px solid var(--border);
  padding: .8rem;
  font-size: 1.15rem;
  letter-spacing: .5px;
  font-family: sysfont;
} 

.box > p {
  padding: .8rem;
  font-size: 1.1rem;
  border-top: 1px solid var(--border);
}

/*IMG TINT*/
.img-tint-wrapper {
  display: grid;
  width: 100%;
  overflow: hidden;
}

.img-tint-wrapper img,
.img-tint-wrapper .tint-overlay-light,
.img-tint-wrapper .tint-overlay-dark {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}

.tint-overlay-light {
  background-color: var(--img-tint-light);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.tint-overlay-dark {
  background-color: var(--img-tint-dark);
  mix-blend-mode: screen;
  pointer-events: none;
}

/*IMAGES*/
#lains_room {
  object-fit: cover;
  height: 350px;
  width: 100%;
  transform: scale(1.5) translate(15%, 0%);
  filter: invert(var(--invert-image-color));
}

/*FORM*/
.form {
  padding: 1rem;
  font-size: 1.2rem;
  display: flex;
  gap: 1.5rem;
  width: 70%;
  margin: auto;
  flex-direction: column;
}

.form div {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.form button {
  background-color: var(--text-box-bg);
  box-shadow: .25rem .2rem var(--border);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .5rem;
  width: 100%;
  font-family: sysfont;
  font-weight: 1000;
  font-size: 1.3rem;
  letter-spacing: .5px;
}

.form input[type="text"],
.form input[type="number"]
 {
  background-color: var(--text-box-bg);
  box-shadow: .25rem .25rem var(--border);
  border: 1px solid var(--border);
  color: var(--text);
  width: 100%;
  height: 2rem;
  font-size: 1.1rem;
  padding: .5rem;
}

.form .form-group {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: space-between;
}

/*MODAL*/
.modal {
  width: 600px;
  height: 600px;
  margin: auto;
  padding: 2rem;
  justify-content: center;
  outline: none;

  background-color: var(--bg3);     
  box-shadow: .25rem .25rem var(--border);
  border: 1px solid var(--border);
  color: var(--text);
}

.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.open-modal {

}

.close-modal-button {
  position: absolute;
  top: 0px;
  right: 0px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.close-modal-button:hover {
  color: var(--link-hover);
}

/*MISCELLANEOUS*/
area:hover {
  cursor: pointer;
}

input[type="text"]:focus,
input[type="number"]:focus,
button:focus {
  outline: none
}

a {
  color: var(--text);
}

a:hover {
  color: var(--link-hover);
}
/*MEDIA RULES*/
@media (max-width: 800px) {
  main,
  .main-sidebar-wrapper {
    width: auto;
    margin: 4.5em 1em;
  }

  .flex-wrapper {
    flex-direction: column
  }

  .flex-item {
    flex: 1 1 fit-content;
  }

  .sidebar {
    display: none;
  }

  .chat-box {
    width: 100%;
    height: 400px;
  }
}

@font-face {
  font-family: 'sysfont';
  src: url('../assets/fonts/sysfont.woff2');
}

@font-face {
  font-family: 'josefin-sans';
  src: url('../assets/fonts/JosefinSans-VariableFont_wght.ttf');
  font-style: normal;
}

@font-face {
  font-family: 'josefin-sans';
  src: url('../assets/fonts/JosefinSans-Italic-VariableFont_wght.ttf');
  font-style: italic;
}

@font-face {
  font-family: 'josefin-slab';
  src: url('../assets/fonts/JosefinSlab-VariableFont_wght.ttf');
  font-style: normal;
}

@font-face {
  font-family: 'josefin-slab';
  src: url('../assets/fonts/JosefinSlab-Italic-VariableFont_wght.ttf');
  font-style: italic;
}
