/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* CENTERED DOUBLE UNDERLINE WAVE */
@media (min-width: 768px) {
    .main-navigation .menu>.menu-item>a:before,
    .main-navigation .menu>.menu-item>a:after {
        content: "";
        position: absolute;
        bottom: 1.6rem;
        left: 50%;                    /* Changed from left: 0 */
        transform: translateX(-50%);  /* Added to center the lines */
        height: 1px;
        background-color: currentColor;
        transition: all 0.4s ease;
    }
    .main-navigation .menu>.menu-item>a:before {
        width: 0;
        transition-delay: 0s;
    }
    .main-navigation .menu>.menu-item>a:after {
        bottom: 1.4rem;
        width: 0;
        transition-delay: 0.1s;
    }
    .main-navigation .menu>.menu-item:hover>a:before,
    .main-navigation .menu>.menu-item:hover>a:after,
    .main-navigation .menu>.current-menu-item>a:before,
    .main-navigation .menu>.current-menu-item>a:after {
        width: calc(100% - 40px);
    }
}


/* 5. FLOATING ELEVATION LEVELS - FLAT TOP CORNERS */
.main-navigation.navigation-stick {
    background: rgba(134, 104, 80, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(134, 104, 80, 0.30);
    
    /* Remove upper left and right corners */
    border-radius: 0 0 20px 20px;
    
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(55, 72, 54, 0.35);
}

.main-navigation.navigation-stick:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 45px rgba(55, 72, 54, 0.4),
        0 0 80px rgba(134, 104, 80, 0.3);
    background: rgba(134, 104, 80, 0.9);
}

/* Individual menu items lift slightly on hover */
.main-navigation .main-nav .menu > li > a:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* VENETIAN GLASS EFFECT DROPDOWN MENU - MATCHING NAV COLOR */
.main-navigation .sub-menu {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(-10px);
    
    /* Separate transitions - no background transition */
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    
    /* Match navigation bar background color */
    background: rgba(134, 104, 80, 0.9); /* Slightly more opaque than nav for better contrast */
    
    /* Add backdrop filter to match nav glassmorphism */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* No borders for clean glass effect */
    border: none;
    
    /* Remove upper left and right border radius */
    border-radius: 0 0 20px 20px;
    
    /* Enhanced shadow for floating effect */
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.main-navigation .menu-item:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.main-navigation .sub-menu a {
    padding: 16px 28px;
    
    /* Only transition transform and color, not background */
    transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    
    border-radius: 15px;
    margin: 5px;
    
    /* White text for good contrast on brown background */
    color: #FFFFFF;
    
    /* Match the navigation container background color */
    background: rgba(134, 104, 80, 0.9);
    border: none; /* No borders for clean glass effect */
}

.main-navigation .sub-menu a:hover {
    /* Light beige background on hover */
    background: #E6D5C3; /* Light beige */
    color: #2C2C2C; /* Dark text for contrast */
    
    transform: scale(1.02);
    
    /* Simple shadow for glass effect - no borders */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: none; /* No borders for clean glass effect */
}


/* 2. ITALIAN-INSPIRED WITH SHIMMER MAIN BUTTON*/
.gbp-button--primary {
    background-color: var(--accent);
    color: #ffffff;
    display: inline-flex;
    font-size: 1rem;
    font-weight: normal;
    text-decoration: none;
    text-transform: uppercase;
    border: 2px solid var(--base);
    padding: 0.75rem 1.5rem;
    
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.gbp-button--primary:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.gbp-button--primary:is(:hover,:focus):before {
    left: 100%;
}

.gbp-button--primary:is(:hover,:focus) {
    background-color: var(--accent-3);
    color: var(--contrast-2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

/*Hero H1*/
.hero-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.67rem;
  box-shadow: 0 6px 25px rgba(34, 139, 34, 0.1);
}


@media (prefers-reduced-motion: no-preference) {
  .animate {
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 1s ease, transform 0.6s ease;
    will-change: opacity, transform;
  }
  .animate.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  .editor-styles-wrapper .animate {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


/* Clean sticky footer with floating main content */
#main {
  position: relative; 
  z-index: 1;
  background: white;
  box-shadow: 0px 20px 40px #00000010; /* Nice subtle shadow */
}

.site-footer {position: sticky; bottom: 0;}

/*Disable font smoothing flexbox*/
html {-webkit-font-smoothing: unset;-moz-osx-font-smoothing: unset;}

/*Rank Math breadcrumbs*/
.rank-math-breadcrumb {font-size:0.9rem; line-height:2rem; text-align:center;}
.rank-math-breadcrumb a,
.rank-math-breadcrumb a:visited,
.rank-math-breadcrumb a:active,
.rank-math-breadcrumb span {
  color: white !important;
  text-decoration: none;
  transition: text-decoration 0.2s ease;}
.rank-math-breadcrumb a:hover {color: white !important;text-decoration: underline;}

/* Если есть разделители */
.rank-math-breadcrumb .separator {color: white;}

/* Remove bottom margin on last paragraph in container (front end) */
.gb-container p:last-child:last-of-type {margin-bottom: 0px;}

ul, ol {padding-left: 0; list-style-position: outside;}
blockquote p {hanging-punctuation: first;}  

/*Image & Caption*/
.wp-element-caption {text-align:center;font-style:italic;font-size:0.8em; margin-top:0.6em;margin-bottom:0.6em;}

/**Link Underline*/
body:not(.blog):not(.archive) .inside-article a:hover {transition: all .35s linear;}

.bottom{margin-bottom:2rem}

.wp-block-image img {border-radius: 0.667rem;display: block;width: 100%;height: auto;}

/* Primary Image Block Targets */
.wp-block-image img,
.wp-image-[class*="wp-image-"] img,
img[class*="wp-image-"] {
    border-radius: 0.75rem;
    /* Hardware acceleration for smooth rendering */
    transform: translateZ(0);
    /* Ensure smooth edges */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;}

/* WordPress Core Image Blocks */
.wp-block-image img {border-radius: 0.75rem;}

/* Gallery Block Images */
.wp-block-gallery .wp-block-image img,
.blocks-gallery-item img,
.wp-block-gallery img {
    border-radius: 0.75rem;}

/* Prevent border-radius on very small images (performance) */
img[width="1"], img[width="2"], img[width="3"],
img[height="1"], img[height="2"], img[height="3"] {
    border-radius: 0;}

/* Maintain aspect ratio during loading */
.wp-block-image img {height: auto;}

/* Improve rendering performance */
.wp-block-image img {
    /* Optimize for painting */
    will-change: auto;
    /* Smooth rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;}

/* Reduce layout shift during image loading */
.wp-block-image {overflow: hidden;
    border-radius: 0.75rem;}

/* Primary Gallery Image Targets */
.wpt-masonry-gallery img,
.wpt-gallery-image img {
    border-radius: 0.75rem;
    /* Performance optimizations */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Smooth rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Gallery Container Optimization */
.wpt-masonry-gallery {
    /* Ensure proper overflow handling */
    overflow: visible;
}

.wpt-gallery-image {
    /* Prevent clipping of rounded corners */
    overflow: hidden;
    border-radius: 0.75rem;
}

/* Ensure links don't interfere with border radius */
.wpt-gallery-image a {
    display: block;
    border-radius: 0.75rem;
    overflow: hidden;
    /* Remove default link styling that might interfere */
    text-decoration: none;
    border: none;
    outline: none;
}
