/*
Theme Name: MW Tech
Description: Tema del sito meridianwest.tech: prodotti e app di Meridian West (MW Captain, MW Logger, MW Autopilot, plugin Signal K) e negozio WooCommerce. Stesso stile del tema "rotta" di meridianwest.org. Bilingue con Polylang.
Version: 0.1.0
Requires at least: 6.5
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: mwtech
WC requires at least: 9.0
*/

/* Inter (SIL Open Font License), served by the theme: no external requests. Same as meridianwest.org. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 200; font-display: swap; src: url("assets/fonts/inter-latin-200-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300; font-display: swap; src: url("assets/fonts/inter-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }

/* Same colours as meridianwest.org (theme "rotta"). */
:root {
	--navy: #0a1a2f;
	--navy-2: #11284a;
	--sea: #1d4f7a;
	--sand: #f6f1e7;
	--paper: #fffdf8;
	--ink: #1b2533;
	--muted: #5d6b7c;
	--line: #e3dccd;
	--brass: #f2b84b;
	--coral: #ff6b4a;
	/* Text on coral: dark blue (contrast 6.2:1, AA), not white (2.8:1). */
	--on-coral: #0a1a2f;
	--coral-hover: #ff8466;
	--sky: #bfe3ff;
	--radius: 14px;
	--wrap: 1180px;
	--font: "Inter", "Helvetica Neue", Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--sand);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
.site-main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--sea); }
a:hover { color: var(--coral); }
h1, h2, h3 { line-height: 1.2; font-weight: 300; letter-spacing: .02em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--brass); margin: 0 0 .5em; font-weight: 600; }

.screen-reader-text, .skip-link:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fff; padding: 8px 12px; }

.btn {
	display: inline-block; padding: .6em 1.2em; border-radius: 999px; border: 0;
	background: var(--coral); color: var(--on-coral); font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--coral-hover); }
.btn:not(.btn-ghost), .btn:not(.btn-ghost):hover, .btn:not(.btn-ghost):focus { color: var(--on-coral); }
.btn-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-small { padding: .35em .9em; font-size: .9rem; }

/* Header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { margin-right: auto; }
.brand a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { height: 42px; width: auto; display: block; }
.brand-wordmark { height: 30px; width: auto; display: block; }
.custom-logo { max-height: 44px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.site-nav a { color: #dfe9f5; text-decoration: none; }
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--brass); }
.lang-switch { gap: 8px !important; text-transform: uppercase; font-size: .85rem; }
.lang-switch .current-lang a { color: var(--brass); font-weight: 700; }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; color: #dfe9f5; text-decoration: none; }
.cart-link svg { width: 22px; height: 22px; }
.cart-count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--coral); color: var(--on-coral); font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cart-count:empty, .cart-count[data-count="0"] { display: none; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }

@media (max-width: 900px) {
	.nav-toggle { display: block; }
	.brand-mark { height: 34px; }
	.brand-wordmark { height: 26px; }
	.site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: flex-start; padding: 16px; gap: 16px; }
	.nav-open .site-nav { display: flex; }
	.site-nav ul { flex-direction: column; gap: 12px; }
	.lang-switch { flex-direction: row !important; }
}

/* Home */
.hero {
	background: radial-gradient(ellipse at 30% 40%, #163a63 0%, var(--navy) 60%, #050d19 100%);
	color: #fff; padding: 72px 0 80px;
}
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-weight: 200; margin: 0 0 .3em; }
.hero h1 strong { font-weight: 500; }
.hero .tagline { color: #cfe0f2; font-size: 1.15rem; max-width: 560px; margin: 0 0 1.6em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-logo { justify-self: center; }
.hero-logo img { width: 260px; height: auto; display: block; opacity: .95; }
@media (max-width: 900px) {
	.hero { padding: 48px 0 56px; }
	.hero-inner { grid-template-columns: 1fr; gap: 24px; }
	.hero-logo { order: -1; }
	.hero-logo img { width: 120px; }
}

.section { padding: 56px 0; }
.section-head { margin-bottom: 28px; max-width: 760px; }
.section-head h2 { margin: 0 0 .3em; }
.section-head p { margin: 0; color: var(--muted); }

/* Product cards */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.product-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.product-card .kind { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--sea); font-weight: 600; margin: 0; }
.product-card h3 { margin: 0; font-size: 1.4rem; font-weight: 400; }
.product-card h3 a { color: var(--ink); text-decoration: none; }
.product-card h3 a:hover { color: var(--coral); }
.product-card p { margin: 0; color: var(--muted); font-size: .97rem; }
.product-card ul { margin: 0; padding-left: 1.1em; color: var(--ink); font-size: .93rem; }
.product-card .more { margin-top: auto; padding-top: 8px; font-weight: 600; text-decoration: none; }

/* How it fits together */
.system { background: var(--navy); color: #dfe9f5; }
.system h2 { color: #fff; }
.system .section-head p { color: #9fb4cc; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; counter-reset: step; }
.steps li { background: var(--navy-2); border-radius: var(--radius); padding: 20px; counter-increment: step; }
.steps li::before { content: counter(step); display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--brass); color: var(--navy); font-weight: 700; align-items: center; justify-content: center; margin-bottom: 10px; }
.steps strong { display: block; color: #fff; font-weight: 500; margin-bottom: 4px; }

/* Pages and posts */
.page-head { padding: 48px 16px 24px; }
.single { padding-top: 48px; padding-bottom: 48px; }
.entry-head { margin-bottom: 24px; }
.post-meta { color: var(--muted); font-size: .92rem; margin: 0; }
.entry-img img { border-radius: var(--radius); display: block; }
.entry-content { font-size: 1.08rem; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content img { border-radius: 10px; }
.entry-content table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry-content a { overflow-wrap: anywhere; }
/* Tables wider than a phone scroll inside their own box, not the whole page. */
@media (max-width: 700px) {
	.entry-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.entry-content th, .entry-content td { min-width: 120px; }
}
.entry-content blockquote { border-left: 3px solid var(--brass); margin-left: 0; padding-left: 20px; font-size: 1.2rem; color: var(--sea); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card-body { padding: 18px 20px 20px; }
.card-body h3 { margin: 0 0 .4em; font-size: 1.3rem; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body p { margin: 0; color: var(--muted); font-size: .95rem; }

.pagination, .nav-links { display: flex; gap: 12px; justify-content: center; padding: 32px 0; }

/* Footer */
.site-footer { background: var(--navy); color: #9fb4cc; padding: 28px 0; font-size: .9rem; border-top: 1px solid rgba(255,255,255,.08); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; }
.site-footer a { color: #dfe9f5; }

/* WooCommerce: same buttons, colours and corners as the rest of the site. */
.shop { padding-top: 40px; padding-bottom: 56px; }
.woocommerce .button, .woocommerce button.button, .woocommerce a.button, .woocommerce input.button,
.woocommerce #respond input#submit, .woocommerce a.button.alt, .woocommerce button.button.alt,
.wc-block-components-button:not(.is-link) {
	background: var(--coral) !important; color: var(--on-coral) !important; border-radius: 999px !important;
	font-weight: 600; border: 0;
}
.woocommerce .button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover,
.wc-block-components-button:not(.is-link):hover { background: var(--coral-hover) !important; }
.woocommerce ul.products li.product { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px !important; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-weight: 400; font-size: 1.15rem; color: var(--ink); }
.woocommerce ul.products li.product .price, .woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--sea); font-weight: 600; }
.woocommerce span.onsale { background: var(--brass); color: var(--navy); }
.woocommerce-message, .woocommerce-info { border-top-color: var(--sea); }
.woocommerce-message::before, .woocommerce-info::before { color: var(--sea); }
.woocommerce-store-notice, p.demo_store { background: var(--brass); color: var(--navy); }
.woocommerce-store-notice a, p.demo_store a { color: var(--navy); }
.woocommerce-breadcrumb { font-size: .88rem; color: var(--muted); }
