/* The one stylesheet. Written for phones first. */

:root {
  --ink: #2b2118;
  --quiet: #6b5d50;
  --paper: #fff8f0;
  --accent: #c2410c;
  --line: #e2d5c5;
  --glow: rgba(194, 65, 12, 0.1); /* soft orange shadow under cards */
  /* Rounded letters for headings where the phone has them (iPhone, Mac). */
  --fun: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}

body {
  min-height: 100vh; /* the background fills the screen even on short pages */
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  /* Two faint warm glows behind everything. */
  background:
    radial-gradient(circle at 0% 0%, #ffe1c7 0, transparent 22rem),
    radial-gradient(circle at 100% 18rem, #ffe0ef 0, transparent 20rem),
    var(--paper);
}

main {
  max-width: 32rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-family: var(--fun);
  font-size: 2.125rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Read aloud by screen readers, hidden on screen (e.g. the name behind an emoji). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a {
  color: var(--accent);
}

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

.error {
  color: #b42318;
  margin: 0.25rem 0 0;
}

/* Forms: big enough to tap, and 16px+ text so iPhones don't zoom in. */

form {
  margin: 1.5rem 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.75rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.625rem;
}

button,
.button {
  display: inline-block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.875rem 1.25rem;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 12px var(--glow);
  cursor: pointer;
  transition: transform 0.1s;
}

button:active,
.button:active {
  transform: scale(0.97); /* a little squish when tapped */
}

button.plain {
  width: auto;
  padding: 0.5rem 0;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--quiet);
  background: none;
  box-shadow: none;
  text-decoration: underline;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

h2 {
  margin: 2rem 0 0.25rem;
  font-family: var(--fun);
  font-size: 1.3125rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* The weekly grid: days across the top, occasions down the side. */

.grid {
  width: 100%;
  margin: 1.25rem 0 0.5rem;
  border-collapse: separate;
  border-spacing: 0.25rem;
  table-layout: fixed;
}

.grid thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--quiet);
  padding-bottom: 0.125rem;
}

.grid thead td,
.grid tbody th {
  width: 3rem;
}

.grid tbody th {
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
}

.grid abbr {
  text-decoration: none;
}

.grid td {
  padding: 0;
}

.grid form {
  margin: 0;
}

.cell {
  display: block;
  width: 100%;
  height: 2.75rem; /* 44px: a comfortable thumb target */
  margin: 0;
  padding: 0;
  background: #f3e8db; /* a faint tile; free ones are solid */
  border: 0;
  border-radius: 0.625rem;
  box-shadow: none;
}

.cell.free {
  background: var(--accent);
  border-color: var(--accent);
}

/* Dates away */

.away {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.away li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--line);
}

.away form {
  margin: 0;
}

.away button {
  margin: 0;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.pair > div {
  min-width: 0; /* lets the date boxes shrink to fit a narrow phone */
}

/* Lists, tags, secondary buttons */

.list {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}

.list li {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--line);
}

.tag {
  margin-left: 0.375rem;
  padding: 0.0625rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--quiet);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.button.secondary {
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--accent);
}

/* Forms with several parts */

.stack > * + * {
  margin-top: 1.25rem;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  font-weight: 600;
}

legend + .quiet {
  margin: 0 0 0.5rem;
}

label.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.625rem 0;
  font-weight: 400;
  border-bottom: 1px solid var(--line);
}

label.check input {
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  accent-color: var(--accent);
}

select {
  box-sizing: border-box;
  width: 100%;
  padding: 0.75rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.625rem;
}

/* The invite link and its copy button */

.invite {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.invite input {
  min-width: 0;
  font-size: 0.9375rem;
  color: var(--quiet);
}

.invite button {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

/* A day changed from the usual week gets a small dot in its corner. */

.cell {
  position: relative;
}

.cell.changed::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.cell.free.changed::after {
  background: #fff;
}

.cell.locked {
  opacity: 0.35;
}

.grid th.past {
  color: var(--quiet);
}

.cell.day-away {
  background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--line) 6px 7px);
}

.grid .day-number {
  font-weight: 400;
  color: var(--quiet);
}

.week-nav {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0 0;
}

.callout {
  margin: 1.25rem 0;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.callout p {
  margin-top: 0;
}

/* The month calendar: each week is one tappable row of seven days. */

.month h2 {
  margin-top: 1.75rem;
}

.month-head,
.week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.month-head {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--quiet);
}

.week-row {
  margin-bottom: 0.25rem;
  padding: 0.125rem;
  color: inherit;
  text-decoration: none;
  border-radius: 0.625rem;
}

a.week-row:hover,
a.week-row:focus-visible {
  background: #fde7d8;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 3rem;
  padding-top: 0.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.day.outside {
  background: none;
  border-color: transparent;
}

.day.gone {
  opacity: 0.4;
}

.day.today {
  border-color: var(--ink);
}

.day.is-away {
  background: repeating-linear-gradient(-45deg, #fff 0 6px, var(--line) 6px 7px);
}

.day .day-number {
  font-size: 0.875rem;
  line-height: 1.2;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  max-width: 2rem;
  margin-top: 0.25rem;
}

.dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.away-mark {
  font-size: 0.625rem;
  color: var(--quiet);
}

/* Messages after an action */

.message {
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
}

.message.error {
  border-left-color: #b42318;
}

.big {
  font-size: 1.25rem;
}

/* The round on the group page */

.round-box {
  margin: 1.5rem 0;
  padding: 0.25rem 1rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.round-box h2 {
  margin-top: 0.75rem;
}

.round-box form {
  margin: 0.5rem 0 0;
}

.secondary-button {
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--accent);
}

/* The Respond screen: one card per date, with Yes and No */

.dates {
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
}

.date-card {
  margin-bottom: 0.75rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.date-card.picked {
  border: 2px solid var(--accent);
}

.date-card.locked {
  border: 2px solid var(--ink);
}

.date-label {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 700;
}

.date-card .quiet {
  margin: 0.125rem 0 0;
}

.nudge {
  margin: 0.5rem 0 0;
  color: var(--accent);
}

.yes-no {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.yes-no form {
  margin: 0;
}

.choice {
  margin: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.choice.chosen {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.choice.no.chosen {
  background: var(--quiet);
  border-color: var(--quiet);
}

.start-round {
  margin-top: 1.5rem;
}

/* Home: a round waiting on your answer */

.nudge-card {
  display: block;
  margin: 1rem 0;
  padding: 1rem;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 0.75rem;
}

.nudge-card span {
  display: block;
  margin-top: 0.25rem;
  font-weight: 600;
  color: var(--accent);
}

/* Group page: members, with admin actions on the right */

.member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.member-actions {
  display: flex;
  gap: 0.75rem;
}

.member-actions form,
.leave {
  margin: 0;
}

.leave {
  margin-top: 2rem;
}

/* Playful touches: rounder cards with a soft glow, emoji row labels. */

.round-box,
.date-card,
.nudge-card {
  border-radius: 1.25rem;
  box-shadow: 0 6px 18px var(--glow);
}

/* Emoji with the occasion's name underneath. */
.grid th.occasion {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  color: var(--quiet);
}

.grid th.occasion .emoji {
  display: block;
  font-size: 1.375rem;
  line-height: 1.2;
}

/* Home: meet-ups as cards with a calendar tile, groups as cards. */

.meetups,
.group-cards {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}

.meetup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.625rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 14px var(--glow);
}

.meetup .tile {
  flex: none;
  width: 3rem;
  padding: 0.25rem 0;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  color: var(--quiet);
  background: #f3e8db;
  border-radius: 0.75rem;
}

.meetup .tile b {
  display: block;
  font-family: var(--fun);
  font-size: 1.375rem;
  color: var(--ink);
}

.meetup.in .tile,
.meetup.in .tile b {
  color: #fff;
  background: var(--accent);
}

.meetup .what {
  flex: 1;
  min-width: 0;
}

.meetup .what span {
  display: block;
  font-size: 0.875rem;
  color: var(--quiet);
}

.meetup .badge {
  flex: none;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: #ffe8d9;
  border-radius: 1rem;
}

/* "Show 2 more" disappears once the rest are showing. */
.more summary {
  padding: 0.25rem 0;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}

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

.more[open] summary {
  display: none;
}

.group-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.group-cards a {
  display: block;
  height: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 14px var(--glow);
}

.group-cards strong {
  display: block;
  overflow-wrap: anywhere;
}

.group-cards span {
  font-size: 0.8125rem;
  color: var(--quiet);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.actions .button {
  margin: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* The welcome page: logo with floating occasion emojis, then three steps. */

.hero {
  margin: 1rem 0 1.5rem;
  text-align: center;
}

.hero-art {
  position: relative;
  width: 8rem;
  height: 8rem;
  margin: 1.5rem auto 1rem;
}

.hero-art .logo {
  width: 100%;
  height: 100%;
  border-radius: 1.875rem;
  box-shadow: 0 14px 34px rgba(194, 65, 12, 0.3);
  transform: rotate(-6deg);
}

.float {
  position: absolute;
  font-size: 1.75rem;
  animation: bob 3s ease-in-out infinite;
}

.f1 { top: -0.75rem; left: -1.75rem; }
.f2 { top: -1rem; right: -1.75rem; animation-delay: 0.6s; }
.f3 { bottom: -0.75rem; right: -2rem; animation-delay: 1.2s; }
.f4 { bottom: -0.5rem; left: -2rem; animation-delay: 1.8s; }

@keyframes bob {
  50% { transform: translateY(-6px) rotate(6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .float { animation: none; }
}

/* The hand-lettered "miit" (core/templates/core/_wordmark.html). */
.wordmark {
  margin: 0.75rem 0 0;
  line-height: 0;
  color: var(--accent);
}

.wordmark .wordmark-art {
  width: 11rem;
  height: auto;
}

.tagline {
  margin: 0.25rem 0 0;
  font-family: var(--fun);
  font-size: 1.25rem;
  font-weight: 600;
}

.steps {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 0.625rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 14px var(--glow);
}

.steps span {
  flex: none;
  font-size: 1.75rem;
}

.steps p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.center {
  text-align: center;
}

/* Logo and name side by side, top of the sign-in pages. */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1.25rem;
}

.brand .logo {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
  box-shadow: 0 8px 20px rgba(194, 65, 12, 0.25);
}

.brand .wordmark-art {
  width: 6.5rem;
  height: auto;
  color: var(--accent);
}
