@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,500;1,700&display=swap');

/* Base theme and layout */
:root {
  --brand: #0833d7; /* primary */
  --secondary: #f96380; /* secondary */
  --muted: #6c757d;
  --card-border: #e6e6e6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
}

h1 {
  margin-top: 0;
}

header.site {
  padding: 0.5rem 0;
  background: var(--brand);
  color: #fff;
}
header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--secondary);
  text-decoration: none;
  text-transform: uppercase;
}
header .brand img.brand-logo { height: 55px; width: auto; display: block; }
header.site nav { display: flex; align-items: center; min-height: 56px; }

.container-narrow { max-width: 860px; margin: 0 auto; padding: 1rem; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 1rem; }

.hero { margin: 2rem 0; }
.hero h1 { margin-bottom: 0.25rem; }
.hero p { color: var(--muted); }

.cards { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  border-bottom: 1px solid var(--card-border);
}

.avatar { 
  width: 80px; 
  min-width: 80px;
  height: 80px; 
  border-radius: 10px; 
  object-fit: cover;
  background: #e6e6e6;
}

.card-title-section {
  flex: 1;
  min-width: 0;
}

.card-title-section h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  line-height: 1.3;
  word-break: break-word;
}

.card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-body {
  padding: 1rem 1.25rem;
  flex: 1;
}

.meta-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 0.95rem;
  color: #333;
  font-weight: 500;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--card-border);
  background: #fff;
}

.card-footer form {
  margin: 0;
}

.btn-write {
  width: 100%;
  padding: 0.6rem 1rem !important;
  font-size: 0.9rem !important;
}

.meta { color: var(--muted); font-size: 0.95rem; }

.badge { padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.8rem; display: inline-block; font-weight: 600; }
.b-green { background: #e6ffed; color: #0b5b2b; }
.b-yellow { background: #fff7cc; color: #7a5a00; }
.b-red { background: #ffe8e6; color: #8a2400; }

.priority-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  display: inline-block;
  background: #6b46c1;
  color: #fff;
  font-weight: 600;
  margin-left: 0.25rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.page-header h1 {
  margin: 0;
  flex: 1;
}

@media (max-width: 768px) {
  .cards {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn-back {
    width: 100%;
    justify-content: center;
  }
  
  .card-header {
    gap: 0.875rem;
  }
  
  .avatar { 
    width: 70px; 
    min-width: 70px;
    height: 70px; 
  }
}

@media (max-width: 640px) {
  .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .container-wide {
    padding: 0 1rem;
  }
  
  .card {
    border-radius: 8px;
  }
  
  .card-header {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .card-body {
    padding: 0.875rem 1rem;
  }
  
  .card-footer {
    padding: 0.875rem 1rem;
  }
  
  .card-title-section h3 {
    font-size: 0.95rem;
  }
  
  .avatar { 
    width: 64px; 
    min-width: 64px;
    height: 64px; 
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1.5rem;
    gap: 0.75rem;
  }
  
  .page-header h1 {
    font-size: 1.5rem;
  }
  
  .btn-back {
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
  }
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--brand);
  border-radius: 8px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.btn-back:hover {
  background: var(--brand);
  color: #fff;
}

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Buttons: use brand and secondary colors */
button, .btn, input[type="submit"], input[type="button"], input[type="reset"] {
  font-family: 'Rubik', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 8px;
}
button.secondary, .secondary {
  font-family: 'Rubik', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  background-color: var(--secondary) !important;
  border-color: var(--secondary) !important;
  color: #fff !important;
}

.letter { white-space: pre-wrap; }
.letter-hand { font-family: 'Patrick Hand', cursive; font-size: 20px; line-height: 1.5; }

/* Print-friendly letter area (A4-ish) */
.letter-page {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
}
.letter-header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.letter-to { text-align: right; white-space: pre-line; }

