/*
Theme Name: Maxtrack
Theme URI: https://maxtrack.com/
Author: Maxtrack Ltd
Description: Clean, photography-led block theme for Maxtrack Distribution. Neutral palette, Inter Tight and Inter, square corners and generous space.
Version: 1.2.1
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: maxtrack
*/

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img { height: auto; }
a { text-decoration-color: var(--wp--preset--color--heritage-red); text-decoration-thickness: 1px; text-underline-offset: 6px; }
a:hover { text-decoration-thickness: 2px; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--wp--preset--color--heritage-red); outline-offset: 3px; border-radius: 2px; }
.wp-site-blocks { padding-top: 0; padding-bottom: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Label / eyebrow */
.mx-label { font-family: var(--wp--preset--font-family--text); font-size: 12px !important; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--wp--preset--color--muted); line-height: 1.4; }
.mx-on-photo .mx-label, .mx-label.has-white-color { color: var(--wp--preset--color--white); }

/* ---------- Header ---------- */
.mx-header { border-bottom: 1px solid var(--wp--preset--color--mist); background: var(--wp--preset--color--paper); }
.mx-header__inner { min-height: 88px; }
.mx-logo { display: block; line-height: 0; text-decoration: none; }
.mx-logo img { width: 168px; height: auto; display: block; }
.mx-header .wp-block-navigation a { text-decoration: none; padding-bottom: 6px; border-bottom: 1px solid transparent; }
.mx-header .wp-block-navigation .current-menu-item > a,
.mx-header .wp-block-navigation a[aria-current="page"] { border-bottom-color: var(--wp--preset--color--heritage-red); }
.mx-header .wp-block-navigation a:hover { border-bottom-color: currentColor; }
.mx-header .mx-nav-cta a { border: 1px solid currentColor !important; padding: 10px 16px !important; }
.mx-header .mx-nav-cta a:hover { background: var(--wp--preset--color--carbon); color: var(--wp--preset--color--white) !important; }

/* Overlay header on photography */
.mx-header--overlay { position: absolute; top: 0; left: 0; right: 0; z-index: 20; background: transparent; border-bottom: 0; color: var(--wp--preset--color--white); }
.admin-bar .mx-header--overlay { top: 32px; }
@media (max-width: 782px) { .admin-bar .mx-header--overlay { top: 46px; } }
.mx-header--overlay .wp-block-navigation, .mx-header--overlay .wp-block-navigation a { color: var(--wp--preset--color--white); }
.mx-header--overlay .mx-nav-cta a:hover { background: rgba(255,255,255,.12); color: var(--wp--preset--color--white) !important; }
.mx-header--overlay .wp-block-navigation__responsive-container-open { color: var(--wp--preset--color--white); }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--paper) !important; color: var(--wp--preset--color--carbon) !important; padding: 32px; }
.wp-block-navigation__responsive-container.is-menu-open a { color: var(--wp--preset--color--carbon) !important; font-size: 22px; font-family: var(--wp--preset--font-family--display); }
.mx-front { position: relative; }

/* ---------- Buttons ---------- */
.wp-block-button__link { border-radius: 0 !important; transition: background .15s, color .15s; text-decoration: none; }
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--carbon); border: 1px solid var(--wp--preset--color--carbon); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--carbon); color: var(--wp--preset--color--white); }
.wp-block-button.is-style-on-photo > .wp-block-button__link { background: var(--wp--preset--color--white); color: var(--wp--preset--color--carbon); border-color: var(--wp--preset--color--white); }
.wp-block-button.is-style-on-photo > .wp-block-button__link:hover { background: var(--wp--preset--color--paper); }
.wp-block-button.is-style-ghost-photo > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--white); border: 1px solid rgba(255,255,255,.75); }
.wp-block-button.is-style-ghost-photo > .wp-block-button__link:hover { background: rgba(255,255,255,.12); }

/* ---------- Hero / photo bands ---------- */
.mx-hero { min-height: min(86vh, 820px) !important; }
.wp-block-cover.mx-hero .wp-block-cover__inner-container, .wp-block-cover.mx-band .wp-block-cover__inner-container { width: 100% !important; margin: 0 !important; }
.wp-block-cover.mx-hero .wp-block-cover__inner-container > .alignwide, .wp-block-cover.mx-band .wp-block-cover__inner-container > .alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto !important; margin-right: auto !important; padding-left: 0; padding-right: 0; }
.mx-hero h1, .mx-band h2 { color: var(--wp--preset--color--white); }
.mx-page-hero { min-height: 420px !important; }

/* ---------- Brand row ---------- */
.mx-brands { }
.mx-brands__list { list-style: none; margin: 0 auto; padding: 32px 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: center; justify-items: center; gap: 40px 32px; max-width: var(--wp--style--global--wide-size); border-top: 1px solid var(--wp--preset--color--mist); border-bottom: 1px solid var(--wp--preset--color--mist); }
.mx-brands__list li { margin: 0; }
.mx-brands__list a { display: flex; align-items: center; justify-content: center; width: 150px; max-width: 100%; height: 80px; text-decoration: none; }
.mx-brands__list img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: grayscale(1) contrast(1.25); mix-blend-mode: multiply; opacity: .85; transition: opacity .15s; }
.mx-brands__list a:hover img { opacity: 1; }
@media (max-width: 1000px) { .mx-brands__list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .mx-brands__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; } .mx-brands__list a { height: 56px; } }

/* ---------- Sport index ---------- */
.mx-sports { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--wp--preset--color--mist); }
.mx-sports li { margin: 0; }
.mx-sports a { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 18px 0; border-top: 1px solid var(--wp--preset--color--mist); text-decoration: none; color: var(--wp--preset--color--carbon); }
.mx-sports__name { font-family: var(--wp--preset--font-family--display); font-weight: 500; font-size: clamp(20px, 2.2vw, 24px); letter-spacing: -0.02em; line-height: 1.2; }
.mx-sports__brands { display: flex; gap: 20px; align-items: baseline; font-size: 14px; color: var(--wp--preset--color--muted); text-align: right; }
.mx-sports a:hover .mx-sports__name { text-decoration: underline; text-decoration-color: var(--wp--preset--color--heritage-red); text-underline-offset: 6px; }
@media (max-width: 600px) { .mx-sports a { flex-direction: column; gap: 4px; } .mx-sports__brands { text-align: left; } .mx-sports__arrow { display: none; } }

/* ---------- Tiles ---------- */
.mx-tile { text-decoration: none; color: var(--wp--preset--color--carbon); display: flex; flex-direction: column; gap: 14px; }
.mx-tile img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; transition: opacity .2s; }
.mx-tile:hover img { opacity: .92; }
.mx-tile__caption { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.mx-tile__caption strong { font-weight: 500; }
.mx-tile__caption span { color: var(--wp--preset--color--muted); text-align: right; }
.mx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

/* ---------- News cards ---------- */
.mx-news .wp-block-post-featured-image img { aspect-ratio: 3 / 2; object-fit: cover; }
.mx-news .wp-block-post-title a { text-decoration: none; }
.mx-news .wp-block-post-title a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--heritage-red); }
.mx-news .wp-block-post-terms a { text-decoration: none; color: var(--wp--preset--color--muted); }

/* ---------- Brand directory ---------- */
.mx-brand-card { border-top: 1px solid var(--wp--preset--color--mist); padding-top: 24px; }
.mx-brand-card__logo { height: 56px; display: flex; align-items: center; }
.mx-brand-card__logo img { max-height: 56px; max-width: 150px; width: auto; filter: grayscale(1) contrast(1.25); mix-blend-mode: multiply; }
.mx-brand-card p { margin: 0; }
.mx-brand-card .mx-brand-card__sports { color: var(--wp--preset--color--muted); font-size: 13px; }

/* ---------- Footer ---------- */
.mx-footer { color: var(--wp--preset--color--footer-text); }
.mx-footer a { color: var(--wp--preset--color--footer-text); text-decoration: none; }
.mx-footer a:hover { color: var(--wp--preset--color--white); text-decoration: underline; }
.mx-footer h2 { color: var(--wp--preset--color--white); font-family: var(--wp--preset--font-family--text); font-size: 14px; font-weight: 500; letter-spacing: 0; margin: 0 0 8px; }
.mx-footer ul { list-style: none; padding: 0; margin: 0; line-height: 1.9; }
.mx-footer .mx-logo img { width: 150px; }

/* ---------- Content ---------- */
.entry-content:not(.mx-page-content) > p, .entry-content:not(.mx-page-content) li { font-size: var(--wp--preset--font-size--body-l); line-height: 1.65; color: var(--wp--preset--color--graphite); }
.entry-content img { max-width: 100%; }
.entry-content:not(.mx-page-content) h2 { margin-top: 1.6em; font-size: var(--wp--preset--font-size--display-m); }
.entry-content iframe { max-width: 100%; }
.mx-prose-muted { color: var(--wp--preset--color--muted); }

/* ---------- Brand directory layout ---------- */
.mx-dir-sport { margin-top: var(--wp--preset--spacing--70); scroll-margin-top: 24px; }
.mx-dir-sport:first-child { margin-top: 0; }
.mx-dir-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 64px; margin-top: 40px; }
@media (max-width: 781px) { .mx-dir-grid { grid-template-columns: 1fr; gap: 40px; } }
.mx-brand-card { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 24px; }
.mx-brand-card h3 { margin: 8px 0 0; font-size: 20px; }
.mx-brand-card p { font-size: 15px; line-height: 1.6; color: var(--wp--preset--color--graphite); }

/* ---------- Fixes 1.0.1 ---------- */
.mx-footer .wp-block-separator { width: 100%; border: 0; height: 1px; opacity: 1; }
.mx-news .wp-block-post-template.is-layout-grid { row-gap: 48px; }
.mx-dir-also { margin-top: 20px; font-size: 15px; color: var(--wp--preset--color--muted); }

/* ---------- Forms (Contact Form 7) ---------- */
.wpcf7 { margin-top: 32px; }
.mx-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.mx-form-grid .mx-span-2 { grid-column: 1 / -1; }
@media (max-width: 600px) { .mx-form-grid { grid-template-columns: 1fr; } }
.mx-form-grid label, .mx-form-grid legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; color: var(--wp--preset--color--carbon); }
.mx-form-grid fieldset { border: 0; padding: 0; margin: 0; }
.mx-form-grid legend { margin-bottom: 10px; }
.wpcf7 input[type=text], .wpcf7 input[type=email], .wpcf7 input[type=tel], .wpcf7 input[type=url], .wpcf7 select, .wpcf7 textarea { width: 100%; box-sizing: border-box; font: 400 15px/1.4 var(--wp--preset--font-family--text); color: var(--wp--preset--color--carbon); background: var(--wp--preset--color--white); border: 1px solid #c9c5bd; border-radius: 0; padding: 12px 14px; }
.wpcf7 textarea { min-height: 120px; resize: vertical; }
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus { outline: 2px solid var(--wp--preset--color--heritage-red); outline-offset: 0; border-color: var(--wp--preset--color--carbon); }
.wpcf7 .wpcf7-checkbox { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-list-item label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 15px; }
.wpcf7 input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--wp--preset--color--carbon); }
.wpcf7 input[type=submit] { margin-top: 24px; background: var(--wp--preset--color--carbon); color: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--carbon); border-radius: 0; font: 500 15px/1 var(--wp--preset--font-family--text); padding: 15px 22px; cursor: pointer; }
.wpcf7 input[type=submit]:hover { background: var(--wp--preset--color--graphite); }
.wpcf7 .wpcf7-not-valid-tip { color: var(--wp--preset--color--heritage-red); font-size: 13px; font-weight: 400; }
.wpcf7 form .wpcf7-response-output { margin: 20px 0 0; padding: 12px 16px; border: 1px solid var(--wp--preset--color--mist); font-size: 15px; }
.wpcf7 .wpcf7-spinner { vertical-align: middle; }
.mx-photo-credit { margin-top: 40px !important; text-align: right; opacity: .8; font-size: 11px !important; letter-spacing: .04em; }

/* Brand directory 1.0.10 */
.mx-dir-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-dir-filter a { text-decoration: none; font-size: 14px; padding: 9px 14px; border: 1px solid var(--wp--preset--color--mist); color: var(--wp--preset--color--graphite); }
.mx-dir-filter a:hover { border-color: var(--wp--preset--color--carbon); color: var(--wp--preset--color--carbon); }
.mx-dir-filter a[aria-current] { background: var(--wp--preset--color--carbon); border-color: var(--wp--preset--color--carbon); color: var(--wp--preset--color--white); }
.mx-dir-grid .mx-brand-card { padding-top: 32px; gap: 12px; }
.mx-dir-grid .mx-brand-card__logo { height: 80px; }
.mx-dir-grid .mx-brand-card__logo img { max-height: 80px; max-width: 200px; }
.mx-dir-grid .mx-brand-card h3 { font-size: var(--wp--preset--font-size--display-m); margin-top: 12px; }
.mx-dir-grid .mx-brand-card p { font-size: 17px; line-height: 1.65; max-width: 560px; }
.mx-dir-grid .mx-brand-card .mx-brand-card__sports { font-size: 13px; letter-spacing: .04em; }

/* Page content holds full-width sections */
.mx-page-content { margin-top: 0 !important; }
.mx-page-content > * + * { margin-block-start: 0; }

/* History timeline */
.mx-timeline { margin-top: 20px !important; border-bottom: 1px solid var(--wp--preset--color--mist); }
.mx-timeline-item { border-top: 1px solid var(--wp--preset--color--mist); padding: 36px 0; margin: 0 !important; }
.mx-timeline-item .mx-timeline-year { color: var(--wp--preset--color--muted); letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.mx-timeline-item h3 { margin: 0 0 12px; }
.mx-timeline-item p { margin: 0; }
.entry-content h2.mx-history-sport, h2.mx-history-sport { margin-top: var(--wp--preset--spacing--70); font-size: var(--wp--preset--font-size--display-l); }
.mx-history-back { margin-top: var(--wp--preset--spacing--60) !important; }

/* Where to buy (landing page for old shop links) */
.mx-wtb__links { display: block; line-height: 1.9 !important; }
.mx-wtb.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 781px) { .mx-wtb.is-layout-grid { grid-template-columns: 1fr; } }
.mx-wtb .mx-brand-card { display: block; }
.mx-wtb .mx-brand-card > * { margin-block: 0; }
.mx-wtb .mx-brand-card h3 { margin: 14px 0 6px; }
.mx-wtb .mx-brand-card p { font-size: 15px; line-height: 1.9; }
.mx-wtb .wp-block-image { margin: 0; }
.mx-wtb__links a { color: var(--wp--preset--color--carbon); font-size: 15px; text-underline-offset: 3px; }
.mx-wtb__links a.mx-wtb__buy { font-weight: 500; }
.mx-wtb-other { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--wp--preset--color--mist); scroll-margin-top: 24px; }

/* Logos sized by area (width set inline by the theme) */
.mx-brands__list img[style*="width"] { height: auto; max-height: 64px; }
.mx-brand-card__logo img[style*="width"] { height: auto; max-height: none; max-width: 100%; }
.mx-brand-card__logo { height: 80px; }
