/*
 * Plural Profiles — application styles
 */

:root {
  --bg: #1E2D25;
  --text: #819d6c;
  --link: #4e855f;
  --heading: #ecd3a2;
  --bg-contrast: #291c13;
  --error: #d96459;
  --success: #6dbf7b;
  --warning: #e2a854;
  --input-bg: #263a2e;
  --input-border: #4e855f;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.site-header {
  background-color: var(--bg-contrast);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--input-border);
}

.site-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
}

.site-header nav a {
  color: var(--link);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

.site-header nav a:hover {
  text-decoration: underline;
}

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.container.narrow {
  max-width: 540px;
}

/* Layout: sidebar + main */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
}

.sidebar {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.main-content {
  min-width: 0;
}

h1, h2, h3 {
  color: var(--heading);
  margin-top: 0;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Flash messages */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.flash--notice {
  background-color: rgba(109, 191, 123, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.flash--alert {
  background-color: rgba(217, 100, 89, 0.15);
  border: 1px solid var(--error);
  color: var(--error);
}

.flash--warning {
  background-color: rgba(226, 168, 84, 0.15);
  border: 1px solid var(--warning);
  color: var(--warning);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

fieldset.form-group {
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

fieldset.form-group legend {
  font-size: 0.9rem;
  color: var(--heading);
  padding: 0 0.35rem;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  accent-color: var(--link);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--heading);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--heading);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input[type="submit"],
button,
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background-color: var(--link);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
}

input[type="submit"]:hover,
button:hover,
.btn:hover {
  background-color: #3d6d4c;
}

.btn--secondary {
  background-color: transparent;
  border: 1px solid var(--link);
  color: var(--link);
}

.btn--secondary:hover {
  background-color: var(--link);
  color: #fff;
}

/* Card */
.card {
  background-color: var(--bg-contrast);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

/* Error list */
.error-messages p {
  color: var(--error);
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

/* Helper links below forms */
.form-links {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.form-links p {
  margin: 0.35rem 0;
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Card list */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card__header h2,
.card__header h3 {
  margin: 0;
}

/* Profile grid (public group view) */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.profile-card {
  text-align: center;
  padding: 1.5rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}

.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.profile-card h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1rem;
}

/* Profile header (show pages) */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-description {
  margin-bottom: 1.5rem;
}

.profile-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* Avatars */
.avatar {
  border-radius: 50%;
  object-fit: cover;
}

.avatar--small {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.avatar--large {
  width: 96px;
  height: 96px;
  font-size: 2.5rem;
}

.avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--link);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

.profile-card .avatar--placeholder {
  margin-left: auto;
  margin-right: auto;
}

.avatar--small.avatar--placeholder {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.avatar--large.avatar--placeholder {
  width: 96px;
  height: 96px;
  font-size: 2.5rem;
}

/* Pronouns */
.pronouns {
  font-style: italic;
  color: var(--text);
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Share box */
.share-box {
  background-color: var(--bg);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.share-box h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.share-url {
  display: flex;
  gap: 0.5rem;
}

.share-url input[type="text"] {
  flex: 1;
  font-size: 0.85rem;
}

/* Text helpers */
.text-muted {
  opacity: 0.7;
  font-size: 0.9rem;
}

.form-hint {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.5rem;
}

/* Button sizes */
.btn--small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn--danger {
  background-color: var(--error);
}

.btn--danger:hover {
  background-color: #c04e44;
}

/* ---- Responsive ---- */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
  }

  .container {
    padding: 0 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .site-header {
    padding: 0.75rem 1rem;
  }
}

/* Mobile (600px and below) */
@media (max-width: 600px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .container {
    margin: 1rem auto;
    padding: 0 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }

  .site-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .site-header nav a {
    margin-left: 0;
    margin-right: 1rem;
  }

  .site-header nav a:last-child {
    margin-right: 0;
  }

  .profile-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .share-url {
    flex-direction: column;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .profile-actions {
    justify-content: center;
  }
}

