/* softrh.fr — mobile & tablet overrides. Loaded LAST, after normalize.min.css.
 * Why this file exists: normalize.min.css is linked after style.css, so its
 * `aside, footer { display: block }` beat the theme's own ≤1024px rules. On a phone the
 * side columns stayed visible and a fixed-position Revive banner sat off-screen, which
 * forced the layout viewport to ~750px and made the whole site render zoomed-out.
 */

html, body { overflow-x: clip; -webkit-text-size-adjust: 100%; }
img, svg, video, iframe { max-width: 100%; height: auto; }
/* The theme gives the header logo flex:0 (basis 0); with max-width:100% on images the logo
   collapsed to 0 on desktop. Give it its natural width at every viewport. */
.wrapper main .nav .logo { flex: 0 0 auto; }
.wrapper main .nav .logo img { max-width: none; }
/* No global box-sizing reset: the Revive banner's fixed 252x222 box relies on content-box. */

/* Revive banner logo: explicit size at every width (the SVG has no intrinsic size, so Safari
   rendered it at the box width). Wins over the banner's inline <style> and site.css. */
ins[data-revive-zoneid] .first-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: nowrap; }
ins[data-revive-zoneid] .first-line img { width: 137px !important; max-width: 60% !important; height: auto !important; max-height: none !important; flex: 0 0 auto; }
ins[data-revive-zoneid] .ann { flex: 0 0 auto; white-space: nowrap; }

/* ---------- Revive banners.
   Zone 1 (in article): the <ins> sits before the header image in the HTML; the article is laid
   out as a flex column so the slot is shown AFTER the table of contents. Below 1500px it is a
   strip (logo | tagline | button), stacked on narrow phones; from 1500px it is the sticky card
   at the right of the column, starting at the end of the table of contents.
   Zone 5 (end of article, injected by deploy/softrh-ads.py after "À lire aussi"): vertical
   card, centred, at every width. ---------- */
article.single { display: flex; flex-direction: column; }
article.single > * { order: 0; }
article.single > .post-info, article.single > .header-image, article.single > #ez-toc-container { order: -1; }
article.single > ins[data-revive-zoneid="1"] { order: 0; }

ins[data-revive-zoneid] { display: block; text-align: left; }
ins[data-revive-zoneid="1"] { padding: 20px 90px 4px; }
ins[data-revive-zoneid] a.a {
  position: static !important; display: block !important; width: 100%; max-width: 760px !important;
  height: auto !important; margin: 0; right: auto !important; top: auto !important; left: auto !important;
  text-align: left; border: 0 !important;
}
ins[data-revive-zoneid] .inner-box {
  display: flex; flex-direction: row; align-items: center; gap: 18px;
  width: 100% !important; max-width: 100% !important; height: auto !important; box-sizing: border-box;
  padding: 12px 18px !important; border: 3px solid #fff !important; border-radius: 10px !important;
}
ins[data-revive-zoneid] .first-line { flex: 0 0 210px; flex-direction: column; align-items: flex-start; gap: 4px; }
ins[data-revive-zoneid] .first-line img { width: 200px !important; max-width: 100% !important; height: auto !important; max-height: none !important; }
ins[data-revive-zoneid] .ann { font-size: 11px !important; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
ins[data-revive-zoneid] .tagline { flex: 1 1 auto; font-size: 15px !important; line-height: 21px !important; }
ins[data-revive-zoneid] .cta { flex: 0 0 auto; white-space: nowrap; font-size: 14px !important; padding: 10px 14px !important; line-height: 20px; }
@media only screen and (max-width: 1024px) { ins[data-revive-zoneid="1"] { padding: 16px 16px 4px; } }
@media only screen and (max-width: 619px) {
  ins[data-revive-zoneid="1"] .inner-box { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px !important; }
  ins[data-revive-zoneid="1"] .first-line { flex: none; flex-direction: row; align-items: center; justify-content: space-between; }
  ins[data-revive-zoneid="1"] .first-line img { width: 160px !important; }
  ins[data-revive-zoneid="1"] .cta { white-space: normal; text-align: center; }
}

/* end-of-article slot: the same horizontal strip, centred, at every width */
.ad-end { padding: 8px 24px 32px; display: flex; justify-content: flex-start; }   /* left edge = text edge */
@media only screen and (min-width: 1151px) { .ad-end { padding: 8px 90px 32px; } }
@media only screen and (max-width: 1024px) { .ad-end { padding: 8px 16px 24px; } }
.ad-end ins[data-revive-zoneid] { padding: 0; width: 100%; max-width: 760px; }
@media only screen and (max-width: 619px) {
  .ad-end ins[data-revive-zoneid] .inner-box { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px !important; }
  .ad-end ins[data-revive-zoneid] .first-line { flex: none; flex-direction: row; align-items: center; justify-content: space-between; }
  .ad-end ins[data-revive-zoneid] .first-line img { width: 160px !important; }
  .ad-end ins[data-revive-zoneid] .cta { white-space: normal; text-align: center; }
}

@media only screen and (min-width: 1500px) {
  ins[data-revive-zoneid="1"] { padding: 0; min-height: 0 !important; height: 0; overflow: visible; align-self: flex-end; width: 304px; margin-right: 6px; position: sticky; top: 128px; z-index: 5; }
  ins[data-revive-zoneid="1"] a.a { width: auto; max-width: none !important; }
  ins[data-revive-zoneid="1"] .inner-box {
    flex-direction: column; align-items: stretch; justify-content: space-between; gap: 0; box-sizing: content-box;
    width: 252px !important; max-width: none !important; height: 222px !important;
    padding: 20px !important; border: 6px solid #fff !important; border-radius: 12px !important;
  }
  ins[data-revive-zoneid="1"] .first-line { flex: none; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  ins[data-revive-zoneid="1"] .first-line img { width: 150px !important; }
  ins[data-revive-zoneid="1"] .ann { margin: 0; font-size: 12px !important; }
  ins[data-revive-zoneid="1"] .tagline { flex: none; font-size: 17px !important; line-height: 24px !important; }
  ins[data-revive-zoneid="1"] .cta { white-space: normal; text-align: center; font-size: 15px !important; padding: 12px !important; }
}

/* Category badges on the header image: side by side, no underline */
.wrapper main .header-image .gradient ul { display: flex; flex-wrap: wrap; gap: 8px; }
.wrapper main .header-image .gradient ul li { display: inline-block; line-height: 24px; padding: 2px 14px; }
.wrapper main .header-image .gradient ul li a { text-decoration: none !important; color: #fff; }

/* ---------- ≤1024px: tablet portrait and phones ---------- */
@media only screen and (max-width: 1024px) {
  body { font-size: 17px; line-height: 28px; }

  .wrapper { display: block; }
  .wrapper aside.left, .wrapper aside.right, aside.sidebar { display: none !important; }
  .wrapper main { width: 100%; max-width: 100%; }

  /* nav */
  .wrapper main .nav { padding: 0 16px; flex-wrap: wrap; min-height: 60px; box-sizing: border-box; }
  .wrapper main .nav .logo { margin-right: 16px; flex: 0 0 auto; }
  .wrapper main .nav ul { margin: 0; }
  .wrapper main .nav ul li a { margin: 0 0 0 8px; padding: 6px 10px; }

  /* post meta */
  .wrapper main .post-info { padding: 16px 16px 8px; }
  .wrapper main .post-info span:last-of-type { float: none; display: block; }

  /* header image */
  .wrapper main .header-image { height: 260px; border-radius: 0; }
  .wrapper main .header-image .gradient ul { margin: 12px 0 0 16px; }
  .wrapper main .header-image .gradient h1 { margin: 12px 0 0 0; }

  /* headings */
  .wrapper main h1 { font-size: 28px; line-height: 36px; margin-left: 0; }
  .wrapper main article:not(.loop, .platform) h1 { padding: 0 16px 20px; }
  .wrapper main h2,
  .wrapper main article:not(.loop, .platform) h2 {
    font-size: 22px; line-height: 30px; max-width: none;
    padding: 20px 16px 16px; margin: 40px 0 20px;
  }
  .wrapper main h3 { font-size: 20px; line-height: 30px; margin: 0 16px 12px; padding-top: 20px; display: block; }
  .wrapper main h4, .wrapper main h5 { margin: 0 16px; padding-top: 20px; display: block; }

  /* body copy */
  .wrapper main article:not(.loop, .platform) p,
  .wrapper main article:not(.loop, .platform) pre,
  .wrapper main article:not(.loop, .platform) form,
  .wrapper main article:not(.loop, .platform) .wp-block-columns { width: auto; padding: 10px 16px; }
  .wrapper main article:not(.loop, .platform) ul:not(.ez-toc-list):not(.post-categories):not(.wp-block-gallery),
  .wrapper main article:not(.loop, .platform) ol {
    width: auto; margin: 14px 16px; padding: 20px 20px 20px 36px; line-height: 28px;
  }
  .wrapper main ul.ez-toc-list li a { padding: 12px 16px; }
  .wrapper main ul.ez-toc-list li a:hover { padding-left: 19px; }
  figure { padding: 10px 16px; }
  figure.wp-block-image { margin: 0; }
  blockquote { margin: 24px 16px; padding: 28px 24px; border-radius: 8px; }
  blockquote p { font-size: 20px; line-height: 32px; }
  pre { overflow-x: auto; }
  .wp-block-columns { gap: 0; }

  /* home */
  body.home .hero { height: auto; min-height: 200px; padding: 32px 16px; margin-bottom: 16px; box-sizing: border-box; }
  body.home .hero h1 {
    white-space: normal; font-size: 20px; line-height: 30px;
    padding: 10px 20px; border-radius: 24px; text-align: center; display: inline-block;
  }
  .discrete-title { line-height: 32px; padding: 8px 16px; }
  .wrapper main .loop-container { margin-bottom: 40px; }
  .loop-container article.loop { grid-template-rows: auto; margin: 0 0 16px; }
  .loop-container article.loop:hover { margin: 0 0 16px; }
  .loop-container article.loop .thumbnail { height: 200px; border-radius: 0; }
  .loop-container article.loop p { display: block; margin: 0 16px 16px; }
  .loop-container .pagination { padding: 16px; }
  body.home .unit { flex-direction: column; margin: 40px 16px; }
  body.home .unit .illustration { height: 220px; margin-right: 0; width: 100%; flex: none; }
  body.home .unit .text { height: auto; flex: none; }
  body.home h3 { margin: 0 0 12px !important; }

  /* platform pages (e.g. /payfit/) */
  .platform { width: auto; max-width: 100%; padding: 0 16px; box-sizing: border-box; }
  .platform .main-image { width: 100%; }
  .platform .presentation { flex-direction: column; }
  .platform .clients, .platform .info { padding: 0; }
  .platform h1 { font-size: 32px; line-height: 40px; }
  .platform h2, .platform h3, .platform h4, .platform h5 { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .stats { margin-right: 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 24px; }
  .stats .stat { margin-right: 0; width: 120px; height: 120px; }
  .stats .stat .stat--number { font-size: 28px; }
  .clients { display: flex; flex-wrap: wrap; justify-content: center; }
  .clients .client { width: 80px; height: 80px; margin: 0 12px 12px 0; float: none; }
  .clients .client img.default { max-width: 56px; max-height: 56px; }
  .clients .client img.full { max-width: 80px; max-height: 80px; }
  a.document { width: 100%; height: auto; float: none; margin: 0 0 20px; padding: 24px 0; display: flex; box-sizing: border-box; }
  a.document:nth-child(even) { margin-right: 0; }
  a.document img { max-width: 100%; height: auto; }
  .items .item { flex-basis: 50%; padding-right: 16px; height: auto; margin-bottom: 16px; box-sizing: border-box; }

  /* forms: 16px inputs stop iOS from auto-zooming on focus */
  input:not([type="checkbox"]), textarea, select { font-size: 16px; }
  input[type="submit"], button, .button { font-size: 14px; }
  label { font-size: 14px; line-height: 20px; }

}

/* ---------- 601–1024px: tablets get two article cards per row ---------- */
@media only screen and (min-width: 601px) and (max-width: 1024px) {
  .wrapper main .loop-container { grid-template-columns: 1fr 1fr; grid-gap: 8px 16px; padding: 0 16px; }
  .wrapper main .loop-container article.loop { border-radius: 4px; }
  .loop-container article.loop .thumbnail { border-radius: 4px; }
  .wrapper main .loop-container article.loop h2 { margin: 16px 0 12px; }
  .loop-container article.loop p { margin: 0 0 16px; }
}

/* ---------- ≤600px: phones ---------- */
@media only screen and (max-width: 600px) {
  .wrapper main .header-image { height: 220px; }
  .wrapper main .header-image .gradient h1 { font-size: 24px; line-height: 32px; }
  .wrapper main h1 { font-size: 26px; line-height: 34px; }
  .items .item { flex-basis: 100%; padding-right: 0; }
  .stats .stat { width: 104px; height: 104px; }
  .stats .stat .stat--number { font-size: 24px; margin: 4px 0 2px; }
  .stats .stat .stat--description { font-size: 12px; line-height: 16px; }
  blockquote { padding: 24px 20px; }
  blockquote p { font-size: 18px; line-height: 28px; }
}

/* ---------- Footer (all widths): in the flow, grid of links, logo first, compact on phones ---------- */
body { position: static; }
.wrapper main { margin-bottom: 0 !important; }
footer[role="contentinfo"] {
  position: static !important; display: block !important;
  margin-top: 48px; padding: 36px 24px 28px; box-sizing: border-box;
  background: #ecfbfb; border-top: 1px solid #d5f3f1;
}
footer nav.footer {
  display: grid; grid-template-columns: 150px repeat(4, minmax(0, 1fr)); gap: 8px 32px;
  max-width: 1152px; margin: 0 auto; align-items: start;
}
footer nav.footer ul { list-style: none; margin: 0; padding: 0; display: block; flex: none; font-size: 15px; }
footer nav.footer ul li { white-space: normal; line-height: 1.5; margin: 0 0 10px; }
footer nav.footer ul li a { font-family: "Book"; color: #006adc; text-decoration: none; }
footer nav.footer ul li a:hover { color: #00a99d; }
footer nav.footer ul:nth-child(3) { order: -1; }
footer nav.footer ul:nth-child(3) img { width: 44px; height: auto; display: block; }
footer .copyright { max-width: 1152px; margin: 20px auto 0; padding-top: 16px; border-top: 1px solid #d5f3f1; font-size: 13px; color: #6b7a86; text-align: center; }
@media only screen and (max-width: 1024px) {
  footer nav.footer { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 24px; }
  footer nav.footer ul { display: contents; }                 /* flatten groups into one grid */
  footer nav.footer ul:nth-child(3) li { grid-column: 1 / -1; margin: 0 0 16px; }
  footer nav.footer ul:nth-child(3) img { width: 40px; }
}
@media only screen and (max-width: 600px) {
  footer[role="contentinfo"] { padding: 28px 16px 20px; margin-top: 32px; }
  footer nav.footer { grid-template-columns: 1fr 1fr; gap: 2px 16px; }
  footer nav.footer ul li { margin: 0 0 8px; font-size: 15px; }
  footer nav.footer ul:nth-child(3) li { text-align: center; margin-bottom: 14px; }
  footer nav.footer ul:nth-child(3) img { margin: 0 auto; }
  footer .copyright { margin-top: 14px; padding-top: 12px; }
}
