/*
Theme Name:        Damson Website Design
Theme URI:         https://damsonwebsitedesign.co.uk/
Description:       Divi child theme by Damson Website Design.
Author:            Damson Website Design
Author URI:        https://damsonwebsitedesign.co.uk/
Template:          Divi
Version:           1.0.0
Requires at least: 6.0
Requires PHP:      7.4
Text Domain:       damson-website-design
Domain Path:       /languages
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   1. Per-client settings
   --------------------------------------------------------------------------
   Change these values for each client site. Everything below uses them, so
   this is the only block you normally need to edit. The defaults are neutral
   on purpose: Damson colours are NOT applied to client front ends.
   Tip: match --dwd-primary / --dwd-accent to the colours set in
   Divi > Theme Options > General so the Builder and this file agree.
   ========================================================================== */
:root {
	/* Brand colours */
	--dwd-primary:        #1f2937; /* Main brand colour: links, focus rings, highlights */
	--dwd-primary-hover:  #111827; /* Darker shade of primary for hover states */
	--dwd-accent:         #2563eb; /* Secondary colour: buttons, badges, small details */
	--dwd-accent-contrast:#ffffff; /* Text colour that sits on top of --dwd-accent */

	/* Text and surfaces */
	--dwd-text:           #1f2933; /* Body text */
	--dwd-text-muted:     #5b6672; /* Captions, meta, small print */
	--dwd-heading:        #111827; /* Headings */
	--dwd-surface:        #ffffff; /* Page background */
	--dwd-surface-alt:    #f5f6f8; /* Alternate section background (.dwd-surface-alt) */
	--dwd-border:         #e3e6ea; /* Lines, dividers, card borders */

	/* Typography: fonts are chosen in Divi; these only fine-tune */
	--dwd-line-height:    1.7;     /* Body line height */
	--dwd-heading-line:   1.2;     /* Heading line height */
	--dwd-measure:        68ch;    /* Comfortable max line length (.dwd-measure) */

	/* Spacing scale used by the helper classes below */
	--dwd-space-xs:       0.5rem;
	--dwd-space-sm:       1rem;
	--dwd-space-md:       2rem;
	--dwd-space-lg:       4rem;
	--dwd-space-xl:       6rem;

	/* Shape */
	--dwd-radius:         8px;     /* Corner radius for .dwd-card, focus rings, etc. */

	/* Header height for anchor links. Set to your fixed header height so
	   #anchors don't hide under it. Use 0px if the header is not fixed. */
	--dwd-header-offset:  90px;

	/* Focus ring for keyboard users */
	--dwd-focus:          var(--dwd-accent);
}

/* ==========================================================================
   2. Base
   ========================================================================== */
html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--dwd-header-offset);
}

/* WordPress admin bar adds height when logged in */
.admin-bar {
	--dwd-admin-bar: 32px;
}
@media (max-width: 782px) {
	.admin-bar { --dwd-admin-bar: 46px; }
}
html:has(body.admin-bar) {
	scroll-padding-top: calc(var(--dwd-header-offset) + 32px);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Images: never overflow, keep proportions, no gaps under inline images */
img {
	max-width: 100%;
	height: auto;
}
.et_pb_image img,
.et_pb_gallery_image img {
	vertical-align: middle;
}

/* ==========================================================================
   3. Accessibility
   ========================================================================== */

/* Visible focus for keyboard users only (mouse clicks stay clean) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.et_pb_button:focus-visible,
.et_pb_menu__icon:focus-visible,
.mobile_menu_bar:focus-visible {
	outline: 3px solid var(--dwd-focus);
	outline-offset: 3px;
	border-radius: 2px;
}

/* Divi buttons: keep a ring on keyboard focus */
.et_pb_button:focus-visible {
	box-shadow: 0 0 0 3px var(--dwd-surface), 0 0 0 6px var(--dwd-focus);
	outline: none;
}

/* Skip link support (if a plugin or child template adds one) */
.screen-reader-text:focus {
	clip: auto !important;
	clip-path: none;
	height: auto;
	width: auto;
	padding: 0.75rem 1rem;
	background: var(--dwd-surface);
	color: var(--dwd-text);
	z-index: 100000;
}

/* Respect "reduce motion" in the visitor's system settings */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
	/* Divi entrance animations: show content straight away */
	.et_animated,
	.et-waypoint,
	.et_pb_animation_off {
		opacity: 1 !important;
		animation: none !important;
		transform: none !important;
	}
	.et_parallax_bg {
		transform: none !important;
	}
}

/* ==========================================================================
   4. Divi fixes
   ========================================================================== */

/* Mobile menu: scrolls if long, bigger tap targets, clear dividers */
@media (max-width: 980px) {
	#main-header .et_mobile_menu,
	.et_pb_menu .et_mobile_menu {
		max-height: calc(100vh - var(--dwd-header-offset));
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: var(--dwd-space-xs) 0;
		border-top-color: var(--dwd-primary);
	}
	.et_mobile_menu li a {
		padding: 12px 5%;
		font-size: 16px;
		line-height: 1.4;
		border-bottom: 1px solid var(--dwd-border);
	}
	.et_mobile_menu li:last-child > a {
		border-bottom: 0;
	}
	/* Sub-menu items: indent instead of stacking flat */
	.et_mobile_menu li li a {
		padding-left: 10%;
		font-size: 15px;
	}
	.mobile_menu_bar {
		cursor: pointer;
	}
}

/* Stop very long words / URLs breaking narrow layouts */
.et_pb_text,
.et_pb_post_content,
.entry-content {
	overflow-wrap: break-word;
}

/* Form fields: prevent iOS zoom on focus (needs 16px+) */
@media (max-width: 767px) {
	input,
	select,
	textarea,
	.et_pb_contact_form input,
	.et_pb_contact_form textarea {
		font-size: 16px !important;
	}
}

/* ==========================================================================
   5. Helper classes
   --------------------------------------------------------------------------
   Add these in Divi: Module/Row/Section > Advanced > CSS Class.
   ========================================================================== */

/* Text */
.dwd-measure      { max-width: var(--dwd-measure); }
.dwd-measure.dwd-center,
.dwd-center .dwd-measure { margin-left: auto; margin-right: auto; }
.dwd-center       { text-align: center; }
.dwd-muted        { color: var(--dwd-text-muted); }
.dwd-lead         { font-size: 1.15em; line-height: 1.6; }
.dwd-balance      { text-wrap: balance; }
.dwd-eyebrow {
	display: inline-block;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dwd-accent);
}

/* Colours */
.dwd-text-primary { color: var(--dwd-primary) !important; }
.dwd-text-accent  { color: var(--dwd-accent) !important; }
.dwd-surface-alt  { background-color: var(--dwd-surface-alt) !important; }

/* Spacing (use on sections, rows or modules) */
.dwd-pad-sm { padding-top: var(--dwd-space-md) !important; padding-bottom: var(--dwd-space-md) !important; }
.dwd-pad-md { padding-top: var(--dwd-space-lg) !important; padding-bottom: var(--dwd-space-lg) !important; }
.dwd-pad-lg { padding-top: var(--dwd-space-xl) !important; padding-bottom: var(--dwd-space-xl) !important; }
.dwd-mb-0   { margin-bottom: 0 !important; }
.dwd-mb-sm  { margin-bottom: var(--dwd-space-sm) !important; }
.dwd-mb-md  { margin-bottom: var(--dwd-space-md) !important; }

/* Card */
.dwd-card {
	background: var(--dwd-surface);
	border: 1px solid var(--dwd-border);
	border-radius: var(--dwd-radius);
	padding: var(--dwd-space-md);
}
.dwd-rounded,
.dwd-rounded img { border-radius: var(--dwd-radius); overflow: hidden; }

/* Equal-height columns in a Divi row (add to the Row) */
.dwd-equal-height,
.dwd-equal-height > .et_pb_column { display: flex; }
.dwd-equal-height { flex-wrap: wrap; }
.dwd-equal-height > .et_pb_column { flex-direction: column; }
.dwd-equal-height > .et_pb_column > .et_pb_module:last-child { margin-top: auto; }
@media (max-width: 980px) {
	.dwd-equal-height { display: block; }
}

/* Visibility */
@media (max-width: 767px)  { .dwd-hide-phone  { display: none !important; } }
@media (min-width: 768px) and (max-width: 980px) { .dwd-hide-tablet { display: none !important; } }
@media (min-width: 981px)  { .dwd-hide-desktop { display: none !important; } }

/* ==========================================================================
   6. Client custom CSS
   --------------------------------------------------------------------------
   Add site-specific styles below this line.
   ========================================================================== */
