/*
Theme Name: G-Mac Digital Garden
Theme URI: https://g-mac.uk
Author: Gareth Mac
Author URI: https://g-mac.uk
Description: A modern WordPress block theme for Full Site Editing.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: g-mac-digital-garden
Tags: full-site-editing
Tested up to: 6.5
Requires PHP: 7.4

Copyright (C) 2024 Gareth Mac
G-Mac Digital Garden is distributed under the terms of the GNU General Public License v2 or later.
*/


/* Background effects */

a {
  text-decoration: underline;
  -o-transition: color 0.5s ease;
  -ms-transition: color 0.5s ease;
  -moz-transition: color 0.5s ease;
  -webkit-transition: color 0.5s ease;
  transition: color 0.5s ease;
}

a:hover {
  color: var(--wp--preset--color--accent);
  text-decoration: underline;

}/* Background effects */
body {
  --light: var(--wp--preset--color--day);
  --dark: var(--wp--preset--color--night);
  --timing-fn: cubic-bezier(0.455, 0.190, 0.000, 0.985);

  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background-color: var(--wp--preset--color--base);

  animation-duration: 0s;
  animation-fill-mode: forwards;
  animation-timing-function: linear;
}

body.animation-ready {
  animation-play-state: running;
  animation-duration: 1s;
  animation-name: sunrise;
}

body.animation-ready.dark {
  animation-duration: 1.7s;
  animation-name: sunset;
}

body.dark {
  --light: var(--wp--preset--color--night);
  --dark: var(--wp--preset--color--day);
  --wp--preset--color--shadow: var(--wp--preset--color--black);
  --wp--preset--color--bounce-light: var(--wp--preset--color--dawn);
  --wp--preset--color--contrast: var(--wp--preset--color--base)	
}

@keyframes sunrise {
  0% {
    background-color: var(--wp--preset--color--night);
  }

  10% {
    background-color: var(--wp--preset--color--dawn);
  }

  35% {
    background-color: var(--wp--preset--color--morning);
  }

  100% {
    background-color: var(--wp--preset--color--day);
  }
}

@keyframes sunset {
  0% {
    background-color: var(--wp--preset--color--day);
  }

  30% {
    background-color: var(--wp--preset--color--evening);
  }

  60% {
    background-color: var(--wp--preset--color--dusk);
  }

  90% {
    background-color: var(--wp--preset--color--dawn);
  }

  100% {
    background-color: var(--wp--preset--color--night);
  }
}

#dappled-light {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: -1;
}

#progressive-blur {
  position: absolute;
  height: 100%;
  width: 100%;
}

#progressive-blur>div {
  position: absolute;
  height: 100%;
  width: 100%;
  inset: 0;
  backdrop-filter: blur(var(--blur-amount));
  mask-image: linear-gradient(252deg, transparent, transparent var(--stop1), black var(--stop2), black);
}

#progressive-blur>div:nth-child(1) {
  --blur-amount: 6px;
  --stop1: 0%;
  --stop2: 0%;
}

#progressive-blur>div:nth-child(2) {
  --blur-amount: 12px;
  --stop1: 40%;
  --stop2: 80%;
}

#progressive-blur>div:nth-child(3) {
  --blur-amount: 48px;
  --stop1: 40%;
  --stop2: 70%;
}

#progressive-blur>div:nth-child(4) {
  --blur-amount: 96px;
  --stop1: 70%;
  --stop2: 80%;
}

#glow {
  position: absolute;
  background: linear-gradient(309deg, var(--wp--preset--color--bounce-light), var(--wp--preset--color--bounce-light) 20%, transparent);
  transition: background 1.0s var(--timing-fn);
  height: 100%;
  width: 100%;
  opacity: 0.5;
}

#glow-bounce {
  content: "";
  position: absolute;
  background: linear-gradient(355deg, var(--wp--preset--color--bounce-light) 0%, transparent 30%, transparent 100%);
  transition: background 1.0s var(--timing-fn);
  opacity: 0.5;
  height: 100%;
  width: 100%;
  bottom: 0;
}

.perspective {
  position: absolute;
  transition: transform 1.7s var(--timing-fn), opacity 4s ease;
  top: -30vh;
  right: 0;
  width: 80vw;
  height: 130vh;
  opacity: 0.07;
  background-blend-mode: darken;
  transform-origin: top right;
  transform-style: preserve-3d;
  transform: matrix3d(0.7500, -0.0625, 0.0000, 0.0008,
      0.0000, 1.0000, 0.0000, 0.0000,
      0.0000, 0.0000, 1.0000, 0.0000,
      0.0000, 0.0000, 0.0000, 1.0000);
}

.dark .perspective {
  opacity: 0.3;
  transform: matrix3d(0.8333, 0.0833, 0.0000, 0.0003,
      0.0000, 1.0000, 0.0000, 0.0000,
      0.0000, 0.0000, 1.0000, 0.0000,
      0.0000, 0.0000, 0.0000, 1.0000);
}

#leaves {
  position: absolute;
  background-size: cover;
  background-repeat: no-repeat;
  bottom: -20px;
  right: -700px;
  width: 1600px;
  height: 1400px;
  background-image: url(./assets/images/leaves.png);
  filter: url(#wind);
  animation: billow 8s ease-in-out infinite;
}

#blinds {
  position: relative;
  width: 100%;
}

#blinds .shutter,
#blinds .bar {
  background-color: var(--wp--preset--color--shadow);
}

#blinds>.shutters {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 60px;
  transition: gap 1.0s var(--timing-fn);
}

.dark #blinds>.shutters {
  gap: 20px;
}

#blinds>.vertical {
  top: 0;
  position: absolute;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-around;
}

.vertical>.bar {
  width: 5;
  height: 100%;
}

.shutter {
  width: 100%;
  height: 40px;
  transition: height 1.0s var(--timing-fn);
}

.dark .shutter {
  height: 80px;
}

@keyframes billow {
  0% {
    transform: perspective(400px) rotateX(0deg) rotateY(0deg) scale(1);
  }

  25% {
    transform: perspective(400px) rotateX(1deg) rotateY(2deg) scale(1.02);
  }

  50% {
    transform: perspective(400px) rotateX(-4deg) rotateY(-2deg) scale(0.97);
  }

  75% {
    transform: perspective(400px) rotateX(1deg) rotateY(-1deg) scale(1.04);
  }

  100% {
    transform: perspective(400px) rotateX(0deg) rotateY(0deg) scale(1);
  }
}

/* Navigation Links Underline Effect */
.wp-block-navigation .wp-block-navigation-item__content {
    position: relative;
    text-decoration: none;
}

.wp-block-navigation .wp-block-navigation-item__content::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: var(--wp--preset--color--accent);
    transition: width 0.3s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
    color: var(--wp--preset--color--accent);
}

.wp-block-navigation .wp-block-navigation-item__content:hover::after {
    width: 100%;
}

/* Sub-Menu Styles */
.wp-block-navigation .wp-block-navigation__submenu-container {
    position: absolute;
    top: 100%; /* Positions the sub-menu right below the parent */
    left: 0;
    margin-top: 2px; /* Offsets the sub-menu down by a few pixels */
    opacity: 0;
    transform: rotateX(-9deg);
    transform-origin: top;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background-color: var(--wp--preset--color--surface); /* Ensures the submenu has a background */
    z-index: 10; /* Keeps the submenu above other content */
}

/* Display Sub-Menu on Hover with Rotate-In Effect */
.wp-block-navigation .wp-block-navigation-item:hover > .wp-block-navigation__submenu-container {
    opacity: 1;
    transform: rotateX(0deg);
}

/* Sub-Menu Links Underline Effect */
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    position: relative;
    text-decoration: none;
    display: block; /* Makes sub-menu links occupy full width */
    padding: 0.5rem 1rem; /* Adds padding for better click area */
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0px;
    width: 0;
    height: 2px;
    background-color: var(--wp--preset--color--accent);
    transition: width 0.3s ease;
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
    color: var(--wp--preset--color--accent);
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover::after {
    width: 100%;
}

/* Site Title Underline Effect */
.wp-block-site-title a {
    position: relative;
    text-decoration: none;
    display: inline-block;
    color: inherit; /* Keeps the original text colour */
}

.wp-block-site-title a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px; /* Adjusts the underline position */
    width: 0;
    height: 2px;
    background-color: var(--wp--preset--color--accent);
    transition: width 0.3s ease;
}

.wp-block-site-title a:hover::after {
    width: 100%; /* Expands the underline to full width */
}

/* General Button Styling */
/* Specific styling to prevent buttons from inheriting general link styles */
button a:hover,
input[type="button"] a:hover,
input[type="submit"] a:hover,
.wp-block-button__link:hover,
.wp-block-button__link:hover a {
    color: var(--wp--preset--color--base); 
    text-decoration: none;
}

/* Ensure all buttons maintain their hover effect without link interference */
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}
