/* Postcard Back Realistic Styling */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&display=swap');

.postcard-back {
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  grid-template-areas: "message divider address";
  align-items: stretch;
  width: 100%;
  min-height: 340px;
  background-color: #f8f5ed;
  background-image: url('images/paper-tile.png'), url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P8z8BQDwAE8QH9iE+u4wAAAABJRU5ErkJggg==');
  background-repeat: repeat, repeat;
  border-radius: 0.25em;
  box-shadow: 0 2px 16px #e5d8b7cc;
  position: relative;
  padding: 2.2em 2.6em 2.2em 2.2em;
  font-family: 'Caveat', 'Comic Sans MS', cursive;
  font-size: 1.5rem;
  color: #2c2c2c;
  overflow: visible;
}

.postcard-message {
  grid-area: message;
  align-self: stretch;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-right: 1.4em;
  /* Removed width: 100%; and max-width: 100%; */
} 

.postcard-divider {
  grid-area: divider;
  width: 2px;
  background: #bfa700;
  opacity: 0.5;
  border-radius: 2px;
  margin: 0 0.7em;
  min-height: 100%;
  z-index: 2;
}

.postcard-address {
  grid-area: address;
  align-self: stretch;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding-left: 1.2em;
  position: relative;
  /* Removed width: 100%; and max-width: 100%; */
} 




.postcard-message {
  grid-area: message;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  background: none;
  padding-right: 1.4em;
}

.postcard-divider {
  grid-area: divider;
  width: 2.5px;
  background: repeating-linear-gradient(
    to bottom,
    #bfa700 0 10px,
    transparent 10px 20px
  );
  border-radius: 2px;
  margin: 0 0.7em;
  min-height: 100%;
  opacity: 0.66;
  z-index: 2;
}

.postcard-address {
  grid-area: address;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  padding-top: 0.7em;
  padding-left: 1.2em;
}
.address-fields {
  padding-left: 0.2em;
  width: 100%;
  margin-top: 6em;
  font-family: 'Shadows Into Light', 'Caveat', 'Indie Flower', 'Patrick Hand', cursive;
  font-size: 1.15em;
  color: #003595;
  letter-spacing: 0.04em;
  line-height: 1.7em;
  text-align: left;
  text-transform: none;
  position: relative;
  min-height: 6em;
  background:
    repeating-linear-gradient(to bottom, transparent, transparent 1.7em, #e4e0d5 1.8em, transparent 1.9em);
  border-radius: 0.1em;
  box-sizing: border-box;
  border: 1px solid #e4e0d5;
  background-clip: padding-box;
}
.postcard-stamp {
  position: absolute;
  top: 0.1em;
  right: 0.2em;
  height: 8em;
  object-fit: contain;
  z-index: 3;
  transition: transform 0.2s cubic-bezier(.5,1.5,.5,1.2);
}

.postcard-id {
  font-size: 0.78em;
  color: #b5a98a;
  position: absolute;
  left: 0.8em;
  bottom: 0.8em;
  font-family: 'Shadows Into Light', 'Caveat', 'Indie Flower', 'Patrick Hand', cursive;
  letter-spacing: 0.04em;
  z-index: 2;
}

.postcard-message {
  grid-area: message;
  position: relative;
  padding-right: 1.2em;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  max-width: 50%;
}
.postcard-message {
  background: none;
  padding-right: 1.2em;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}
.postcard-message-text {
  font-family: 'Caveat', 'Comic Sans MS', cursive;
  font-size: 1.32rem;
  line-height: 1.7em;
  color: #2c2c2c;
  word-break: break-word;
  letter-spacing: 0.01em;
  min-height: 4.5em;
}

.postcard-signature {
  font-family: 'Caveat', cursive;
  font-size: 1.16em;
  margin-top: 1.6em;
  text-align: right;
  color: #1a2a4a;
  letter-spacing: 0.03em;
}

.postcard-id {
  font-size: 0.95em;
  color: #b5a98a;
  margin-top: 1.6em;
  font-family: 'Shadows Into Light', 'Caveat', 'Indie Flower', 'Patrick Hand', cursive;
  letter-spacing: 0.04em;
}

.postcard-divider {
  grid-area: divider;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    #c3bcae 0 8px,
    transparent 8px 16px
  );
  border-radius: 2px;
  margin: 0 0.5em;
  min-height: 98%;
  opacity: 0.45;
  z-index: 1;
}

.postcard-address {
  grid-area: address;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  padding-top: 0.7em;
  padding-left: 1.2em;
}


/* --- Canonical mobile override for postcard back and message (do not duplicate below) --- */



@media (max-width: 700px) {
  .postcard-back {
    display: flex;
    grid-template-columns: 1fr 0.06fr 1fr;;
    grid-template-areas:
      "message"
      "divider"
      "address";
    padding: 0em 0em 0em 0em;
    font-size: 1.05rem;
  }
  .postcard-address {
    align-items: flex-end;
    padding-left: 0;
  }
  .postcard-message {
    padding-right: 0.1em;
    max-width: 50%;
  }
  .postcard-address {
    padding-left: 0.1em;
  }
  .postcard-stamp {
    width: 96px;
    height: 96px;
    top: 0.1em;
    right: 0.1em;
  }
  .address-fields {
    margin-top: 3.2em;
    font-size: 0.98em;
  }
}

@media (max-width: 480px) {
  .postcard-back {
    display: flex;
    flex-direction: column;
    padding: 0.6em 0.1em 0.8em 0.1em;
    font-size: 1.01rem;
  }
  .postcard-message {
    padding-right: 0;
    margin-bottom: 0.5em;
    max-width: 50%;
  }
  .postcard-address {
    padding-left: 0;
    margin-top: 0.7em;
    align-items: flex-end;
  }
  .address-fields {
    margin-top: 4.5em;
    font-size: 0.96em;
    text-align: right;
    width: 100%;
  }
  .postcard-stamp {
    width: 72px;
    height: 72px;
    right: 0.05em;
  }
}

/* Mythic doodle overlays */
.mythic-doodle {
  position: absolute;
  z-index: 5;
  opacity: 0.18;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px #bfa70022);
  transition: opacity 0.3s;
}
.mythic-doodle svg {
  width: 128px;
  height: 128px;
  display: block;
}
