/*
Theme Name: Meridian
Description: Block theme for Meridian Apparels Limited.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: meridian
*/

:root { --navy: #1b2a4a; --bar: #222a35; --slate: #333f50; --gold: #bf9000; --gold-soft: #d9a91a; --light: #f2f2f2; --grey: #dedede; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: Carlito, Calibri, Arial, sans-serif; font-size: 1.0625rem; line-height: 1.65; }
h1, h2, h3 { font-family: "Bodoni Moda", "Bodoni MT", Didot, Georgia, serif; line-height: 1.15; font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.2rem; }
h2 em { color: var(--gold); font-weight: 500; }
.wp-site-blocks > * , .entry-content > *, main { margin-block: 0; }

/* header */
.mer-header { background: var(--bar); color: #fff; position: sticky; top: 0; z-index: 50; padding: 14px 24px; }
.admin-bar .mer-header { top: 32px; }
.mer-header .wp-block-site-title a { color: #fff; text-decoration: none; font-size: 1.5rem; }
.mer-header nav { font-size: .85rem; font-weight: 700; text-transform: uppercase; }
.mer-header .current-menu-item > a { color: var(--gold-soft); }
.mer-header .wp-block-navigation__submenu-container { background: var(--bar) !important; color: #fff !important; border-color: var(--gold) !important; }
.mer-header .mer-nav-cta > a { background: var(--gold); color: #111; padding: 8px 16px; }

/* sections */
.mer-section { padding: clamp(48px, 7vw, 96px) 24px; scroll-margin-top: 80px; }
.mer-light { background: var(--light); color: #222; }
.mer-grey { background: var(--grey); color: #222; }
.mer-dark { background: var(--slate); color: #e8eaee; }
.mer-darker { background: var(--bar); color: #e8eaee; }
.mer-eyebrow { color: var(--gold); text-transform: uppercase; font-size: .8rem; font-weight: 700; letter-spacing: .06em; margin: 0 0 .6em; }
.mer-grey .mer-eyebrow, .mer-light .mer-eyebrow { color: #7a5c00; }
.mer-intro { max-width: 70ch; }
/* WordPress centres narrow children; keep intros aligned with their heading. */
.mer-section > p.mer-intro { margin-left: max(0px, calc((100% - 1200px) / 2)) !important; }

/* hero: navy on the left fading into the picture on the right */
.mer-hero { position: relative; background: var(--navy); color: #fff; padding: clamp(56px, 8vw, 110px) 24px; overflow: hidden; }
.mer-hero.mer-hero-plain { background: var(--slate); }
.mer-hero > .mer-hero-media { position: absolute; inset: 0 0 0 auto; width: 58%; max-width: none; margin: 0; }
.mer-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mer-hero > .mer-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy) 0%, rgba(27,42,74,.65) 18%, rgba(27,42,74,0) 55%); }
.mer-hero > .mer-hero-text { position: relative; }
.mer-hero-text > * { max-width: min(560px, 100%); }
.mer-hero h1 em { font-family: Merienda, "Lucida Calligraphy", cursive; font-style: normal; font-weight: 500; font-size: .75em; color: var(--gold-soft); }
.mer-gold { color: var(--gold-soft); font-family: "Bodoni Moda", Georgia, serif; font-size: 1.15rem; margin: .35em 0; }

/* grids and hover cards */
.mer-grid { display: grid; gap: 16px; margin-block: 32px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.mer-grid > * { margin: 0; }
.mer-cols-2 { --cols: 2; }
.mer-cols-4 { --cols: 4; }
.mer-stack { display: flex; flex-direction: column; gap: 16px; }
.mer-stack > * { margin: 0; }
.mer-card { padding: 24px; border: 2px solid transparent; transition: background-color .2s, border-color .2s; }
.mer-light .mer-card { background: #e6e6e6; }
.mer-grey .mer-card { background: #f4f4f4; }
.mer-dark .mer-card { background: #3d4a5e; }
.mer-darker .mer-card { background: #2e3849; }
.mer-card:hover, .mer-card:focus-within { border-color: var(--gold) var(--gold) transparent; }
.mer-light .mer-card:hover, .mer-grey .mer-card:hover { background: #fff; }
.mer-dark .mer-card:hover, .mer-darker .mer-card:hover { background: var(--navy); }
.mer-plain > .mer-card { background: transparent; }
.mer-card ul, .mer-split ul { padding-left: 1.2em; }
.mer-icon { margin: 0 0 12px; }
.mer-icon img { height: 48px; width: auto; }
.mer-num { font-family: "Bodoni Moda", Georgia, serif; font-size: 2.2rem; color: var(--gold-soft); margin: 0; }

/* image + text rows */
.mer-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; padding: 24px; border: 2px solid transparent; transition: background-color .2s, border-color .2s; }
.mer-split:hover { background: #fff; border-color: var(--gold) var(--gold) transparent; }
.mer-split > * { margin: 0; }
.mer-split-media img { width: 100%; height: auto; display: block; }
.mer-flip > .mer-split-media { order: -1; }

/* buttons and form */
.wp-element-button, .mer-form button { background: var(--gold); color: #111; border: 0; border-radius: 0; padding: 13px 28px; font: 700 .9rem Carlito, Calibri, sans-serif; text-transform: uppercase; cursor: pointer; }
.wp-element-button:hover, .mer-form button:hover { background: var(--gold-soft); color: #111; }
.mer-grey > .wp-block-buttons { justify-content: center; }
.mer-form-box { background: #e6e6e6; padding: 32px; }
.mer-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.mer-form > * { grid-column: 1 / -1; }
.mer-form .mer-f-first, .mer-form .mer-f-last { grid-column: span 1; }
.mer-form label { display: block; font-weight: 700; font-size: .8rem; text-transform: uppercase; margin-bottom: 4px; }
.mer-form input, .mer-form select, .mer-form textarea { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid #bbb; background: #fff; font: inherit; }
.mer-form :focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.mer-form [aria-invalid="true"] { border-color: #b00020; }
.mer-form button { background: #000; color: #fff; }
.mer-form button:hover { background: var(--gold); color: #111; }
.mer-hp { position: absolute; left: -9999px; }
.mer-note { padding: 12px 16px; background: #fff; border-left: 4px solid; }
.mer-ok { border-color: #1b7f3b; }
.mer-err { border-color: #b00020; }

/* footer */
.mer-footer { background: var(--slate); color: #d5d9df; padding: 56px 24px 0; font-size: .95rem; }
.mer-footer a { color: inherit; text-decoration: none; }
.mer-footer a:hover { color: var(--gold-soft); text-decoration: underline; }
.mer-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 48px; }
.mer-footer-grid > * { margin: 0; }
.mer-footer h2 { font-family: Carlito, Calibri, sans-serif; font-size: .8rem; text-transform: uppercase; color: var(--gold-soft); }
.mer-footer ul { list-style: none; padding: 0; }
.mer-copy { border-top: 1px solid #4b586b; padding: 20px 0; margin: 0; }

@media (max-width: 1000px) {
	.mer-cols-4, .mer-grid:not(.mer-cols-2) { --cols: 2; }
	.mer-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 782px) {
	.admin-bar .mer-header { top: 46px; }
	.mer-grid, .mer-grid:not(.mer-cols-2), .mer-split, .mer-footer-grid, .mer-form { grid-template-columns: minmax(0, 1fr); }
	.mer-form .mer-f-first, .mer-form .mer-f-last { grid-column: 1 / -1; }
	.mer-flip > .mer-split-media { order: 0; }
	.mer-hero > .mer-hero-media { position: relative; width: auto; height: 220px; margin: -56px -24px 32px; }
	.mer-hero > .mer-hero-media::after { background: linear-gradient(0deg, var(--navy), rgba(27,42,74,0) 55%); }
}

/* fixes found on the live site */
header.wp-block-template-part { position: sticky; top: 0; z-index: 50; }
.admin-bar header.wp-block-template-part { top: 32px; }
.mer-header, .admin-bar .mer-header { position: static; }
.mer-header .mer-nav-cta > a, .mer-header .is-menu-open .mer-nav-cta > a { color: #111 !important; }
.mer-header .is-menu-open { padding: 24px !important; }
.mer-header .is-menu-open .wp-block-navigation__submenu-container { padding: 8px 0 0 !important; }
.mer-light a:not(.wp-element-button), .mer-grey a:not(.wp-element-button) { color: #7a5c00; }
h2 { font-variation-settings: "opsz" 24; }
h3 { font-variation-settings: "opsz" 11; }
.mer-hero > .mer-hero-media::after { left: -2px; }
@media (max-width: 782px) {
	.admin-bar header.wp-block-template-part { top: 46px; }
	.mer-hero > .mer-hero-media { margin: -56px -24px 32px !important; }
	.mer-hero > .mer-hero-media::after { left: 0; }
}

/* product pages */
@media (min-width: 600px) { .mer-header .mer-nav-products > .wp-block-navigation__submenu-container { max-height: calc(100vh - 110px); overflow-y: auto !important; flex-wrap: nowrap !important; right: 0; left: auto; } }
.mer-categories a { display: block; text-decoration: none; }
.mer-hero .mer-eyebrow a { color: var(--gold-soft); }
.wp-block-gallery.mer-products img { aspect-ratio: 1; object-fit: cover; width: 100%; height: auto; }
.mer-products:has(img) ~ .mer-soon { display: none; }
