/**
 * Front-end only: Astra integration, header, footer, floating contact.
 * Block styling lives in blocks.css (shared with the editor).
 */

/* ==========================================================================
   Typography: Poppins everywhere, including Astra's form elements.
   ========================================================================== */

body,
button,
input,
select,
textarea,
.ast-button,
.ast-custom-button {
	font-family: var(--wp--preset--font-family--poppins);
}

/* ==========================================================================
   Full-width block pages ("Dilverse · Tam genişlik" template, programs)
   ========================================================================== */

.dv-full-width {
	/* Astra pads every top-level group/columns; sections handle their own spacing. */
	--wp--custom--ast-default-block-top-padding: 0;
	--wp--custom--ast-default-block-bottom-padding: 0;
	--wp--custom--ast-default-block-left-padding: 0;
	--wp--custom--ast-default-block-right-padding: 0;
}

/* Sections keep core's side gutters (Astra's rule above would zero them). */
.dv-full-width .entry-content > .has-global-padding {
	padding-right: var(--wp--style--root--padding-right);
	padding-left: var(--wp--style--root--padding-left);
}

.dv-full-width .site-main > article,
.dv-full-width.ast-page-builder-template .site-main > article {
	margin: 0;
	padding: 0;
}

.dv-full-width .entry-content > * {
	margin-top: 0;
	margin-bottom: 0;
}

/* Blocks added straight into the page (not inside a section) stay readable. */
.dv-full-width .entry-content > :where(:not(.alignfull):not(.alignwide)) {
	max-width: min(var(--wp--style--global--content-size, 1232px), calc(100% - 2 * var(--wp--style--root--padding-left)));
	margin-inline: auto;
}

.dv-full-width .entry-content > .alignwide {
	max-width: min(var(--wp--style--global--wide-size, 1440px), calc(100% - 2 * var(--wp--style--root--padding-left)));
	margin-inline: auto;
}

/* Let full-width bands inside sections bleed to the edges. Astra resets this
   with ".ast-page-builder-template.ast-no-sidebar .entry-content .alignfull .alignfull",
   hence the doubled class to outrank it. */
body.dv-full-width .entry-content .has-global-padding > .alignfull.alignfull {
	width: auto;
	max-width: none;
	margin-right: calc(var(--wp--style--root--padding-right) * -1);
	margin-left: calc(var(--wp--style--root--padding-left) * -1);
}

/* ==========================================================================
   Header
   ========================================================================== */

.dv-topbar {
	position: relative;
	z-index: 100;
	background: #fff;
}

.dv-topbar .wp-block-social-links a {
	text-decoration: none;
}

/* On phones the bottom contact bar replaces the top bar. */
@media (max-width: 781px) {
	.dv-topbar {
		display: none;
	}
}

#masthead {
	position: sticky;
	top: 0;
	z-index: 99;
	box-shadow: 0 1px 0 rgba(109, 30, 37, 0.14);
}

.admin-bar #masthead {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	.admin-bar #masthead {
		top: 0; /* The admin bar scrolls away on small screens. */
	}
}

.site-header .custom-logo-link img,
.site-header .site-logo-img img {
	width: auto;
	max-width: none;
	height: 52px;
}

@media (max-width: 921px) {
	.site-header .custom-logo-link img,
	.site-header .site-logo-img img {
		height: 40px;
	}
}

.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link {
	padding-right: 14px;
	padding-left: 14px;
	color: var(--wp--preset--color--brand-dark);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

/* Anchor links (e.g. /#sss) count as "current" on the home page; only real pages should. */
.ast-builder-menu-1 .main-header-menu > .menu-item:hover > .menu-link,
.ast-builder-menu-1 .main-header-menu > .menu-item.current-menu-item:not(.menu-item-type-custom) > .menu-link {
	color: var(--wp--preset--color--brand);
}

.ast-builder-menu-1 .sub-menu {
	border-top: 3px solid var(--wp--preset--color--brand);
	border-radius: 0 0 var(--wp--custom--radius--md) var(--wp--custom--radius--md);
	box-shadow: var(--wp--preset--shadow--card);
}

/* ==========================================================================
   Footer (synced pattern rendered by inc/site-parts.php)
   ========================================================================== */

.dv-footer {
	margin: 0;
	padding: 0;
}

.dv-footer a {
	text-decoration: none;
}

.dv-footer a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Floating contact (desktop) and bottom bar (mobile)
   ========================================================================== */

.dv-float__whatsapp,
.dv-float__cta {
	position: fixed;
	z-index: 90;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: transform 0.2s, background-color 0.2s;
}

.dv-float__whatsapp {
	bottom: 16px;
	left: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 12px;
	background: #000;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
	font-size: 14px;
}

.dv-float__cta {
	top: 40%;
	right: 0;
	padding: 18px 12px;
	border-radius: 0 12px 12px 0;
	background: var(--wp--preset--color--brand);
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	transform: rotate(180deg);
	writing-mode: vertical-rl;
}

.dv-float__whatsapp:hover,
.dv-float__cta:hover {
	color: #fff;
}

.dv-float__whatsapp:hover {
	transform: translateY(-2px);
}

.dv-float__cta:hover {
	background: var(--wp--preset--color--brand-dark);
}

.dv-mobilebar {
	display: none;
}

@media (max-width: 781px) {
	.dv-float {
		display: none;
	}

	body {
		padding-bottom: 64px;
	}

	.dv-mobilebar {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 90;
		display: flex;
		gap: 1px;
		padding-bottom: env(safe-area-inset-bottom);
		background: var(--wp--preset--color--line);
		box-shadow: 0 -4px 16px rgba(42, 20, 22, 0.12);
	}

	.dv-mobilebar a {
		display: flex;
		flex: 1;
		align-items: center;
		justify-content: center;
		gap: 8px;
		min-height: 56px;
		background: #fff;
		color: var(--wp--preset--color--brand-dark);
		font-size: 14px;
		font-weight: 700;
		text-decoration: none;
	}

	.dv-mobilebar a.is-primary {
		background: var(--wp--preset--color--brand);
		color: #fff;
	}
}
