/* Shared components: header, buttons, text link, cards, footer.
   Follows the "Components" page of the Penpot library. Load it after tokens.css and fonts.css
   and BEFORE the page's own style.css, so a page can still adjust layout.
   Pages move onto this file one at a time (see NOTES.md). */

/* Component colors. A page theme overrides these. */
:root {
  --ui-bg:var(--color-bg-page);
  --ui-ink:var(--color-neutral-ink);
  --ui-accent:var(--color-brand-teal);
  --ui-line:var(--color-neutral-line);
  --ui-focus:var(--color-focus);
  --ui-focus-on-dark:var(--color-focus-on-dark);
}

a:focus-visible,summary:focus-visible {
  outline:3px solid var(--ui-focus);
  outline-offset:4px;
}

.on-dark a:focus-visible,.button.pale:focus-visible {
  outline-color:var(--ui-focus-on-dark);
}

/* Header */
.header {
  max-width:var(--layout-max-width);
  margin:0 auto;
  min-height:var(--space-20);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-8);
}

.logo {
  font-size:var(--font-size-xl);
  font-weight:var(--font-weight-bold);
  letter-spacing:-.06em;
  text-decoration:none;
  color:var(--color-brand-teal-deep);
}

.logo span {
  font-weight:var(--font-weight-regular);
}

.wordmark {
  font-family:var(--font-family-serif);
  font-size:var(--font-size-2xl);
  line-height:1.2;
  letter-spacing:-.06em;
  text-decoration:none;
  color:var(--ui-ink);
}

.wordmark span {
  font-family:var(--font-family-sans);
  font-size:var(--font-size-xs);
  letter-spacing:0;
  vertical-align:top;
  margin-left:3px;
}

.header nav {
  display:flex;
  gap:var(--space-8);
}

.header nav a,.top-link {
  font-size:var(--font-size-xs);
  font-weight:var(--font-weight-bold);
  text-decoration:none;
  text-underline-offset:5px;
}

.header nav a:hover,.top-link:hover {
  text-decoration:underline;
}

.top-link {
  display:inline-flex;
  align-items:center;
  gap:var(--space-2);
  min-height:44px;
  color:var(--ui-accent);
}

/* Buttons */
.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:var(--space-6);
  min-height:52px;
  padding:var(--space-3) var(--space-5);
  font-size:var(--font-size-xs);
  font-weight:var(--font-weight-bold);
  text-decoration:none;
}

.button.dark {
  background:var(--color-brand-teal);
  color:var(--color-neutral-white);
}

.button.dark:hover {
  background:var(--color-brand-teal-deep);
}

.button.outline {
  border:1px solid var(--color-brand-teal);
  color:var(--color-brand-teal);
}

.button.outline:hover {
  background:var(--color-brand-teal);
  color:var(--color-neutral-white);
}

.button.pale {
  background:var(--color-tint-peach);
  color:var(--color-neutral-ink);
}

.button.pale:hover {
  background:var(--color-neutral-white);
}

/* Text link */
.text-link {
  display:inline-flex;
  align-items:center;
  gap:var(--space-2);
  padding:var(--space-2) 0;
  font-size:var(--font-size-xs);
  font-weight:var(--font-weight-bold);
  text-decoration:none;
  color:var(--ui-accent);
  border-bottom:1px solid var(--color-tint-sage-300);
}

.text-link:hover {
  border-bottom-color:var(--ui-accent);
  box-shadow:0 1px 0 var(--ui-accent);
}

/* On dark sections the underline follows the text color */
.on-dark .text-link:hover {
  border-bottom-color:currentColor;
  box-shadow:0 1px 0 currentColor;
}

/* Cyoflow theme: its own colors and buttons. Add class="theme-cyoflow" to <body>. */
.theme-cyoflow {
  --ui-bg:var(--color-cyoflow-cream);
  --ui-ink:var(--color-cyoflow-ink);
  --ui-accent:var(--color-cyoflow-ink);
  --ui-line:var(--color-cyoflow-line);
  --ui-focus:var(--color-cyoflow-orange);
  --ui-focus-on-dark:var(--color-cyoflow-sand);
}

.theme-cyoflow .top-link span {
  color:var(--color-cyoflow-orange);
}

.button.button-dark {
  background:var(--color-cyoflow-green);
  color:var(--color-neutral-white);
}

.button.button-dark:hover {
  background:var(--color-cyoflow-green-deep);
}

.button.button-sand {
  background:var(--color-cyoflow-sand);
  color:var(--color-cyoflow-green-deep);
}

.button.button-sand:hover {
  background:var(--color-cyoflow-cream);
}

/* Tinted card */
.card {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:var(--space-4);
  padding:var(--space-8);
}

.card-sage {
  background:var(--color-tint-sage-200);
}

.card-lavender {
  background:var(--color-tint-lavender);
}

.card-sand {
  background:var(--color-tint-sand);
}

.card-cream {
  background:var(--color-neutral-cream);
}

/* Column card */
.card-column {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:var(--space-4);
  padding-top:var(--space-5);
  border-top:1px solid var(--color-neutral-line-warm);
}

.card-label {
  font-size:var(--font-size-xs);
  font-weight:var(--font-weight-bold);
  letter-spacing:.1em;
}

.card .card-label {
  color:var(--color-text-muted);
}

.card-column .card-label {
  color:var(--color-text-accent);
}

.card h3,.card-column h3 {
  font-size:var(--font-size-2xl);
  line-height:1.15;
}

.card p,.card-column p {
  font-size:var(--font-size-sm);
  line-height:1.55;
}

.card .text-link {
  margin-top:auto;
}

/* Footer */
.site-footer {
  min-height:var(--space-24);
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:var(--space-5);
  border-top:1px solid var(--ui-line);
  font-size:var(--font-size-xs);
}

.site-footer p {
  margin:0;
}

.site-footer a:not(.logo):not(.wordmark) {
  display:inline-flex;
  align-items:center;
  gap:var(--space-2);
  min-height:44px;
  font-weight:var(--font-weight-bold);
  text-decoration:none;
  text-underline-offset:5px;
}

.site-footer a:not(.logo):not(.wordmark):hover {
  text-decoration:underline;
}

/* Second footer row: legal links and copyright */
.footer-legal {
  order:2;
  flex-basis:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:0 var(--space-6);
  padding-bottom:var(--space-4);
}

.footer-legal-links {
  display:flex;
  gap:var(--space-6);
}

.site-footer .footer-legal a:not(.logo):not(.wordmark) {
  font-weight:var(--font-weight-regular);
  text-decoration:underline;
}

@media(max-width:1264px) {
  .header {
    margin:0 var(--layout-gutter-tablet);
  }
}

@media(max-width:1000px) {
  .header nav {
    gap:var(--space-6);
  }
}

@media(max-width:760px) {
  .header {
    margin:0 var(--layout-gutter-mobile);
    min-height:72px;
  }
  .header nav {
    display:none;
  }
  .logo {
    font-size:var(--font-size-lg);
  }
  .card {
    padding:var(--space-6);
  }
  .site-footer {
    padding:var(--space-5) 0;
  }
  .site-footer .footer-note {
    display:none;
  }
  /* Cyoflow footer: the home link drops to its own row */
  .site-footer .footer-home {
    order:1;
  }
  .footer-legal {
    flex-direction:column;
    align-items:flex-start;
    padding-bottom:0;
  }
}
