/*
Theme Name: Buggin Music Theme
Theme URI: 
Author: Buggin Da Muggin
Author URI: 
Description: Buggin Da Muggin Music Theme
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.0
License: GNU General Public License v3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: buggin-music-theme
Tags: block-patterns, block-styles, custom-colors, custom-logo, custom-menu, editor-style, full-site-editing, one-column, template-editing, threaded-comments, translation-ready, wide-blocks

/* Defaults
---------------------------------------- */

/* Defaults
---------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

a,
button,
input:focus,
input[type="button"],
input[type="submit"],
textarea:focus,
.wp-element-button {
	transition: all 0.2s ease-in-out;
}

a,
a:focus,
a:hover,
a:not(.wp-element-button) {
	text-decoration-thickness: 1px;
}

b,
strong,
th {
	font-weight: var(--wp--custom--font-weight--medium);
}

mark {
	background: linear-gradient(90deg, var(--wp--preset--color--primary) 0%, var(--wp--preset--color--primary) 100%);
	background-position: 0 85%;
	background-repeat: repeat-x;
	background-size: 100% 15%;
}

/* -- Forms -- */

input,
select,
textarea {
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 0;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: var(--wp--custom--font-weight--light);
	line-height: var(--wp--custom--line-height--body);
	padding: 10px 20px;
	width: 100%;
}

input:focus,
textarea:focus {
	background-color: var(--wp--preset--color--neutral);
	outline: none;
}

input[type="checkbox"],
input[type="image"],
input[type="radio"] {
	width: auto;
}

input[type="button"],
input[type="email"],
input[type="search"],
input[type="submit"],
input[type="text"],
textarea {
	-webkit-appearance: none;
}

::placeholder {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	opacity: 0.5;
}

/* Blocks
---------------------------------------- */

/* -- Code -- */

*:not(.wp-block-code) > code {
	background-color: var(--wp--preset--color--neutral);
	font-size: var(--wp--preset--font-size--small);
	padding: 5px 8px;
}

/* -- Navigation -- */

/* Custom mobile menu */
@media only screen and (max-width: 782px) {
  .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease-in-out;
        z-index: 110000; /* keep behind the menu but above everything else */
  }

  .mobile-menu-overlay.active {
        opacity: 1;
        pointer-events: auto;
        align-items: flex-start;
        justify-content: flex-start;
  }

    /* Ensure the menu is visible when the overlay is active */
    .mobile-menu-overlay.active .primary-menu {
        left: 0;
    }
}

/* Keep sticky header beneath the mobile menu overlay */
.wp-site-blocks > header {
    z-index: 1000;
}

/* -- Navigation Submenu -- */

.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
	background-color: var(--wp--preset--color--contrast);
	border: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	padding: 10px;
}

.wp-block-navigation :where(.wp-block-navigation__submenu-container) a {
	padding: 2px 10px;
}

/* Utility
---------------------------------------- */

/* -- Box Shadow -- */

.is-style-shadow-light {
	box-shadow: var(--wp--preset--shadow--light);
}

.is-style-shadow-solid {
	box-shadow: var(--wp--preset--shadow--solid);
}

/* Media Queries
---------------------------------------- */

@media only screen and (max-width: 600px) {

	/* -- Utility -- */

	.is-style-hidden-mobile {
		display: none !important;
	}

}

@media only screen and (max-width: 782px) {

	/* -- Columns -- */

	.is-style-columns-reverse {
		flex-direction: column-reverse;
	}

}

/* Masonry layout for archive posts */
.posts-masonry .wp-block-post-template {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 1fr;
    grid-auto-flow: dense;
    gap: var(--wp--preset--spacing--small);
}
.posts-masonry .wp-block-post {
    break-inside: avoid;
    margin: 0;
    background: var(--wp--preset--color--neutral);
    padding: var(--wp--preset--spacing--small);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease-in-out;
}
.posts-masonry .wp-block-post:hover {
    transform: translateY(-4px);
}
.posts-masonry .wp-block-post-excerpt__excerpt {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.posts-masonry .wp-block-post-excerpt__more-link,
.wp-block-post-excerpt__more-link {
    margin-top: auto;
    margin-left: auto;
    display: inline-block;
    border-radius: 4px;
    background-color: #6600cc;
    border: none;
    color: #FFFFFF;
    text-align: center;
    font-size: 16px;
    padding: 10px 16px;
    width: auto;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    margin: 5px;
    position: relative;
    text-decoration: none;
}
.posts-masonry .wp-block-post-excerpt__more-link:hover,
.wp-block-post-excerpt__more-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.archive-header {
    border-bottom: 1px solid var(--wp--preset--color--contrast);
    padding-bottom: var(--wp--preset--spacing--small);
    margin-bottom: var(--wp--preset--spacing--medium);
}
.archive-pagination {
    display: flex;
    align-items: center;
    margin-top: var(--wp--preset--spacing--medium);
}
.archive-pagination .wp-block-query-pagination-previous {
    margin-right: auto;
}
.archive-pagination .wp-block-query-pagination-next {
    margin-left: auto;
}
/* -- Custom Header Navigation -- */
.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    display: none;
}

.menu-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--wp--preset--color--contrast);
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 110020;
    display: none;
    cursor: pointer;
}

.primary-menu {
    display: flex;
    gap: var(--wp--custom--spacing--gap);
}

  .primary-menu a {
      text-decoration: none;
      padding: 2px 10px;
  }

.site-header.hidden {
    display: none;
}

@media only screen and (max-width: 782px) {
    .menu-toggle {
        display: block;
    }

    .primary-menu {
        position: fixed;
        top: 0;
        left: -100%;
        right: auto;
        width: 100%;
        height: 100%;
        max-width: none;
        background-color: rgba(255, 255, 255, 0.85);
        color: var(--wp--preset--color--contrast);
        padding: var(--wp--custom--spacing--gap);
        overflow-y: auto;
        transition: left 0.3s ease-in-out;
        flex-direction: column;
        align-items: flex-start;
        z-index: 110010;
        display: block;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .primary-menu li {
        margin-bottom: var(--wp--custom--spacing--gap);
    }

    .primary-menu a {
        font-size: 1.25rem;
    }

    .primary-menu.open {
        left: 0;
    }

    .primary-menu.open .menu-close {
        display: block;
    }

    .primary-menu li > ul {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateX(-20px);
        transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    }

    .primary-menu li.submenu-open > ul {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Ensure YouTube embeds on Track posts fill the available width */
.single-track iframe[src*="youtube"] {
    width: 100% !important;
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 300px;
    max-height: 70vh;
}

.track-services {
    margin: 1em 0;
}

.track-services-icons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 16px;
    align-items: center;
}

.track-services-icons a {
    flex: 1;
    text-align: center;
}

.track-services-icons a svg {
    height: min(40px, 8vw);
    width: auto;
    max-width: 100%;
    display: block;
}
