/* Color palette */
:root {
  --red: #E53935;
  --pink: #F48FB1;
  --bg-light: #FFF8F8;
  --text-dark: #330000;
}

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

body {
  font-family: 'Georgia', serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  position: relative;
}

header.header {
  margin-bottom: 1rem;
  text-align: center;
}

header h1 {
  color: var(--red);
  font-size: 2rem;
}

.letter-container {
  width: 100%;
  max-width: 800px;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
}

.hero-figure {
  margin-bottom: 1rem;
  text-align: center;
}

.hero-img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.letter-content p {
  margin-bottom: 1rem;
}

.edit-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Modal */
.modal[hidden] { display:none; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-content h2 {
  margin-bottom: 0.5rem;
  color: var(--pink);
}

.modal-content label {
  font-weight: bold;
  margin-top: 0.5rem;
}

.modal-content textarea,
.modal-content input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
}

.modal-content input[type="file"] {
  margin-top: 0.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.save-btn {
  background: var(--red);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.cancel-btn {
  background: #ccc;
  color: #333;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

/* Butterflies */
.butterfly {
  position: absolute;
  width: 80px;
  height: 80px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.4;
  pointer-events: none;
}

.butterfly-tl {
  top: 0;
  left: 0;
  background-image: url('assets/butterfly.svg');
  transform: rotate(20deg);
}

.butterfly-br {
  bottom: 0;
  right: 0;
  background-image: url('assets/butterfly.svg');
  transform: rotate(-20deg);
}

/* Responsive */
@media (min-width: 600px) {
  header h1 { font-size: 2.5rem; }
  .letter-container { padding: 2rem; }
  .edit-btn { width: 3.5rem; height: 3.5rem; font-size: 1.8rem; }
}
