/* ================
   Base / Background
================ */
*{ box-sizing: border-box; }

body{
  margin: 0;
  background-color: #DACBB6;
  background-image: url('https://i.imgur.com/m5Mig5o.png');
  background-repeat: repeat;
  font-family: Georgia, "Times New Roman", serif;
  color: #111;
}

/* ================
   Book Wrapper
================ */
#cover{
  width: 820px;
  height: 580px;
  border-radius: 15px;
  background-color: #91697b;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-image: url('https://i.imgur.com/BspyVOP.png');
  box-shadow: 2px 2px 2px #57443E;
  padding: 10px;
}

#page1{
  background-color: #fff;
  border-radius: 15px;
  width: 818px;
  height: 578px;
  padding: 2px;
  box-shadow: 0px 0px 2px #57443E;
}

#page2{
  background-color: #fff;
  border-radius: 15px;
  width: 814px;
  height: 574px;
  box-shadow: 0px 0px 2px #574539;
  padding: 2px;
}

#page3{
  background-color: #fff;
  border-radius: 15px;
  width: 814px;
  height: 574px;
  box-shadow: 0px 0px 2px #574539;
  background-image: url('https://i.imgur.com/BspyVOP.png');
  position: relative;
}

/* Center “spine” line */
#line{
  width: 1px;
  height: 574px;
  margin: 0 auto;
  background-color: #A19386;
  box-shadow: 0px 0px 10px #2e2a27;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

/* Pages */
#leftpage{
  float: left;
  width: 363px;
  height: 544px;
  padding: 15px;
  overflow-y: auto;
}

#rightpage{
  float: right;
  width: 361px;
  height: 544px;
  padding: 15px;
  overflow: hidden; /* iframe handles scroll */
}

/* Typography */
h1{
  margin: 0 0 10px;
  font-size: 26px;
}
p{
  line-height: 1.4;
  margin: 0 0 12px;
}

a{
  color: #111;
  text-decoration: underline;
}
a:hover{
  background: #111;
  color: #DACBB6;
  text-decoration: none;
}

/* Back link style */
a.back{
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #111;
  text-decoration: none;
}
a.back:hover{
  background: #111;
  color: #DACBB6;
}

/* Guestbook iframe */
#guestbook-frame{
  width: 100%;
  height: 100%;
  border: 1px solid #A19386;
  border-radius: 10px;
  background: #fff;
}

/* ================
   Mobile / Small screens
   Make it stack instead of “book”
================ */
@media (max-width: 900px){
  #cover{
    position: static;
    transform: none;
    width: calc(100% - 20px);
    height: auto;
    margin: 14px auto;
  }

  #page1, #page2, #page3{
    width: 100%;
    height: auto;
  }

  #page3{
    padding-bottom: 12px;
  }

  #line{
    display: none;
  }

  #leftpage, #rightpage{
    float: none;
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  #guestbook-frame{
    height: 520px; /* big enough for signing on phones */
  }
}
