/*
Theme Name: HappyTools
Description: Thème de HappyTools asbl.
Version: 0.2.0
Text Domain: happytools
*/

:root {
	--bg: #ffffff;
	--ink: #111111;
	--mute: #6b6b6b;
	--line: #111111;
	--soft: #f3f3f3;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 "Inter", system-ui, sans-serif; }
a { color: var(--ink); }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }

/* ---------- Wordmark: one font per letter, all black ---------- */
.ht-wordmark { display: inline-flex; align-items: baseline; line-height: 1; white-space: nowrap; color: var(--ink); }
.ht-wordmark .l { display: inline-block; }
.l1  { font-family: "Playfair Display", serif; font-weight: 900; }
.l2  { font-family: "Instrument Serif", serif; font-style: italic; }
.l3  { font-family: "Space Grotesk", sans-serif; font-weight: 700; }
.l4  { font-family: "Cormorant Garamond", serif; font-style: italic; font-weight: 600; }
.l5  { font-family: "Syne", sans-serif; font-weight: 800; }
.l6  { font-family: "IBM Plex Mono", monospace; font-weight: 600; }
.l7  { font-family: "DM Serif Display", serif; }
.l8  { font-family: "Archivo Black", sans-serif; }
.l9  { font-family: "Bodoni Moda", serif; font-style: italic; font-weight: 700; }
.l10 { font-family: "Instrument Serif", serif; }

/* ---------- Homepage ---------- */
.home {
	min-height: 100vh; padding: 2rem 1rem; position: relative;
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.home-title { margin: 0; font-size: clamp(3rem, 13vw, 9rem); font-weight: 400; }
.home-title .l { animation: appear .8s ease both; animation-delay: calc(var(--i) * .08s + .1s); }
.home-sub { margin: .6rem 0 0; font: 500 .8rem/1 "Inter", sans-serif; letter-spacing: .5em; text-transform: uppercase; padding-left: .5em; color: var(--mute); animation: fade .8s ease both; animation-delay: 1s; }
.home-menu { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: center; margin-top: 3.5rem; animation: rise .8s ease both; animation-delay: 1.4s; }
.pill {
	font: 400 1.35rem/1 "Fraunces", Georgia, serif; color: var(--ink); text-decoration: none;
	padding-bottom: .15rem; border-bottom: 1px solid transparent; transition: border-color .2s;
}
.pill:hover, .pill:focus-visible { border-bottom-color: var(--ink); }
.home-login { position: absolute; top: 1.2rem; right: 1.4rem; font-size: .85rem; color: var(--mute); animation: fade .8s ease both; animation-delay: 1.8s; }
.home-login:hover { color: var(--ink); }

@keyframes appear { from { opacity: 0; transform: translateY(.3em); } to { opacity: 1; transform: none; } }
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .home * { animation: none !important; } }

/* ---------- Interior pages ---------- */
.site-header {
	display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
	padding: 1rem clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line);
}
.site-logo { text-decoration: none; font-size: 1.8rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; align-items: center; }
.site-nav a { text-decoration: none; font-weight: 500; font-size: .95rem; padding: .2rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a.is-current { border-bottom-color: var(--ink); }
.site-nav .nav-session { color: var(--mute); }

.page { max-width: 820px; margin: 0 auto; padding: 3rem 1rem 4rem; }
.page-title { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 2rem; }
.site-footer { text-align: center; padding: 2rem 1rem; font-size: .8rem; color: var(--mute); }

.ht-h2 { font-size: 1.6rem; margin: 2.5rem 0 .5rem; display: flex; align-items: center; gap: .6rem; }
.ht-count { font: 500 .8rem/1 "Inter", sans-serif; border: 1px solid var(--ink); padding: .25rem .5rem; }
.ht-lead { margin: 0 0 1rem; color: var(--mute); }
.ht-empty { color: var(--mute); font-style: italic; }
.ht-meta { font-size: .82rem; color: var(--mute); margin: .5rem 0 0; }
.ht-body p { margin: .4rem 0; }

.ht-notice { border: 1px solid var(--ink); background: var(--soft); padding: .6rem 1rem; }
.ht-notice.is-error { background: var(--ink); color: #fff; }

/* Forms */
.ht-add { border: 1px solid var(--line); margin: 0 0 2rem; }
.ht-add > summary { cursor: pointer; padding: .9rem 1.2rem; font: 500 1.1rem/1.2 "Fraunces", Georgia, serif; list-style: none; }
.ht-add > summary::-webkit-details-marker { display: none; }
.ht-add[open] > summary { border-bottom: 1px solid var(--line); }
.ht-add > .ht-form, .ht-add > .ht-meta { margin: 1rem 1.2rem; }
.ht-form label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .8rem; }
.ht-form label[hidden] { display: none; }
.ht-form small { font-weight: 400; color: var(--mute); }
.ht-form input[type=text], .ht-form input[type=url], .ht-form input[type=date], .ht-form select, .ht-form textarea, .ht-form input[type=file] {
	display: block; width: 100%; margin-top: .25rem; padding: .55rem .7rem; font: inherit; font-weight: 400;
	border: 1px solid var(--ink); border-radius: 0; background: #fff;
}
.ht-form input:focus, .ht-form select:focus, .ht-form textarea:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.ht-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .ht-row { grid-template-columns: 1fr; } }
.ht-btn { background: var(--ink); color: #fff; font: 600 .95rem/1 "Inter", sans-serif; padding: .75rem 1.5rem; border: 1px solid var(--ink); border-radius: 0; cursor: pointer; }
.ht-btn:hover { background: #fff; color: var(--ink); }
.ht-inline { display: inline; margin: 0; }
.ht-link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* Docs */
.ht-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.ht-chip { display: inline-block; padding: .15rem .7rem; font-size: .8rem; font-weight: 500; text-decoration: none; border: 1px solid var(--ink); border-radius: 999px; }
.ht-chip:hover, .ht-chip.is-on { background: var(--ink); color: #fff; }
.ht-tags-inline { margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ht-cards { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ht-card { border: 1px solid var(--line); padding: 1.2rem; overflow-wrap: anywhere; }
.ht-card h3 { margin: .3rem 0 .4rem; font-size: 1.5rem; }
.ht-kind { font: 600 .68rem/1 "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); }

/* To Do */
.ht-todos { list-style: none; margin: 0; padding: 0; }
.ht-todo { display: flex; gap: 1rem; align-items: flex-start; padding: .9rem 0; border-top: 1px solid #ddd; }
.ht-todo:last-child { border-bottom: 1px solid #ddd; }
.ht-todo.is-late strong { text-decoration: underline; text-decoration-thickness: 2px; }
.ht-todo-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ht-check { width: 1.6rem; height: 1.6rem; flex: none; border: 1px solid var(--ink); border-radius: 0; background: #fff; font-weight: 700; color: #fff; cursor: pointer; line-height: 1; margin-top: .1rem; }
.ht-check:hover { background: var(--soft); }
.ht-check.is-on { background: var(--ink); }
.is-done .ht-todo { color: var(--mute); }
.is-done .ht-todo-main > strong { text-decoration: line-through; }

/* Charte */
.ht-rules { list-style: none; counter-reset: rule; margin: 0 0 1rem; padding: 0; }
.ht-rule { counter-increment: rule; position: relative; padding: 1rem 0 1rem 3.2rem; border-top: 1px solid #ddd; }
.ht-rule:last-child { border-bottom: 1px solid #ddd; }
.ht-rule::before { content: counter(rule, decimal-leading-zero); position: absolute; left: 0; top: 1.05rem; font: 600 .85rem/1.6 "IBM Plex Mono", monospace; color: var(--mute); }
.ht-rule > strong { font: 500 1.15rem/1.35 "Fraunces", Georgia, serif; }
.is-exclusion .ht-rule::before { color: var(--ink); }
.ht-admin-tools { margin-top: .6rem; font-size: .88rem; }
.ht-admin-tools summary { cursor: pointer; color: var(--mute); }
.ht-admin-tools .ht-form { margin-top: .8rem; }

/* Bons plans */
.ht-map { height: 460px; border: 1px solid var(--line); margin-bottom: 1.5rem; z-index: 0; }
@media (max-width: 560px) { .ht-map { height: 340px; } }
.ht-pin { background: var(--ink); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--ink); }
.ht-pin.is-draft { background: #fff; border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.ht-popup { font: 400 .9rem/1.4 "Inter", sans-serif; }
.ht-popup strong { font: 500 1.05rem/1.2 "Fraunces", Georgia, serif; }
.ht-popup-meta { color: var(--mute); }
.ht-popup p { margin: .4rem 0; }
.ht-geo { display: flex; gap: .5rem; }
.ht-geo input { flex: 1; }
.ht-geo .ht-btn { white-space: nowrap; margin-top: .25rem; }
button.ht-chip { font-family: inherit; background: #fff; color: var(--ink); cursor: pointer; }
button.ht-chip:hover, button.ht-chip.is-on { background: var(--ink); color: #fff; }
.ht-places { list-style: none; margin: 0; padding: 0; }
.ht-place { padding: 1rem 0; border-top: 1px solid #ddd; }
.ht-place[hidden] { display: none; }
.ht-place:last-child { border-bottom: 1px solid #ddd; }
.ht-place-name { background: none; border: 0; padding: 0; cursor: pointer; font: 500 1.25rem/1.25 "Fraunces", Georgia, serif; color: var(--ink); text-align: left; }
.ht-place-name:hover { text-decoration: underline; }
.ht-map .leaflet-tile-pane { filter: grayscale(1) contrast(1.05); }
.ht-popup-actions { display: flex; gap: 1rem; margin-top: .5rem; }
.ht-popup .ht-link-btn { font-size: inherit; }

/* AG */
.ht-ag-head { margin-bottom: 1.5rem; }
.ht-ag-title { width: 100%; font: 500 1.9rem/1.2 "Fraunces", Georgia, serif; border: 0; border-bottom: 1px solid var(--ink); padding: .2rem 0; margin-bottom: 1rem; background: transparent; }
.ht-ag-title-ro { font-size: 2rem; margin: 0 0 .4rem; }
.ht-ag-head input[type=date], .ht-ag-head input[type=text]:not(.ht-ag-title), .ht-ag-block textarea, .ht-ag-point textarea, .ht-ag-point input, .ht-ag-point select {
	width: 100%; padding: .5rem .7rem; font: inherit; border: 1px solid var(--ink); border-radius: 0; background: #fff; margin-top: .4rem;
}
.ht-ag-head label { font-weight: 600; font-size: .85rem; display: block; }
.ht-seg { display: inline-flex; border: 1px solid var(--ink); margin: .6rem 0; }
.ht-seg button { font: 500 .9rem/1 "Inter", sans-serif; padding: .6rem 1rem; border: 0; background: #fff; cursor: pointer; }
.ht-seg button + button { border-left: 1px solid var(--ink); }
.ht-seg button.is-on { background: var(--ink); color: #fff; }
.ht-ag-save { margin-left: 1rem; font-size: .85rem; color: var(--mute); }
.ht-ag-h { font-size: 1.6rem; margin: 2rem 0 .6rem; }
.ht-ag-block h3 { font-size: 1.2rem; margin: 1rem 0 .3rem; }
.ht-ag-points { list-style: none; counter-reset: pt; margin: 0 0 1.5rem; padding: 0; }
.ht-ag-point { counter-increment: pt; position: relative; padding: 1rem 0 1rem 3rem; border-top: 1px solid #ddd; }
.ht-ag-point:last-child { border-bottom: 1px solid #ddd; }
.ht-ag-point::before { content: counter(pt, decimal-leading-zero); position: absolute; left: 0; top: 1.15rem; font: 600 .85rem/1.6 "IBM Plex Mono", monospace; color: var(--mute); }
.ht-ag-prow { display: flex; gap: .8rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.ht-ag-prow .ht-ag-ptitle { flex: 1; min-width: 12rem; font: 500 1.15rem/1.35 "Fraunces", Georgia, serif; }
.ht-ag-prow select { width: auto; }
.ht-ag-ptitle-ro { font: 500 1.15rem/1.35 "Fraunces", Georgia, serif; }
.ht-ag-point.is-done .ht-ag-ptitle-ro { color: var(--mute); }
.ht-ag-point.is-doing { border-left: 3px solid var(--ink); margin-left: -1rem; padding-left: 4rem; }
.ht-ag-point.is-doing::before { left: 1rem; }
.ht-ag-notes { white-space: pre-wrap; margin: .4rem 0; }
.ht-ag-decision { margin-top: .4rem; font-weight: 600; }
.ht-ag-decision span { font: 600 .7rem/1 "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.ht-ag-tools { margin-top: .4rem; display: flex; gap: 1rem; font-size: .85rem; }
.ht-ag-tools button:disabled { opacity: .3; cursor: default; }
.ht-ag-danger { margin-top: 2rem; font-size: .85rem; }
.ht-kind.is-live { color: var(--ink); font-weight: 700; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media print {
	.site-header, .site-footer, .ht-ag-print, .ht-ag-tools, .ht-ag-danger, .page > p:first-of-type, .ht-btn, .ht-ag-save, .ht-seg { display: none !important; }
	.ht-ag-point textarea, .ht-ag-point input, .ht-ag-point select { border: 0; padding: 0; }
}
