/*
Theme Name: Romy
Theme URI: https://romy.pennylamont.com/
Description: A fashion and lifestyle child theme for Divi 5.
Author: Penny Lamont
Author URI: https://pennylamont.com/
Template: Divi
Version: 1.0.8
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, one-column, two-columns, grid-layout, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, theme-options
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: romy
*/

/*
 * Blog grid: equal-height cards with Read More aligned along the bottom.
 * Add the class romy-blog-grid to a Blog module (Advanced > Attributes).
 */
.romy-blog-grid .et_pb_post {
	display: flex;
	flex-direction: column;
}

.romy-blog-grid .post-content {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.romy-blog-grid .post-content-inner {
	margin-bottom: 20px;
}

.romy-blog-grid .post-content a.more-link {
	margin-top: auto;
	align-self: flex-start;
}

/*
 * Header: search icon moved to the far right of the main bar (desktop).
 * The main menu module carries the class romy-main-menu (Advanced > Attributes).
 * The right offset is tied to the header's 3/18/3 column split: change the
 * split and this value must change too.
 */
@media (min-width: 981px) {
	.et_pb_menu.romy-main-menu .et_pb_menu_inner_container {
		width: 100%;
	}

	.et_pb_menu.romy-main-menu .et_pb_menu__search-button {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		right: calc(-16.667% - 15px);
	}

	/*
	 * Journal dropdown: arrow centred on the link text, and the dropdown
	 * drops from the header's bottom line (28px = main bar bottom padding
	 * below the menu links). The ::before bridge keeps hover alive across
	 * that gap. Change the main bar padding and 28px must change too.
	 */
	.et_pb_menu.romy-main-menu .nav > li.menu-item-has-children > a::after {
		top: 50%;
		transform: translateY(-50%);
		right: -6px;
	}

	.et_pb_menu.romy-main-menu .nav > li > .sub-menu {
		top: calc(100% + 28px);
	}

	.et_pb_menu.romy-main-menu .nav > li > .sub-menu::before {
		content: '';
		position: absolute;
		left: 0;
		right: 0;
		bottom: 100%;
		height: 32px;
	}
}

/*
 * Header (tablet and phone): search and hamburger sit at the right edge,
 * and the dropdown menu and search box are half the screen width, anchored
 * to the right edge so the search box never runs behind the logo.
 * !important is needed to beat Divi's generated centred alignment.
 */
@media (max-width: 980px) {
	.et_pb_menu.romy-main-menu .et_pb_menu__wrap {
		justify-content: flex-end !important;
	}

	.et_pb_menu.romy-main-menu .et_mobile_menu,
	.et_pb_menu.romy-main-menu .et_pb_menu__search-container {
		left: auto;
		right: 0;
		width: 50vw;
	}
}

/*
 * Arrow buttons: the icon slides right on hover, matching the ShopCard
 * "Shop now" buttons. Applies to buttons using the Romy - Button Text Arrow
 * and Romy - Button Text Link presets. Uses the translate property so it
 * adds to Divi's own icon positioning rather than replacing it.
 */
.et_pb_button.preset--module--divi-button--9bfef3f6-062a-4492-8ce8-db12d91da72a::after,
.et_pb_button.preset--module--divi-button--7ba3edab-d810-48db-b661-294b7e9a4ae5::after {
	transition: translate 0.2s ease, opacity 0.2s ease;
}

.et_pb_button.preset--module--divi-button--9bfef3f6-062a-4492-8ce8-db12d91da72a:hover::after,
.et_pb_button.preset--module--divi-button--7ba3edab-d810-48db-b661-294b7e9a4ae5:hover::after {
	translate: 4px 0;
}

@media (prefers-reduced-motion: reduce) {
	.et_pb_button.preset--module--divi-button--9bfef3f6-062a-4492-8ce8-db12d91da72a:hover::after,
	.et_pb_button.preset--module--divi-button--7ba3edab-d810-48db-b661-294b7e9a4ae5:hover::after {
		translate: none;
	}
}
