/*
Theme Name: RSC Group
Description: Like-for-like rebuild of the original rscgroup.co design (2017 Perch theme) for WordPress. Intended to be exported as a static site.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: rsc
*/

/* The site's styles live in build/css/app.css (the original theme CSS, unchanged).
   Small WordPress-specific additions go below. */

.editorial img { max-width: 100%; height: auto; }
.editorial iframe { max-width: 100%; }
.screen-reader-text { position: absolute; left: -9999px; }

/* WordPress adds width/height attributes to images; the original CSS expects natural height. */
.staff .img-wrap img,
.home-carousel img,
.accreditations img,
.testimonials-cell .avatar { height: auto; }

/* Staff cards: the original hover colour (#233342) matched the card background, so links vanished on hover.
   Use the cards' light-blue accent instead. */
.grid-parent .grid-panel.staff .content-block a:hover,
.grid-parent .grid-panel.staff .content-block a.more:hover { color: #93b4bd; }

/* Latest News cards (About page), wide screens: the original pins the text to the bottom of a fixed
   280px card and grows it on hover to reveal "Read More", so longer headlines spilled out of the card.
   Let each card grow with its text instead, and reserve space for the link so nothing moves on hover. */
@media only screen and (min-width: 75em) {
    .latest-news { display: flex; }
    .latest-news .latest { float: none; height: auto; min-height: 280px; }
    .latest-news .latest.img { height: auto; }
    .latest-news .latest.text { display: flex; flex-direction: column; justify-content: flex-end; }
    .grid-parent .latest-news .grid-panel.text .content-block,
    .grid-parent .latest-news .grid-panel.text:hover .content-block { position: relative; bottom: auto; padding: 2rem; }
    .grid-parent .latest-news .grid-panel.text .content-block a.more,
    .grid-parent .latest-news .grid-panel.text:hover .content-block a.more { position: static; display: inline-block; padding-top: 1rem; }
}

/* Latest News cards: the light blue (#93b4bd) on grey was 1.35:1, failing WCAG AA. A darker shade of the
   same blue-green reaches at least 4.73:1 on all four card greys (AA for normal and large text). */
.grid-parent .latest-news .content-block h2,
.grid-parent .latest-news .content-block h2.dash { color: #3a575f; }
.grid-parent .latest-news .grid-panel.text .content-block a.more:link,
.grid-parent .latest-news .grid-panel.text .content-block a.more:visited { color: #3a575f; }
.grid-parent .latest-news .grid-panel.text .content-block a.more:hover,
.grid-parent .latest-news .grid-panel.text .content-block a.more:focus { color: #233342; }

/* ---- WCAG AA contrast (Nov 2026) ----
   The original design used the light brand blue (#93b4bd) for text on light backgrounds and white text on
   light-blue blocks. On light backgrounds, text now uses a darker shade of the same blue-green (#3a575f,
   4.7:1 or better); on light-blue blocks it uses the brand navy (#233342, about 5.9:1). The light blue stays
   for backgrounds, accents and text on dark backgrounds, where it already passes. */

/* Link hover states on light backgrounds (body text, top menu, Get In Touch box, carousel arrows).
   Dark areas (footer, staff, service and certificate cards, page banners) keep their own hover colours. */
a:hover, a:focus { color: #3a575f; }
.row .panel .col.contactus h3 a:hover, .row .panel .col.contactus h4 a:hover,
.row .panel .col.contactus h3 a:focus, .row .panel .col.contactus h4 a:focus { color: #3a575f; }
.section-title-header .carousel-nav-wrap .carousel-nav:hover { color: #3a575f; }
.site-nav .nav-toggle:hover { color: #3a575f; }

/* "Read more" / "Find out more" / "Contact Us" links on light backgrounds */
a.more:link, a.more:visited { color: #3a575f; }
a.more:hover, a.more:focus { color: #233342; }
/* ...but keep the light blue where the card is dark navy (certificates, related-services carousel),
   with white on hover (the original navy hover vanished on these cards) */
.certificates-carousel .grid-panel.certificates-carousel-cell .content-block a.more:link,
.certificates-carousel .grid-panel.certificates-carousel-cell .content-block a.more:visited,
.services-carousel .services-carousel-cell .content-block a.more:link,
.services-carousel .services-carousel-cell .content-block a.more:visited { color: #93b4bd; }
.services-carousel .services-carousel-cell .content-block a.more:hover,
.services-carousel .services-carousel-cell .content-block a.more:focus { color: #fff; }

/* Phone/email banner at the bottom of every page */
.get-in-touch-banner span a:hover, .get-in-touch-banner span a:focus { color: #3a575f; }
.get-in-touch-banner .btn:link, .get-in-touch-banner .btn:visited { color: #233342; }
.get-in-touch-banner .btn:hover, .get-in-touch-banner .btn:focus { color: #233342; }

/* Testimonials: light-blue cards (1st, 3rd, ...) get navy text; navy cards keep white text */
.grid-panel .testimonials-carousel .testimonials-cell:nth-child(2n+1) { color: #233342; }
