/*
Theme Name: DMHouse Theme
Theme URI: https://dmhouse.market/dmhouse-theme
Author: DM House
Author URI: https://dmhouse.market
Description: A completely blank, ultra-optimized parent theme built for Elementor and WooCommerce. Zero design, maximum performance. Designed as a foundation for premium DM House child themes.
Version: 1.5.3
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dmhouse-theme
Tags: elementor, woocommerce, e-commerce, translation-ready, full-width-template
*/

/* -------------------------------------------------------------------------
 * DMHouse Theme — Bare minimum structural resets ONLY.
 *
 * This file intentionally contains NO visual/aesthetic styling.
 * Its sole purpose is to keep default WordPress markup and WooCommerce
 * forms structurally usable. All design belongs in child themes / Elementor.
 * ---------------------------------------------------------------------- */

/* Layout token only — no colors. Child themes add brand tokens on top. */
:root {
	--dmhouse-content-width: 1140px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	padding: 0;
}

/* -------------------------------------------------------------------------
 * Global horizontal-scroll failsafes. Guarantees a 100% responsive baseline
 * so no element (wide media, tables, embeds, long strings) can push the page
 * wider than the viewport.
 * ---------------------------------------------------------------------- */
html,
body {
	max-width: 100%;
	/* `clip` prevents horizontal overflow WITHOUT turning html/body into a
	 * scroll container — unlike `hidden`, which breaks every `position: sticky`
	 * scroll-pinned section on the page. `hidden` stays as a fallback for old
	 * browsers that don't support `clip`. */
	overflow-x: hidden;
	overflow-x: clip;
}

.dmhouse-site {
	max-width: 100vw;
}

/* Never let a long unbroken string (URLs, tokens) blow out the layout. */
body,
p,
li,
dd,
dt,
h1, h2, h3, h4, h5, h6,
a,
span,
td,
th,
figcaption,
.dmhouse-entry__content {
	overflow-wrap: break-word;
	word-wrap: break-word;
}

/* Wide block-level content scrolls inside itself, not the page. */
pre,
table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

/* Media should never overflow its container. */
img,
svg,
video,
canvas,
iframe,
embed,
object {
	max-width: 100%;
	height: auto;
}

/* Structural page wrapper — no visual styling. */
.dmhouse-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.dmhouse-site__main {
	flex: 1 0 auto;
}

/* Minimal default header/footer chrome so a fresh install isn't blank.
 * A built Elementor header/footer replaces these entirely. */
.dmhouse-site__header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	padding-top: 16px;
	padding-bottom: 16px;
}

/* Cap the custom logo so a large upload can't blow up the header. */
.dmhouse-branding img,
.dmhouse-branding .custom-logo {
	max-height: 56px;
	width: auto;
	height: auto;
}

.dmhouse-branding__title {
	font-size: 1.4rem;
	font-weight: 700;
	text-decoration: none;
}

.dmhouse-branding__desc {
	margin: 2px 0 0;
	font-size: 0.85rem;
	opacity: 0.7;
}

/* Horizontal, un-bulleted nav — covers both wp_nav_menu and the
 * wp_page_menu fallback (which wraps its list in a div). */
.dmhouse-nav ul,
.dmhouse-nav__menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dmhouse-nav li {
	list-style: none;
}

.dmhouse-nav a {
	text-decoration: none;
}

.dmhouse-site__footer {
	margin-top: 40px;
}

.dmhouse-site__footer-inner {
	padding-top: 24px;
	padding-bottom: 24px;
	text-align: center;
	font-size: 0.85rem;
	opacity: 0.8;
}

/* Content entries — spacing only, no decoration. */
.dmhouse-entry {
	margin-bottom: 40px;
}

.dmhouse-entry__thumbnail {
	margin-bottom: 16px;
}

.dmhouse-archive-header {
	margin-bottom: 30px;
}

/* Footer widget columns — responsive grid, layout only. */
.dmhouse-footer-widgets {
	display: grid;
	gap: 30px;
	margin-bottom: 24px;
	text-align: start;
}

.dmhouse-footer-widgets--cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.dmhouse-footer-widgets--cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.dmhouse-footer-widgets--cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 782px) {
	.dmhouse-footer-widgets {
		grid-template-columns: 1fr;
	}
}

/* Sidebar + widgets — spacing only. */
.dmhouse-sidebar {
	margin-top: 40px;
}

.widget {
	margin-bottom: 30px;
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Structural content container — boxes non-Elementor content so it isn't
 * edge-to-edge. Elementor stretched sections override this via their own JS,
 * and the Canvas / Full Width page templates opt out entirely. */
.dmhouse-container {
	width: 100%;
	max-width: var(--dmhouse-content-width, 1140px);
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
}

/* WordPress core accessibility helper (required for valid markup). */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #fff;
	clip: auto !important;
	clip-path: none;
	display: block;
	height: auto;
	left: 5px;
	padding: 15px 23px 14px;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* Skip link (accessibility requirement). */
.skip-link {
	left: -9999px;
	position: absolute;
	z-index: 999999;
}

.skip-link:focus {
	left: 6px;
	top: 6px;
}

/* Alignment classes required by the WP block/media editor. */
.alignleft {
	float: left;
	margin-right: 1.5em;
}

.alignright {
	float: right;
	margin-left: 1.5em;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* -------------------------------------------------------------------------
 * Minimal WooCommerce structural safeguards.
 * Prevents forms / notices / galleries from collapsing when no CSS is loaded.
 * ---------------------------------------------------------------------- */
.woocommerce form .form-row {
	display: block;
	margin: 0 0 6px;
}

.woocommerce form .form-row label {
	display: block;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
	width: 100%;
}

.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
	display: block;
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}

.woocommerce .screen-reader-text {
	position: absolute;
}

/* Bare structural product grid so the shop loop isn't one giant column.
 * Fixed 3-up on desktop (matches common shop layouts), 2-up tablet, 1-up mobile.
 * Purely layout: zero color, border, or shadow. */
.dmhouse-woocommerce-content ul.products,
.woocommerce ul.products,
.woocommerce-page ul.products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* WooCommerce adds clearfix pseudo-elements that become empty grid cells. */
.dmhouse-woocommerce-content ul.products::before,
.dmhouse-woocommerce-content ul.products::after,
.woocommerce ul.products::before,
.woocommerce ul.products::after {
	content: none;
	display: none;
}

@media (max-width: 900px) {
	.woocommerce ul.products,
	.woocommerce-page ul.products {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.woocommerce ul.products,
	.woocommerce-page ul.products {
		grid-template-columns: 1fr;
	}
}

/* Each card fills its grid cell (100%). The extra always-present .type-product
 * class lifts specificity above WooCommerce's own .columns-N width:30.75%
 * float rule — so it wins everywhere (shop, Elementor widget, [products]),
 * with or without our container wrapper, and without !important. */
.woocommerce ul.products li.product.type-product,
.woocommerce-page ul.products li.product.type-product,
.dmhouse-woocommerce-content ul.products li.product.type-product {
	width: 100%;
	max-width: 100%;
	margin: 0;
	float: none;
	clear: none;
	text-align: center;
}

/* Scoped under our container so specificity beats WooCommerce's own
 * stylesheet (which loads later) and the product image fills the cell. */
.dmhouse-woocommerce-content ul.products li.product a img,
.dmhouse-woocommerce-content ul.products li.product img,
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 0 14px;
}

/* Keep the single-product gallery from overflowing the container. */
.woocommerce div.product .woocommerce-product-gallery {
	max-width: 100%;
}

/* No brand/color layer here by design — the parent theme ships ZERO visual
 * styling. Colors, buttons, and typography live in child themes / Elementor,
 * so third-party plugin and builder designs are never overridden. */

/* -------------------------------------------------------------------------
 * Site typography — migrated from the previous Hello-Elementor child theme.
 * Kept here so the Elementor-built site keeps its exact fonts after the theme
 * switch. Body = Dana, headings = IRANSansX. (On DM House page templates the
 * mockup's DanaFaNum in base.css loads later and wins there by design.)
 * ---------------------------------------------------------------------- */
@font-face {
	font-family: 'Dana';
	src: url('assets/global/fonts/Dana-Bold.woff2') format('woff2');
	font-weight: bold;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Dana';
	src: url('assets/global/fonts/Dana-Regular.woff2') format('woff2');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'IRANSansX';
	src: url('assets/global/fonts/IRANSansX-Black.woff2') format('woff2');
	font-weight: bold;
	font-style: normal;
	font-display: swap;
}

body {
	font-family: 'Dana', 'Noto Sans Arabic', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
	font-family: 'IRANSansX', 'Noto Sans Arabic', sans-serif;
}

h1 { font-size: 28px; }
h2 { font-size: 25px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
h5 { font-size: 15px; }
h6 { font-size: 14px; }

.editor-styles-wrapper {
	font-family: 'Dana', 'Noto Sans Arabic', sans-serif;
}

img {
	max-width: 100%;
	display: block;
}
