/*
Theme Name: trulytype®
Theme URI: https://trulytype.com/
Author: trulytypeteam
Author URI: https://trulytype.com/
Description: A custom theme for trulytype, a font foundry and type design company. Features custom post types for fonts, drag-and-drop image management, and specialized checkout functionality.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.2
Version: 2.9.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trulytype
*/

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .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
*/
.more-link {
	display: block;
}

/*
 * Custom caption positioning - move captions to lower left corner
 */
.wp-block-image {
  position: relative;
}

.wp-block-image .aligncenter>figcaption,
.wp-block-image .alignleft>figcaption,
.wp-block-image .alignright>figcaption,
.wp-block-image.aligncenter>figcaption,
.wp-block-image.alignleft>figcaption,
.wp-block-image.alignright>figcaption {
  caption-side: bottom;
  display: table-caption;
  text-align: left;
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 1);
  padding: 0.5em;
  margin: 0;
  z-index: 10;
}

.wp-block-image :where(figcaption) {
  margin-bottom: 0;
  margin-top: 0;
  text-align: left;
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 1);
  padding: 0.5em;
  z-index: 10;
}

/* Ensure captions are left-aligned regardless of image alignment */
.wp-block-image figcaption {
  text-align: left !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  background: rgba(255, 255, 255, 1) !important;
  padding: 0.5em !important;
  z-index: 10 !important;
}

/*
 * Global page fade-out effect for navigation
 */
.page-content {
    transition: opacity 0.8s ease !important;
    opacity: 0 !important; /* Start invisible, will be set to 1 by JavaScript */
}

.page-content.fade-out {
    opacity: 0 !important;
}

/* Ensure navigation stays visible during fade */
nav {
    opacity: 1 !important;
    visibility: visible !important;
    transition: transform 0.3s ease !important;
}

nav.fade-out {
    opacity: 1 !important;
}

/* Fade-in effect for page content */
.page-content.fade-in {
    opacity: 1 !important;
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
