/* ---------- GLOBAL ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-image: url("hearts%203.gif");
  background-repeat: repeat;
  margin: 0;
  font-family: Verdana, system-ui, sans-serif;
  color: black;
}

/* ---------- BANNERS ---------- */

.top-banner img,
.bottom-banner img {
  width: 100%;
  height: 100%;
  display: block;
}

.top-banner img {
  padding: 20px;
}

.instruction-box {
text-align: center;
}

/* ---------- LAYOUT WRAPPER ---------- */

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  box-sizing: border-box;
}

.notebook {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* area where cover / dividers / content swap */
.page-area {
  max-width: 600px;   /* was 800 */
  width: 100%;
  margin: 0 auto 40px;
  aspect-ratio: 2321 / 2852;
  position: relative;
}
/* each "page" image (cover + dividers) */
.page-image {
  width: 100%;
  height: auto;
  display: none;   /* JS turns the current one on */
}

/* ---------- TABS ---------- */

.cover-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;  /* center tabs + cover together */
}


/* Tab row floats on top of the cover and scales with width */
/* Tabs should come first in the column */
.tab-row {
  order: 1;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 8px;

  position: static;      /* in normal flow */
  width: 80%;
  max-width: 480px;
  margin: 0 auto 6px;    /* small gap above cover image */
}

/* Cover image should come after tabs */
#cover {
  order: 2;
}



.tab-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;

  flex: 1 1 0;
  max-width: 20%;
}

.tab-btn img {
  display: block;
  width: 100%;
  height: auto;
}

.tab-hidden {
  visibility: hidden;
}

/* ---------- CONTENT PAGE STYLING ---------- */

.content-page {
  width: 100%;
  max-width: 600px;   /* was 800 */
  aspect-ratio: 35 / 43;
  margin: 0 auto 40px;

  /* PAPER BACKGROUND */
  background-image: url("notebook_paper.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;

  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* inner scroll area so the paper stays framed */
.content-inner {
  padding: 40px 50px 30px 80px;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
}

/* entire entry block */
.entry {
  font-family: Verdana, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #7a4c30;
}

/* top header (icon + date + home button) */
.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px;
  margin-bottom: 10px;

  background: #ffe3f2;
  border-radius: 999px;
  border: 1px solid #ffb7d6;
  box-shadow: 0 2px 0 rgba(255,183,214,0.5);
  position: relative;
}

/* center the date pill text inside the header */
.entry-header .entry-date {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.entry-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.entry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

.entry-icon img {
  width: 16px;
  height: 16px;
  display: block;
}

.entry-date {
  font-weight: bold;
  letter-spacing: 0.03em;
}

.home-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.home-btn img {
  width: 51px;
  height: 21px;
  display: block;
}

.entry-section {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin: 16px 0 6px;

  background: #ffe3f2;
  border-radius: 999px;
  border: 1px solid #ffb7d6;
  box-shadow: 0 2px 0 rgba(255,183,214,0.5);

  font-weight: bold;
  color: #7a4c30;
}

.entry-body {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dotted #f3c2a9;
}

.entry-body p {
  margin: 0 0 8px 0;
}

/* divider images between cover and content */
.divider {
  max-height: 900px;
  object-fit: contain;
}

/* ---------- RESPONSIVE TWEAKS ---------- */

/* Tablets / small laptops */
@media (max-width: 900px) {
  .page {
    padding: 16px;
  }

  .top-banner img {
    padding: 12px;
  }

  .content-inner {
    padding: 32px 32px 24px 48px;
  }
}

/* Phones (portrait) */
@media (max-width: 600px) {
  .page {
    padding: 10px;
  }

  .top-banner img {
    padding: 8px;
  }

  .content-page {
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  }

  .content-inner {
    padding: 22px 16px 18px 28px;
    font-size: 13px;
  }

  .entry {
    font-size: 13px;
  }

  .entry-header {
    padding: 3px 8px;
  }

  .entry-section {
    padding: 3px 8px;
    font-size: 12px;
  }

  .home-btn img {
    width: 42px;
    height: auto;
  }

  .tab-row {
    top: 4%;       /* a bit closer to the top on small screens */
    width: 86%;
    gap: 6px;
  }
}

/* Very small phones */
@media (max-width: 400px) {
  .content-inner {
    padding: 18px 12px 14px 20px;
  }

  .entry {
    font-size: 12px;
  }

  .entry-section {
    font-size: 11px;
  }

  .tab-row {
    width: 90%;
  }
}


@media (max-width: 480px) {
  .tab-row {
    width: 88%;
    margin-bottom: 4px;
  }
}