/*
Theme Name: MRC Cat Litter
Theme URI: http://mairuichi.cc/
Author: MRC
Author URI: http://mairuichi.cc/
Description: Classic PHP theme for Qingdao MRC Cat Litter. Product and news content types, taxonomies and field groups are created with Advanced Custom Fields PRO; SEO output is handled by Rank Math SEO and the contact form by Contact Form 7.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mrc
Tags: business, custom-menu, custom-logo, featured-images, translation-ready
*/

/* ============================================================
   Theme utility layer.
   Layout, colour and typography live in assets/css/base.css
   (extracted 1:1 from the static site) plus one page-*.css file.
   This file only carries glue needed by WordPress itself.
   ============================================================ */

/* ---- Extra neutral steps used by the WordPress-specific shells ----
   base.css ships --gray-100/300/500/700/900; these fill the two gaps. */
:root {
    --gray-200: #e6e6e6;
    --gray-600: #5a5a5a;
}

/* ---- WordPress core alignment + caption helpers ---- */
.alignleft {
    float: left;
    margin: 0 24px 16px 0;
}

.alignright {
    float: right;
    margin: 0 0 16px 24px;
}

.aligncenter {
    display: block;
    margin: 0 auto 16px;
}

.alignwide,
.alignfull {
    max-width: 100%;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text,
.screen-reader-text {
    font-size: 13px;
    color: var(--gray-500);
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sticky,
.bypostauthor {
    display: block;
}

/* ---- Logged-in admin bar offset (nav is fixed to the top) ---- */
body.admin-bar .navbar {
    top: 32px;
}

body.admin-bar .search-drop {
    top: calc(var(--nav-height) + 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .navbar {
        top: 46px;
    }

    body.admin-bar .search-drop {
        top: calc(var(--nav-height) + 46px);
    }
}

/* ---- Search drop wrapper: base.css expects the bar to be the direct child ---- */
.search-drop form {
    flex: 1;
    display: flex;
    align-items: center;
    margin: 0;
}

/* ---- Rank Math breadcrumb: current item ---- */
.about-breadcrumb .rank-math-breadcrumb .last,
.prod-breadcrumb .rank-math-breadcrumb .last,
.news-breadcrumb .rank-math-breadcrumb .last,
.contact-breadcrumb .rank-math-breadcrumb .last,
.oem-breadcrumb .rank-math-breadcrumb .last,
.pd-breadcrumb .rank-math-breadcrumb .last,
.nd-breadcrumb .rank-math-breadcrumb .last {
    color: var(--gray-900);
    font-weight: 600;
}

/* ---- Nav fallback for layouts without a dark hero ----
   .mrc-nav-solid is added by header.php on pages that do not open with a
   full-bleed dark hero (search results, 404, generic pages). Without it the
   transparent navbar would render white text on a white background. */
.mrc-nav-solid .navbar {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 30px rgba(0, 0, 0, 0.05);
}

.mrc-nav-solid .navbar .logo .logo-white {
    display: none;
}

.mrc-nav-solid .navbar .logo .logo-green {
    display: block;
}

.mrc-nav-solid .navbar .nav-links {
    color: var(--gray-700);
}

.mrc-nav-solid .navbar .lang-switch {
    color: var(--gray-500);
    background: rgba(0, 0, 0, 0.03);
}

.mrc-nav-solid .navbar .search-btn {
    color: var(--gray-900);
}

.mrc-nav-solid .navbar .nav-toggle span {
    background: var(--gray-900);
}

/* ---- Rank Math breadcrumbs adapted to the static breadcrumb styling ----
   The static site renders  <a>..</a><span class="sep">/</span><span class="current">..</span>
   inside a page-specific wrapper. Rank Math is preferred when active, so its
   markup is normalised onto the same visual result here. */
.about-breadcrumb .rank-math-breadcrumb,
.prod-breadcrumb .rank-math-breadcrumb,
.news-breadcrumb .rank-math-breadcrumb,
.contact-breadcrumb .rank-math-breadcrumb,
.oem-breadcrumb .rank-math-breadcrumb,
.pd-breadcrumb .rank-math-breadcrumb,
.nd-breadcrumb .rank-math-breadcrumb {
    font-size: 13px;
    color: var(--gray-500);
}

.about-breadcrumb .rank-math-breadcrumb p,
.prod-breadcrumb .rank-math-breadcrumb p,
.news-breadcrumb .rank-math-breadcrumb p,
.contact-breadcrumb .rank-math-breadcrumb p,
.oem-breadcrumb .rank-math-breadcrumb p,
.pd-breadcrumb .rank-math-breadcrumb p,
.nd-breadcrumb .rank-math-breadcrumb p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.about-breadcrumb .rank-math-breadcrumb .separator,
.prod-breadcrumb .rank-math-breadcrumb .separator,
.news-breadcrumb .rank-math-breadcrumb .separator,
.contact-breadcrumb .rank-math-breadcrumb .separator,
.oem-breadcrumb .rank-math-breadcrumb .separator,
.pd-breadcrumb .rank-math-breadcrumb .separator,
.nd-breadcrumb .rank-math-breadcrumb .separator {
    color: var(--gray-300);
}

/* ---- Optional intro block on the products page (ACF mrc_products_intro) ---- */
.prod-intro {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 0 0;
    color: var(--gray-700);
    font-size: 16px;
    line-height: 1.8;
}

.prod-intro p:last-child {
    margin-bottom: 0;
}

/* ---- Light page head for templates without a static counterpart
   (search results, 404, generic pages). These pages have no dark hero, so the
   navbar is forced solid by .mrc-nav-solid and this head clears its height. ---- */
.mrc-page-head {
    padding: calc(var(--nav-height) + 56px) 0 44px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.mrc-page-head h1 {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(34px, 4vw, 54px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--gray-900);
    margin-bottom: 14px;
}

.mrc-page-head .hero-sub {
    font-size: 17px;
    color: var(--gray-500);
    font-weight: 500;
    max-width: 760px;
}

.mrc-breadcrumb {
    padding: 18px 0;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
    font-size: 13px;
    color: var(--gray-500);
}

.mrc-breadcrumb a {
    color: var(--gray-500);
}

.mrc-breadcrumb a:hover {
    color: var(--green);
}

.mrc-breadcrumb .sep {
    margin: 0 8px;
    color: var(--gray-300);
}

.mrc-breadcrumb .current {
    color: var(--gray-900);
    font-weight: 600;
}

/* ---- Search results / 404 / generic content ---- */
.mrc-section {
    padding: 80px 0;
}

.mrc-section--tight {
    padding: 56px 0 80px;
}

.mrc-entry {
    max-width: 860px;
    margin: 0 auto;
    color: var(--gray-700);
    font-size: 16px;
    line-height: 1.9;
    font-weight: 500;
}

.mrc-entry h2,
.mrc-entry h3,
.mrc-entry h4 {
    font-family: 'Fredoka One', cursive;
    font-weight: 400;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    margin: 32px 0 14px;
}

.mrc-entry h2 {
    font-size: 32px;
}

.mrc-entry h3 {
    font-size: 26px;
}

.mrc-entry h4 {
    font-size: 21px;
}

.mrc-entry p,
.mrc-entry ul,
.mrc-entry ol,
.mrc-entry blockquote {
    margin-bottom: 18px;
}

.mrc-entry ul,
.mrc-entry ol {
    padding-left: 22px;
}

.mrc-entry li {
    margin-bottom: 8px;
}

.mrc-entry a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mrc-entry img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.mrc-entry blockquote {
    border-left: 4px solid var(--green);
    padding: 6px 0 6px 22px;
    font-size: 18px;
    color: var(--gray-600);
}

.mrc-result-count {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 28px;
}

.mrc-result-list {
    display: grid;
    gap: 18px;
}

.mrc-result-item {
    display: block;
    padding: 26px 30px;
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    background: var(--white);
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.mrc-result-item:hover {
    border-color: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0, 60, 22, 0.07);
}

.mrc-result-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 8px;
}

.mrc-result-item h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
    font-weight: 400;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.mrc-result-item p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--gray-500);
    font-weight: 500;
}

.mrc-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.mrc-pagination a.page-numbers,
.mrc-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.mrc-pagination span.page-numbers.current,
.mrc-pagination a.page-numbers:hover,
.mrc-pagination a.page-numbers:focus-visible {
    background: var(--green);
    color: var(--white);
}

.mrc-empty {
    padding: 60px 30px;
    text-align: center;
    border: 1px dashed var(--gray-200);
    border-radius: 18px;
    background: var(--gray-100);
}

.mrc-empty h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 26px;
    font-weight: 400;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.mrc-empty p {
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 20px;
}

.mrc-btn {
    display: inline-block;
    padding: 13px 30px;
    border-radius: 50px;
    background: var(--green);
    color: var(--white) !important;
    font-weight: 700;
    font-size: 15px;
    transition: background 0.3s, transform 0.3s;
}

.mrc-btn:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

.mrc-btn--ghost {
    background: transparent;
    border: 1.5px solid var(--green);
    color: var(--green) !important;
}

.mrc-btn--ghost:hover {
    background: var(--green);
    color: var(--white) !important;
}

/* ---- Screen reader only headline used by front-page hero ---- */
.mrc-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Footer sitemap link */
.footer-bottom .footer-legal {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-bottom .footer-sitemap {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.72);
    transition: color 0.2s;
}

.footer-bottom .footer-sitemap:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-bottom {
        padding-bottom: 96px; /* keep clear of the floating contact launcher */
    }
}

/* Active nav item — every template, not just the product pages */
.nav-links a.active,
.navbar.scrolled .nav-links a.active {
    color: var(--green);
}

/* Dark hero: brand green sits too close to the banner green */
.navbar:not(.scrolled) .nav-links a.active {
    color: #7CE8A4;
}

/* Light nav (inner pages) keeps the brand green for contrast */
body.mrc-nav-solid .navbar:not(.scrolled) .nav-links a.active {
    color: var(--green);
}

/* Underline only for plain links. The Products item draws its chevron with
   ::after as well, so stretching that pseudo element turns the arrow into a
   full-width diagonal slash. */
@media (min-width: 1025px) {
    .nav-links > li:not(.nav-drop) > a.active::after {
        width: 100%;
    }
}

/* Mobile panel: links are forced to gray-900 with !important (breakpoint 1024) */
@media (max-width: 1024px) {
    .nav-links > li > a.active,
    .nav-links .nav-drop-link.active {
        color: var(--green) !important;
    }

    /* Keep the chevron an 11px arrow, whatever the active state says */
    .nav-links .nav-drop-link.active::after {
        width: 11px;
        height: 11px;
        background: transparent;
        border-right: 2.5px solid var(--green);
        border-bottom: 2.5px solid var(--green);
    }
}






/* Footer contact rows: Address / Tel / Email / WhatsApp with inline labels */
.footer-grid .col .contact-line {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.footer-grid .col .contact-line .label,
.footer-grid .col a .label {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 700;
}

.footer-grid .col .contact-line .label {
    margin-right: 4px;
}

/* About block video lightbox */
.mrc-video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mrc-video-modal[hidden] {
    display: none;
}

.mrc-video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.mrc-video-modal__body {
    position: relative;
    z-index: 1;
    width: min(960px, 92vw);
}

.mrc-video-modal video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    background: #000;
}

.mrc-video-modal__close {
    position: absolute;
    top: -46px;
    right: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

/* Poster cards are links when a destination is set */
a.poster-item {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* The marquee is driven by JS; the CSS keyframes assumed four printed copies */
.news-marquee .news-track {
    animation: none;
}

/* Hero slide click-through link (below the arrows/dots) */
.banner-slide {
    position: relative;
}

.banner-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
}

/* Whole card is clickable: stretch the primary link over the card */
.prod-card,
.news-card,
.news-item {
    position: relative;
}

.prod-card a.read-more::after,
.news-card h4 a::after,
.news-item h2 a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
}
