/*
Theme Name: Pliska Pro Child
Description: Child theme of Pliska Pro. Adds the custom homepage design and responsive fixes across the site. Activate Pliska Pro again to undo.
Template: pliska-pro
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: pliska-pro-child
*/

/* Responsive fixes for the Pliska Pro theme, loaded on every page. */

/* Footer: the theme lays it out as a table, and a table grows to fit its widest
   content. The X timeline in the footer is 900px wide, so on phones the whole page
   became 930px and was zoomed out, pushing the menu button off screen. */
.site-footer { table-layout: fixed; }
.site-footer .wp-block-embed,
.site-footer iframe { max-width: 100%; }

/* Videos: the theme does not turn on WordPress's responsive embeds, so a YouTube
   video kept its 506px height on phones and showed tall black bars. Keep the
   width WordPress set (up to the screen) and size the height from the ratio. */
.wp-block-embed.wp-embed-aspect-16-9 iframe { max-width: 100%; height: auto; aspect-ratio: 16 / 9; }
.wp-block-embed.wp-embed-aspect-4-3 iframe { max-width: 100%; height: auto; aspect-ratio: 4 / 3; }

/* Long URLs in post source lists have no spaces to wrap at, so on phones they
   stretched the page up to 517px wide. Let them break when they do not fit. */
.entry-content { overflow-wrap: break-word; }

/* Softly rounded photos and videos in page and post content, to match the homepage. */
.entry-content .wp-block-image img,
.entry-content .wp-block-gallery img,
.entry-content .wp-block-embed.is-type-video iframe { border-radius: 8px; }

/* Dark mode switch: the theme pulls the sun/moon circle up with a -2px margin, so it
   sat high in its track (3.6px above, 5.6px below). Centre it vertically. */
.theme-toggle + div { align-items: center; }
.theme-toggle + div span { margin-top: 0; }
/* From 80em the theme widens the track and moves the moon 2px too far right.
   Stop it the same distance from the right edge as the sun is from the left. */
@media (min-width: 80em) {
	.js-toggle--checked .theme-toggle + div span { transform: translateX(1.875em) scale(0.65); }
}

/* Navbar, tablets and small laptops: use the theme's phone menu instead of
   wrapping the links over two or three rows. Mirrors the theme's own rules
   for screens under 40em. */
@media (min-width: 40em) and (max-width: 1099px) {
	.main-navigation { position: absolute; top: 20px; right: 16px; float: none; width: auto; padding-left: 0; }
	.menu-toggle { display: inline-block; position: relative; z-index: 999; border: none; background-color: transparent; }
	.menu-toggle:focus { outline: 1px solid #bbb; }
	.main-navigation > .dark-mode-widget { display: block !important; position: absolute; top: 0; right: 3.5em; padding: 5px; }

	.slide-menu {
		position: fixed; top: 0; right: 0; bottom: 0; left: 100%;
		opacity: 0; z-index: 1; overflow: auto;
		color: #fff; line-height: 2em;
		transition: 0.4s ease-out all;
	}
	.toggled .slide-menu { left: 0; opacity: 1; z-index: 2; display: flex; height: 100%; pointer-events: auto; }
	#primary-menu {
		position: absolute; top: 25%; width: 100%;
		margin-left: 0; padding: 2em;
		display: flex; flex-direction: column; line-height: 36px;
	}
	#primary-menu > li { position: static; float: none; order: 2; }
	#main-navigation .slide-menu a { display: inline-block; width: 100%; padding: 0; color: #fff; }
	#main-navigation .slide-menu a:hover { text-decoration: underline; }
	/* Search box first, with its icon inside the field, as on phones. */
	#primary-menu > .search-item { order: 1; padding-bottom: 0.5em; }
	#main-navigation .slide-menu .search-item > a { display: none; }
	.slide-menu .search-item .search-form { display: block; }
	.slide-menu .search-item button { background-color: transparent; }
	.slide-menu .dark-mode-menu-item { display: none; }
}

/* Navbar, wider screens: branding and every link on one row. */
@media (min-width: 1100px) {
	.main-navigation-container { display: flex; align-items: center; gap: 1.5rem; }
	.main-navigation-container::after { content: none; }
	.site-branding { float: none; flex: none; width: auto; }
	.main-navigation { float: none; flex: 1; width: auto; padding-left: 0; }
	#primary-menu { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; }
	.site-menu li { float: none; }
	.main-navigation a { padding: 20px 0.75rem; white-space: nowrap; }
	.dark-mode-menu-item .dark-mode-widget { padding: 10px; }
}
