/*
 * Shared components. Each component is written once and themed purely through
 * tokens, so the same markup renders Soft Stationery (light) and Calm Night (dark).
 */

/* Layout */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-top: var(--section-gap);
}

/* Icons */

.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* Header */

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 44px;
  height: 44px;
}

.site-nav {
  display: flex;
  gap: var(--space-8);
  font-weight: 500;
}

.site-nav a,
.site-footer a {
  transition: color var(--duration-fast) ease;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--color-accent);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: 1.25rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--lg {
  min-height: 58px;
  padding: 0 28px;
}

.btn--sm {
  min-height: 44px;
  padding: 0 20px;
  font-size: var(--text-small);
}

.btn--primary {
  background: var(--color-cta-bg);
  color: var(--color-cta-fg);
}

.btn--primary:hover {
  background: var(--color-cta-bg-hover);
}

.btn--secondary {
  background: var(--color-secondary-bg);
  border-color: var(--color-secondary-border);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: var(--color-secondary-bg-hover);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
}

.icon-btn:hover {
  border-color: var(--color-secondary-border);
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

/* The toggle shows the scheme it switches to. theme.js keeps [data-scheme] current. */
:root[data-scheme="dark"] .theme-toggle .icon-moon,
:root:not([data-scheme="dark"]) .theme-toggle .icon-sun {
  display: none;
}

/* Type */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h2);
  line-height: 1.15;
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}

.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h3);
  line-height: 1.3;
}

.lead {
  font-size: var(--text-lead);
  line-height: var(--leading-body);
  color: var(--color-text-muted);
  text-wrap: pretty;
}

.body-muted {
  font-size: var(--text-small);
  line-height: 1.55;
  color: var(--color-text-muted);
}

.script-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-script);
  font-weight: 700;
  font-size: var(--text-script);
  line-height: 1.1;
  color: var(--color-accent);
}

.script-label--tilt {
  transform: rotate(-2deg);
  transform-origin: left center;
}

.script-label .icon {
  width: 0.9em;
  height: 0.9em;
}

.marker {
  padding: 0 0.08em;
  background: linear-gradient(
    transparent 60%,
    var(--color-marker) 60%,
    var(--color-marker) 94%,
    transparent 94%
  );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.section-head .lead {
  margin-top: var(--space-3);
}

/* Social proof */

.proof {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.proof strong {
  color: var(--color-text);
  font-weight: 700;
}

.proof__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.proof__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--color-star);
}

.proof__stars .icon {
  width: 16px;
  height: 16px;
}

.proof__sep {
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-text-subtle);
  opacity: 0.5;
}

@media (max-width: 480px) {
  .proof {
    gap: var(--space-2) var(--space-5);
  }

  .proof__sep {
    display: none;
  }
}

/* Stationery */

.dot-paper {
  background-color: var(--color-surface);
  background-image: radial-gradient(var(--color-dot-grid) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
}

.polaroid {
  padding: 6px;
  border-radius: 16px;
  background: var(--color-frame);
  box-shadow: var(--shadow-card);
  transform: rotate(var(--tilt, 0deg));
}

.polaroid img {
  width: 100%;
  border-radius: var(--radius-sm);
}

.tape {
  position: absolute;
  height: 30px;
  background: var(--color-tape-butter);
  transform: rotate(var(--tilt, -8deg));
}

.tape--pink {
  background: var(--color-tape-pink);
}

.tape--butter {
  background: var(--color-tape-butter);
}

.tape--sage {
  background: var(--color-tape-sage);
}

.tape--lilac {
  background: var(--color-tape-lilac);
}

/* Die-cut sticker edge keeps dark line art readable on every surface. */
.sticker {
  filter: drop-shadow(2px 0 0 var(--color-sticker-edge))
    drop-shadow(-2px 0 0 var(--color-sticker-edge))
    drop-shadow(0 2px 0 var(--color-sticker-edge))
    drop-shadow(0 -2px 0 var(--color-sticker-edge))
    drop-shadow(0 12px 18px var(--color-shadow-soft));
}

.decor {
  position: absolute;
  pointer-events: none;
}

.decor--heart {
  color: var(--color-heart);
}

.decor--spark {
  color: var(--color-spark);
}

/* Category tag */

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 22px 8px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-weight: 500;
}

.tag img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* Paper card */

.paper-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 34px 28px 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.paper-card__tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 84px;
  height: 24px;
  margin-left: -42px;
  transform: rotate(var(--tilt, -3deg));
}

.icon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: var(--radius-md);
  background: var(--color-tile-pink);
  color: var(--color-on-tile);
}

.icon-tile .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.icon-tile--butter {
  background: var(--color-tile-butter);
}

.icon-tile--sage {
  background: var(--color-tile-sage);
}

.icon-tile--lilac {
  background: var(--color-tile-lilac);
}

.icon-tile--sky {
  background: var(--color-tile-sky);
}

/* Template card */

.template-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.template-card .polaroid {
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.template-card:hover .polaroid {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: var(--shadow-float);
}

.template-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-inline: var(--space-1);
}

.template-card__name {
  font-weight: 600;
}

.template-card__type {
  font-size: var(--text-caption);
  color: var(--color-text-subtle);
}

/* Calendar widget */

.calendar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: 26px;
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-float);
}

.calendar__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.calendar__month {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
}

.calendar__range {
  font-size: var(--text-caption);
  color: var(--color-text-subtle);
}

.calendar__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.calendar__dow {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-subtle);
}

.calendar__day {
  position: relative;
  padding: 8px 0;
  border-radius: 12px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.calendar__day--event::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--color-event-dot-a);
}

.calendar__day--today {
  background: var(--color-today-bg);
  color: var(--color-today-fg);
  font-weight: 600;
}

.calendar__events {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.calendar__event {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-event-a);
  font-size: var(--text-small);
}

.calendar__event--b {
  background: var(--color-event-b);
}

.calendar__event-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 4px;
  background: var(--color-event-dot-a);
}

.calendar__event--b .calendar__event-dot {
  background: var(--color-event-dot-b);
}

.calendar__time {
  width: 44px;
  flex: none;
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Checklist */

.checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.checklist__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  margin-top: 1px;
  border-radius: 8px;
  background: var(--color-tile-sage);
  color: var(--color-on-tile);
}

.checklist__icon .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

/* Footer */

.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--color-divider);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-7);
  padding-block: var(--space-8);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-footer__brand img {
  width: 32px;
  height: 32px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}
