/*
Theme Name: Cal Talaia
Theme URI: 
Author: Uli Hake
Author URI: 
Description: A theme for Cal Talaia
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cal-talaia
Tags: 

/*
 * Control the hover stylings of outline block style.
 * Unnecessary once block styles are configurable via theme.json
 * https://github.com/WordPress/gutenberg/issues/42794
 */

/*
 * Control the hover stylings of outline block style.
 * Unnecessary once block styles are configurable via theme.json
 * https://github.com/WordPress/gutenberg/issues/42794
 */

@font-face {
  font-family: "Chawp";
  src: url("./assets/fonts/chawpwebfont.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Excalifont";
  src: url("./assets/fonts/excalifont-regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "GREC";
  src: url("./assets/fonts/grec-regular.woff2") format("woff2");
  font-display: swap;
}



:root {
	--wp--custom--carousel-block--pagination-bottom: -30px;
	--wp--custom--carousel-block--pagination-top: auto;
	--wp--custom--carousel-block--pagination-bullet-size: 18px;
	--featured-image-fallback-height: 0.25rem;
}

input[type="checkbox"] {
	min-width: 14px !important;
	min-height: 14px !important;
}

:root :where(.wp-block-quote) {
	border-color: var(--wp--preset--color--primary);
	border-width: 0px 0px 0px 40px;
	font-style: normal;
	padding-left: var(--wp--preset--spacing--50);
	/* border-image: url("./assets/images/50.png") 1 fill; */
	font-weight: bolder;
	text-transform: uppercase;
}

/* Reader mode */
body.reader-mode {
  --wp--preset--font-family--base-hand: var(--wp--preset--font-family--system-font-alt);
  --wp--preset--font-family--system-font: var(--wp--preset--font-family--system-font-alt);

}

img {
	border-radius: 15px;
}

.wp-block-navigation-overlay-close svg {
    height: 50px !important;
    width: 50px !important;
    stroke: black !important;
}


.featured-image-fallback {
    height: var(--featured-image-fallback-height, 0.25rem);
}

.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background):hover {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--background);
	border-color: var(--wp--preset--color--secondary);
}

/* 
 * Search block (inside button) styles 
 * https://github.com/WordPress/gutenberg/issues/39946
 */
.wp-block-search__button-inside > .wp-block-search__inside-wrapper {
	box-sizing: border-box;
}
.wp-block-search__button-inside .wp-block-search__input {
	padding: 0 0.25rem;
}

.fixed-bottom-nav .wp-block-search.wp-block-search__button-only .wp-block-search__button {
	padding-right: 0;
	padding-left: 0;
	background-color: var(--wp--preset--color--primary);
	color: currentColor;
}

/* Comment styles */
.wp-block-comment-template > .comment .wp-block-group-is-layout-flex,
.wp-block-comment-template > .comment .wp-block-group-is-layout-flow {
	flex-grow: 1;
}

main {
  min-height: 70vh !important;
}

/*
 * Fixed bottom nav
 */
.fixed-bottom-nav {
	bottom: 0;
	left: 0;
	height: 64px;
	position: fixed;
	width: 100%;
}

.fixed-bottom-nav::before {
	content: '';
	background-color: var(--wp--preset--color--primary);
	position: absolute;
	height: 100px;
	width: 100%;
	top: -40px;
	mix-blend-mode: color;
	-webkit-mask: url(assets/images/nav-edge.png) no-repeat center / cover;
	mask: url(assets/images/nav-edge.png) no-repeat center / cover;
	z-index: -1;
}

.fixed-bottom-nav-overlay {
	bottom: 0;
	left: 0;
	height: auto;
	position: fixed;
	width: 100%;
}

.wp-block-navigation__responsive-container-close svg, .wp-block-navigation-overlay-close svg, .wp-block-navigation__responsive-container-open svg, .reader-mode-toggle svg {
  height: var(--wp--custom--fixed-bottom-bar--icon-size);
  width: var(--wp--custom--fixed-bottom-bar--icon-size);
}

.reader-mode-toggle {
  cursor: pointer;	
}

.wp-block-search__inside-wrapper .wp-block-search__button svg {
  height: var(--wp--custom--fixed-bottom-bar--icon-size);
  width: var(--wp--custom--fixed-bottom-bar--icon-size);
}

.wp-block-search.wp-block-search__button-only .wp-block-search__input {
  max-height: var(--wp--custom--fixed-bottom-bar--icon-size);
  margin-top: 10px;
  font-family: var(--wp--preset--font-family--base-hand);	;
  border: 0;
  background-color: var(--wp--preset--color--foreground);
  color: var(--wp--preset--color--tertiary);
}

.wp-block-search.wp-block-search__button-only .wp-block-search__input:focus {
  outline: none;
}

.fixed-bottom-nav .wp-block-group a img {
	min-height: 30px;
	vertical-align: middle;
	margin-left:auto;
    margin-right:auto;
}

.fixed-bottom-nav .wp-element-button, .fixed-bottom-nav .wp-block-button__link, .fixed-bottom-nav .sib-link:hover, .fixed-bottom-nav .sib-link {
	color: var(--wp--preset--color--foreground);
	background-color: var(--wp--preset--color--primary);
}

.background-overlay {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
	background-image: url(assets/images/background-texture.png);
	background-size: contain;
	background-repeat: repeat;
	position: fixed;
    z-index: -1; /* Keeps the background behind other content */
}

.background-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--wp--preset--color--background);
    mix-blend-mode: color; /* Change to desired blend mode */
    pointer-events: none;
}

/* Custom Cal Talaia alternating post styles */
.post-content-cal-talaia-container {
	background-image: url(assets/images/25.png);
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center top;
	position: relative;
}

.wp-block-post-template-is-layout-flow > .wp-block-post:nth-child(2n) .post-content-cal-talaia-container {
	background-image: url(assets/images/50.png);
}

.wp-block-post-template-is-layout-flow > .wp-block-post:nth-child(3n) .post-content-cal-talaia-container {
	background-image: url(assets/images/90.png);
}

.cal-talaia-archive-title {
	background-image: url(assets/images/90.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-position: center top;
}

.cal-talaia-single-container, .cal-talaia-comments-section {
	background-image: url(assets/images/50.png);
	background-size: 120% 100%;
	background-repeat: no-repeat;
	background-position: center top;
	position: relative;
	min-height: 300px;
}

.caltalaia-footer-banner {
	background-image: url(assets/images/25.png);
	background-size: 120% 100%;
	background-repeat: no-repeat;
	background-position: center 25px;
	position: relative;
	background-color: var(--wp--preset--color--foreground);
	padding-top: 50px;
	padding-bottom: 50px;
}

.caltalaia-footer-banner.is-layout-constrained .wp-block-columns {
	margin-top: 25px;
	margin-bottom: 25px;
	max-width: 60%;
}

.caltalaia-footer-banner a {
	color: var(--wp--preset--color--secondary);	
}

.caltalaia-footer-banner a:hover {
	color: var(--wp--preset--color--foreground);	
}

/* =========================================
   Mobile (no hover available and not on a wide screen)
========================================= */
@media (hover: none) and (max-width: 768px) {
	.caltalaia-footer-banner.is-layout-constrained .wp-block-columns {
		max-width: var(--wp--style--global--content-size);
	}
}

.caltalaia-footer-banner-spacer {
	background-color: var(--wp--preset--color--foreground);
}

@media screen and (min-width: 960px){
	.post-content-cal-talaia-container, .cal-talaia-archive-title, .cal-talaia-single-container, .caltalaia-footer-banner {
		background-size: 75% 100% !important;
	}
}

/* Nav modal styles */
.wp-block-navigation__responsive-container.is-menu-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /*background-color: inherit;*/
	background-color: var(--wp--preset--color--primary);
	/*background-color: var(--wp--preset--color--foreground);*/
    mix-blend-mode: color; /* Change to desired blend mode */
    pointer-events: none;
}

.wp-block-navigation__responsive-container {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
	background-image: url(assets/images/background-texture.png);
	background-size: contain;
	background-repeat: repeat;
	position: fixed;
    z-index: -1; /* Keeps the background behind other content */
}

.wp-block-navigation-overlay-close {
	top: 0rem;
	right: 0rem;
	position:fixed;
}

.wp-block-navigation__responsive-container.is-menu-open li.wp-block-navigation-item.wp-block-navigation-submenu,
.wp-block-navigation__responsive-container.is-menu-open li.wp-block-navigation-item.wp-block-navigation-link,
.wp-block-navigation__responsive-container .wp-block-navigation .wp-block-navigation-item {
	padding: 1.2rem;
    background-image: url(assets/images/90.png) !important;
    background-size: 105% 100% !important;
    background-position: center !important;
	font-size:1.2rem;
}


/* carousel related css */
.swiper {
	z-index:0 !important;
}

.swiper-button-next,
.swiper-button-prev {
  z-index:0 !important;
}

.wp-block-cb-carousel-v2.cb-carousel-block .cb-pagination.swiper-pagination.swiper-pagination-horizontal {
  justify-content: right !important;
  z-index:0 !important;
  top: unset !important;
  bottom: var(--wp--custom--carousel-block--pagination-bottom) !important;
}

.swiper .wp-block-image img {
	width: auto !important;
	height: auto !important;
	max-height: 400px;
	margin-left: auto;
	margin-right: auto;
	justify-content: center !important;
	display: flex !important;
}


.wp-block-post-terms.taxonomy-category::before {
	content: "·  ";
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container {
	gap: 0;
}

footer.wp-block-template-part {
	position:relative;
}

footer.wp-block-template-part:before {
content: '';
  background-color: var(--wp--preset--color--foreground);
  position: absolute;
  height: 100px;
  width: 100%;
  top: -40px;
  mix-blend-mode: darken;
  -webkit-mask: url(assets/images/nav-edge.png) no-repeat center / cover;
  mask: url(assets/images/nav-edge.png) no-repeat center / cover;
  z-index: -1;}

/* test */
.wp-block-navigation.has-expandable-modal-submenus .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child.open-always.wp-block-navigation-submenu .wp-block-navigation__submenu-container.wp-block-navigation-submenu {
	height: 0;
	opacity: 0;
	overflow: hidden;
	visibility: hidden;
	width: 0;
}

.wp-block-navigation.has-expandable-modal-submenus .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child.open-always.wp-block-navigation-submenu:hover .wp-block-navigation__submenu-container.wp-block-navigation-submenu {
	height: auto;
	opacity: 1;
	overflow: visible;
	visibility: visible !important;
	width: auto;
	
}

.wp-block-navigation__overlay-container .wp-block-navigation__container.is-vertical .wp-block-navigation-item.has-child.wp-block-navigation-submenu .wp-block-navigation__submenu-container.wp-block-navigation-submenu li {
	background-image: none !important;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.wp-block-navigation .wp-block-navigation__container .has-child.open-always > .wp-block-navigation__submenu-container {
	background-color: initial;
	border: none;
	color: inherit;
	flex-basis: 100%;
	height: 0;
	opacity: 1;
	overflow: hidden;
	position: absolute;
	width: 0;
	visibility: hidden;
}

.wp-block-navigation .wp-block-navigation__container .has-child.open-always:hover > .wp-block-navigation__submenu-container {
	background-color: initial;
	border: none;
	color: inherit;
	flex-basis: 100%;
	height: auto;
	opacity: 1;
	overflow: hidden;
	position: static;
	width: auto;
	visibility: visible;
}


.wp-block-navigation.has-expandable-modal-submenus .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item {
	display: block;
	text-align: var(--navigation-layout-justification-setting,initial);
}

/* =========================================
    root overrides (bad idea, fix root elements in json, whenever you can)
========================================= */
.wp-site-blocks input,
.wp-site-blocks textarea {
    background: var(--wp--preset--color--foreground);
    color: var(--wp--preset--color--tertiary);
}

:root :where(.wp-element-caption, .wp-block-gallery.has-nested-images figcaption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption) {
	font-size: var(--wp--preset--font-size--small);
	text-align: left !important;
}

/* =========================================
   Gutenberg Enhancements
========================================= */
/* =============================
   WRAPPER (STRUCTURE - DO NOT BREAK)
============================= */

.inline-image-wrapper {
    display: block;
    width: 100%;
    position: relative;
}


/* =============================
   IMAGE ELEMENT
============================= */

.inline-image {
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


/* =============================
   ALIGNMENT
============================= */

/* LEFT (default) */
.inline-image.is-left {
    margin-right: auto;
}

/* CENTER */
.inline-image.is-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* RIGHT */
.inline-image.is-right {
    display: block;
    margin-left: auto;
}


/* =============================
   FIXED SIZE MODE
============================= */

.inline-image.is-fixed {
    max-width: 100%;
}


/* =============================
   HOVER (EDITOR ONLY)
============================= */

.inline-image-wrapper.is-hovered {
    outline: 2px dashed #999;
    outline-offset: 2px;
}


/* =============================
   OPTIONAL: ACTIVE / SELECTED STATE
============================= */

.inline-image-wrapper.is-selected {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}


/* =============================
   PREVENT TEXT SELECTION ARTIFACTS
============================= */

.inline-image-wrapper::selection {
    background: transparent;
}

.inline-image-wrapper *::selection {
    background: transparent;
}


/* =============================
   SAFETY (CLICK AREA)
============================= */

/* Ensures clickable area is never collapsed */
.inline-image-wrapper:empty::before {
    content: '';
    display: block;
    min-height: 20px;
}

.editor-styles-wrapper .inline-image-wrapper {
    cursor: pointer;
}

.editor-styles-wrapper .inline-image-wrapper.is-hovered {
    outline: 2px dashed #999;
}
/* =============================
   OVERLAY BASE
============================= */

.caltalaia-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    opacity: 0;
    z-index: 9999;
    cursor: zoom-out;

    transition: opacity 0.5s ease, background 0.5s ease;
}


/* =============================
   VISIBLE
============================= */

.caltalaia-lightbox.is-visible {
    opacity: 1;
    background: rgba(0,0,0,0.9);
}


/* =============================
   IMAGE CONTAINER
============================= */

.caltalaia-lightbox img {
    max-width: 90%;
    max-height: 90%;
}


/* =============================
   OPEN ANIMATION (WP-like)
============================= */

@media not (prefers-reduced-motion) {

    .caltalaia-lightbox.is-visible img {
        animation: caltalaia-zoom-in 0.7s ease;
    }

    .caltalaia-lightbox.is-closing img {
        animation: caltalaia-zoom-out 0.7s ease forwards;
    }
}


/* =============================
   KEYFRAMES
============================= */

@keyframes caltalaia-zoom-in {
    0% {
        transform: scale(0.92);
        opacity: 0;
    }
    60% {
        transform: scale(1.02);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

@keyframes caltalaia-zoom-out {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.92);
        opacity: 0;
    }
}

/* =============================
   LIGHTBOX
============================= */
/*
caltalaia-lightbox img {
    transition: transform 0.2s ease;
}
*/
.inline-image-wrapper.has-lightbox {
    cursor: zoom-in;
}


/* ==========================================
	Chalk effects
========================================== */
/* =========================
   CHALK EFFECT (NON-INVASIVE)
   ========================= */

/* Base chalk effect */
.is-style-chalk {
  /*
  position: relative;
  overflow: hidden;
  */
}

/* Subtle chalk diffusion (does NOT override fonts) */
.is-style-chalk {
  position: relative;
  font-family: var(--wp--preset--font-family--base-hand);

  font-feature-settings: "calt" 1, "liga" 1;
  letter-spacing: -0.01em;

  color: #2b2b2b;

  text-shadow:
    0.15px 0.1px 0 rgba(0,0,0,0.18),
    -0.15px -0.1px 0 rgba(0,0,0,0.12),
    0.1px -0.15px 0 rgba(0,0,0,0.08);

  filter: contrast(1.04) brightness(0.97);

  -webkit-font-smoothing: antialiased;	
  font-smoothing: antialiased;
}

.is-style-chalk-writing, .is-style-chalk-title {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid rgba(255,255,255,0.6);
  animation: chalkWrite 2.5s steps(30, end);
}

@keyframes chalkWrite {
  from { width: 0 }
  to { width: 100% }
}

.chalk-smudge {
  filter: blur(0.5px) contrast(0.95);
}

.chalk-erase:hover {
  filter: blur(2px);
  opacity: 0.4;
  transition: all 0.3s ease;
}

.chalk-light::after { opacity: 0.25; }
.chalk-heavy::after { opacity: 0.7; }


