/*
 * LunchTag theme — white / gray / Yale Blue.
 * Retheme by editing the variables below; the rest of the file only
 * references these variables (plus a few neutral grays).
 */
:root {
  --yale-blue: #00356b;        /* primary accent: header, buttons */
  --yale-blue-dark: #00254d;   /* hover state for primary buttons */
  --link-blue: #286dc0;        /* links on white backgrounds */
  --ink: #222222;              /* main text */
  --muted: #666666;            /* secondary text */
  --bg: #f5f5f5;               /* page background */
  --panel: #ffffff;            /* panels and cards */
  --border: #dddddd;           /* hairline borders */
  --surface: #f5f5f5;          /* subtle gray fills (chips, tags) */
  --danger: #9e1b1b;           /* destructive buttons */
  --shadow: rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0 0 0.6rem 0;
}

p {
  margin: 0.3rem 0 0.8rem 0;
}

a {
  color: var(--link-blue);
}

a:hover {
  color: var(--yale-blue);
}

.site-header {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 2rem;
  background: var(--yale-blue);
  color: #ffffff;
}

.site-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.site-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 3px;
}

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

.nav a {
  text-decoration: none;
  color: #ffffff;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.draft-chip {
  justify-self: start;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 0.9rem;
  color: #ffffff;
}

.draft-chip a {
  color: #ffffff;
  font-weight: 600;
}

.content {
  padding: 2rem;
  display: grid;
  gap: 1.5rem;
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
}

.panel {
  background: var(--panel);
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px var(--shadow);
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--panel);
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.form-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

input, select, button {
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  border: 1px solid #bbbbbb;
  font-size: 0.95rem;
  background: #ffffff;
  color: var(--ink);
}

input:focus, select:focus {
  outline: 2px solid var(--link-blue);
  outline-offset: 1px;
}

button {
  background: var(--yale-blue);
  color: #ffffff;
  border: none;
  cursor: pointer;
}

button:hover {
  background: var(--yale-blue-dark);
}

/* Anchor styled as a button (e.g. "View draft" link). */
a.button {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  background: var(--yale-blue);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
}

a.button:hover {
  background: var(--yale-blue-dark);
  color: #ffffff;
}

button.ghost {
  background: #ffffff;
  color: var(--yale-blue);
  border: 1px solid var(--yale-blue);
}

button.ghost:hover {
  background: var(--surface);
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #7c1414;
}

.muted {
  color: var(--muted);
}

.tag-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.6rem 0 1rem 0;
}

.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.groups {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.group-card {
  background: var(--surface);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

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

.flash {
  display: grid;
  gap: 0.4rem;
}

.flash-item {
  background: #eaf1f8;
  border: 1px solid #c3d5e8;
  border-left: 4px solid var(--yale-blue);
  color: var(--ink);
  padding: 0.7rem 1rem;
  border-radius: 4px;
}

.table {
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  color: var(--yale-blue);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

th, td {
  padding: 0.6rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 720px) {
  .content {
    padding: 1.2rem;
  }
  .site-header {
    padding: 1rem 1.2rem;
  }
}

/* --- Member profile screen ------------------------------------------------ */

.profile-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.profile-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-facts {
  margin: 12px 0 0;
}

.profile-facts dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 10px;
}

.profile-facts dd {
  margin: 2px 0 0;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

.stacked-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.stacked-form input,
.stacked-form select,
.stacked-form textarea {
  font: inherit;
  color: var(--ink);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}

.stacked-form button {
  align-self: flex-start;
}

.widget-card {
  border: 1px solid var(--border);
  border-left: 3px solid #b9b9b9;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.widget-card.current {
  border-left-color: var(--yale-blue);
}

.widget-card strong {
  display: block;
  margin: 2px 0;
}

.load-more {
  display: inline-block;
  margin-top: 4px;
}

.onboarding {
  max-width: 480px;
  margin: 40px auto;
}

@media (max-width: 800px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

/* --- Strike / Boost widgets ----------------------------------------------- */

.pref-widgets {
  display: grid;
  /* Cards wrap to fewer columns instead of shrinking past readability;
     natural height (no fixed aspect ratio) so content never clips. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.pref-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.pref-widget h3 {
  margin: 0;
}

.pref-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.strike-icon {
  background: #fbeaea;
  color: var(--danger);
}

.boost-icon {
  background: #fff6de;
  color: #b8860b;
}

.pref-list {
  list-style: none;
  margin: 4px 0;
  padding: 0;
  width: 100%;
}

.pref-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.pref-remove {
  padding: 2px 8px;
  font-size: 0.8rem;
}

.pref-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: auto;
}

.pref-form select {
  flex: 1;
  min-width: 150px;
  font: inherit;
  color: var(--ink);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}

.pref-note {
  font-size: 0.78rem;
  margin: 6px 0 0;
}

/* --- Edit profile (collapsed by default) ---------------------------------- */

.edit-profile summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--yale-blue);
  list-style: none;
}

.edit-profile summary::-webkit-details-marker {
  display: none;
}

.edit-profile summary::before {
  content: "▸ ";
}

.edit-profile[open] summary::before {
  content: "▾ ";
}

.edit-profile[open] summary {
  margin-bottom: 8px;
}

/* --- Portal tabs ----------------------------------------------------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.tab {
  color: #ffffff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px 6px 0 0;
  font-size: 0.9rem;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.12);
}

.tab.active {
  background: var(--bg);
  color: var(--yale-blue);
  font-weight: 600;
}

.tab.disabled {
  opacity: 0.45;
  cursor: default;
}

.tab.disabled em {
  font-style: normal;
  font-size: 0.75rem;
}

.subnav {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 8px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

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

.subnav a:hover {
  text-decoration: underline;
}

.subnav-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* --- Hero pairing card + footer -------------------------------------------- */

.hero-pairing {
  border-left: 4px solid var(--yale-blue);
  margin-bottom: 20px;
}

.hero-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 8px;
}

.hero-partner {
  flex: 1 1 240px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface);
}

.hero-partner h3 {
  margin: 0 0 2px;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 28px 16px 20px;
}

.check-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
  font-size: 0.9rem !important;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--yale-blue);
}

.template-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

.template-form {
  max-width: 720px !important;
}

.email-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  white-space: pre-wrap;
  font-size: 0.88rem;
  font-family: inherit;
}

.email-preview.error {
  color: var(--danger);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- Apple-style toggle switches ------------------------------------------- */

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink);
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: relative;
  width: 44px;
  height: 26px;
  background: #c7c7cc;
  border-radius: 999px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.switch .slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .slider {
  background: var(--yale-blue);
}

.switch input:checked + .slider::after {
  transform: translateX(18px);
}

.switch-lg .slider {
  width: 62px;
  height: 36px;
}

.switch-lg .slider::after {
  width: 32px;
  height: 32px;
}

.switch-lg input:checked + .slider::after {
  transform: translateX(26px);
}

/* --- Onboarding opt-in box + splash ---------------------------------------- */

.optin-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border: 2px solid var(--yale-blue);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--surface);
  max-width: 560px;
}

.optin-box h3 {
  margin: 0 0 4px;
}

.optin-box p {
  margin: 0;
}

.splash {
  text-align: center;
  padding: 56px 32px;
  max-width: 560px;
  margin: 48px auto;
}

.bell-icon {
  background: #e8eef7;
  color: var(--yale-blue);
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: auto 0;
}

/* --- Message templates admin page ------------------------------------------ */

.template-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.template-head h3 {
  margin: 0;
}

.tag-custom {
  background: #e8eef7;
  border-color: var(--yale-blue);
  color: var(--yale-blue);
}

.template-vars {
  margin: 12px 0;
  font-size: 0.85rem;
}

.template-vars summary {
  cursor: pointer;
  color: var(--link-blue);
}

.template-block h4 {
  margin: 12px 0 6px;
}
