/*
Theme Name: MAKTOUM
Theme URI: https://www.maktoum-maroc.com/
Author: INTICSOLUTIONS
Description: Custom block theme for MAKTOUM COMMODITIES. Native blocks, no page builder.
Version: 1.2.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: maktoum
*/

:root {
	--mc-corner: 0 50px 0 50px;
	--mc-gutter: clamp(16px, 4vw, 60px);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--wp--preset--color--blue); outline-offset: 2px; }

/* Header */
.mc-header { padding: 14px var(--mc-gutter); gap: 24px; }
.mc-header .wp-block-site-logo img { width: 170px; height: auto; }
.mc-header .wp-block-navigation { font-family: var(--wp--preset--font-family--sen); font-weight: 700; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; color: var(--wp--preset--color--navy); }
.mc-header .wp-block-navigation a:hover, .mc-header .wp-block-navigation a[aria-current="page"] { color: var(--wp--preset--color--coral-text); }
.mc-header .wp-block-navigation__submenu-container { text-transform: none; font-weight: 500; min-width: 220px; padding: 8px 0; border: 0 !important; box-shadow: 0 8px 24px rgb(8 36 113 / 14%); }
.mc-header__contact { text-align: left; line-height: 1.25; }
.mc-header__contact p { margin: 0; }
.mc-header__phone a { color: var(--wp--preset--color--slate); font-weight: 700; font-size: 16px; text-decoration: none; }
.mc-header__hint { color: #6b6b6b; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.mc-lang { display: flex; gap: 8px; justify-content: flex-end; font-size: 12px; font-weight: 700; }
.mc-lang a { color: var(--wp--preset--color--navy); }
.mc-lang [aria-current] { color: var(--wp--preset--color--coral-text); }

/* Social rail */
.mc-rail { position: fixed; left: 12px; top: 200px; z-index: 20; flex-direction: column; }
@media (max-width: 1100px) { .mc-rail { display: none !important; } }

/* Layout helpers */
.mc-rounded { border-radius: var(--mc-corner); overflow: hidden; }
.mc-band { position: relative; overflow: hidden; }
.mc-band > * { position: relative; z-index: 1; }
.mc-hatch::after { content: ""; position: absolute; right: -40px; top: -30px; width: 280px; height: 280px; background: repeating-linear-gradient(135deg, rgb(255 255 255 / 28%) 0 2px, transparent 2px 16px); clip-path: polygon(50% 0, 100% 100%, 0 100%); pointer-events: none; z-index: 0; }

/* Hero */
.mc-hero { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--mc-corner); scrollbar-width: none; background: var(--wp--preset--color--navy); }
.mc-hero::-webkit-scrollbar { display: none; }
.mc-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: clamp(380px, 56vw, 720px); padding: clamp(24px, 5vw, 64px); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; color: #fff; background: linear-gradient(135deg, var(--wp--preset--color--navy), var(--wp--preset--color--blue)); margin: 0 !important; }
.mc-slide:has(img.mc-slot-bg) { order: -1; } /* While originals are missing, slides with a real photo come first. */
.mc-slide > * { position: relative; z-index: 2; margin: 0; }
.mc-slide .wp-block-heading { color: #fff; font-family: var(--wp--preset--font-family--sen); font-size: clamp(26px, 3.2vw, 40px); line-height: 1.2; text-shadow: 0 1px 12px rgb(0 0 0 / 55%); max-width: 22ch; }
.mc-slide .mc-slot-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.mc-slide .mc-slot-missing.mc-slot-bg { position: absolute; inset: auto 16px 16px auto; width: auto; height: auto; min-height: 0; z-index: 2; }
.mc-slide:has(img.mc-slot-bg)::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, rgb(8 36 113 / 62%), rgb(8 36 113 / 10%) 62%); }
.mc-file-button a, .mc-pill a { display: inline-block; background: #1b6ef3; color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 20px; text-decoration: none; }
.mc-hero-tabs { margin-top: 28px; }
.mc-hero-tabs a { display: flex; gap: 16px; align-items: center; padding: 20px 24px; border: 2px solid transparent; border-radius: 0 30px 0 30px; color: var(--wp--preset--color--navy); text-decoration: none; font-family: var(--wp--preset--font-family--sen); font-size: 18px; font-weight: 700; line-height: 1.3; }
.mc-hero-tabs a::before { content: attr(data-n); color: var(--wp--preset--color--coral-text); font-size: 34px; }
.mc-hero-tabs a[aria-current="true"] { border-color: #e6e8ee; box-shadow: 0 8px 24px rgb(8 36 113 / 8%); }
.mc-hero-tabs p { margin: 0; }

/* Coral panel text is navy so it passes contrast on coral; large headings stay white */
.has-coral-background-color { color: var(--wp--preset--color--navy); }
.has-coral-background-color :where(p, li) { color: var(--wp--preset--color--navy); }
.mc-cols-rule > .wp-block-column + .wp-block-column { border-left: 1px solid rgb(255 255 255 / 45%); padding-left: 24px; }
@media (max-width: 781px) { .mc-cols-rule > .wp-block-column + .wp-block-column { border-left: 0; padding-left: 0; } }

/* Media */
.mc-slot { margin: 0 0 16px; }
.wp-block-post-content > .mc-slot img { width: 100%; }
.mc-img { max-width: 100%; height: auto; display: block; }
.mc-slot-missing { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 150px; padding: 12px; text-align: center; color: #3d3d3d; font-size: 12px; background: repeating-linear-gradient(45deg, #f3f4f7 0 10px, #e9ebf1 10px 20px); border: 2px dashed #8d94a8; }
.mc-slot-missing span { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.mc-slot-missing code { font-size: 11px; word-break: break-all; background: none; }
.mc-missing-note { display: inline-block; margin: 4px 0; padding: 4px 10px; font-size: 12px; color: #3d3d3d; background: #fff; border: 2px dashed #8d94a8; }

/* Product cards */
.mc-products .wp-block-post-featured-image { margin: 0; }
.mc-products .wp-block-post-featured-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.mc-card-media .mc-slot-missing { aspect-ratio: 4 / 3; min-height: 0; box-sizing: border-box; }
.mc-card-empty { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--wp--preset--color--mist), #e6e8ee); }
.mc-products .wp-block-post-title { position: relative; padding-top: 16px; margin: 12px 0 8px; font-size: 18px; }
.mc-products .wp-block-post-title::before { content: ""; position: absolute; top: 0; left: 0; width: 46px; height: 4px; background: var(--wp--preset--color--coral); }
.mc-products .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--navy); }
.mc-products .wp-block-post-excerpt { font-size: 14px; }
.mc-products .wp-block-post-excerpt p { margin: 0 0 8px; }
.mc-products .wp-block-read-more { font-size: 13px; font-weight: 700; color: var(--wp--preset--color--navy); }
.mc-products .wp-block-read-more::after { content: " \2192"; }
p.mc-pill { width: fit-content; margin-inline: auto; padding: 6px 18px; font-weight: 700; color: #fff; background: var(--wp--preset--color--coral-text); border-radius: 0 14px 0 14px; }
.mc-footer .wp-social-link { border-radius: 8px; }

/* Accordions */
.wp-block-details { border-bottom: 1px solid #d9dce4; padding: 12px; }
.wp-block-details summary { font-weight: 700; cursor: pointer; color: var(--wp--preset--color--navy); }

/* Contact form */
.mc-form { display: grid; gap: 24px; }
.mc-form__hp { position: absolute; left: -9999px; height: 1px; overflow: hidden; }
.mc-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 30px; }
.mc-form--short { align-items: end; grid-template-columns: minmax(0, 3fr) auto; }
@media (max-width: 640px) { .mc-form__row, .mc-form--short { grid-template-columns: minmax(0, 1fr); } }
.mc-field { display: block; color: var(--wp--preset--color--navy); font-weight: 700; }
.mc-field span { display: block; margin-bottom: 4px; font-size: 16px; }
.mc-field input, .mc-field select, .mc-field textarea { width: 100%; box-sizing: border-box; padding: 10px 2px; color: var(--wp--preset--color--navy); font: inherit; font-weight: 400; background: transparent; border: 0; border-bottom: 2px solid var(--wp--preset--color--navy); border-radius: 0; }
.mc-form__submit { justify-self: start; padding: 14px 50px; font: inherit; font-size: 16px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #fff; cursor: pointer; background: var(--wp--preset--color--navy); border: 0; border-radius: 8px; }
.mc-form__submit:hover { background: var(--wp--preset--color--blue); }
.mc-form__status { margin: 0; font-weight: 700; color: var(--wp--preset--color--navy); }
.mc-form__status:empty { display: none; }
.mc-form--short .mc-form__status { grid-column: 1 / -1; }
.has-navy-background-color .mc-field, .has-navy-background-color .mc-field input { color: #fff; }

/* Navy contact block */
.has-navy-background-color a { color: #fff; }
.mc-kicker { margin: 0; font-size: 14px; text-transform: uppercase; color: #ffb3ad; }
.mc-contact-value { margin: 0 0 16px; font-weight: 700; color: #fff; }

/* Album */
.mc-album { margin-bottom: 32px; }
.mc-album__title { font-size: 20px; }
.mc-album__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.mc-album__grid img { width: 100%; height: 170px; object-fit: cover; }

/* Partners */
.mc-logos { align-items: center; }
.mc-logos img { max-height: 140px; width: auto; margin: 0 auto; }

/* Map */
.mc-map iframe { display: block; width: 100%; min-height: 330px; border: 0; }

/* Footer */
.mc-footer__copy { font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--coral-text); }
