/* A Common Endeavor — Pflugerville
   Mobile-first styles. Colors and fonts match the printed materials. */

:root {
  --paper: #faf5ea;
  --paper-deep: #f2e9d6;
  --blue: #2f3b70;
  --terracotta: #b4533a;
  --gold: #d8a23e;
  --sage: #7a9a7e;
  --sky: #9cc0d4;
  --ink: #23284a;

  --heading: "DM Serif Display", Georgia, "Times New Roman", serif;
  --body: "Source Sans 3", "Segoe UI", Arial, sans-serif;

  --header-height: 3.75rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 0.5rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--blue);
  font-family: var(--heading);
  font-weight: 400;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.25rem, 7vw, 3.75rem);
}

h1 span {
  display: block;
  margin-top: 0.2em;
  color: var(--terracotta);
  font-size: 0.62em;
}

h2 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
}

h3 {
  font-size: 1.4rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--terracotta);
  text-underline-offset: 0.15em;
}

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

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.narrow {
  max-width: 44rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  background: var(--blue);
  color: #fff;
}

.skip-link:focus {
  top: 0.5rem;
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--terracotta);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead {
  font-size: 1.3rem;
  line-height: 1.5;
}

.note {
  font-style: italic;
}

.placeholder {
  padding: 0 0.2em;
  background: rgba(216, 162, 62, 0.3);
  border-bottom: 2px dashed var(--terracotta);
}

.noscript {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--gold);
  color: var(--ink);
  text-align: center;
}

/* Buttons */

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--terracotta);
  color: #fff;
}

.button-primary:hover {
  background: var(--blue);
  color: #fff;
}

.button-secondary {
  background: var(--gold);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--blue);
  color: #fff;
}

.button-outline {
  border-color: var(--blue);
  color: var(--blue);
}

.button-outline:hover {
  background: var(--blue);
  color: #fff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 3px solid var(--blue);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}

.brand {
  color: var(--blue);
  font-family: var(--heading);
  font-size: 1.25rem;
  text-decoration: none;
}

.brand span {
  color: var(--terracotta);
}

.nav-toggle {
  display: none;
  padding: 0.4rem 0.9rem;
  background: none;
  border: 2px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  font: 700 1rem var(--body);
  cursor: pointer;
}

.js .nav-toggle {
  display: block;
}

.site-nav {
  width: 100%;
}

.js .site-nav {
  display: none;
}

.js .nav-open .site-nav {
  display: block;
}

.site-nav ul {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0 0 0.75rem;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.6rem 0;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--terracotta);
  text-decoration: underline;
}

/* Patchwork */

.patchwork {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
}

.tile {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--tile);
}

.tile::after {
  content: "";
  position: absolute;
  background: var(--shape);
}

.tile.plain::after {
  display: none;
}

.tile.circle::after {
  inset: 14%;
  border-radius: 50%;
}

.tile.dot::after {
  inset: 32%;
  border-radius: 50%;
}

.tile.square::after {
  inset: 26%;
}

.tile.quarter-tl::after,
.tile.quarter-tr::after,
.tile.quarter-bl::after,
.tile.quarter-br::after {
  inset: 0;
}

.tile.quarter-tl::after {
  border-top-left-radius: 100%;
}

.tile.quarter-tr::after {
  border-top-right-radius: 100%;
}

.tile.quarter-bl::after {
  border-bottom-left-radius: 100%;
}

.tile.quarter-br::after {
  border-bottom-right-radius: 100%;
}

.tile.half-top::after {
  inset: 0 0 50%;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.tile.half-bottom::after {
  inset: 50% 0 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.hero-patchwork {
  --cols: 6;
  border: 6px solid var(--blue);
}

.strip {
  --cols: 12;
}

/* Opening banner: the national site's opening video (used with permission),
   with the title fading in over the white shape in its center. A still image
   sits underneath and shows until the video plays. */

.banner {
  --banner-h: max(22rem, calc(100vh - var(--header-height)));
  /* The white shape's size, worked out from how the video is scaled to fill the banner */
  --size: max(calc(var(--banner-h) * 0.58), 32.6vw);
  position: relative;
  height: var(--banner-h);
  overflow: hidden;
  background: var(--paper);
}

@supports (height: 100svh) {
  .banner {
    --banner-h: max(22rem, calc(100svh - var(--header-height)));
  }
}

.banner-media,
.banner-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

video.banner-media {
  opacity: 0;
  transition: opacity 0.6s ease;
}

video.banner-media.is-playing {
  opacity: 1;
}

.banner-center {
  position: absolute;
  left: 50%;
  top: 54%;
  display: grid;
  place-content: center;
  justify-items: center;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
}

.banner-title {
  margin: 0;
  color: #222;
  font-family: var(--heading);
  font-size: calc(var(--size) * 0.1);
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.banner-title span {
  display: block;
}

.banner-star {
  width: calc(var(--size) * 0.11);
  aspect-ratio: 1;
  margin-top: calc(var(--size) * 0.05);
  background: var(--gold);
  clip-path: polygon(50% 0, 60.9% 19.9%, 82.1% 11.7%, 77.7% 34%, 99.2% 41.3%, 81.5% 55.6%, 93.3% 75%, 70.6% 74.5%, 67.1% 97%, 50% 82%, 32.9% 97%, 29.4% 74.5%, 6.7% 75%, 18.5% 55.6%, 0.8% 41.3%, 22.3% 34%, 17.9% 11.7%, 39.1% 19.9%);
}

/* Title lines fade and sharpen into view one after another */
.banner-title span,
.banner-star {
  animation: banner-line-in 1s ease both;
}

.banner-title span:nth-child(1) {
  animation-delay: 0.4s;
}

.banner-title span:nth-child(2) {
  animation-delay: 0.7s;
}

.banner-title span:nth-child(3) {
  animation-delay: 1s;
}

.banner-star {
  animation-delay: 1.4s;
}

@keyframes banner-line-in {
  from {
    opacity: 0;
    filter: blur(8px);
  }
}

/* Tall screens (phones held upright) use the portrait version of the video */
@media (max-aspect-ratio: 1/1) {
  .banner {
    --size: max(72vw, calc(var(--banner-h) * 0.405));
  }

  .banner-center {
    top: 50%;
  }
}

/* Hero */

.hero {
  padding: 2.5rem 0 3rem;
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.glance {
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
  font-size: 1.2rem;
}

.glance li {
  padding: 0.6rem 0;
  border-top: 1px solid rgba(47, 59, 112, 0.25);
}

.glance li:last-child {
  border-bottom: 1px solid rgba(47, 59, 112, 0.25);
}

.glance-label {
  display: inline-block;
  min-width: 4.5rem;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Sections */

.section {
  padding: 4rem 0;
}

.section-tint {
  background: var(--paper-deep);
}

.section-blue {
  background: var(--blue);
  color: var(--paper);
}

.section-blue h2,
.section-blue h3 {
  color: var(--paper);
}

.section-blue .eyebrow {
  color: var(--gold);
}

/* About: five themes */

.themes {
  margin: 2.5rem 0 0;
}

.theme-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: theme;
}

.theme-list li {
  padding: 1.25rem;
  background: #fff;
  border-top: 6px solid var(--accent);
  border-radius: 0 0 0.5rem 0.5rem;
  color: var(--blue);
  font-family: var(--heading);
  font-size: 1.3rem;
  line-height: 1.25;
  counter-increment: theme;
}

.theme-list li::before {
  content: counter(theme);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.9rem;
  background: var(--accent);
  border-radius: 50%;
  color: var(--number, #fff);
  font-size: 1.4rem;
}

.theme-list li:nth-child(1) {
  --accent: var(--terracotta);
}

.theme-list li:nth-child(2) {
  --accent: var(--gold);
  --number: var(--ink);
}

.theme-list li:nth-child(3) {
  --accent: var(--sage);
  --number: var(--ink);
}

.theme-list li:nth-child(4) {
  --accent: var(--sky);
  --number: var(--ink);
}

.theme-list li:nth-child(5) {
  --accent: var(--blue);
}

/* Square badges on alternating cards, echoing the patchwork */
.theme-list li:nth-child(even)::before {
  border-radius: 0.2rem;
}

/* The Event */

.expect {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.expect li {
  padding: 1.5rem;
  border: 2px solid rgba(250, 245, 234, 0.35);
  border-radius: 0.5rem;
}

.expect li:nth-child(1) {
  border-top: 6px solid var(--gold);
}

.expect li:nth-child(2) {
  border-top: 6px solid var(--sky);
}

.expect li:nth-child(3) {
  border-top: 6px solid var(--sage);
}

.expect p {
  margin: 0;
}

.moderator {
  margin: 0;
  font-size: 1.2rem;
}

.section-blue .placeholder {
  background: rgba(216, 162, 62, 0.35);
  border-bottom-color: var(--gold);
}

/* Panelists */

.panelist-list {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 1.5rem;
}

.tba {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2rem 1.5rem;
  background: #fff;
  border: 2px dashed var(--sage);
  border-radius: 0.5rem;
  color: var(--blue);
  font-family: var(--heading);
  font-size: 1.5rem;
  text-align: center;
}

.panelist {
  padding: 1.5rem;
  background: #fff;
  border-radius: 0.5rem;
  text-align: center;
}

.panelist img,
.panelist-initials {
  width: 10rem;
  height: 10rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
}

.panelist img {
  display: block;
  object-fit: cover;
}

.panelist-initials {
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: var(--heading);
  font-size: 3rem;
}

.panelist-initials.terracotta {
  background: var(--terracotta);
  color: #fff;
}

.panelist-initials.gold {
  background: var(--gold);
}

.panelist-initials.sage {
  background: var(--sage);
}

.panelist-initials.sky {
  background: var(--sky);
}

.panelist-initials.blue {
  background: var(--blue);
  color: #fff;
}

.panelist h3 {
  margin-bottom: 0.25rem;
}

.panelist-title {
  margin-bottom: 0.5rem;
  color: var(--terracotta);
  font-weight: 700;
}

.panelist p:last-child {
  margin-bottom: 0;
}

/* Event details */

.details {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.5rem 0 0;
}

.detail {
  padding: 1.5rem;
  background: var(--paper);
  border-left: 6px solid var(--blue);
  border-radius: 0 0.5rem 0.5rem 0;
}

.detail:nth-child(2) {
  border-left-color: var(--terracotta);
}

.detail:nth-child(3) {
  border-left-color: var(--gold);
}

.detail:nth-child(4) {
  border-left-color: var(--sage);
}

.detail:nth-child(5) {
  border-left-color: var(--sky);
}

.detail dt {
  margin-bottom: 0.4rem;
  color: var(--blue);
  font-family: var(--heading);
  font-size: 1.4rem;
}

.detail dd {
  margin: 0;
}

/* RSVP */

.rsvp-form,
.contact-form {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fff;
  border-top: 6px solid var(--sage);
  border-radius: 0 0 0.5rem 0.5rem;
}

.field {
  width: 100%;
}

.field-small {
  max-width: 12rem;
}

.field label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--blue);
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  background: var(--paper);
  border: 2px solid var(--blue);
  border-radius: 0.35rem;
  color: var(--ink);
  font: inherit;
}

.form-status {
  margin: 0;
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

.form-status.is-success {
  color: #3d6143;
}

.form-status.is-error {
  color: var(--terracotta);
}

/* Footer */

.site-footer {
  padding: 3rem 0;
  background: var(--blue);
  color: var(--paper);
  text-align: center;
}

.site-footer p {
  margin-bottom: 0.5rem;
}

.site-footer a {
  color: var(--gold);
}

.site-footer a:hover {
  color: #fff;
}

.site-footer .placeholder {
  border-bottom-color: var(--gold);
}

.sponsor {
  font-family: var(--heading);
  font-size: 1.6rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
  list-style: none;
}

/* Community pages (home, teachings, devotional gatherings, contact) */

.site-nav a[aria-current="page"] {
  color: var(--terracotta);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.cards li {
  padding: 1.5rem;
  background: #fff;
  border-top: 6px solid var(--blue);
  border-radius: 0 0 0.5rem 0.5rem;
}

.cards li:nth-child(5n + 1) {
  border-top-color: var(--terracotta);
}

.cards li:nth-child(5n + 2) {
  border-top-color: var(--gold);
}

.cards li:nth-child(5n + 3) {
  border-top-color: var(--sage);
}

.cards li:nth-child(5n + 4) {
  border-top-color: var(--sky);
}

.cards p:last-child {
  margin-bottom: 0;
}

.cards a {
  font-weight: 700;
}

/* Lists and buttons that sit on the deep blue background */

.section-blue .glance li {
  border-color: rgba(250, 245, 234, 0.35);
}

.section-blue .glance-label {
  color: var(--gold);
}

.section-blue .button:hover {
  background: var(--paper);
  color: var(--blue);
}

.section-blue a:not(.button) {
  color: var(--gold);
}

.section-blue a:not(.button):hover {
  color: #fff;
}

.after-buttons {
  margin: 1.5rem 0 0;
}

/* Home page picture: a circle of hands with a quotation in the middle */

.unity {
  margin: 0;
}

.unity img {
  display: block;
  width: 100%;
}

/* On phones and tablets the picture comes first, above the welcome text */
@media (max-width: 59.99rem) {
  .unity {
    order: -1;
  }
}

/* Explanatory text under a numbered card's title */
.theme-text {
  margin: 0.6rem 0 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.5;
}

.field textarea {
  resize: vertical;
}

/* A checkbox with its label beside it */
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  margin: 0.2rem 0 0;
  accent-color: var(--blue);
}

/* The email address offered under a form */
.form-alt {
  margin: 1.25rem 0 0;
}

/* A question card that links to its section of the letter */
.theme-list a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.theme-list a:hover {
  color: var(--terracotta);
}

.theme-section {
  display: block;
  margin-top: 0.75rem;
  color: var(--terracotta);
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Hidden spam trap: people never see it, automated spam fills it in */
.hp {
  display: none;
}

/* Scroll animations: only hide content when JavaScript is running */

.js .reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal,
  .button {
    transition: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .banner-title span,
  .banner-star {
    animation: none;
  }
}

/* Larger screens */

@media (min-width: 48rem) {
  body {
    font-size: 1.1875rem;
  }

  .js .nav-toggle {
    display: none;
  }

  .site-nav,
  .js .site-nav {
    display: block;
    width: auto;
  }

  .site-nav ul {
    flex-direction: row;
    gap: 1.75rem;
    padding: 0;
  }

  .strip {
    --cols: 24;
  }

  .section {
    padding: 5.5rem 0;
  }
}

@media (min-width: 60rem) {
  .hero {
    padding: 4.5rem 0 5rem;
  }

  .hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
  }
}

/* The event page's menu needs a little more room than a small tablet has,
   so it stays behind the Menu button slightly longer. */
@media (min-width: 48rem) and (max-width: 53.99rem) {
  .js .mid-nav .nav-toggle {
    display: block;
  }

  .js .mid-nav .site-nav {
    display: none;
  }

  .js .mid-nav.nav-open .site-nav {
    display: block;
  }

  .mid-nav .site-nav {
    width: 100%;
  }

  .mid-nav .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 0 0.75rem;
  }
}

/* The community pages have a longer menu, so it stays behind the Menu button
   until the screen is wide enough to fit it on one line. */
@media (min-width: 48rem) and (max-width: 67.99rem) {
  .js .wide-nav .nav-toggle {
    display: block;
  }

  .js .wide-nav .site-nav {
    display: none;
    width: 100%;
  }

  .js .wide-nav.nav-open .site-nav {
    display: block;
  }

  .wide-nav .site-nav {
    width: 100%;
  }

  .wide-nav .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 0 0.75rem;
  }
}
