/*
Theme Name: Everest Metal
Theme URI: https://www.everestmetal.com
Author: Everest Metal Industries
Author URI: https://www.everestmetal.com
Description: Official WordPress block theme for Everest Metal Industries — precision brass components manufacturer and exporter, Jamnagar, India, since 1982. Full Site Editing theme: every template, page, image and block is editable in the WordPress Site Editor. Includes ready-made pages, product category layouts, catalogue download section and built-in SEO markup.
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: everest-metal
Tags: block-patterns, full-site-editing, one-column, custom-colors, custom-logo, custom-menu, editor-style, featured-images, wide-blocks
*/

/* =========================================================
   Everest Metal — supplementary styles
   (Design tokens live in theme.json; this file adds polish.)
   ========================================================= */

/* ---------- Header ---------- */
.em-header {
	position: sticky;
	top: 0;
	z-index: 90;
	border-bottom: 3px solid var(--wp--preset--color--primary);
	box-shadow: 0 1px 12px rgba(20, 22, 26, 0.08);
}
body.admin-bar .em-header { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .em-header { top: 46px; }
}
.em-header .wp-block-navigation a:hover,
.em-header .wp-block-navigation .current-menu-item > a {
	color: var(--wp--preset--color--primary);
}
.em-topbar a { color: inherit; text-decoration: none; }
.em-topbar a:hover { text-decoration: underline; }
@media screen and (max-width: 781px) {
	.em-hide-mobile { display: none !important; }
}

/* ---------- Buttons ---------- */
.wp-block-button__link {
	text-transform: uppercase;
	letter-spacing: 0.05em;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.wp-block-button__link:hover {
	box-shadow: 0 6px 18px rgba(237, 28, 36, 0.28);
}
.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	box-shadow: none;
}

/* ---------- Cards ---------- */
.em-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.em-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 16px 34px rgba(20, 22, 26, 0.12);
	border-color: transparent;
}
.em-card img { transition: transform 0.4s ease; }
.em-card:hover img { transform: scale(1.04); }
.em-card a { text-decoration: none; }

.em-feature {
	border-top: 3px solid var(--wp--preset--color--primary);
	border-radius: 0 0 6px 6px;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.em-feature:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

/* ---------- Typography helpers ---------- */
.em-overline {
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-weight: 700;
}
.em-stat h3, .em-stat .wp-block-heading { line-height: 1; }

/* ---------- Checked lists ---------- */
ul.em-list-check, ul.is-style-check { list-style: none; padding-left: 0; }
ul.em-list-check li, ul.is-style-check li {
	position: relative;
	padding-left: 1.75em;
	margin-bottom: 0.65em;
}
ul.em-list-check li::before, ul.is-style-check li::before {
	content: "\2713";
	position: absolute;
	left: 0;
	top: 0;
	font-weight: 900;
	color: var(--wp--preset--color--primary);
}
.has-charcoal-background-color ul.em-list-check li::before,
.has-charcoal-background-color ul.is-style-check li::before,
.has-charcoal-deep-background-color ul.em-list-check li::before,
.has-charcoal-deep-background-color ul.is-style-check li::before {
	color: var(--wp--preset--color--brass);
}

/* ---------- Product listing cards ---------- */
.em-plist .em-plist-img img {
	width: 100%;
	height: 215px;
	object-fit: contain;
	background: #ffffff;
	padding: 14px;
	box-sizing: border-box;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.em-plist h3 { margin-top: 0.2rem; }
@media (max-width: 781px) {
	.em-plist .em-plist-img img { height: 190px; }
}

/* ---------- Tag chips ---------- */
.em-chip {
	display: inline-block;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	padding: 0.35em 1.1em;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--ink-soft);
	background: var(--wp--preset--color--base);
}

/* ---------- Footer ---------- */
.em-footer a { text-decoration: none; }
.em-footer a:hover { color: var(--wp--preset--color--brass) !important; text-decoration: underline; }
.em-footer .wp-block-image img { max-height: 56px; width: auto; }
.em-tricolor {
	height: 4px;
	background: linear-gradient(to right, #f5891f 33.3%, #ffffff 33.3% 66.6%, #0b8a44 66.6%);
}

/* ---------- Misc ---------- */
.em-badge-strip img { max-height: 76px; width: auto; }
.wp-site-blocks > main { display: block; }
img { height: auto; }
.em-page-hero { border-bottom: 4px solid var(--wp--preset--color--primary); }

/* ---------- Hero slider ---------- */
.em-slider { position: relative; overflow: hidden; }
/* Slides are only hidden once the front-end script initialises (adds
   .em-slider-ready), so all slides stay visible & editable in the editor. */
.em-slider.em-slider-ready > .em-slide { display: none; }
.em-slider.em-slider-ready > .em-slide.is-active {
	display: flex;
	animation: em-slide-in 0.7s ease;
}
@keyframes em-slide-in {
	from { opacity: 0; transform: translateX(28px); }
	to { opacity: 1; transform: translateX(0); }
}
.em-slider-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(0, 0, 0, 0.3);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
.em-slider-arrow:hover { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); }
.em-slider-arrow.em-prev { left: 18px; }
.em-slider-arrow.em-next { right: 18px; }
.em-slider-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 18px;
	display: flex;
	justify-content: center;
	gap: 10px;
	z-index: 5;
}
.em-slider-dots button {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}
.em-slider-dots button.is-active { background: var(--wp--preset--color--primary); transform: scale(1.25); }
@media (max-width: 781px) {
	.em-slider-arrow { display: none; }
}

/* ---------- Catalogue flipbook overlay ---------- */
.em-fb-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(12, 13, 16, 0.97);
	display: flex;
	flex-direction: column;
}
.em-fb-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 20px;
	color: #fff;
	font-size: 0.9rem;
	background: rgba(0, 0, 0, 0.35);
}
.em-fb-toolbar .em-fb-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-fb-actions { display: flex; align-items: center; gap: 10px; }
.em-fb-btn {
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: transparent;
	color: #fff;
	border-radius: 4px;
	padding: 7px 14px;
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	line-height: 1;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.em-fb-btn:hover { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); color: #fff; }
.em-fb-btn.em-fb-close { font-size: 1rem; }
.em-fb-stage {
	flex: 1;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px 70px;
	min-height: 0;
}
.em-fb-book { max-width: 100%; max-height: 100%; }
.em-fb-book img { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); }
.em-fb-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	z-index: 3;
	transition: background 0.2s ease;
}
.em-fb-arrow:hover { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); }
.em-fb-arrow.em-fb-prev { left: 14px; }
.em-fb-arrow.em-fb-next { right: 14px; }
.em-fb-status { color: #cfd2d8; font-size: 0.85rem; text-align: center; padding-bottom: 12px; }
.em-fb-loading {
	color: #fff;
	font-size: 1rem;
	text-align: center;
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 14px;
}
.em-fb-loading .em-fb-spin {
	width: 42px;
	height: 42px;
	border: 4px solid rgba(255, 255, 255, 0.2);
	border-top-color: var(--wp--preset--color--primary);
	border-radius: 50%;
	animation: em-fb-rot 0.9s linear infinite;
}
@keyframes em-fb-rot { to { transform: rotate(360deg); } }
@media (max-width: 781px) {
	.em-fb-stage { padding: 10px 8px; }
	.em-fb-arrow.em-fb-prev { left: 4px; }
	.em-fb-arrow.em-fb-next { right: 4px; }
}
body.em-fb-open { overflow: hidden; }

/* Table styling for spec tables users may add */
.wp-block-table { overflow-x: auto; }
.wp-block-table table { border-collapse: collapse; }
.wp-block-table td, .wp-block-table th { border: 1px solid var(--wp--preset--color--line); padding: 0.6em 1em; }
.wp-block-table thead th { background: var(--wp--preset--color--mist); }

/* =========================================================
   Responsive refinements
   ========================================================= */

/* Safety net: bare blocks placed directly in post content (outside the
   padded sections) never touch the screen edge on small devices. */
@media (max-width: 820px) {
	.wp-block-post-content > :where(:not(.alignfull):not(.alignwide)) {
		padding-left: var(--wp--preset--spacing--40);
		padding-right: var(--wp--preset--spacing--40);
	}
	.wp-block-post-content > .alignwide {
		padding-left: var(--wp--preset--spacing--40);
		padding-right: var(--wp--preset--spacing--40);
	}
}

/* Tablet & mobile */
@media (max-width: 781px) {
	/* Slider slides: let height follow content, tighten padding,
	   keep dots clear of the buttons */
	.em-slider > .em-slide {
		min-height: 480px !important;
		padding-bottom: var(--wp--preset--spacing--70) !important;
	}
	.em-slider .wp-block-cover__inner-container { width: 100%; }
	.em-slide .wp-block-image img {
		max-height: 260px;
		width: auto;
		margin: 0 auto;
		display: block;
	}
	.em-slide h1, .em-slide h2 { font-size: clamp(1.6rem, 7vw, 2.2rem) !important; }

	/* Section rhythm: slightly tighter vertical padding */
	.em-page-hero { padding-top: var(--wp--preset--spacing--50) !important; padding-bottom: var(--wp--preset--spacing--50) !important; }

	/* Stats strip: two per row, centred */
	.em-badge-strip { justify-content: center !important; gap: 1.25rem; }
	.em-stat { text-align: center; }

	/* Header: keep logo readable, centre items when they wrap */
	.em-header .wp-block-site-logo img { max-width: 150px; height: auto; }
	.em-topbar .wp-block-group { justify-content: center; }

	/* Cards get breathing room when columns stack */
	.wp-block-columns .em-card,
	.wp-block-columns .em-feature { margin-bottom: var(--wp--preset--spacing--30); }

	/* Footer columns: centre the logo block */
	.em-footer .wp-block-image { text-align: left; }

	/* Flipbook: smaller toolbar, full-width status */
	.em-fb-toolbar { flex-wrap: wrap; padding: 10px 12px; }
	.em-fb-btn { padding: 6px 10px; font-size: 0.8rem; }
	.em-fb-status { font-size: 0.75rem; padding: 0 10px 10px; }
}

/* Small phones */
@media (max-width: 480px) {
	.em-slider > .em-slide { min-height: 420px !important; }
	.em-slide .wp-block-image img { max-height: 200px; }
	h1 { word-break: break-word; }
	.wp-block-button { width: 100%; }
	.wp-block-button__link { width: 100%; text-align: center; }
	.wp-block-buttons { width: 100%; }
}

/* Large screens: cap hero slide height so it doesn't tower */
@media (min-width: 1600px) {
	.em-slider > .em-slide { min-height: 680px !important; }
}
