:root {
  --shelf-width: 34vw;
  --bg: #3b3223;
  --wood: #3b3223;
  --wood-edge: #4e4230;
  --text: #3b3223;
  --plank-height: 18px;
  --shelf-gap: 40px;
}

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

html, body { height: 100%; }
@font-face {
  font-family: "Old-Soviet";
  src: url("/fonts/Old-Soviet.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "Old-Soviet", "Roboto", sans-serif;
  background-color: ##3b3223;
  background-image: url('/dworzec/images/mazlibrary.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
}

.preview h1 {
  font-size: 18px; /* bigger headline */
}

.preview p {
  font-size: 12px; /* body text */
}


.app {
  display: flex;
  height: 100vh;
  position: relative;
  align-items: center; /* vertically center the preview */
  justify-content: flex-start; /* left edge is the start */
  gap: 2vw; /* space between preview and shelf */
  padding-left: 2vw; /* optional padding from left edge */
}


/*preview box styles*/
.preview {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;

  background-image: url('/dworzec/images/libcard.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;

  width: 800px; /* initial max width */
  max-width: 100%; /* allow scaling down */
  aspect-ratio: 4 / 3;
  padding: 20px 80px 70px;
  color: var(--text);
  overflow: hidden;
}


/* Text stays inside visible area */
.preview .default-text,
.preview #title,
.preview #author,
.preview #description,
.preview #readLink,
.preview .submission-form {
  max-width: 45%;
  margin: 0 auto;
  line-height: 1.3;
  position: relative;
  z-index: 2;
}






.preview .cover {
  display: none;
  width: 180px;
  height: auto;
  border-radius: 6px;
  margin-bottom: 16px;
}

.preview #title,
.preview #author,
.preview #description,
.preview #readLink {
  display: none;
}

#readLink {
  color: red;         
  margin-top: 10px;
  display: inline-block;
  transition: color 0.2s ease;
}

#readLink:hover {
  color: #ffffef;
}


/*bookshelf styles*/
.shelf {
  width: var(--shelf-width);
  background: var(--wood);
  border-left: 8px solid var(--wood-edge);
  border-top: 8px solid var(--wood-edge);
  border-bottom: 8px solid var(--wood-edge);
  margin-left: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 20px 10px;
  box-sizing: border-box;
}

.shelf-label {
  font-size: 16px;
  font-weight: bold;
  color: #e6d7c8;
  margin-bottom: 10px;
}

.shelf-rows {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1; /* let rows stretch evenly */
}

.shelf-row {
  display: flex;
  justify-content: center;
  align-items: flex-end; /* keeps books bottom-aligned */
  position: relative;
  padding-bottom: var(--plank-height);
  height: clamp(160px, 22vw, 220px); /* responsive height */
}

.shelf-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--plank-height);
  background: linear-gradient(
    90deg,
    var(--wood-edge) 0%,
    var(--wood) 50%,
    var(--wood) 100%
  );
  border-top: 4px solid var(--wood-edge);
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.5);
  border-radius: 3px;
  z-index: 1;
}

.book {
  height: 100%; /* relative to shelf-row height */
  aspect-ratio: 2 / 10; /* width scales proportionally */
  background-size: cover;
  background-position: bottom center;
  background-repeat: no-repeat;
  margin: 0;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.1s ease;
  z-index: 2; /* ensures books sit above shelf plank */
}

.book:hover {
  transform: translateY(-6px);
}


footer {
  position: fixed;
  bottom: 10px;
  left: 10px;
  font-size: 8px;
  color: #0e0f13;
  z-index: 10;

footer a {
  color: #0e0f13;  
  text-decoration: underline;
}

/*checkout submission form*/
.submission-form {
  text-align: left;
  padding: 20px;
  border-radius: 10px;
  color: var(--text);
  width: 100%;
}

.submission-form h2 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 12px;
}

.submission-form input,
.submission-form select {
  width: 60%; /* fill narrower form */
  font-size: 10px; /* smaller text */
  padding: 4px 6px; /* less padding */
  margin-bottom: 10px;
}

.submission-form button {
  background-color: #e6d7c8;
  color: #3b3223;
  border: 1px solid #4e4230;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  text-transform: lowercase;
  transition: all 0.2s ease;
}

.submission-form button:hover {
  background-color: #d3c0a8;
  color: #000;
  border-color: #3b3223;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}


#openFormLink {
  color: red;
  text-decoration: underline;
  cursor: pointer;
}

#openFormLink:hover {
  color: #ffffef;
}

.submission-form input,
.submission-form select {
  width: 100%;
  color: #3b3223;
  background-color: #ffffef;
  border: 1px solid #4e4230;
  border-radius: 4px;
  padding: 6px;
  font-family: inherit;
  font-size: 12px;
}





/* Mobile / narrow screen breakpoint */
@media screen and (max-width: 900px) { 
  .preview {
    display: none !important; /* force hide */
  }

  .shelf {
    width: 100% !important;
    margin-left: 0;
    border-left: none;
    border-right: none;
    padding: 16px;
  }

  .shelf-rows {
    flex-direction: column;
  }
}