/* Legibility repairs measured with qa_legibility.js + _scripts/_pi_taps.cjs.
   Rationale for every block is in _scripts/o5_pi_legibility.py and _scripts/o5_pi_finish3.py.

   THIS FILE WAS WIPED ONCE ALREADY. o45_legibility_pass.py (a batch-wide installer used across
   every site in this project) rewrites css/restore-legibility.css unconditionally whenever it
   finds a page missing the <link>/<script> tags it installs - and it uses the SAME filename this
   site's own, much larger, per-site sheet is written to. The batch tool has no way to tell a
   site-customised file from one it created itself, so its next run silently replaced ~175 lines of
   measured, documented repairs with its own 28-line generic file. Root cause fixed in
   o45_legibility_pass.py (it no longer overwrites an existing file); this comment is here so the
   next person who finds a suspiciously short restore-legibility.css on THIS site knows why, and
   checks with `node _scripts/qa_legibility.js portail.perspective-implantaire.org / ...` before
   assuming a clean gate result. */

/* 1. White on the #a9d300 accent is 1.75:1. Keep the accent, darken the text to 7.2:1. */
#top-menu > li.current-menu-item > a,
#top-menu > li > a:hover,
#top-menu > .sfHover > a,
#top-menu li li a,
.et_mobile_menu li a,
.meta-info, .meta-info span, .meta-info .month,
a.read-more, a.read-more span,
.comment-reply-link,
h1.post-heading,
.form-submit input { color: #2f3a00 !important; }

/* 2. Tap targets. Boxes only.
   NOTE the split. Forcing `line-height: 24px` is safe on a single-line list link and is DAMAGE on
   a heading: the first version of this sheet put it on `.et-description h2 a` too, and every
   listing title that wrapped to two or three lines - "Précédente session : 23-24-25 septembre 2021
   à Tours, Loire et Cher, France" on /news/ and on the homepage - printed its lines on top of each
   other at a 30px type size. Caught by looking at the screenshots, not by any gate: the contrast
   was fine, the boxes were fine, the numbers all improved. Headings get their height from padding
   and keep the theme's own leading. */
#menu-footer-menu a,
.bottom-nav a,
.widget li a,
.fwidget li a,
ul.pi-cat-links a,
#breadcrumbs a,
.load-more a,
.pi-map-credit a { display: inline-block; min-height: 24px; line-height: 24px; }

/* Featured-card titles AND every archived-content link get the same treatment: padding, never
   line-height, so a heading that wraps keeps its own leading (see the note above) while a
   single-line prose link still grows to 24px. This is deliberately NOT scoped to `.pi-noimage` or
   to a min-width - the independent review found the previous, narrower version of this rule could
   not reach a featured card WITH a photograph (/a-propos-rubrique/, 390px) or a plain link inside
   an archived post body (/session-zurich-fevrier-2014/, /session-marseille-octobre-2015/), because
   those are exactly the same shape - a 19px-tall link with no padding - just outside the box the
   old rule drew. */
.et-description h2 a,
.post-description h2 a,
a.post-title { display: inline-block; min-height: 24px; padding: 3px 0; }

.entry-content a { display: inline-block; min-height: 24px; padding: 3px 0; }

.tagcloud a,
.pagination a,
a.pi-older { display: inline-block; min-height: 24px; line-height: 24px; padding: 0 3px; }

/* 1b. The theme's own link colour, #4bb6f5, measures 2.26:1 on the white body - readable as a
   shape, not as a word, and it is the colour of every link inside an article. Deepened to #1573b0
   (5.0:1), which is the same blue an eye recognises, ONLY where the ground is white: the footer
   and the dark featured band keep #4bb6f5, where it sits at 7:1 and darkening would make it
   worse. The sidebar's own link colour was already above the threshold and is left alone.

   Scoped to links inside PROSE - a paragraph, a list item, a table cell - and deliberately not to
   headings: `#left-area a` as a whole turned every listing headline on /news/ and the homepage
   blue, which is a redesign, not a repair. The theme's headline links are near-black on white and
   were never the problem. */
#left-area p a, #left-area li a, #left-area td a,
.o5-legal p a, .o5-legal li a,
.pagination a,
.pi-hit h3 a { color: #1573b0; }

/* The two AUTHORED pages - 404.html and /politique-de-cookies/ - were written into a plain
   `.o5-legal` wrapper rather than the theme's `#left-area`, so every rule above addressed to
   `#left-area` walked straight past them: twelve 19px-high links and fourteen 2.26:1 links on the
   404 alone. Both classes are named here because a restored site's 404 is the page a lost visitor
   reads, and it was the least legible page on the site. */
.o5-legal li a { display: inline-block; min-height: 24px; line-height: 24px; }

/* 1c. A featured card whose photograph the archive never held collapses to height 0 above 1301px
   (the theme takes the card's height from the <img> it no longer has, and
   `.et-featured-post{overflow:hidden}` then clips the caption away with it - a black hole in the
   band and a session post simply absent from the page). The class is written into the markup by
   o5_pi_finish2.hold_open_imageless_featured_cards rather than selected with :has(), so the repair
   does not depend on the browser supporting that selector.

   Heights are not invented: measured against the sibling photographed cards on the same band at
   the same width - 420px in the first slot, 208px in the remaining three. Below 1301px the theme
   sets its own explicit heights, so this is scoped to not touch the phone/tablet layout, which
   restore-legibility 1d already covers.

   Ground was #252525 flat first and had no edge: sampled off the rendered page, the band paints
   rgb(39,39,39) and the flush card measured rgb(35,35,35) - a four-value difference the eye reads
   as no card at all. Lifted to #363636 with a 1px inset outline (outline, not box-shadow: the
   theme's own inset shadow is what seats the four PHOTOGRAPHED cards on the band, and overriding
   box-shadow on `.et-featured-post` would take that seating away from all four, not just this
   one). */
#featured .et-featured-post,
.et-featured-post { background-color: #252525; }

@media (min-width: 1301px) {
  .et-featured-post.pi-noimage {
    background-color: #363636;
    outline: 1px solid #4d4d4d;
    outline-offset: -1px;
  }
  .et-featured-post.et-first.pi-noimage { height: 420px; }
  .et-featured-post.pi-noimage { height: 208px; }
}

/* 1d. The featured band's captions are absolutely positioned INSIDE the photograph
   (`.post-description{position:absolute;bottom:33px}`), which works at 1440 where a card is 420px
   tall and fails at 390 where it is 100px: a three-line session title climbs out of the top of its
   own photograph and the green date badge - 60x60, z-index 3 - prints over its first two letters.
   Only the phone layout changes; the desktop overlay the site was designed around is untouched.

   Taking the caption OUT of absolute positioning was tried first and was worse: `.et-featured-post`
   is `overflow:hidden` over a fixed-ratio image, so a caption in normal flow is simply clipped away
   and three of the four cards lost their titles entirely. It stays absolute; it is given the full
   width of the card, moved clear of the badge, and set at a size where the longest session title
   on the site fits inside the shortest card. */
@media (max-width: 767px) {
  #et-featured-posts .post-description { left: 12px; right: 12px; bottom: 10px; padding-right: 0; }
  #et-featured-posts .post-description h2 { font-size: 18px; line-height: 1.25; }
  /* !important because the theme resets min-height to 0 further down its own cascade. 170px is
     not a round number: it is the height at which the tallest caption on the site (three lines at
     18/1.25 plus its 10px offset) starts BELOW the 60px date badge instead of behind it. Verified
     by measuring capTop against the badge, not by looking once. */
  #et-featured-posts .et-featured-post { min-height: 170px !important; }
}

/* Entries on /articles/, the complete index built by o5_pi_archive_index.py. */
.pi-article { padding: 16px 0; border-bottom: 1px solid #e6e6e6; }
.pi-article h2 { margin: 0 0 4px; font-size: 21px; line-height: 1.35; }
.pi-article-date { margin: 0 0 6px; font-size: 13px; color: #666; text-transform: uppercase;
  letter-spacing: .04em; }
.pi-article p { margin: 0; line-height: 1.6; }
/* The cloud's small end is set inline at 8pt (~10.7px) - below the 12px floor and genuinely hard
   to read. Only the smallest step is lifted, so the cloud still weights its terms. */
.tagcloud a[style*="8pt"] { font-size: 13px !important; }

/* The footer's own legal-page link, added by o5_pi_finish3.link_the_orphan_legal_page. Small and
   quiet on purpose - it is a policy link, not a call to action - but it must clear 24px like every
   other footer widget link, which the ul.pi-cat-links rule above already gives it. */
.pi-legal-widget .title { margin: 0 0 6px; }

/* The header logo is a fixed 587px bitmap; at 390 it overhung its own header and printed on top
   of the address line burned into it. */
#logo { max-width: 100%; height: auto; }

/* The sidebar search field is now `type="search"` (see o5_pi_controls), which the earlier
   `input[type=text]` rule no longer matched - so it went back to being a 20px-high slot. */
#searchform input[type=text],
#searchform input[type=search] { min-height: 44px; box-sizing: border-box; padding: 0 8px;
  font-size: 15px; }
#searchform input[type=submit] { min-height: 44px; }

/* TablePress inherits a line-height near 1 from the theme, so any cell that wraps - and in a
   speaker roster most of them do - prints its second line into the first. */
.tablepress td, .tablepress th, .entry-content table td, .entry-content table th
  { line-height: 1.5; }
#top-info > a { display: inline-block; }
.et-main-image > a, .main-tab-image > a { display: block; line-height: 0; }
/* o7 visual review: was `display:block`, which stretched the link across the whole header box -
   and the theme hangs its chevron 25px OUTSIDE the link's right edge (`.mobile_nav > span
   {position:absolute;right:-25px;top:3px}`), so at 390px the arrow sat at the window edge, outside
   the white box (home-p0). inline-block is the theme's own value and keeps the 44px height; the
   chevron is re-centred on the 44px line instead of the old ~20px one. */
a.mobile_nav { display: inline-block; min-height: 44px; line-height: 44px; }
a.mobile_nav > span { top: 17px; }
a.excerpt-more { min-width: 24px; min-height: 24px; background-position: left center; }
.et-scroll-arrows a { min-height: 40px; }

/* 3. Nothing here - the scroller fix is in the markup (screen-reader-text span). This is the
   style that idiom needs, in case the theme's own copy is ever dropped. */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
  white-space: nowrap; border: 0; }

/* 4. The 67-row speaker roster is 462px wide; on a 390px screen it took the whole page sideways
   with it. Let the table scroll inside its own box instead. */
@media (max-width: 782px) {
  .entry-content table,
  .tablepress { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
  .entry-content img, .entry-content iframe { max-width: 100%; height: auto; }
}
