/* revolution-francaise.net — the DotClear theme's look (textured background, bonnet,
   logo banner, white boxes framed in navy, Georgia headings), on a fluid grid. */

:root {
  --navy: #272f3e;
  --head: #224466;
  --ink: #1d1d1f;
  --muted: #667;
  --soft: #f4f5f7;
  --rule: #d9dbe0;
  --link: #224466;
  --gap: 20px;
  --side: 186px;                      /* the 182x130 bonnet plus its border, as in the DotClear theme */
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Verdana, Arial, Helvetica, sans-serif;
  --trebuchet: "Trebuchet MS", Verdana, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #111 url(/themes/default/bg.png) repeat;
  color: var(--ink);
  font: 14px/1.5 var(--sans);
}
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--link); }
a:hover { color: #000; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: normal; color: var(--head); line-height: 1.25; }
h1 a, h2 a, h3 a { color: inherit; text-decoration: none; }
h1 a:hover, h2 a:hover, h3 a:hover { color: #000; }

/* Frame ------------------------------------------------------------ */
.site {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  grid-template-areas:
    "bonnet banner"
    "nav    main"
    "nav    footer";
  grid-template-rows: auto 1fr auto;
  gap: 18px var(--gap);
  max-width: 2200px;
  min-height: 100vh;
  padding: 20px clamp(16px, 3vw, 60px) 40px;
}
.bonnet, .banner, .sidebar, .main, .footer {
  background: #fff;
  border: 2px solid var(--navy);
}
.bonnet { grid-area: bonnet; display: block; align-self: start; }
.bonnet img { display: block; width: 100%; height: auto; aspect-ratio: 182 / 130; }
.banner { grid-area: banner; min-height: 134px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.banner a { display: block; line-height: 0; }
.banner img { display: block; width: 550px; max-height: 130px; object-fit: contain; }
.menu-toggle, .nav-backdrop, .nav-close { display: none; }

/* Sidebar ---------------------------------------------------------- */
.sidebar {
  grid-area: nav;
  align-self: start;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e2e4e8 #fff;      /* white track: the bar disappears into the box */
  padding-bottom: 1.5em;
  font-size: 90%;
  line-height: 1.5;
}
.sidebar::-webkit-scrollbar { width: 8px; background: #fff; }
.sidebar::-webkit-scrollbar-track { background: #fff; }
.sidebar::-webkit-scrollbar-thumb { background: #e2e4e8; border-radius: 4px; border: 2px solid #fff; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #c9cdd3; }
.sidebar h2, .search label {
  display: block;
  margin: 1.1em 0 .45em;
  padding: 0 12px .15em;
  border-bottom: 1px solid #333;
  font: 1.4em/1.6 var(--serif);
  color: var(--head);
}
.sidebar ul { list-style: none; margin: 0; padding: 0 12px 0 16px; }
.sidebar a { color: #222; text-decoration: none; }
.sidebar a:hover, .sidebar .current > a { color: #357; text-decoration: underline; }
.sidebar .current > a { font-weight: bold; text-decoration: none; }
.sidebar .n { color: #99a; font-size: .85em; }
.sidebar .nav-pages { margin-top: 1em; font: bold 1.05em/2 var(--trebuchet); }

.search { margin: 0; }
.search label { margin-top: .6em; }
.search-row { display: flex; margin: .4em 12px 0; }
.search input {
  flex: 1; min-width: 0;
  padding: 5px 8px;
  border: 1px solid #999; border-right: 0; border-radius: 3px 0 0 3px;
  font: inherit; font-size: 14px;
}
.search button {
  padding: 0 9px;
  border: 1px solid var(--navy); border-radius: 0 3px 3px 0;
  background: var(--navy); color: #fff; cursor: pointer;
}
.search input:focus { outline: 2px solid #8ab; outline-offset: -1px; }

.years details { padding: 0 12px 0 16px; }
.years summary {
  display: flex; justify-content: space-between; align-items: baseline;
  cursor: pointer; list-style: none;
  font-family: var(--serif); font-size: 1.12em; color: #222;
  padding: 1px 0;
}
.years summary::-webkit-details-marker { display: none; }
.years summary::marker { content: ""; }
.years summary::before {
  content: "▸"; display: inline-block; width: 1em; color: var(--head); transition: transform .15s;
}
.years details[open] > summary::before { transform: rotate(90deg); }
.years summary > span:first-child { flex: 1; }
.years summary:hover { color: #357; }
.years ul { padding: 0 0 .4em 1em; }

/* Main -------------------------------------------------------------- */
.main {
  grid-area: main;
  padding: 1.2em clamp(16px, 3vw, 48px) 1em;
  min-width: 0;
}
.footer {
  grid-area: footer;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5em 2em;
  padding: 1em clamp(16px, 3vw, 48px);
  font-size: 1.1em; color: #222;
}
.footer a { color: #222; text-decoration: none; border-bottom: 1px dotted #555; }

.license { display: flex; gap: 12px; align-items: center; margin: 3em 0 0; padding-top: 1em; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
.license img { flex: none; }
.license a { color: var(--muted); }

.list-title { font-size: 1.9em; margin: .4em 0 .5em; }
.search-count { color: var(--muted); margin-top: -.6em; }
.empty { color: var(--muted); }

/* Lists: one post per row, as on the DotClear home */
.teasers { max-width: 82rem; }
.teaser { padding: .4em 0 1.6em; border-bottom: 1px solid var(--rule); min-width: 0; }
.teaser + .teaser { margin-top: .6em; }
.teaser h2 { font-size: 1.4em; line-height: 1.5; margin: .3em 0 .3em; }
.teaser h2 small { font-size: 65%; white-space: nowrap; }
.teaser h2 small a { color: #668; }
.teaser h2 small a:hover { color: #555; }
.teaser .more { margin: .4em 0 0; }
.teaser .more a { font-weight: bold; text-decoration: none; }
.teaser .more a::after { content: " →"; }

.post-meta { margin: 0 0 .8em; font-size: 12.5px; font-style: italic; color: gray; }
.post-meta time::first-letter { text-transform: uppercase; }
.post-meta a { color: #668; text-decoration: none; font-style: normal; }
.post-meta a:hover { text-decoration: underline; }

/* Article ------------------------------------------------------------ */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2em 4rem; }
@media (min-width: 1500px) {
  .post-layout { grid-template-columns: minmax(0, 52rem) minmax(16rem, 24rem); justify-content: space-between; }
}
.post h1 { font-size: clamp(1.6em, 2.2vw, 2.1em); margin: .4em 0 .2em; }
.post .hero { display: block; max-height: 460px; width: auto; margin: .5em 0 1.2em; border: 1px solid #333; }
.post-chapo { font-size: 1.06em; margin-bottom: 1.4em; }
.post-chapo::after { content: ""; display: block; clear: both; }

.post-body { overflow-wrap: break-word; }
.post-body::after { content: ""; display: block; clear: both; }
.post-body p { margin: 0 0 1em; }
.post-body a { text-decoration: none; border-bottom: 1px dotted #555; color: #133; }
.post-body a:hover { border-bottom-style: solid; color: #000; }
.post-body img { border: 1px solid #333; }
.post-body img.align-left, .teaser .thumb { float: left; margin: .3em 1.2em .8em 0; max-width: 45%; }
.post-body img.align-right { float: right; margin: .3em 0 .8em 1.2em; max-width: 45%; }
.post-body img.align-center { display: block; margin: 1em auto; }
.teaser .thumb { width: 160px; border: 1px solid #333; }
.post-body blockquote { margin: 1em 0 1em 1.2em; padding-left: 1em; border-left: 3px solid var(--rule); font-family: var(--serif); font-style: italic; font-size: 1.05em; }
.post-body pre { white-space: pre-wrap; font: inherit; font-weight: bold; color: var(--head); margin: 1.4em 0 .6em; }
.post-body h2 { font-size: 1.5em; margin: 1.4em 0 .5em; }
.post-body h3 { font-size: 1.25em; margin: 1.3em 0 .4em; }
.post-body figure { margin: 1.2em 0; }
.post-body figure.embed iframe { display: block; width: 100%; max-width: 760px; height: auto; aspect-ratio: 16 / 9; border: 0; background: #000; }
.post-body figure.image img { display: block; }
.post-body figcaption { font-size: .9em; color: var(--muted); margin-top: .4em; }
.post-body a.file, .post-body a[download] { display: inline-block; padding: .35em .8em .35em 2em; border: 1px solid var(--rule); border-radius: 4px; background: var(--soft) no-repeat .6em center / 1em; }
.post-body a.file::before, .post-body a[download]::before { content: "⬇"; margin: 0 .5em 0 -1.4em; }
.post-body sup { line-height: 0; }
.post-body table { border-collapse: collapse; margin: 1em 0; }
.post-body td, .post-body th { border: 1px solid var(--rule); padding: .3em .6em; }

.related { align-self: start; font-size: 13.5px; }
.related h2 { font-size: 1.3em; margin: .6em 0 .4em; padding-bottom: .2em; border-bottom: 1px solid #333; }
.related ul { list-style: none; margin: 0 0 1.5em; padding: 0; }
.related li { padding: .45em 0; border-bottom: 1px solid var(--rule); }
.related li a { text-decoration: none; color: #222; }
.related li a:hover { color: #357; text-decoration: underline; }
.related time { display: block; color: #889; font-size: .9em; font-style: italic; }
@media (min-width: 1500px) { .related { position: sticky; top: 18px; } }

.preview-banner { background: #fff4cc; border: 1px solid #e6c35c; padding: .5em 1em; border-radius: 4px; }

/* Pagination --------------------------------------------------------- */
.pagination {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5em 1em;
  margin: 2em 0 .5em; font-size: 14px;
}
.pagination .nums { display: flex; flex-wrap: wrap; gap: 4px; }
.pagination a, .pagination .current, .pagination .gap {
  min-width: 2.2em; padding: .25em .6em; text-align: center;
  border: 1px solid var(--rule); border-radius: 3px; text-decoration: none; color: #222;
}
.pagination a:hover { border-color: var(--navy); }
.pagination .current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination .gap { border-color: transparent; }
.pagination .jump { margin-left: auto; color: var(--muted); }
.pagination .jump input { width: 4.5em; padding: .2em .3em; font: inherit; }

/* Wide desktop: a bit more of everything ------------------------------ */
@media (min-width: 1700px) {
  body { font-size: 15px; }
}
@media (min-width: 960px) {
  .post-body, .teaser .post-body { text-align: justify; hyphens: auto; }
}

/* Mobile ---------------------------------------------------------------- */
@media (max-width: 959px) {
  body { font-size: 15px; }
  .site {
    /* bonnet | banner | room for the fixed menu button */
    grid-template-columns: 96px minmax(0, 1fr) 64px;
    grid-template-areas:
      "bonnet banner ."
      "main   main   main"
      "footer footer footer";
    grid-template-rows: auto;
    gap: 10px;
    padding: 10px 10px 24px;
  }
  .banner { min-height: 0; padding: 0 8px; }
  .banner img { width: 100%; max-height: 66px; }

  /* menu button: fixed top right, always reachable */
  .menu-toggle {
    /* the bonnet and banner boxes have a 2px navy border that melts into the dark background:
       the button's white area is matched to theirs (1.5px inset), not their outer edge */
    position: fixed; top: 11px; right: 11.5px; z-index: 40;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    width: 61px; height: 67.5px;          /* bonnet box 92px * 130/182 + borders, minus the inset */
    background: #fff; color: var(--navy);
    border: .5px solid var(--navy);
    transition: box-shadow .2s;
    font: 12px/1 var(--trebuchet); letter-spacing: .02em; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .menu-toggle:active { background: #eef1f5; }
  html.scrolled .menu-toggle { box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }   /* only once it floats over the text */

  /* the sidebar becomes a drawer from the right */
  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(340px, 86vw);
    /* explicit: the desktop rules (sticky, align-self) otherwise leave it as tall as its content */
    height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    border-width: 0 0 0 2px;
    font-size: 15px;
    transform: translateX(100%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
    overscroll-behavior: contain;
    padding-top: 6px;
  }
  .site.nav-open .sidebar { transform: none; visibility: visible; transition: transform .25s ease; box-shadow: -8px 0 30px rgba(0, 0, 0, .4); }
  /* on the "Rechercher" line rather than on a row of its own */
  .nav-close {
    display: block; position: absolute; top: 9px; right: 4px; z-index: 1;
    width: 44px; height: 44px; border: 0; background: none;
    font: 32px/1 var(--sans); color: var(--navy); cursor: pointer;
  }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .5); }
  .nav-backdrop[hidden] { display: none; }
  html.nav-locked { overflow: hidden; }

  .main { padding: .8em 14px; }
  .list-title { font-size: 1.6em; }
  .teaser h2 { font-size: 1.3em; }
  .teaser .thumb { width: 110px; }
  .post-body img.align-left, .post-body img.align-right { max-width: 50%; }
  .pagination .jump { margin-left: 0; width: 100%; }
  .footer { font-size: 14px; }
}
@media (max-width: 480px) {
  .site { grid-template-columns: 70px minmax(0, 1fr) 54px; }
  .menu-toggle { width: 51px; height: 48.5px; font-size: 11px; }   /* bonnet box 66px * 130/182 + borders, minus the inset */
  .menu-toggle svg { width: 22px; height: 22px; }
  .banner img { max-height: 46px; }
  .post-body img.align-left, .post-body img.align-right { float: none; display: block; max-width: 100%; margin: .8em auto; }
  .license { flex-direction: column; align-items: flex-start; }
}

@media print {
  body { background: #fff; }
  .site { display: block; padding: 0; }
  .bonnet, .sidebar, .menu-toggle, .nav-backdrop, .license, .pagination, .related { display: none; }
  .main, .banner, .footer { border: 0; }
}
