/* Shared by all five pages -- Dictionnaire (dictionnaire.html), Genre (index.html),
   Synonymes (synonymes.html), Comparer (comparer.html) and Conjugaison
   (conjugaison.html) -- and by À propos (a-propos.html). */
:root{
  --bg:#fbfaf8; --surface:#fff; --line:#e6e2db; --ink:#1c1a17; --muted:#6f6a61;
  --masc:#2f5fd0; --masc-bg:#eaf0fe; --fem:#c02f68; --fem-bg:#fdecf3;
  --both:#7a5bbd; --both-bg:#f2edfb; --warn:#8a6d1f; --warn-bg:#fbf4e0;
  /* Comparer's verdict: can one stand in for the other? Not the gender
     colours, which mean masculine and feminine everywhere else. */
  --ok:#2e7d4f; --ok-bg:#e5f4ea; --no:#b3261e; --no-bg:#fcebe9;
  --radius:14px;
  /* The space between two boxes, wherever they meet: the search row, the tabs
     under it, the answer, and the boxes inside it. Twice that above a heading
     that starts a new group. */
  --gap:12px;
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#16151a; --surface:#1f1e24; --line:#332f3a; --ink:#f0eee9; --muted:#9a948c;
    --masc:#8fb0ff; --masc-bg:#1d2740; --fem:#ff9bc3; --fem-bg:#3a1f2c;
    --both:#c0a6f5; --both-bg:#2b2340; --warn:#e8cc84; --warn-bg:#332c18;
    --ok:#86d6a2; --ok-bg:#1c3326; --no:#ff9a8f; --no-bg:#3d201d;
  }
}
*{box-sizing:border-box}
body{
  /* The space above the site's name; with an answer up, below it too. */
  --edge:clamp(14px,3vh,32px);
  margin:0; background:var(--bg); color:var(--ink); min-height:100vh; min-height:100dvh;
  font:16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  display:flex; flex-direction:column; align-items:center; padding:var(--edge) 20px 18px;
}

/* The site's name, alone at the top. It leads home. */
.brand{margin:0 0 clamp(10px,1.8vh,16px); font:700 clamp(28px,6vw,34px)/1 "Iowan Old Style",Georgia,"Times New Roman",serif;
  letter-spacing:-.02em; color:var(--ink); text-decoration:none; transition:margin .3s ease}
.brand:hover{opacity:.75}

/* The page -- its title, the box, the tabs, the examples -- sits in the middle of the
   screen while there is nothing else to show, like a search engine's home
   page. Once a search starts, it slides up and reads from the top, and the
   title and subtitle step aside, as "Essaie" does: the lit tab already says
   which page this is, and on a phone that is two lines more of the answer.
   Screen readers still get the title. */
.stage{flex:1 0 auto; width:100%; display:flex; flex-direction:column; align-items:center}
.stage::before, .stage::after{content:""; flex:1 0 22px; transition:flex-grow .3s ease, flex-basis .3s ease}
body:has(#out:not(:empty)) .stage::before, body:has(#out:not(:empty)) .stage::after{flex-grow:0}
body:has(#out:not(:empty)) header{position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
/* With an answer up, the name sits halfway between the top of the screen and
   the box: as much space under it as over it, at every height. */
body:has(#out:not(:empty)) .stage::before{flex-basis:0}
body:has(#out:not(:empty)) .brand{margin-bottom:var(--edge)}
@media (prefers-reduced-motion:reduce){ .stage::before, .stage::after, .brand{transition:none} }

header{text-align:center; margin-bottom:18px}
h1{
  margin:0 0 6px; font-size:clamp(21px,4.4vw,27px); letter-spacing:-.02em; font-weight:650;
  font-family:"Iowan Old Style",Georgia,"Times New Roman",serif;
}
.sub{margin:0; color:var(--muted); font-size:15px}
main{width:100%; max-width:600px}
form{display:flex; gap:var(--gap); margin-bottom:var(--gap)}
input{
  flex:1; min-width:0; padding:15px 18px; font-size:19px; color:var(--ink);
  background:var(--surface); border:1.5px solid var(--line); border-radius:var(--radius);
  font-family:inherit; transition:border-color .15s;
}
input:focus{outline:none; border-color:var(--masc)}

/* "Nouvelle recherche": an icon beside the search button, small enough that
   the row stays on one line on the narrowest phone. */
.reset{flex:none; width:54px; padding:0; display:flex; align-items:center; justify-content:center;
  color:var(--ink); background:transparent; border:1.5px solid var(--line)}
.reset:hover{border-color:var(--ink); opacity:1}
.reset svg{width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
@media (max-width:420px){
  form{gap:8px}
  form button[type=submit]{padding:15px 16px}
  .reset{width:48px}
}
/* The narrowest phones (320 px): tighter still, so "Tape ton mot" fits. 16 px
   is also the size below which iOS zooms in on the box when it is tapped. */
@media (max-width:360px){
  form{gap:6px}
  input{padding:15px 11px; font-size:16px}
  form button[type=submit]{padding:15px 12px}
  .reset{width:44px}
}
button{
  padding:15px 22px; font-size:16px; font-weight:600; font-family:inherit; cursor:pointer;
  color:var(--bg); background:var(--ink); border:none; border-radius:var(--radius);
  transition:opacity .15s;
}
button:hover{opacity:.85}
button:disabled{opacity:.45; cursor:default}

.card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:26px; animation:rise .22s ease-out;
}
@keyframes rise{from{opacity:0; transform:translateY(6px)}to{opacity:1; transform:none}}
@media (prefers-reduced-motion:reduce){.card{animation:none}}

.verdict{display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:4px}
.word{
  font-family:"Iowan Old Style",Georgia,serif; font-size:clamp(30px,7vw,44px);
  line-height:1.1; letter-spacing:-.02em;
}
.word .art{color:var(--muted)}
.tag{
  font-size:12px; font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  padding:5px 11px; border-radius:100px; white-space:nowrap;
}
.m .tag{color:var(--masc); background:var(--masc-bg)}
.f .tag{color:var(--fem); background:var(--fem-bg)}
.b .tag{color:var(--both); background:var(--both-bg)}
.u .tag{color:var(--warn); background:var(--warn-bg)}
.m .word .art{color:var(--masc)} .f .word .art{color:var(--fem)}

.kind{color:var(--muted); font-size:14px; margin:0 0 18px}
.rows{border-top:1px solid var(--line); margin-top:18px; padding-top:16px; display:grid; gap:11px}
.row{display:flex; gap:14px; font-size:15px; align-items:baseline}
.row dt{color:var(--muted); flex:0 0 118px; margin:0; font-size:13px; text-transform:uppercase; letter-spacing:.05em}
.row dd{margin:0; font-weight:550}
.row dd .g{font-size:12px; color:var(--muted); font-weight:400; margin-left:5px}

.senses{display:grid; gap:var(--gap); margin-top:18px}
.sense{padding:14px 16px; border-radius:11px; border:1px solid var(--line)}
.sense.m{background:var(--masc-bg); border-color:transparent}
.sense.f{background:var(--fem-bg); border-color:transparent}
.sense b{display:block; font-family:"Iowan Old Style",Georgia,serif; font-size:19px; margin-bottom:2px}
.sense.m b{color:var(--masc)} .sense.f b{color:var(--fem)}
.sense span{font-size:14px; color:var(--muted)}

.note{
  margin:16px 0 0; padding:13px 15px; border-radius:11px; font-size:14px;
  background:var(--warn-bg); color:var(--warn);
}
.roast{
  font-family:"Iowan Old Style",Georgia,serif; font-size:clamp(19px,3.6vw,23px);
  line-height:1.45; margin:0;
}
.didyou{margin:18px 0 0; padding-top:16px; border-top:1px solid var(--line)}
.didyou p{margin:0 0 10px; font-size:13px; color:var(--muted);
          text-transform:uppercase; letter-spacing:.05em}
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  font-family:"Iowan Old Style",Georgia,serif; font-size:17px; cursor:pointer;
  padding:8px 15px; border-radius:100px; border:1px solid var(--line);
  background:var(--bg); color:var(--ink); transition:border-color .15s,background .15s;
}
.chip:hover{border-color:var(--masc); background:var(--surface)}
.chip .art{color:var(--muted); margin-right:4px}
.corrected{margin:0 0 14px; font-size:14px; color:var(--muted)}
.src{margin-top:18px; font-size:12px; color:var(--muted); display:flex; align-items:center; gap:6px}
.dot{width:5px; height:5px; border-radius:50%; background:var(--muted); opacity:.5; flex:none}
.examples{margin-top:18px; text-align:center; font-size:14px; color:var(--muted)}
.examples button{
  background:none; border:none; color:var(--muted); font-size:14px; padding:3px 6px;
  text-decoration:underline; text-underline-offset:3px; cursor:pointer; font-family:inherit; font-weight:400;
}
.examples button:hover{color:var(--ink); opacity:1}
footer{padding-top:14px; font-size:12px; color:var(--muted); text-align:center}
footer a{color:var(--muted)}
/* Two lines at every width, the same on every page: who made it and « À
   propos » (where the data credits and their licences live), then the
   thank-you. Each line stays whole down to 320 px. */
footer .maker{margin:0}
footer .maker span{display:block; white-space:nowrap}
footer .maker span + span{margin-top:4px}
footer a[aria-current]{text-decoration:none}
.spin{display:inline-block; width:15px; height:15px; border:2px solid var(--line);
      border-top-color:var(--ink); border-radius:50%; animation:sp .7s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}

/* Every row of choices is drawn like the box: the five pages just under it,
   Conjugaison's mood filter, and the two-way switches (the auxiliary, the
   language). The box's surface, border and corners; the lit choice dark like
   the button beside it. */
nav.tabs, .moods, .seg{gap:3px; padding:4px; background:var(--surface);
  border:1.5px solid var(--line); border-radius:var(--radius)}
nav.tabs a, .moods button, .seg button{padding:8px 10px; border-radius:10px; background:none;
  font-size:14px; font-weight:600; line-height:inherit; color:var(--muted); text-align:center;
  white-space:nowrap; text-decoration:none}
nav.tabs a:hover, .moods button:hover, .seg button:hover{opacity:1; color:var(--ink)}
nav.tabs a[aria-current="page"], .moods button[aria-pressed="true"], .seg button[aria-pressed="true"]{
  background:var(--ink); color:var(--bg)}
/* The two full-width rows share it out evenly. One row at every width. */
nav.tabs, .moods{display:flex; width:100%}
nav.tabs a, .moods button{flex:1 1 0}

nav.tabs{margin:0 0 var(--gap)}
nav.tabs .tab-short{display:none}

/* A pointer to the other page. */
.xlink{display:flex; align-items:center; justify-content:space-between; gap:28px; margin-top:18px;
  padding:13px 16px; border-radius:11px; border:1px solid var(--line); background:var(--bg);
  color:var(--ink); text-decoration:none; font-size:15px; transition:border-color .15s}
.xlink:hover{border-color:var(--ink); opacity:1}
/* Inside a card as outside: a box right after another box sits --gap below it
   (Genre's two senses, a note, the links out). */
:is(.senses, .note, .xlink) + :is(.senses, .note, .xlink){margin-top:var(--gap)}
button.xlink{width:100%; font:inherit; text-align:left}
/* Side by side when the text fits on one line; when it does not, where the
   link goes drops under it, rather than a wrapped text running into
   "Dictionnaire →". At every width, by what fits, not by a breakpoint. */
.xlink{flex-wrap:wrap; row-gap:6px}
.xlink > span:not(.go){flex:1 1 auto; line-height:1.45; text-wrap:pretty}
.xlink .go{flex:none; font-weight:650; white-space:nowrap}
.xlink em{font-family:"Iowan Old Style",Georgia,serif; font-style:normal; font-size:17px}
/* Five labels at full size need about 580 px, and even at 11 px they are wider
   than a 320 px phone. So below 600 px the row takes the box's full width --
   edge to edge with it, just below -- the five tabs share it, the text steps
   down a little, and Dictionnaire becomes "Dico", as people say it -- still
   one row, every label whole (measured from 320 to 600 px). The page's side
   margins narrow a little to make that room. The mood filter takes the same
   steps, so the two rows still match. */
@media (max-width:600px){
  body{padding-inline:16px}
  nav.tabs, .moods{width:auto; gap:1px; padding:3px}
  nav.tabs a, .moods button{flex:1 1 auto; padding:7px 5px; font-size:13px}
  nav.tabs .tab-long{display:none}
  nav.tabs .tab-short{display:inline}
}
@media (max-width:380px){ nav.tabs a, .moods button{padding:7px 2px; font-size:12px} }
@media (max-width:340px){ nav.tabs, .moods{gap:0; padding:2px} }

/* A two-way switch -- the auxiliary on Conjugaison, the language on
   Dictionnaire and Comparer -- sits in a card, so it takes the page's colour,
   like everything else set into one; its two words keep their room. */
.seg{display:inline-flex; background:var(--bg)}
.seg button{padding-inline:14px}
.linkish{background:none; border:none; padding:0; color:var(--ink); font-size:15px; font-weight:550;
  text-decoration:underline; text-underline-offset:3px}
.linkish:hover{opacity:.7}

/* Shared by Dictionnaire and Synonymes. */
/* A form that led to its word says how. */
.via{margin:0 0 8px; font-size:14px; color:var(--muted)}
.via b{color:var(--ink); font-weight:600}
/* Can you say it? Colour only where the answer is "careful". */
.lab{display:inline-block; margin:0 6px 2px 0; padding:1px 7px; border:1px solid var(--line); border-radius:100px;
  font:600 10.5px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; letter-spacing:.05em;
  text-transform:uppercase; color:var(--muted); vertical-align:2px}
.lab.fam{color:var(--warn); background:var(--warn-bg); border-color:transparent}
.lab.risk{color:var(--fem); background:var(--fem-bg); border-color:transparent}
.lab.old{border-style:dashed}
details.more{margin-top:12px}
details.more summary{cursor:pointer; font-size:14px; color:var(--muted); text-decoration:underline;
  text-underline-offset:3px; list-style:none; width:max-content; max-width:100%}
details.more summary::-webkit-details-marker{display:none}
details.more[open] summary{margin-bottom:12px}

/* "Essaie" is for an empty box: once a word is typed -- or a result is up --
   the examples step aside. (Browsers without :has() just keep showing them.) */
main:has(#q:not(:placeholder-shown)) .examples{display:none}
