/*
  Wrenfield Cider's theme. Four looks, each a set of custom properties on
  <html data-look>; the page and the Cut the Cake snippets read the same
  properties, so a switch restyles both at once. The snippets are styled only
  through their contract's class names (ctc-*), as any venue's theme would.
  The framed invitation keeps the party's own design.
*/

/* ---------- The looks ---------- */

:root,
:root[data-look="farmhouse"] {
  --s-paper: #f6f1e7;
  --s-paper-sunk: #ece4d4;
  --s-card: #fdfaf3;
  --s-ink: #1f2a22;
  --s-ink-soft: #55604f;
  --s-rule: #ddd2bd;
  --s-accent: #9a3d26;
  --s-accent-ink: #fdfaf3;
  --s-accent-wash: #f3e0d6;
  --s-display: "Fraunces", Georgia, serif;
  --s-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --s-text-size: 1.0625rem;
  --s-display-weight: 500;
  --s-display-tracking: -0.01em;
  --s-display-transform: none;
  --s-radius: 12px;
  --s-button-radius: 999px;
  --s-shadow: 0 1px 2px rgba(31, 42, 34, 0.05), 0 12px 30px -16px rgba(31, 42, 34, 0.3);
  --s-header-bg: var(--s-paper);
  --s-header-rule: 3px double var(--s-rule);
  --s-date-bg: var(--s-accent-wash);
  --s-date-ink: var(--s-ink);
  --s-date-month: var(--s-accent);
  --s-date-border: 0;
  --s-date-radius: 10px;
  --s-hero-shade: linear-gradient(180deg, rgba(20, 16, 10, 0.05) 30%, rgba(20, 16, 10, 0.62));
  color-scheme: light;
}

:root[data-look="classic"] {
  --s-paper: #ffffff;
  --s-paper-sunk: #f0f0f1;
  --s-card: #ffffff;
  --s-ink: #1e1e1e;
  --s-ink-soft: #50575e;
  --s-rule: #dcdcde;
  --s-accent: #2c55c9;
  --s-accent-ink: #ffffff;
  --s-accent-wash: #e5ecfb;
  --s-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --s-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --s-text-size: 1rem;
  --s-display-weight: 600;
  --s-display-tracking: 0;
  --s-display-transform: none;
  --s-radius: 2px;
  --s-button-radius: 2px;
  --s-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  --s-header-bg: #ffffff;
  --s-header-rule: 1px solid var(--s-rule);
  --s-date-bg: var(--s-paper-sunk);
  --s-date-ink: var(--s-ink);
  --s-date-month: var(--s-accent);
  --s-date-border: 1px solid var(--s-rule);
  --s-date-radius: 2px;
  --s-hero-shade: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55));
  color-scheme: light;
}

:root[data-look="modern"] {
  --s-paper: #ffffff;
  --s-paper-sunk: #f2f2ee;
  --s-card: #ffffff;
  --s-ink: #0c0c0c;
  --s-ink-soft: #4c4c48;
  --s-rule: #0c0c0c;
  --s-accent: #1f7a4d;
  --s-accent-ink: #ffffff;
  --s-accent-wash: #d9f0e2;
  --s-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --s-text: "Inter", system-ui, sans-serif;
  --s-text-size: 1rem;
  --s-display-weight: 700;
  --s-display-tracking: -0.035em;
  --s-display-transform: none;
  --s-radius: 0;
  --s-button-radius: 0;
  --s-shadow: 6px 6px 0 var(--s-ink);
  --s-header-bg: #ffffff;
  --s-header-rule: 2px solid var(--s-ink);
  --s-date-bg: var(--s-ink);
  --s-date-ink: #ffffff;
  --s-date-month: #b9f3cf;
  --s-date-border: 0;
  --s-date-radius: 0;
  --s-hero-shade: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.7));
  color-scheme: light;
}

:root[data-look="night"] {
  --s-paper: #10140f;
  --s-paper-sunk: #0b0e0a;
  --s-card: #171d16;
  --s-ink: #efe8d6;
  --s-ink-soft: #b3ad9b;
  --s-rule: #2e3829;
  --s-accent: #d6a94e;
  --s-accent-ink: #10140f;
  --s-accent-wash: #2b2a1c;
  --s-display: "Bodoni Moda", "Didot", Georgia, serif;
  --s-text: "Jost", "Futura", system-ui, sans-serif;
  --s-text-size: 1.0625rem;
  --s-display-weight: 600;
  --s-display-tracking: 0;
  --s-display-transform: none;
  --s-radius: 2px;
  --s-button-radius: 2px;
  --s-shadow: 0 0 0 1px var(--s-accent), 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  --s-header-bg: #0b0e0a;
  --s-header-rule: 1px solid #3b4634;
  --s-date-bg: transparent;
  --s-date-ink: var(--s-ink);
  --s-date-month: var(--s-accent);
  --s-date-border: 1px solid var(--s-accent);
  --s-date-radius: 2px;
  --s-hero-shade: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.75));
  color-scheme: dark;
}

/* ---------- The page ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--s-paper);
  color: var(--s-ink);
  font-family: var(--s-text);
  font-size: var(--s-text-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

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

a {
  color: var(--s-accent);
  text-underline-offset: 0.18em;
}

h1,
h2,
h3 {
  font-family: var(--s-display);
  font-weight: var(--s-display-weight);
  letter-spacing: var(--s-display-tracking);
  text-transform: var(--s-display-transform);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

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

h2 {
  font-size: clamp(1.625rem, 3.6vw, 2.375rem);
}

h3 {
  font-size: 1.375rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: min(1120px, 100% - 40px);
  margin: 0 auto;
}

.wrap--narrow {
  width: min(760px, 100% - 40px);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.75em;
  font: 600 0.75rem/1.2 var(--s-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--s-accent);
}

.section {
  padding: clamp(56px, 9vw, 112px) 0;
}

.section--sunk {
  background: var(--s-paper-sunk);
  transition: background-color 0.35s ease;
}

.lede {
  font-size: 1.1875em;
  color: var(--s-ink-soft);
  max-width: 40em;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--s-header-bg);
  border-bottom: var(--s-header-rule);
  transition: background-color 0.35s ease;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--s-ink);
  text-decoration: none;
  font-family: var(--s-display);
  font-weight: var(--s-display-weight);
  font-size: 1.375rem;
  letter-spacing: var(--s-display-tracking);
}

.site-title svg {
  width: 36px;
  height: 36px;
  color: var(--s-accent);
}

.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 8px 12px;
  color: var(--s-ink);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--s-button-radius);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--s-accent);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

/* ---------- Buttons: the theme's, worn by the RSVP snippet too ---------- */

.button,
.ctc-rsvp {
  display: inline-block;
  padding: 0.75em 1.5em;
  border: 2px solid var(--s-accent);
  border-radius: var(--s-button-radius);
  background: var(--s-accent);
  color: var(--s-accent-ink);
  font: 600 1rem/1.2 var(--s-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.button:hover,
.ctc-rsvp:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.button--ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

:root[data-look="modern"] .button,
:root[data-look="modern"] .ctc-rsvp {
  box-shadow: 4px 4px 0 var(--s-ink);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(78vh, 720px);
  color: #fff;
  background: #2a241c url("../img/barn.jpg") center 40% / cover no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 10, 6, 0.62), rgba(12, 10, 6, 0.18) 70%),
    var(--s-hero-shade);
}

.hero__inner {
  position: relative;
  padding: 0 0 clamp(40px, 8vw, 88px);
}

.hero h1 {
  max-width: 14em;
  color: #fff;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35);
}

.hero p:not(.eyebrow) {
  max-width: 34em;
  font-size: 1.1875em;
  color: rgba(255, 255, 255, 0.9);
}

.hero .ctc-rsvp {
  background: #fff;
  border-color: #fff;
  color: #1b1b1b;
}

.hero .button--ghost {
  color: #fff;
}

.page-hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--s-rule);
}

/* ---------- Cards and pictures ---------- */

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

.card {
  overflow: hidden;
  background: var(--s-card);
  border: 1px solid var(--s-rule);
  border-radius: var(--s-radius);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.card__body {
  padding: 20px 22px 24px;
}

.card__body p {
  color: var(--s-ink-soft);
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.split--top {
  align-items: start;
}

/* The words beside a tall invitation stay in view while it scrolls past. */
.split--top > :first-child {
  position: sticky;
  top: 104px;
}

.picture {
  display: block;
  width: 100%;
  border-radius: var(--s-radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--s-radius);
}

.hours {
  width: 100%;
  border-collapse: collapse;
}

.hours th,
.hours td {
  padding: 10px 0;
  border-bottom: 1px solid var(--s-rule);
  text-align: left;
  font-weight: 400;
}

.hours td {
  text-align: right;
  color: var(--s-ink-soft);
}

/* ---------- The Cut the Cake next-event snippet ---------- */

.ctc-next {
  margin: 0;
}

.ctc-next .ctc-invitation,
.feature-frame .ctc-invitation {
  overflow: hidden;
  background: var(--s-paper-sunk);
  border: 1px solid var(--s-rule);
  border-radius: var(--s-radius);
  box-shadow: var(--s-shadow);
}

:root[data-look="night"] .ctc-next .ctc-invitation,
:root[data-look="night"] .feature-frame .ctc-invitation {
  border-color: var(--s-accent);
}

.ctc-invitation:not(.ctc-invitation--ready) {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 24px;
}

.ctc-events:not(.ctc-events--ready) > a,
.ctc-next:not(.ctc-next--ready) > a,
.ctc-invitation:not(.ctc-invitation--ready) > a,
.ctc-events__more a {
  color: var(--s-accent);
  font-weight: 600;
}

.ctc-invitation__frame {
  display: block;
}

/* ---------- The Cut the Cake events list ---------- */

.ctc-events__list,
.ctc-next__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.ctc-event {
  margin: 0;
}

.ctc-event__link {
  --s-picture: 9.5rem;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) var(--s-picture);
  grid-template-areas:
    "date title image"
    "date when image"
    "date place image"
    "date status image";
  grid-template-rows: auto auto auto 1fr;
  column-gap: 20px;
  align-items: start;
  padding: 18px 20px;
  background: var(--s-card);
  border: 1px solid var(--s-rule);
  border-radius: var(--s-radius);
  color: var(--s-ink);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.35s ease;
}

.ctc-event__link:hover {
  border-color: var(--s-accent);
  box-shadow: var(--s-shadow);
  transform: translateY(-1px);
}

:root[data-look="modern"] .ctc-event__link {
  border-width: 2px;
}

:root[data-look="modern"] .ctc-event__link:hover {
  border-color: var(--s-ink);
  transform: translate(-2px, -2px);
}

.ctc-event__image {
  grid-area: image;
  align-self: center;
  justify-self: center;
  display: block;
  float: none;
  margin: 0;
  width: auto;
  max-width: 100%;
  max-height: var(--s-picture);
  border-radius: calc(var(--s-radius) * 0.6);
}

.ctc-event__image--round {
  border-radius: 50%;
}

.ctc-event__date {
  grid-area: date;
  width: 4.5rem;
  height: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--s-date-bg);
  color: var(--s-date-ink);
  border: var(--s-date-border);
  border-radius: var(--s-date-radius);
}

.ctc-event__month {
  font: 600 0.6875rem/1.2 var(--s-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--s-date-month);
}

.ctc-event__day {
  font-family: var(--s-display);
  font-weight: var(--s-display-weight);
  font-size: 1.875rem;
  line-height: 1.1;
  letter-spacing: var(--s-display-tracking);
}

.ctc-events .ctc-event__title,
.ctc-next .ctc-event__title {
  grid-area: title;
  margin: 2px 0 0;
  font-family: var(--s-display);
  font-weight: var(--s-display-weight);
  font-size: clamp(1.1875rem, 2.6vw, 1.4375rem);
  line-height: 1.25;
  letter-spacing: var(--s-display-tracking);
  color: var(--s-ink);
}

.ctc-event__when,
.ctc-event__place {
  margin-top: 4px;
  font-size: 0.9375em;
  line-height: 1.45;
  color: var(--s-ink-soft);
}

.ctc-event__when {
  grid-area: when;
}

.ctc-event__place {
  grid-area: place;
}

.ctc-event__status {
  grid-area: status;
  justify-self: start;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--s-accent-wash);
  color: var(--s-ink);
  font-size: 0.8125em;
  font-weight: 600;
}

:root[data-look="modern"] .ctc-event__status,
:root[data-look="classic"] .ctc-event__status {
  border-radius: 0;
}

.ctc-event--full .ctc-event__status {
  background: var(--s-paper-sunk);
  color: var(--s-ink-soft);
}

.ctc-events__empty {
  margin: 0;
  padding: 28px 20px;
  border: 1px dashed var(--s-rule);
  border-radius: var(--s-radius);
  text-align: center;
  color: var(--s-ink-soft);
}

.ctc-events__credit,
.ctc-next__credit {
  margin: 24px 0 0;
  font-size: 0.8125rem;
}

.ctc-events__credit a,
.ctc-next__credit a {
  color: var(--s-ink-soft);
}

/* ---------- How it's built ---------- */

.snippets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

.snippet h3 {
  margin-bottom: 0.25em;
}

.snippet p {
  color: var(--s-ink-soft);
}

.snippet pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: #1b1d1a;
  color: #e9e4d6;
  border-radius: var(--s-radius);
  font: 0.8125rem/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.note {
  padding: 14px 18px;
  border-left: 3px solid var(--s-accent);
  background: var(--s-accent-wash);
  color: var(--s-ink);
  border-radius: 0 var(--s-radius) var(--s-radius) 0;
  font-size: 0.9375em;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 56px 0 120px;
  background: var(--s-paper-sunk);
  border-top: 1px solid var(--s-rule);
  color: var(--s-ink-soft);
  font-size: 0.9375em;
  transition: background-color 0.35s ease;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.site-footer h2 {
  font-size: 1.125rem;
  color: var(--s-ink);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: inherit;
}

/* ---------- The demo's own chrome: not part of the venue's theme ---------- */

.demo-ribbon {
  position: relative;
  padding: 9px 48px 9px 20px;
  background: #1f1720;
  color: #f6efe4;
  font: 500 0.875rem/1.4 "Inter", system-ui, sans-serif;
  text-align: center;
}

.demo-ribbon a {
  color: #f3c5d1;
  font-weight: 600;
}

.demo-ribbon__close {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: 400 1.25rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.demo-ribbon__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.demo-ribbon[hidden] {
  display: none;
}

.looks {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 6px 6px 16px;
  min-width: 0;
  transform: translateX(-50%);
  background: rgba(31, 23, 32, 0.94);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.5);
  color: #f6efe4;
  font: 500 0.8125rem/1 "Inter", system-ui, sans-serif;
}

.js .looks {
  display: flex;
}

.looks__legend {
  float: left;
  padding: 0;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.6875rem;
  color: rgba(246, 239, 228, 0.7);
  white-space: nowrap;
}

.looks__options {
  display: flex;
  gap: 2px;
}

.looks__option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px 8px 9px;
  border-radius: 999px;
  color: rgba(246, 239, 228, 0.78);
  white-space: nowrap;
  cursor: pointer;
}

.looks__option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.looks__option:hover {
  color: #fff;
}

.looks__option:has(input:checked) {
  background: #f6efe4;
  color: #1f1720;
}

.looks__option:has(input:focus-visible) {
  outline: 2px solid #f3c5d1;
  outline-offset: 2px;
}

.looks__swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

[data-look-option="farmhouse"] .looks__swatch {
  background: linear-gradient(135deg, #f6f1e7 50%, #9a3d26 50%);
}

[data-look-option="classic"] .looks__swatch {
  background: linear-gradient(135deg, #ffffff 50%, #2c55c9 50%);
}

[data-look-option="modern"] .looks__swatch {
  background: linear-gradient(135deg, #ffffff 50%, #1f7a4d 50%);
}

[data-look-option="night"] .looks__swatch {
  background: linear-gradient(135deg, #10140f 50%, #d6a94e 50%);
}

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  .site-header {
    position: static;
  }

  .site-header__inner {
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 12px 0;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
  }

  .site-nav a {
    padding: 6px 10px 6px 0;
  }

  .split,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .split--top > :first-child {
    position: static;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ctc-event__link {
    --s-picture: 100%;
    grid-template-columns: 4rem minmax(0, 1fr);
    grid-template-areas:
      "image image"
      "date title"
      "date when"
      "date place"
      "date status";
    row-gap: 2px;
  }

  .ctc-event__image {
    width: 100%;
    max-height: 12rem;
    object-fit: cover;
    margin-bottom: 14px;
  }

  .ctc-event__date {
    width: 4rem;
    height: 4rem;
  }

  .looks {
    left: 8px;
    right: 8px;
    bottom: 8px;
    transform: none;
    padding: 5px;
    border-radius: 18px;
  }

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

  .looks__options {
    flex: 1;
    justify-content: space-between;
  }

  .looks__option {
    flex: 1;
    justify-content: center;
    padding: 9px 4px;
    gap: 5px;
  }
}
