/* this is updated */
@font-face {
  font-family: "Luckiest Guy";
  src: url("../fonts/luckiest-guy-v25-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-v9-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-v9-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  /* Text styles */
  --header-font-family: "Luckiest Guy", sans-serif;
  --paragraph-font-family: "Figtree", sans-serif;
  --card-fontsize-header-1: 2.25rem;
  --header-color: #3C342F;
  --spilgalleri-titel-fontsize: 20px;
  --brand-red: #E0201F;
  --brand-green: #29503B;

  /* index standards */
  --page-background-color: #F8F5F1;

  /* Color styles */
  --card-background-color: #fff;


  /* effect styles */
  --shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.05);
  --transition: 250ms ease;
}

/* Location index.html */

.spilcafe-logo {
  margin: 0;
}

.spilcafe-logo img {
  width: 160px;
  height: auto;
}

.spilgalleri-titel {
  grid-column: 2;
  margin: 0;
  text-align: center;
  color: var(--header-color);
  font-family: var(--header-font-family);
  font-size: var(--spilgalleri-titel-fontsize);
}

/* HTML */
html {
  scroll-padding: 150px;
}

/* Headings */

h2 {
  color: var(--header-color);
  font-family: var(--header-font-family);
}

/* Card in general */
/* Card */
.game-card {
  width: 100%; 
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 16px;
  background: var(--card-background-color);
  box-shadow: var(--shadow);
  z-index: 1;
  transition: transform 400ms ease, box-shadow 400ms ease;
}

.game-card:focus-within {
  outline: 3px solid #0057ff;
  outline-offset: 2px;
}
.game-card:hover {
cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
transform: scale(1.02);
}

/* card badges language */
.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Card badge difficulty */
.badge {
  padding: 4px 10px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--header-color);
  border: 1px solid #d9cfc3;
  font-family: var(--paragraph-font-family);
  font-size: 0.875rem;
  font-weight: 700;
}

/* badge outer stroke */
.badge-icon {
  padding: 4px;
  line-height: 0;
}

/* bade image size */
.badge-icon img {
  display: block;
  width: 32px;
  height: 32px;
}

/* Cards tag - before opening */

/* Card badge difficulty color */
.badge-let {
  background: #D9F2D0;
}

.badge-mellem {
  background: #FBEAB8;
}

.badge-svaer {
  background: #F9D3CF;
}


/* kort Btn. border styling */
.card-open-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
}

/* Øvre card */
.top-card {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}


/* Billede af brætspil */
.game-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--card-background-color);
  transition: var(--transition);
  border-radius: 16px 16px 0 0;
  display: block;
}

/* Nedre card */
.bottom-card {
  width: 100%;
  padding: 8px 16px;
  box-sizing: border-box;
  border-radius: 0 0 16px 16px;
  background: var(--card-background-color);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}



/* Card titel front page */
.card-titel {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  text-align: center;
  font-family: var(--header-font-family);
  font-size: var(--card-fontsize-header-1);
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
}

/* Text for card description */
.card-description {
  font-family: var(--paragraph-font-family);
  font-size: 14px;
  margin: 8px 0 0;
  align-self: stretch;
  text-align: center;
}

/* FORSIDE */

body {
  margin: 0;
  background-color: var(--page-background-color);
  font-family: var(--paragraph-font-family);
  /* stops browser from making a fake "fat" font - luckiest guy only has weight 400 */
  font-synthesis: none;
}

footer {
  padding: 16px 16px 112px;
  text-align: center;
  font-family: var(--paragraph-font-family);
  font-size: 14px;
}

/*LOCATIONSIDE*/

.location {
  margin: 0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content: center;
  align-items: center;
}

.location h2 {
  color: #000;
  text-align: center;
  font-family: var(--paragraph-font-family);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
}

.button-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 300px;
  height: 80px;
  background: #ebdfd7;
  color: #000;
  font-size: 36px;
  font-family: var(--paragraph-font-family);
  font-weight: 400;
  text-decoration: none;
  border-radius: 15px;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.button:hover {
  background: #d8cfc3;
  transform: translateY(-2px);
}

/*SPILGALLERISIDE*/
/*Navbar*/
.navbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 24px 12px;
  background-color: var(--page-background-color);
  box-shadow: var(--shadow);
}

.header-logo {
  width: 48px;
  height: auto;
}

/* "vælg café" button */
.back-btn {
  justify-content: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--brand-red);
  color: #FFF;
  white-space: nowrap;
  font-family: var(--paragraph-font-family);
  font-weight: 700;
  text-decoration: none;
}

/* SEARCHBAR */
.search-group {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-group label {
  font-family: var(--paragraph-font-family);
  font-weight: 700;
  color: var(--header-color);
}

#search-input, #search-input-dialog {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #88786b;
  border-radius: 8px;
  background: #fff;
  font-family: var(--paragraph-font-family);
  font-size: 1rem;
}

/* Focus visible "vælg cafe / filter / searchbar" */
.back-btn:focus-visible, #open-filter:focus-visible, #search-input:focus-visible, #search-input-dialog:focus-visible {
  outline: 3px solid var(--header-color);
  outline-offset: 3px;
}


/* Filter bar */
.filter-bar {
  position: fixed;
  bottom: 16px;
  left:50%;
  transform: translateX(-50%);
  z-index:10;
}

#open-filter {
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 16px;
  background: var(--brand-red);
  color: #fff;
  font-family: var(--paragraph-font-family);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.main-content {
  padding: 0 24px 24px;
}

.main-content h2, .main-content .result-count {
  text-align: center;
}

/* Dialog filter - size */
#filter-dialog {
  box-sizing:border-box;
  width: 100%;
  max-width: 100%;
  max-height: 100dvh;
  margin-inline: 0;
  padding: 24px;
  background-color: var(--page-background-color);
  border: none;
}

#filter-title {
  margin: 0 0 24px;
  font-size: 2rem;
}

/* Dialog filter - close button */
.close-filter {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 50px;
  height: 50px;
  border: none;
  background: none;
  color: #000;
  font-size: 2rem;
  cursor: pointer;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.filter-group {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
}

/* Top filter */
.filter-group label {
  padding: 10px 8px;
  background: var(--brand-red);
  color: #fff;
  font-family: var(--paragraph-font-family);
  font-size: 1rem;
  text-align: center;
}

/* buttom filter */
.filter-group select {
  min-height: 44px;
  border: none;
  background: var(--brand-green);
  color: #fff;
  padding: 8px;
  font-family: var(--paragraph-font-family);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
/* Dropdown-liste background */
.filter-group option {
  background: #fff;
  color: var(--header-color);
}

/* Filter font */
.result-count {
  font-family: var(--paragraph-font-family);
}

/* filter result of filtering */
#filter-dialog .result-count {
  margin: 24px 0 8px;
  padding-top: 24px;
  border-top: 1px solid #88786b;
  font-size: 1.125rem;
}

.show-games {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--brand-red);
  color: #fff;
  font-family: var(--paragraph-font-family);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

#reset-filter {
  display: block;
  margin: 24px auto 0;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-family: var(--paragraph-font-family);
  font-weight: 700;
  cursor: pointer;
}

/* --- ALLE SPIL (grid) --- */
.game-list-all {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;

  margin: 0 auto;
  align-items: start;
  min-height: 100vh;
}








/* ====== DIALOG ====== */
#game-dialog {
  width: min(800px, 90%);
  max-height: 90vh;
  border: none;
  border-radius: 16px;
  background: var(--card-background-color);
  padding: 20px;
  overflow: hidden;
}

#game-dialog::backdrop {
  background: rgba(2, 2, 2, 0.6);
  backdrop-filter: blur(2px);
}

#dialog-content {

  display: flex;
  flex-direction: column;
  max-height: calc(90vh - 40px);
  overflow-y:auto; 
  
}

#dialog-content img {
  width: 100%;
  height: 350px;
  object-fit: contain;
  
}

.dialog-details {
  padding: 20px;
  display: flex;
  flex-direction: column;
}


.dialog-details h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-family: var(--header-font-family);
}

.dialog-details p {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-family: var(--paragraph-font-family);
}

.dialog-details .game-description {
  margin-top: 1rem;
  line-height: 1.6;
}

/* Close btn for dialog */
#close-dialog {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #88786b;
  border-radius: 24px;
  background: #f8f5f0;
  color: #3c342f;
  cursor: pointer;
}

/* 2 boxes for fact-list */
.fact-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Fact-list styling */
.fact-list li {
  padding: 11px 13px;
  background: var(--brand-green);
  border-radius: 10px;
  font-family: var(--paragraph-font-family);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  overflow-wrap: anywhere;
}

/* styling for factlabel */
.fact-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.875rem;
  font-weight: 400;
  color: #fff;
}

.game-card .fact-list {
  align-self: stretch;
  margin: 8px 0 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--page-background-color)
}

/* About / Rules for game */
#game-dialog summary {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #bc201f;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.game-rules {
  margin-top: 1rem;
  line-height: 1.6;
}

/* outline Styling for dialog and close dialog */
#close-dialog:focus-visible,
#game-dialog summary:focus-visible,
.filter-group select:focus-visible,
.show-games:focus-visible,
#reset-filter:focus-visible,
.close-filter:focus-visible {
  outline: 3px solid #3c342f;
  outline-offset: 4px;
}

.filter-group:has(select:focus-visible) {
  outline:3px solid #3C342F;
  outline-offset: 3px;
}

/* hidden for screenreader  */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


/* MEDIA RESPONSIVE DESIGN */

/* Tablet 768px */

/* 2 cards column */
@media (min-width: 768px) {
  .game-list-all {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Standard filter instead of dialog */
  #filter-dialog {
    display: block;
    position: sticky;
    top:139px;
    z-index: 4;
    width: auto;
    max-width:none;
    max-height: none;
    margin: 0 auto;
    padding: 12px 24px;
    background-color: var(--page-background-color);
  }

  /* filter and reset filter in a row */
  #filter-dialog form {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--header-color);
  }



  /* FILTER DIALOG REMOVE - Removing filter dialog specific details */
  .filter-bar,
  .close-filter,
  #filter-dialog .search-group,
  #filter-dialog .result-count,
  .show-games {
    display: none;
  }

  /* TITLE - hidden, but shown by  */
  #filter-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  /* FILTERS - 4 filters in grid system */
  .filter-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 0px;
  }

  /* filter label (red) */
  .filter-group label {
    padding: 6px 8px;
  }

  /* RESET FILTER - placement to the right */
  #reset-filter {
    margin: 0;
    min-height: 44px;
  }

  .navbar .search-group {
    justify-content: center;
  }

  /* card size reduced */
  
  .top-card {
    height: 160px;
  }

  .card-titel {
    font-size: 1.4rem;
  }

  .game-card .fact-list li {
    padding: 6px 8px;
    font-size: 1rem;
  }

  .filter-group select {
    min-height: 44px;
  }
}

/* desktop media query 1200 */

@media (min-width: 1200px) {
  .game-list-all {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* desktop media query 1600 */

@media (min-width: 1600px) {
  .game-list-all {
    grid-template-columns: repeat(4, 1fr);
  }
}

