/*
Theme Name: Kerstin Metz Design
Theme URI: https://kerstinmetz.com
Author: Kevin Eberhardt
Author URI: https://github.com/kevin-eberhardt
Description: Design created for Kerstin Metz
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.0
Text Domain: kerstinmetz
*/

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
  text-decoration-thickness: 1px !important;
  text-underline-offset: 0.1em;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
  outline-width: 2px;
  outline-style: solid;
}

/* Increase the bottom margin on submenus, so that the outline is visible. */
.wp-block-navigation
  .wp-block-navigation-submenu
  .wp-block-navigation-item:not(:last-child) {
  margin-bottom: 3px;
}

/* Increase the outline offset on the parent menu items, so that the outline does not touch the text. */
.wp-block-navigation
  .wp-block-navigation-item
  .wp-block-navigation-item__content {
  outline-offset: 4px;
}

/* Remove outline offset from the submenus, otherwise the outline is visible outside the submenu container. */
.wp-block-navigation
  .wp-block-navigation-item
  ul.wp-block-navigation__submenu-container
  .wp-block-navigation-item__content {
  outline-offset: 0;
}

/*
 * Progressive enhancement to reduce widows and orphans
 * https://github.com/WordPress/gutenberg/issues/55190
 */
h1,
h2,
h3,
h4,
h5,
h6,
blockquote,
caption,
figcaption,
p {
  text-wrap: pretty;
}

/*
 * Change the position of the more block on the front, by making it a block level element.
 * https://github.com/WordPress/gutenberg/issues/65934
*/
h1, h2, h3, h4 {
    margin: 2rem 0;
}

h2.intro-text {
  font-size: clamp(2.4rem, calc(1rem + 2.16vw), 3.6rem);
}

/* ===================================
   Animated Header Styles
   =================================== */

:root {
    --header-transition-speed: 0.3s;
    --header-bg-scrolled: rgba(255, 255, 255, 0.98);
    --header-padding-large: 1.5rem;
    --header-padding-small: 0.75rem;
}


header {
    position: fixed;
    z-index: 100;
    width: 100%;
    top: 0px;
}

/* Add padding to body to compensate for fixed header */
/* Use the larger padding value to ensure content is never hidden */

/* Smooth transitions for navigation items */
.wp-block-navigation .wp-block-navigation-item a {
    transition: color 0.2s ease-in-out;
}

.wp-block-navigation .wp-block-navigation-item a:hover {
    opacity: 0.7;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    height: 100%;
    align-self: center;
    justify-content: center;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content :where(.wp-block-navigation-item a) {
  font-size: calc((var(--heading-2-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem) !important;
}

/* Site title animation */
/* Mobile adjustments */
@media (max-width: 768px) {
    /* .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
        position: absolute !important;
        z-index: 100;
    } */
    body {
        padding-top: calc(var(--header-padding-large) * 2 + 3rem);
    }

    .is-menu-open .wp-block-navigation__responsive-dialog {
        position: absolute;
        left: 0px;
        top: 0px;
        width: 100%;
        height: 100%;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
}

/* ===================================
   Responsive Typography
   =================================== */

:root {
    /* Font size variables matching current website */
    --heading-1-size: 4rem;
    --heading-1-size-value: 4;
    --heading-2-size: 2.8rem;
    --heading-2-size-value: 2.8;
    --heading-3-size: 2.2rem;
    --heading-3-size-value: 2.2;
    --heading-4-size: 1.2rem;
    --heading-4-size-value: 1.2;
    --large-text-size: 1.5rem;
    --large-text-size-value: 1.5;
    --normal-text-size: 1rem;
    --normal-text-size-value: 1;
    --small-text-size: 0.9rem;
    --small-text-size-value: 0.9;
}

/* Body text and paragraphs */
@media screen and (max-width: 767px) and (orientation: portrait) {
    .intro-section {
        padding-top: calc(var(--header-padding-large) * 2 + 3rem);
    }
    body, 
    .wp-site-blocks p:not(.wp-block-site-title):not(.has-large-font-size):not(.has-x-large-font-size):not(.has-xx-large-font-size):not(.has-huge-font-size),
    .wp-block-post-content p:not(.has-large-font-size):not(.has-x-large-font-size):not(.has-xx-large-font-size):not(.has-huge-font-size) {
        font-size: calc((var(--normal-text-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem) !important;
    }
}

@media screen and (min-width: 768px), screen and (max-width: calc(2120px - 1px)) and (orientation: landscape) {
    body,
    .wp-site-blocks p:not(.wp-block-site-title):not(.has-large-font-size):not(.has-x-large-font-size):not(.has-xx-large-font-size):not(.has-huge-font-size),
    .wp-block-post-content p:not(.has-large-font-size):not(.has-x-large-font-size):not(.has-xx-large-font-size):not(.has-huge-font-size) {
        font-size: calc((var(--normal-text-size-value) - 1) * 1.2vw + 1rem) !important;
    }
}

@media screen and (min-width: 2120px) {
    body,
    .wp-site-blocks p:not(.wp-block-site-title):not(.has-large-font-size):not(.has-x-large-font-size):not(.has-xx-large-font-size):not(.has-huge-font-size),
    .wp-block-post-content p:not(.has-large-font-size):not(.has-x-large-font-size):not(.has-xx-large-font-size):not(.has-huge-font-size) {
        font-size: calc(var(--normal-text-size-value) * 1rem) !important;
    }
}

/* Headings */
@media screen and (max-width: 767px) and (orientation: portrait) {
    h1,
    .wp-site-blocks h1,
    .wp-block-post-content h1 {
        font-size: calc((var(--heading-1-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem) !important;
    }
    
    h2,
    .wp-site-blocks h2,
    .wp-block-post-content h2 {
        font-size: calc((var(--heading-2-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem) !important;
    }
    
    h3,
    .wp-site-blocks h3,
    .wp-block-post-content h3 {
        font-size: calc((var(--heading-3-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem) !important;
    }
    
    h4,
    .wp-site-blocks h4,
    .wp-block-post-content h4 {
        font-size: calc((var(--heading-4-size-value) - 1) * calc(0.012 * min(100vh, 900px)) + 1rem) !important;
    }
}

@media screen and (min-width: 768px), screen and (max-width: calc(2120px - 1px)) and (orientation: landscape) {
    h1,
    .wp-site-blocks h1,
    .wp-block-post-content h1 {
        font-size: calc((var(--heading-1-size-value) - 1) * 1.2vw + 1rem) !important;
    }
    
    h2,
    .wp-site-blocks h2,
    .wp-block-post-content h2 {
        font-size: calc((var(--heading-2-size-value) - 1) * 1.2vw + 1rem) !important;
    }
    
    h3,
    .wp-site-blocks h3,
    .wp-block-post-content h3 {
        font-size: calc((var(--heading-3-size-value) - 1) * 1.2vw + 1rem) !important;
    }
    
    h4,
    .wp-site-blocks h4,
    .wp-block-post-content h4 {
        font-size: calc((var(--heading-4-size-value) - 1) * 1.2vw + 1rem) !important;
    }
}

@media screen and (min-width: 2120px) {
    h1,
    .wp-site-blocks h1,
    .wp-block-post-content h1 {
        font-size: calc(var(--heading-1-size-value) * 1rem) !important;
    }
    
    h2,
    .wp-site-blocks h2,
    .wp-block-post-content h2 {
        font-size: calc(var(--heading-2-size-value) * 1rem) !important;
    }
    
    h3,
    .wp-site-blocks h3,
    .wp-block-post-content h3 {
        font-size: calc(var(--heading-3-size-value) * 1rem) !important;
    }
    
    h4,
    .wp-site-blocks h4,
    .wp-block-post-content h4 {
        font-size: calc(var(--heading-4-size-value) * 1rem) !important;
    }
}
