/*
Theme Name: Magicspace
Theme URI: https://magicspace.design/
Author: Hemanth
Description: Custom theme for Magicspace Designers & Developers Private Limited, an architecture, interiors, construction and real estate company in Hyderabad. Includes one-click starter pages, colour-coded service pages, editable block patterns, sidebar widgets, footer menus and built-in SEO markup.
Version: 2.3.3
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: magicspace
Tags: business, custom-logo, custom-menu, featured-images, full-width-template, right-sidebar, block-patterns, block-styles, wide-blocks, theme-options
*/

/**
 * Layout and chrome. Block styles live in assets/css/blocks.css.
 *
 * 1. Base
 * 2. Header and navigation
 * 3. Page hero
 * 4. Page layout and sidebar
 * 5. Footer
 * 6. Posts, 404 and utilities
 */

/* 1. Base
--------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 110px;
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 1.0625rem;
	color: var(--ink);
	background: #fff;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
	overflow-x: clip;
}

img,
svg {
	max-width: 100%;
}

img {
	height: auto;
}

iframe,
video,
embed,
object {
	max-width: 100%;
}

a {
	text-underline-offset: 4px;
	text-decoration-thickness: 1px;
}

::selection {
	color: #fff;
	background: var(--navy-700);
}

:focus-visible {
	outline: 2px solid var(--brass);
	outline-offset: 3px;
}

.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.icon {
	flex-shrink: 0;
	width: 1.05em;
	height: 1.05em;
	vertical-align: middle;
	stroke-width: 1.5;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link:focus {
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 12px 20px;
	clip: auto;
	clip-path: none;
	color: #fff;
	background: var(--navy-900);
}

/* 2. Header and navigation
--------------------------------------------- */
.topbar {
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.7);
	background: var(--navy-950);
}

.topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 40px;
}

.topbar ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.topbar li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.topbar .icon {
	color: var(--brass-light);
}

.topbar a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.topbar a:hover {
	color: #fff;
}

.topbar .social-links {
	gap: 1.1rem;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, 0.98);
	border-bottom: 1px solid var(--line);
	transition: box-shadow 0.3s ease;
}

.admin-bar .site-header {
	top: 32px;
}

.site-header.is-scrolled {
	box-shadow: 0 12px 40px -24px rgba(7, 18, 36, 0.4);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	min-height: 92px;
	transition: min-height 0.3s ease;
}

.is-scrolled .site-header__inner {
	min-height: 76px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.9rem;
	color: var(--navy-900);
	text-decoration: none;
}

.brand__mark {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	font-family: var(--font-display);
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1;
	color: var(--navy-900);
	border: 1px solid var(--navy-900);
	box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px var(--brass);
}

.brand__text {
	display: flex;
	flex-direction: column;
	line-height: 1;
}

.brand__name {
	font-family: var(--font-display);
	font-size: 1.75rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.brand__sub {
	margin-top: 5px;
	font-size: 0.62rem;
	font-weight: 500;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--brass-dark);
}

.brand--light {
	color: #fff;
}

.brand--light .brand__mark {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.7);
	box-shadow: inset 0 0 0 4px var(--navy-950), inset 0 0 0 5px var(--brass);
}

.brand--light .brand__sub {
	color: var(--brass-light);
}

.custom-logo {
	display: block;
	width: auto;
	max-height: 72px;
}

.site-footer .custom-logo {
	max-height: 96px;
}

.main-nav {
	display: flex;
	align-items: center;
	gap: 2rem;
}

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

.main-nav > ul,
.main-nav > div > ul {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.main-nav li {
	position: relative;
}

.main-nav a:not(.wp-element-button) {
	position: relative;
	display: block;
	padding: 0.75rem 0.9rem;
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--navy-900);
	text-decoration: none;
	transition: color 0.2s ease;
}

.main-nav > ul > li > a::after {
	content: "";
	position: absolute;
	right: 0.9rem;
	bottom: 0.35rem;
	left: 0.9rem;
	height: 1px;
	background: var(--brass);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.35s var(--ease);
}

.main-nav > ul > li > a:hover::after,
.main-nav > ul > .current-menu-item > a::after,
.main-nav > ul > .current-menu-ancestor > a::after {
	transform: scaleX(1);
}

/* "Services" links to a section on the home page; never mark it as the current page. */
.main-nav > ul > .menu-item-type-custom.current-menu-item:not(.current-menu-ancestor) > a::after {
	transform: scaleX(0);
}

.menu-item-has-children {
	display: flex;
	align-items: center;
}

.submenu-toggle {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	margin-left: -8px;
	padding: 0;
	color: var(--navy-900);
	background: none;
	border: 0;
	cursor: pointer;
}

.submenu-toggle .icon {
	width: 14px;
	height: 14px;
	transition: transform 0.25s ease;
}

.submenu-toggle[aria-expanded="true"] .icon {
	transform: rotate(180deg);
}

.main-nav .sub-menu {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	z-index: 10;
	min-width: 290px;
	padding: 0.75rem 0;
	background: #fff;
	border-top: 2px solid var(--brass);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0.25s;
}

.main-nav .menu-item-has-children:hover > .sub-menu,
.main-nav .menu-item-has-children:focus-within > .sub-menu,
.main-nav .submenu-toggle[aria-expanded="true"] + .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.main-nav .sub-menu a:not(.wp-element-button) {
	padding: 0.7rem 1.5rem;
	font-size: 0.92rem;
	letter-spacing: 0.02em;
	text-transform: none;
}

.main-nav .sub-menu .menu-service > a:hover {
	color: var(--accent);
	background: var(--accent-tint);
}

.header-cta {
	white-space: nowrap;
}

.nav-toggle {
	display: none;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	color: var(--navy-900);
	background: none;
	border: 1px solid var(--line);
	cursor: pointer;
}

.nav-toggle .icon {
	width: 22px;
	height: 22px;
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-menu {
	display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
	display: block;
}

@media (max-width: 1100px) {
	.nav-toggle {
		display: grid;
	}

	.main-nav {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		display: none;
		flex-direction: column;
		align-items: stretch;
		max-height: calc(100vh - 120px);
		padding: 1rem var(--gutter) 2rem;
		overflow-y: auto;
		background: #fff;
		border-bottom: 1px solid var(--line);
		box-shadow: var(--shadow);
	}

	.main-nav.is-open {
		display: flex;
	}

	.main-nav > ul,
	.main-nav > div > ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.main-nav > ul > li {
		border-bottom: 1px solid var(--line);
	}

	.main-nav > ul > li > a::after {
		display: none;
	}

	.main-nav a:not(.wp-element-button) {
		padding: 1rem 0;
	}

	.menu-item-has-children {
		flex-wrap: wrap;
	}

	.menu-item-has-children > a {
		flex: 1;
	}

	.submenu-toggle {
		width: 44px;
		height: 44px;
	}

	.main-nav .sub-menu {
		position: static;
		display: none;
		flex-basis: 100%;
		min-width: 0;
		padding: 0 0 0.75rem;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.main-nav .submenu-toggle[aria-expanded="true"] + .sub-menu {
		display: block;
	}

	.main-nav .sub-menu a:not(.wp-element-button) {
		padding: 0.6rem 0;
	}

	.header-cta {
		justify-content: center;
		margin-top: 1rem;
	}
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 0;
	}

	.topbar__address,
	.topbar .social-links {
		display: none;
	}
}

@media (max-width: 480px) {
	.topbar li:nth-child(2) {
		display: none;
	}

	.brand__name {
		font-size: 1.45rem;
	}
}

/* 3. Page hero
--------------------------------------------- */
.page-hero {
	/* Never taller than the first screen below the top bar and header (132px). */
	--masthead: 132px;
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: min(clamp(380px, 44vw, 540px), calc(100vh - var(--masthead)));
	min-height: min(clamp(380px, 44vw, 540px), calc(100svh - var(--masthead)));
	padding-block: clamp(28px, 7vh, 112px) clamp(28px, 5vh, 80px);
	overflow: hidden;
	color: #fff;
	background-color: var(--navy-950);
	background-image: radial-gradient(ellipse at 90% 10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%), linear-gradient(160deg, var(--navy-800) 0%, var(--navy-950) 75%);
}

.page-hero::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	height: 4px;
	background: linear-gradient(90deg, var(--accent) 0 30%, var(--brass) 30% 100%);
}

.page-hero--compact {
	min-height: 0;
}

.page-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.page-hero.has-image::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg, rgba(7, 18, 36, 0.9) 0%, rgba(7, 18, 36, 0.55) 55%, rgba(7, 18, 36, 0.25) 100%);
}

.page-hero__inner {
	position: relative;
	z-index: 2;
}

.page-hero__eyebrow {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin: clamp(0.75rem, 2.5vh, 2rem) 0 0;
	font-size: 0.76rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--brass-light);
}

.page-hero__eyebrow::before {
	content: "";
	width: 40px;
	height: 1px;
	background: currentColor;
}

.page-hero__title {
	max-width: 900px;
	margin: clamp(0.5rem, 1.5vh, 1rem) 0 0;
	font-family: var(--font-display);
	font-size: clamp(2.3rem, min(6vw, 8.5vh), 5rem);
	font-weight: 600;
	line-height: 1.02;
	letter-spacing: -0.015em;
	color: #fff;
}

.page-hero__lead {
	max-width: 620px;
	margin: clamp(0.75rem, 2vh, 1.5rem) 0 0;
	font-size: clamp(1rem, 1.4vw, 1.2rem);
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.78);
}

.page-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: clamp(1rem, 3vh, 2.25rem);
}

.page-hero__actions .wp-element-button {
	color: var(--navy-950);
	background: var(--brass-light);
}

.page-hero__actions .wp-element-button:hover {
	background: #fff;
}

.page-hero__actions .is-outline {
	color: #fff;
	background: transparent;
	border-color: rgba(255, 255, 255, 0.45);
}

.page-hero__actions .is-outline:hover {
	color: var(--navy-950);
	background: #fff;
}

.placeholder-label {
	display: none;
}

.show-placeholders .placeholder-label {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 4px 10px;
	font-size: 0.68rem;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.65);
	border: 1px dashed rgba(255, 255, 255, 0.35);
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	font-size: 0.76rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	list-style: none;
	color: rgba(255, 255, 255, 0.55);
}

.breadcrumbs li + li::before {
	content: "/";
	margin-right: 0.6rem;
	opacity: 0.5;
}

.breadcrumbs a {
	color: rgba(255, 255, 255, 0.85);
	text-decoration: none;
}

.breadcrumbs a:hover {
	color: var(--brass-light);
}

/* 4. Page layout and sidebar
--------------------------------------------- */
.page-layout {
	padding-block: clamp(64px, 8vw, 112px);
}

.has-sidebar .page-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	align-items: start;
	gap: clamp(40px, 5vw, 80px);
}

.entry-content > * + * {
	margin-top: 1.5rem;
}

.entry-content--full > .alignfull {
	margin-block: 0;
}

.entry-content--full > :not(.alignfull) {
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.ms-service-body > .wp-block-heading:not(:first-of-type) {
	margin-top: clamp(56px, 6vw, 80px);
}

.ms-service-body > h2 + * {
	margin-top: 2rem !important;
}

.sidebar {
	position: sticky;
	top: 120px;
	display: grid;
	gap: 1.5rem;
}

.widget {
	padding: 32px;
	background: #fff;
	border: 1px solid var(--line);
}

.widget_block:has(.is-style-cta-card) {
	padding: 0;
	border: 0;
}

.widget-title {
	margin: 0 0 1.25rem;
	font-family: var(--font-display);
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1.1;
	color: var(--navy-900);
}

.widget p {
	margin: 0 0 1.25rem;
	color: var(--muted);
}

.widget .is-style-cta-card p {
	color: rgba(255, 255, 255, 0.78);
}

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

.widget_nav_menu li {
	border-top: 1px solid var(--line);
}

.widget_nav_menu li:last-child {
	border-bottom: 1px solid var(--line);
}

.widget_nav_menu a {
	display: block;
	padding: 1rem 0.25rem;
	font-weight: 500;
	color: var(--navy-900);
	text-decoration: none;
	transition: color 0.2s ease, padding 0.3s var(--ease);
}

.widget_nav_menu a:hover,
.widget_nav_menu .current-menu-item > a {
	padding-left: 0.75rem;
	color: var(--accent);
}

.contact-list {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.contact-list li {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
}

.contact-list .icon {
	margin-top: 0.25em;
	color: var(--brass-dark);
}

.contact-list a {
	color: inherit;
	text-decoration: none;
}

.contact-list a:hover {
	color: var(--accent);
}

@media (max-width: 1000px) {
	.has-sidebar .page-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar {
		position: static;
	}
}

/* 5. Footer
--------------------------------------------- */
.site-footer {
	color: rgba(255, 255, 255, 0.62);
	background: var(--navy-950);
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 0.9fr 0.8fr 1.5fr;
	gap: clamp(28px, 3vw, 44px);
	padding-block: clamp(72px, 8vw, 104px);
}

.footer-tagline {
	margin: 1.75rem 0 0.75rem;
	font-family: var(--font-display);
	font-size: 1.6rem;
	font-style: italic;
	font-weight: 500;
	line-height: 1.25;
	color: #fff;
}

.footer-about p:not(.footer-tagline) {
	margin: 0;
	font-size: 0.95rem;
}

.footer-about .social-links {
	margin-top: 1.75rem;
}

.footer-title {
	margin: 0.5rem 0 1.5rem;
	font-family: var(--font-display);
	line-height: 1.2;
	font-size: 0.74rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--brass-light);
}

.footer-menu {
	display: grid;
	gap: 0.8rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer a {
	color: rgba(255, 255, 255, 0.78);
	text-decoration: none;
	transition: color 0.2s ease;
}

.site-footer a:hover {
	color: #fff;
}

.site-footer .contact-list .icon {
	color: var(--brass-light);
}

.social-links {
	display: flex;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer .social-links a {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.site-footer .social-links a:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: var(--brass);
}

.footer-widgets {
	padding-bottom: 48px;
}

.footer-widgets .widget {
	color: inherit;
	background: rgba(255, 255, 255, 0.03);
	border-color: rgba(255, 255, 255, 0.1);
}

.footer-bottom {
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 2rem;
	padding-block: 1.5rem;
}

.footer-bottom p {
	margin: 0;
}

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

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

	.footer-about {
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.footer-about .social-links {
		justify-content: center;
	}
}

.whatsapp-float {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 90;
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	color: #fff;
	background: #1e9e52;
	border-radius: 50%;
	box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.5);
	transition: transform 0.25s var(--ease);
}

.whatsapp-float:hover {
	transform: translateY(-3px);
}

.whatsapp-float .icon {
	width: 24px;
	height: 24px;
	stroke-width: 2;
}

/* 6. Posts, 404 and utilities
--------------------------------------------- */
.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2.5rem;
}

.post-card {
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
}

.post-card img {
	width: 100%;
	height: auto;
}

.post-card__title {
	font-family: var(--font-display);
	font-size: 1.7rem;
	font-weight: 600;
}

.post-card__title a {
	color: var(--navy-900);
	text-decoration: none;
}

.entry-meta {
	font-size: 0.85rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.link-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.link-grid a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem 1.25rem 1.5rem 0;
	font-family: var(--font-display);
	font-size: 1.6rem;
	font-weight: 600;
	color: var(--accent);
	text-decoration: none;
	border-bottom: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

@media (min-width: 601px) {
	.site-footer .nowrap {
		white-space: nowrap;
	}
}

/* 7. Responsive refinements
--------------------------------------------- */
.entry-content .wp-block-table {
	max-width: 100%;
	overflow-x: auto;
}

/* Laptops: fit the full menu and button on one line. */
@media (min-width: 1101px) and (max-width: 1280px) {
	.site-header__inner,
	.main-nav {
		gap: 1rem;
	}

	.main-nav a:not(.wp-element-button) {
		padding-inline: 0.6rem;
		letter-spacing: 0.1em;
	}

	.main-nav > ul > li > a::after {
		right: 0.6rem;
		left: 0.6rem;
	}
}

@media (max-width: 1100px) {
	.main-nav {
		max-height: calc(100dvh - 120px);
	}
}

@media (max-width: 782px) {
	.site-header__inner {
		gap: 1rem;
		min-height: 76px;
	}

	.is-scrolled .site-header__inner {
		min-height: 68px;
	}

	.page-hero__title {
		overflow-wrap: break-word;
	}
}

@media (max-width: 480px) {
	.brand {
		gap: 0.6rem;
	}

	.brand__mark {
		width: 40px;
		height: 40px;
		font-size: 1.5rem;
	}

	.brand__sub {
		font-size: 0.55rem;
		letter-spacing: 0.16em;
	}

	.nav-toggle {
		width: 44px;
		height: 44px;
	}

	.page-hero__title {
		font-size: clamp(2rem, 9.5vw, 2.6rem);
	}

	.page-hero__eyebrow,
	.breadcrumbs ol {
		letter-spacing: 0.14em;
	}

	.widget {
		padding: 24px 20px;
	}

	.page-hero__actions .wp-element-button {
		justify-content: center;
		width: 100%;
	}
}

@media (max-width: 360px) {
	.brand__sub {
		display: none;
	}
}
