@font-face {
  font-family: 'JGgwakchanGothicA-Regular';
  src: url('fonts/JGgwakchanGothicA_RRegular-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'JGgwakchanGothicA-Bold';
  src: url('fonts/JGgwakchanGothicA_RBold-Bold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'JGgwakchanGothicA-Heavy';
  src: url('fonts/JGgwakchanGothicA_RHeavy-Heavy.woff') format('woff');
  font-weight: 900;
  font-style: normal;
}

@font-face {
  font-family: 'JGgwakchanGothicA-Thin';
  src: url('fonts/JGgwakchanGothicA_RThin-Thin.woff') format('woff');
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: 'JLongZukinie';
  src: url('fonts/JLongZukinie-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}


body {
    font-family: 'JGgwakchanGothicA-Regular', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

.deck-headline h2 {
  font-family: 'JGgwakchanGothicA-Regular';
  position: relative;
  top: 20px;
}

#headlineDots {
  display: inline-block;
  min-width: 1em;
  animation: fadeDots 1.2s infinite ease-in-out;
}

@keyframes fadeDots {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.deck-scroll-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  height: 100%;
  position: relative;
  padding: 12px;
}

#deckContainer {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.deck {
  position: relative;
  height: 100%;
  width: max-content;
  display: flex;
  gap: 0;
}

.card {
  position: absolute;
  width: 285px;
  height: 400px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.4s ease;
  cursor: pointer;
}


.card.shifted {
  transform: translate(400px, -50%);
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 3s ease-in-out;
}


.card-inner.flip {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.card-front {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-back {
  background-color: #fff;
  transform: rotateY(180deg);
}
.wrapper, .content {
  height: 100vh;
  display: flex;
}
.wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: 100vh;
}
.card-back-layout {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 1em 1em 2em;  /* ⬅ slightly reduced bottom padding */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;  /* content to bottom */
  align-items: center;
  overflow: hidden;
  gap: 0.5em; /* ⬅ compact space between caption & footer */
}

.card-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
}



.card-caption {
  z-index: 2;
  position: relative;
  border-radius: 8px;
  width: 90%;
  font-family: 'JLongZukinie', sans-serif;
  font-size: 40px;
  text-align: justify;
  text-align-last: left;
  line-height: 1;
  word-break: break-word;
  margin: 0; /* ⬅ remove extra margin */
}

.card-footer {
  z-index: 2;
  position: relative;
  border-radius: 8px;
  width: 90%;
  font-family: 'JGgwakchanGothicA-Regular';
  font-size: 12px;
  text-align: justify;
  text-align-last: left;
  line-height: 1.4;
  word-break: break-word;
  margin: 0;
}

.match-label {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 90%;
  margin-top: 0.4em;
  margin-bottom: 0.3em;
  z-index: 2;
}

.match-label .line {
  flex-grow: 1;
  height: 1px;
  background-color: #333;
  margin-right: 0.5em;
}

.match-label .label-text {
  font-family: 'JGgwakchanGothicA-Bold';
  font-size: 18px;
  white-space: nowrap;
  color: #111;
}


.content {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #f9f9f9;
    width: 100%;
    flex-direction: column;
    margin-top: 0;
}

/* Dimmed overlay for focused card */
#focusedContainer {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  z-index: 100;
}


.focused-card .card-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 3s ease-in-out;
}

.focused-card.flip .card-inner {
  transform: rotateY(180deg);
}
.focused-wrapper {
  position: fixed;
  top: 50%;
  left: 260px; /* start right after the sidebar */
  width: calc(100vw - 260px); /* space right of sidebar */
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateY(-50%);
  z-index: 100;
}




.focused-card {
  width: 401px;
  height: 560px;
  position: relative; /* no fixed/absolute here */
  z-index: 101;
}

.focused-card .card-caption {
  z-index: 2;
  position: relative;
  border-radius: 8px;
  width: 90%;
  font-family: 'JLongZukinie', sans-serif;
  font-size: 60px;
  text-align: justify;
  text-align-last: left;
  line-height: 1;
  word-break: break-word;
  margin: 0; /* ⬅ remove extra margin */
}

.focused-card .card-footer {
  z-index: 2;
  position: relative;
  border-radius: 8px;
  width: 90%;
  font-family: 'JGgwakchanGothicA-Regular';
  font-size: 18px;
  text-align: justify;
  text-align-last: left;
  line-height: 1.4;
  word-break: break-word;
  margin: 0;
}

@keyframes shakeMatch {
0%   { transform: rotate(0deg); }
  10%  { transform: rotate(2deg); }
  20%  { transform: rotate(-2deg); }
  30%  { transform: rotate(1deg); }
  40%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.card.match {
  animation: shakeMatch 1s ease-in-out 3;
  /*box-shadow: 0 0 12px gold;*/
  position: relative;
  z-index: 0;
   border-radius: 20px;
  overflow: visible; /* make sure glow isn't clipped */
}

.card.match::after {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  background: rgba(255, 215, 0, 0.4); /* solid gold glow box */
  border-radius: 20px;
  filter: blur(20px);
  pointer-events: none;
  animation: pulseGlow 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 0.4;
  }
}

.overlay-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar {
  z-index: 200;
  width: 260px;
  transition: width 0.4s ease;
  background: white;
  width: 260px;
  padding: 50px 50px; /* Control side padding here */
  box-sizing: border-box;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: 'JGgwakchanGothicA-Regular';
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Push footer to bottom */
  height: 100vh; 
}



.sidebar.expanded {
  width: 360px;
}
.sidebar h1 {
  font-family: JLongZukinie, sans-serif;
  font-size: 110px;
  line-height: 1;
  text-align: center;
  margin: 0 auto 20px auto;
  width: fit-content;
  letter-spacing: 2px; /* ⬅ Increase tracking */
  transform: translateY(-10px); /* ⬅ Move slightly up */
  letter-spacing: 3px;
}


.sidebar-section-title {
  display: block;
  font-size: 16px;
  margin-top: 16px;
  font-family: 'JGgwakchanGothicA-Bold'; /* or another bold from your set */
}

.sidebar-subtitle {
  font-weight: 500;
  margin-top: 4px;
  font-family: 'JGgwakchanGothicA-Regular';
  font-size: 14px;
}


.divider {
  text-align: center;
  font-size: 20px;
  margin: 30px 0;
  transition: font-size 0.3s ease, margin 0.3s ease;
}

.sidebar--focused .divider {
  font-size: 0px;
  margin: -20px 0;
}

.intro {
  font-size: 15px;
  line-height: 1.6;
  margin-top: 12px;
}

.intro strong {
  display: block;            /* puts it on its own line */
  /* margin-top: 12px;*/
  font-size: 17px;           /* different size */
  font-family: 'JGgwakchanGothicA-Bold';  /* or another of your custom fonts */
  color: #111;
}

.card-info {
  margin-top: 24px;
  font-size: 14px;
  line-height: 1.5;
}

.sidebar-image {
  max-width: 100%;
  border-radius: 6px;
  margin-top: 8px;
}

.image-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}

.image-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.3);
}

.close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 32px;
  color: white;
  cursor: pointer;
}

.sidebar-footer {
  font-family: 'JGgwakchanGothicA-Regular';
  font-size: 10px;
  color: #888;
  text-align: left;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  margin-top: 24px;
  margin-bottom: 0;
}
.mobile-footer {
  font-family: 'JGgwakchanGothicA-Regular';
  font-size: 10px;
  color: #888;
  text-align: center;
  padding: 16px 0;
  display: none; /* hidden by default for desktop */
}

.deck-headline {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  z-index: 200;
  pointer-events: none;
  width: 420px; /* same width as focused card */
}



.deck-headline h2 {
  font-size: 40px;
  font-weight: bold;
  margin: 0;
  pointer-events: none;
}

/* mobile */


@media screen and (max-width: 768px) {
  body {
    flex-direction: column;
    display: block; /* allow natural scroll */
  }

  .wrapper {
    flex-direction: column;
    display: block;
    z-index: 100;
  }

  .sidebar {
    width: 100%;
    height: 800px;
    margin-top: 50px;
    box-shadow: none;
    padding: 20px;
    box-sizing: border-box;
    border-bottom: 0px solid #ccc;
    z-index: 200;
  }

  .intro {
  font-size: 15px;
  line-height: 1.6;
  margin-top: 12px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}


  #cardInfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }


  .sidebar-section {
    width: 40%;
     margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    
  }

  .sidebar-section-title,
  .sidebar-subtitle {
    margin-top: 8px;
    text-align: left;
    width: 100%;
  }

  .sidebar-image {
    display: block;
    width: 100%;
    margin: 15px auto 20px auto;
    border-radius: 6px;
  }

.sidebar-section-title {

  font-size: 16px;
  
}

.sidebar-subtitle {

  font-size: 16px;
}
 
  .content {
    width: 100%;
    flex-direction: column;
    padding-top: 0; /* remove any flex-specific layout */
    margin-top: 20px; /* or match the height of .sidebar if needed */
  }

  .deck-scroll-wrapper {
    padding: 20px;
  }

  .deck {
    gap: 12px;
  }

  .card {
    width: 240px;
  height: 333px;
  }
  
  #focusedContainer {
    position: static;
    width: 100%;
    height: auto;
    background: transparent;
    backdrop-filter: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 24px;
    padding-bottom: 24px;
  }

   .focused-wrapper {
    position: static;        /* removes fixed behavior */
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    height: auto;
    margin-top: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .focused-card {
    width: 90vw;
    aspect-ratio: 3 / 4;
    width: 401px;
  height: 560px;
    /* max-width: 400px;
    height: auto; let aspect-ratio handle it */
    border-radius: 16px;
     box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }

  .focused-card .card-inner {
    border-radius: 16px;
  }

  .sidebar-footer {
     display: none;
  }
  .mobile-footer {
    display: block;
  }



}
