/* Rossella Ricchiari — base styles, layout primitives and components.
   Depends on tokens.css. No classes for one-off tweaks: if a page needs
   something this file can't express, change the system, not the page. */

/* Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Text ------------------------------------------------------------------ */
body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  font-weight: 400;
}
h1, h2, h3 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 300;               /* Fraunces Light, as in the chosen specimen */
  font-optical-sizing: auto;
  line-height: var(--leading-heading);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--size-h1); line-height: var(--leading-tight); max-width: var(--measure-heading); }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); font-weight: 400; } /* Light is too thin at card-title sizes */
p, li { max-width: var(--measure); text-wrap: pretty; }
strong { font-weight: 600; color: var(--ink); }
small, .note { font-size: var(--size-small); color: var(--muted); }

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

/* The one paragraph allowed directly under an h1. */
.lead { font-size: var(--size-lead); color: var(--ink); }
/* The one eyebrow allowed on the site: the home hero. */
.eyebrow { font-size: var(--size-small); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

/* Layout primitives ----------------------------------------------------- */
/* .wrap — the page column. Every left edge on the page is this edge. */
.wrap { width: min(100% - 2 * var(--gutter), var(--page-max)); margin-inline: auto; }
/* .section — vertical rhythm between sections. .section--sand for a quiet band. */
.section { padding-block: var(--section); }
.section--sand { background: var(--sand); }
/* .stack — vertical flow. Set --gap on the element to change it. */
/* --gap is reset on every stack so a nested stack doesn't inherit its parent's gap. */
.stack { --gap: var(--space-4); display: flex; flex-direction: column; align-items: flex-start; gap: var(--gap); }
.stack > * { width: 100%; }
/* Gap modifiers. Use these rather than an inline style, which the site's CSP blocks. */
.gap-2 { --gap: var(--space-2); } .gap-3 { --gap: var(--space-3); } .gap-5 { --gap: var(--space-5); }
.gap-6 { --gap: var(--space-6); } .gap-7 { --gap: var(--space-7); }
.stack > .button, .stack > .cluster { width: auto; }
/* A heading belongs to what follows it: twice the space above as below. */
.stack > :is(h2, h3):not(:first-child) { margin-top: var(--space-5); }
/* .cluster — things in a row that wrap (buttons, links). */
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
/* .grid — equal columns that collapse on narrow screens. */
.grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
/* .split — text beside a narrower aside; stacks under 50rem. */
.split { display: grid; gap: var(--space-7); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 50rem) { .split { grid-template-columns: 1fr; } }

/* Components ------------------------------------------------------------ */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 3rem; padding: var(--space-3) var(--space-5);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--peach); color: var(--ink);
  font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--peach-strong); }
.button--outline { background: transparent; border-color: var(--ink); }
.button--outline:hover { background: var(--surface); }
.button--small { min-height: 2.5rem; padding: var(--space-2) var(--space-4); font-size: var(--size-small); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }

/* A card: title, one paragraph, one link. Nothing else. The link sits at the bottom. */
.card {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-5); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.card > :last-child { margin-top: auto; padding-top: var(--space-2); }
.card h3 a { color: inherit; text-decoration: none; }

/* A callout for "what I don't do" and "when to see someone else". */
.callout { padding: var(--space-5); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-small) var(--radius-small) 0; }

/* Site header and footer */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-4); }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); }
.site-header nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-header nav a[aria-current]:not(.button) { color: var(--accent); text-decoration: underline; }
.brand { color: var(--ink); text-decoration: none; font-family: var(--font-serif); font-size: 1.375rem; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer { background: var(--night); color: var(--paper); padding-block: var(--space-8); }
.site-footer :is(h2, a:not(.button)) { color: var(--paper); }

/* Forms ------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: var(--space-2); font-weight: 500; color: var(--ink); }
.field :is(input, textarea) {
  width: 100%; min-height: 3rem; padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius-small);
  font-weight: 400;
}
fieldset { border: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
legend { font-weight: 600; color: var(--ink); margin-bottom: var(--space-3); }
.choice {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); min-height: 3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small);
  cursor: pointer;
}
.choice input { width: 1.125rem; height: 1.125rem; accent-color: var(--chosen-line); flex: none; }
.choice:has(input:checked) { background: var(--chosen); border-color: var(--chosen-line); color: var(--ink); }
.choice:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.error { color: var(--error); font-weight: 500; }

/* Site components (added with the page build, 25 September 2026) --------- */
/* Skip link: hidden until focused. */
.skip-link { position: absolute; left: var(--gutter); top: var(--space-2); transform: translateY(-200%); padding: var(--space-2) var(--space-4); background: var(--surface); color: var(--ink); border-radius: var(--radius-small); font-weight: 500; z-index: 1; }
.skip-link:focus { transform: none; }
/* Hidden from sight, still read by assistive technology. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Language switch in the header: EN | IT. */
.lang-switch { display: flex; gap: var(--space-2); font-size: var(--size-small); font-weight: 500; color: var(--muted); }
.lang-switch a { color: var(--ink); }
.lang-switch [aria-current] { color: var(--ink); font-weight: 600; }

/* Breadcrumb on inner pages: small, muted, never an eyebrow. */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; list-style: none; font-size: var(--size-small); color: var(--muted); }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--space-2); }
.breadcrumb a { color: var(--muted); }

/* The first section of an inner page sits closer to the header. */
.section--page { padding-top: var(--space-6); }

/* Lists and tables inside text. */
ul, ol { padding-left: var(--space-5); }
li + li { margin-top: var(--space-2); }
.stack > .grid { margin-top: var(--space-4); }
.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: var(--size-small); }
th, td { padding: var(--space-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--ink); font-weight: 600; }

/* A panel: a surface for a form section or an aside. Unlike a card it has no content rule. */
.panel { padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel--sand { background: var(--sand); border-color: transparent; }
@media (min-width: 50rem) { .split > .panel { position: sticky; top: var(--space-5); } }

/* Questionnaire: progress, the review summary and list. */
progress { width: 100%; height: var(--space-2); appearance: none; border: 0; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.summary { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--paper); border-radius: var(--radius-small); }
.summary dt { font-size: var(--size-small); color: var(--muted); }
.summary dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.review { padding-left: var(--space-5); }
.review > li { padding-block: var(--space-3); border-top: 1px solid var(--line); }
.review > li > p { color: var(--ink); font-weight: 500; }
.review ul { margin-top: var(--space-2); }
.review ul li + li { margin-top: var(--space-1); }

/* Footer band details. */
.site-footer .note { color: var(--sand); }
