/* ==========================================================================
   Pépinière Graines Voyageuses — public site
   Design system "Organic": tokens first, then components, then page layout.
   Retune the palette in :root and the whole site follows.
   ========================================================================== */

/* Fonts live in css/fonts.css, linked from <head> before this file: an @import here would
   force the browser to fetch and parse this stylesheet before discovering them. */

:root {
	--color-bg: #f5ead8;
	--color-surface: #ebddc5;
	--color-text: #201e1d;
	--color-accent: #c67139;
	--color-accent-2: #7a8a5e;
	--color-divider: rgba(32, 30, 29, 0.16);

	/* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
	   same step of any role matches the others in visual value. */
	--color-neutral-100: #f9f4ed;
	--color-neutral-200: #eee7db;
	--color-neutral-300: #dcd3c4;
	--color-neutral-400: #c0b6a5;
	--color-neutral-500: #a19786;
	--color-neutral-600: #82796a;
	--color-neutral-700: #645c50;
	--color-neutral-800: #474238;
	--color-neutral-900: #2e2b25;

	--color-accent-100: #fff2eb;
	--color-accent-200: #ffe1d0;
	--color-accent-300: #ffc6a5;
	--color-accent-400: #f6a06b;
	--color-accent-500: #d67f48;
	--color-accent-600: #b2622d;
	--color-accent-700: #8c491a;
	--color-accent-800: #643312;
	--color-accent-900: #402310;

	--color-accent-2-100: #f0fae1;
	--color-accent-2-200: #e1eecc;
	--color-accent-2-300: #ccdbb2;
	--color-accent-2-400: #aebf92;
	--color-accent-2-500: #8fa073;
	--color-accent-2-600: #728157;
	--color-accent-2-700: #56633f;
	--color-accent-2-800: #3d472b;
	--color-accent-2-900: #272e1b;

	--font-heading: "Caprasimo", system-ui, sans-serif;
	--font-body: "Figtree", system-ui, sans-serif;

	--space-1: 4.4px;
	--space-2: 8.8px;
	--space-3: 13.2px;
	--space-4: 17.6px;
	--space-6: 26.4px;
	--space-8: 35.2px;

	--radius-sm: 8px;
	--radius-md: 16px;
	--radius-lg: 28px;

	--shadow-sm: 0 1px 2px rgba(46, 43, 37, 0.14);
	--shadow-md: 0 3px 10px rgba(46, 43, 37, 0.16);
	--shadow-lg: 0 12px 32px rgba(46, 43, 37, 0.22);

	--container: 1160px;
}

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

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.65;
	font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: 400;
	line-height: 1.12;
	letter-spacing: -0.015em;
	margin: 0 0 var(--space-2);
}

p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent-2-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-2); }
img { display: block; max-width: 100%; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: rgba(198, 113, 57, 0.3); }

.text-muted { color: var(--color-neutral-700); }
.visually-hidden {
	position: absolute; width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container { max-width: var(--container); margin: 0 auto; width: 100%; }

/* The header is sticky, so an anchor jump would otherwise park the section title behind
   it. Reserve its height above every jump target. */
html { scroll-behavior: smooth; }
:target,
section[id] { scroll-margin-top: 104px; }

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

/* — buttons — */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	cursor: pointer; text-decoration: none;
	font-family: var(--font-heading); font-weight: 400;
	font-size: 14px; line-height: 1.2; color: var(--color-text);
	background: transparent; border: 1px solid transparent;
	padding: var(--space-2) calc(var(--space-3) * 1.2);
	border-radius: 999px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent-600); border-color: var(--color-accent-600); color: #fff; }
.btn-primary:active { background: var(--color-accent-700); }
.btn-accent-2 { background: var(--color-accent-2); color: var(--color-bg); border-color: var(--color-accent-2); }
.btn-accent-2:hover { background: var(--color-accent-2-600); border-color: var(--color-accent-2-600); color: var(--color-bg); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: rgba(32, 30, 29, 0.07); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); background: transparent; }
.btn-ghost:hover { background: rgba(198, 113, 57, 0.1); }
.btn-lg { padding: 14px 26px; font-size: 15px; }

/* — forms — */
.field > label {
	display: block; font-size: 12px; margin-bottom: 5px;
	color: var(--color-neutral-700);
}
.input {
	width: 100%; min-height: 38px; padding: 6px 14px; font: inherit;
	font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
	background: var(--color-surface);
	border: 1px solid var(--color-divider); border-radius: 999px;
}
.input:hover { border-color: rgba(32, 30, 29, 0.45); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; border-radius: var(--radius-md); }
select.input { appearance: none; padding-right: 32px; background-image: none; }

.seg {
	display: inline-flex; overflow: hidden; flex-wrap: wrap;
	border: 1px solid var(--color-divider); border-radius: 999px;
}
.seg-opt {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 14px; font-size: 13px; cursor: pointer;
	background: transparent; border: none; font-family: inherit; color: inherit;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:hover { background: rgba(32, 30, 29, 0.07); }
.seg-opt.is-active { background: var(--color-accent-2); color: var(--color-bg); }
.seg-opt.is-active:hover { background: var(--color-accent-2-600); }

/* — cards — */
.card {
	display: flex; flex-direction: column; gap: var(--space-2);
	padding: var(--space-4); border-radius: calc(var(--radius-lg) * 1.15);
	background: var(--color-surface);
}
.card-title { font-family: var(--font-heading); font-weight: 400; font-size: 17px; line-height: 1.2; margin: 0 0 8px; }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
	display: inline-flex; align-items: center; font-size: 11px;
	letter-spacing: 0.02em; padding: 3px 10px; border-radius: 999px;
	white-space: nowrap;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
	text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--color-neutral-700);
	padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td { padding: var(--space-2); border-bottom: 1px solid rgba(32, 30, 29, 0.08); }
.table tbody tr:hover { background: rgba(32, 30, 29, 0.04); }
.table tbody tr[hidden] { display: none; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.th-hint {
	text-decoration: none; cursor: help;
	border-bottom: 1px dotted var(--color-neutral-500);
}

.table-frame {
	border-radius: var(--radius-md); overflow: hidden;
	background: var(--color-neutral-100); box-shadow: var(--shadow-md);
}
.table-scroll { max-height: 560px; overflow: auto; }
.table-scroll thead tr { position: sticky; top: 0; background: var(--color-surface); z-index: 1; }

/* — alerts — */
.alert { padding: 12px 18px; border-radius: var(--radius-md); margin-bottom: var(--space-4); font-size: 14px; }
.alert-success { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.alert-error { background: var(--color-accent-200); color: var(--color-accent-800); }

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--color-bg);
	border-bottom: 1px solid var(--color-divider);
}
.header-inner {
	display: flex; align-items: center; gap: var(--space-4);
	padding: var(--space-3) var(--space-4);
}
.nav-brand {
	display: flex; align-items: center; gap: 10px;
	text-decoration: none; color: inherit; margin-right: auto;
	font-family: var(--font-heading); font-weight: 400; font-size: 19px;
}
.nav-brand img {
	width: 58px; height: 58px; flex: none; border-radius: 8px; object-fit: cover;
	box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(32, 30, 29, 0.25);
}
.site-nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.site-nav a { color: inherit; text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: var(--color-accent); }
.site-nav .btn { margin-left: 6px; }

.menu-toggle {
	display: none; flex-direction: column; gap: 5px;
	background: none; border: none; cursor: pointer; padding: 8px;
}
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--color-text); }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: 64px 24px; }
.section-tight { padding: 40px 24px 72px; }
/* Two plain sections in a row read as one block: their facing paddings add up to 128px of
   emptiness, which looks like a rendering fault rather than a break. Sections that change
   the background colour keep their full padding — there the gap is the separation. */
.section:not(.section-surface):not(.section-olive) + .section:not(.section-surface):not(.section-olive) {
	padding-top: 0;
}
.section-surface { background: var(--color-surface); }
.section-olive { background: var(--color-accent-2-100); }
.section-title { font-size: 32px; margin: 0 0 10px; }
.section-intro { max-width: 70ch; color: var(--color-neutral-700); margin: 0 0 var(--space-6); }

.grid-2 {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 40px; align-items: start;
}
.grid-cards {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}

/* Hero */
.hero { padding: 56px 24px 72px; }
.hero-grid {
	display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 0.9fr);
	gap: 48px; align-items: center;
}
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; margin: 0 0 18px; }
.hero-intro { font-size: 19px; max-width: 46ch; margin: 0 0 28px; color: var(--color-neutral-700); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-photo { width: 100%; height: 380px; object-fit: cover; border-radius: 32px; }

/* La pépinière */
.about-grid {
	display: grid; grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.15fr);
	gap: 48px; align-items: start;
}
.about-photo { width: 100%; border-radius: 32px; object-fit: cover; }
.logo-plate {
	background: #fff; border-radius: var(--radius-md); padding: 10px 14px;
	display: inline-flex; align-items: center;
}
.logo-plate img { max-height: 64px; width: auto; }
.logo-row { display: flex; gap: 14px; align-items: center; margin-top: 20px; flex-wrap: wrap; }

/* Galerie */
.gallery-grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
}
.gallery-grid img { width: 100%; height: 260px; object-fit: cover; border-radius: 24px; }

/* Catalogue */
.catalog-controls {
	display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 24px 0 20px;
}
.catalog-controls .input.search { flex: 1; min-width: 240px; }
.catalog-controls select.input { width: auto; }
.catalog-footer {
	display: flex; align-items: center; justify-content: space-between;
	flex-wrap: wrap; gap: 10px; margin-top: 14px;
}
.catalog-footer p { margin: 0; font-size: 13px; color: var(--color-neutral-600); }

/* Bandeau devis */
.cta-band {
	display: flex; justify-content: space-between; align-items: center;
	gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { font-size: 28px; margin: 0 0 8px; color: var(--color-accent-2-800); }
.cta-band p { margin: 0; max-width: 60ch; color: var(--color-accent-2-800); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.faq-item {
	background: var(--color-surface); border-radius: var(--radius-md);
	padding: 14px 18px; box-shadow: var(--shadow-sm);
}
.faq-item summary {
	cursor: pointer; font-weight: 600; list-style: none;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
	content: '+'; font-size: 20px; line-height: 1; color: var(--color-accent); flex: none;
}
.faq-item[open] summary::after { content: '–'; }
.faq-answer { margin-top: 10px; font-size: 15px; color: var(--color-neutral-700); }
.faq-answer > :last-child { margin-bottom: 0; }

/* Contact */
.contact-grid {
	display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(300px, 1.2fr); gap: 40px;
}
.contact-grid address { font-style: normal; font-size: 15px; line-height: 1.8; }
.contact-map { width: 100%; height: 300px; border: 0; border-radius: 32px; }

/* Pied de page */
.site-footer { padding: 32px 24px; border-top: 1px solid var(--color-divider); }
.footer-inner {
	display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	font-size: 13px; color: var(--color-neutral-600);
}

/* ==========================================================================
   Quote dialog
   ========================================================================== */

.dialog-backdrop {
	position: fixed; inset: 0; z-index: 100;
	display: flex; align-items: center; justify-content: center; padding: 20px;
	background: rgba(46, 43, 37, 0.5);
}
.dialog-backdrop[hidden] { display: none; }
.dialog {
	max-width: 860px; width: 100%; max-height: 88vh;
	display: flex; flex-direction: column;
	padding: var(--space-6); border-radius: calc(var(--radius-lg) * 1.15);
	background: var(--color-surface); box-shadow: var(--shadow-lg);
	overflow: hidden;
}
/* The form is the dialog's only child, so it has to carry the column layout itself —
   otherwise the scrollable body is measured against an auto-height block and the bottom
   of the form becomes unreachable. */
.dialog > form {
	display: flex; flex-direction: column; gap: var(--space-3);
	flex: 1; min-height: 0;
}
.dialog-title { font-family: var(--font-heading); font-weight: 400; font-size: 20px; }
.dialog-body { font-size: 14px; overflow-y: auto; flex: 1; min-height: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
/* An author `display` beats the user-agent [hidden] rule, so the inactive step's buttons
   would stay on screen next to the active one's. */
.dialog-actions[hidden] { display: none; }
.dialog-note {
	margin: 0 0 20px; font-size: 13px; color: var(--color-neutral-600);
	background: var(--color-neutral-100); padding: 10px 14px; border-radius: var(--radius-md);
}

.quote-line { border-bottom: 1px dashed var(--color-divider); padding-bottom: 10px; margin-bottom: 14px; }
.quote-line:last-of-type { border-bottom: none; }
/* One product per row: essence gets the slack, quantity stays narrow, remove button last.
   The essence field is deliberately not 1fr-greedy — it only needs room for a name. */
.quote-line-grid {
	display: grid;
	grid-template-columns: minmax(150px, 1.5fr) minmax(120px, 1fr) minmax(130px, 1.1fr) 78px 32px;
	gap: 10px; align-items: end;
}
/* Searchable dropdown for the essence field. A native <datalist> was tried first and
   rejected: once a value is picked its arrow stops reopening the list, and there is no way
   to browse the catalogue without deleting what you typed. */
.combo { position: relative; }
.combo-toggle {
	position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
	width: 28px; height: 28px; padding: 0;
	display: flex; align-items: center; justify-content: center;
	background: none; border: none; cursor: pointer;
	color: var(--color-neutral-700); font-size: 11px; line-height: 1;
}
.combo-toggle:hover { color: var(--color-accent); }
.combo-input { padding-right: 34px; }
.combo-list {
	position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px);
	margin: 0; padding: 4px; list-style: none;
	max-height: 240px; overflow-y: auto;
	background: var(--color-neutral-100);
	border: 1px solid var(--color-divider); border-radius: var(--radius-md);
	box-shadow: var(--shadow-md);
}
.combo-list[hidden] { display: none; }
.combo-option {
	padding: 7px 10px; font-size: 13px; cursor: pointer; border-radius: var(--radius-sm);
}
.combo-option:hover,
.combo-option.is-active { background: var(--color-accent-2-200); }
.combo-option[aria-selected="true"] { font-weight: 600; }
.combo-option .combo-latin { font-style: italic; color: var(--color-neutral-700); }
.combo-empty { padding: 7px 10px; font-size: 13px; color: var(--color-neutral-600); }

.quote-line-zone { margin: 6px 0 0; font-size: 12px; color: var(--color-neutral-600); }
.quote-line-remove { padding: 4px; font-size: 18px; line-height: 1; min-height: 38px; }
.quote-line-remove[disabled] { opacity: 0.3; pointer-events: none; }
.quote-separator { border: 0; border-top: 1px solid var(--color-divider); margin: 22px 0 18px; }
.quote-error { color: var(--color-accent-700); font-size: 13px; margin: 14px 0 0; }
.quote-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.quote-field { margin-bottom: 14px; }

/* ==========================================================================
   Responsive — the layout above is desktop-first, like the mockup
   ========================================================================== */

@media (max-width: 900px) {
	.hero-grid,
	.about-grid,
	.contact-grid { grid-template-columns: 1fr; gap: 28px; }
	.hero-photo { height: 260px; }
	.about-photo { max-height: 420px; }
}

@media (max-width: 760px) {
	.menu-toggle { display: flex; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 0;
		background: var(--color-bg); border-bottom: 1px solid var(--color-divider);
		padding: var(--space-3) var(--space-4);
	}
	.site-nav.open { display: flex; }
	.site-nav a { padding: 10px 0; }
	.site-nav .btn { margin: 8px 0 0; }
	.header-inner { position: relative; }
}

@media (max-width: 560px) {
	.section, .section-tight { padding-left: 16px; padding-right: 16px; }
	.section { padding-top: 44px; padding-bottom: 44px; }
	.section-title { font-size: 26px; }
	.quote-fields { grid-template-columns: 1fr; }
	.gallery-grid img { height: 200px; }
	.dialog { padding: var(--space-4); max-height: 92vh; }
	.catalog-controls .input.search { min-width: 0; }
}

/* One product per row needs room; below that the fields stack rather than shrink to
   unusable widths, with the remove button pinned to the essence row. */
@media (max-width: 720px) {
	.quote-line-grid { grid-template-columns: 1fr 32px; }
	.quote-line-grid .field:first-child { grid-column: 1; }
	.quote-line-grid .field:not(:first-child) { grid-column: 1 / -1; }
	.quote-line-remove { grid-row: 1; grid-column: 2; }
}
