/*
Theme Name: Late Night Texts
Theme URI:
Author: Late Night Texts
Author URI:
Description: A warm, cozy storytelling theme for Late Night Texts — soft colors, rounded cards, and a literary serif for headlines.
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: late-night-texts
Tags: blog, two-columns, wide-blocks, block-patterns, featured-images, full-site-editing, rtl-language-support, style-variations, threaded-comments, translation-ready

/* Remove auto-applied padding on headings when color is applied. */

h1.has-background, h2.has-background, h3.has-background, h4.has-background, h5.has-background, h6.has-background {
    padding: 0;
}


/* Set default line height for font size presets. */

.has-xx-large-font-size {
	line-height: 1;
}

/* Add a transition state for buttons. */

.wp-element-button {
    transition: border, background-color, color, box-shadow, opacity, filter;
    transition-duration: 0.15s;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(30px) brightness(120%);
}

/* Fields */

label,
.jetpack-field-label .rich-text.jetpack-field-label__input,
.wp-block-jetpack-contact-form-container .wp-block-jetpack-contact-form label {
    display: inline-block;
    font-size: var(--wp--preset--font-size--small);
    margin-bottom: 0.25em;
    font-weight: inherit;
}

textarea,
input:not([type=submit]):not([type=checkbox]),
.wp-block-post-comments-form textarea,
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),
.jetpack-contact-form .jetpack-field .jetpack-field__input,
.jetpack-contact-form .jetpack-field .jetpack-field__textarea {
    backdrop-filter: saturate(1.075);
    background-color: transparent;
    border-color: currentColor;
    border-style: solid;
    border-radius: 6px;
    border-width: 1px;
    box-shadow: none;
    box-sizing: border-box;
    color: currentColor;
    filter: brightness(1.05);
    font-size: var(--wp--preset--font-size--small);
    font-weight: inherit;
    line-height: 1.5;
    min-height: 42px;
    padding: 0.8rem 1rem;
    width: 100%;
}

textarea:focus,
input:not([type=submit]):focus,
.wp-block-post-comments-form textarea:focus,
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]):focus {
    outline: 1px solid currentColor;
}

/* Restore WC's native floating-label padding for all WC text inputs */
.wc-block-components-text-input input:not([type=submit]):not([type=checkbox]):not([type=radio]) {
    padding: 1.5em .5em .5em;
}

/* Jetpack Forms: Clean up errors */

.contact-form__error {
    font-size: 13px;
}

.contact-form__input-error {
	font-size: 13px;
    gap: 8px;
}

.contact-form__input-error .contact-form__warning-icon {
    border-width: 0;
}

/* Jetpack Forms: Animated block style tweaks */

.contact-form .is-style-animated .grunion-field-wrap.grunion-field-select-wrap .animated-label__label label,
.contact-form .is-style-animated .grunion-field-wrap .grunion-field.has-placeholder ~ .animated-label__label label,
.contact-form .is-style-animated .grunion-field-wrap .grunion-field:focus ~ .animated-label__label label,
.contact-form .is-style-animated .grunion-field-wrap .grunion-field:not(:placeholder-shown) ~ .animated-label__label label {
	opacity: 0.7;
    font-size: 11px;
}


/* Make sure footers have no margin. */

footer {
	margin-top: 0 !important;
}

/* Social Links: Better default color. */

.wp-block-social-links.is-style-logos-only li.wp-social-link {
	color: currentcolor;
}

.wp-block-social-links.is-style-logos-only .wp-social-link svg {
	height: 1em;
	width: 1em;
}

.wp-block-social-links.has-small-icon-size {
	font-size: 20px;
}

/* Move header core/navigation to the right on mobile. */

.order-0 {
	order: 0;
}

.order-1 {
	order: 1;
}

.grow-0 {
	flex-grow: 0;
}

.grow {
	flex-grow: 1;
}

@media (min-width: 600px) {

	.md\:order-0 {
		order: 0;
	}

	.md\:order-1 {
		order: 1;
	}

	.md\:grow-0 {
		flex-grow: 0;
	}

	.md\:grow {
		flex-grow: 1;
	}

}

.overflow-hidden {
	overflow: hidden;
}

/* Header search dropdown: soften the default hard-edged white popover to match the cozy theme. */

.wp-block-navigation__submenu-container {
	background-color: var(--wp--preset--color--theme-1) !important;
	border: none !important;
	border-radius: 20px !important;
	box-shadow: var(--wp--preset--shadow--cozy-soft) !important;
	padding: 16px !important;
	min-width: 0 !important;
	width: min(420px, calc(100vw - 48px)) !important;
	left: auto !important;
	right: -1px !important;
}

.wp-block-navigation__submenu-container .wp-block-search {
	width: 100% !important;
}

.wp-block-navigation__submenu-container .wp-block-search__inside-wrapper {
	width: 100% !important;
	border-radius: 999px;
	border-color: var(--wp--preset--color--theme-3);
	overflow: hidden;
}

.wp-block-navigation__submenu-container .wp-block-search__input {
	flex: 1;
	min-width: 0;
	border: none;
	background: transparent;
	padding-left: 18px;
}

.wp-block-navigation__submenu-container .wp-block-search__button {
	border-radius: 999px;
	margin: 3px;
}

/* Series shelf slider */

.cozy-slider-wrap {
	position: relative;
	overflow-x: hidden;
	max-width: 100%;
}

.cozy-slider-controls {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-bottom: var(--wp--preset--spacing--30);
}

.cozy-slider-btn {
	width: 40px;
	height: 40px;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--theme-2);
	background-color: var(--wp--preset--color--theme-1);
	color: var(--wp--preset--color--theme-4);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.cozy-slider-btn:hover:not(:disabled) {
	background-color: var(--wp--preset--color--theme-6);
}

.cozy-slider-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.cozy-slider {
	box-sizing: border-box;
	display: flex;
	gap: var(--wp--preset--spacing--50);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-left: 4px;
	padding: 4px 4px 20px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--theme-3) transparent;
}

.cozy-slider > * {
	box-sizing: border-box;
	flex: 0 0 auto;
	width: 100%;
	scroll-snap-align: start;
}

@media (min-width: 782px) {
	.cozy-slider > * {
		width: calc((100% - 2 * var(--wp--preset--spacing--50)) / 3);
	}
}

/* Cozy subscribe form */

.cozy-subscribe-form {
	display: flex;
	align-items: stretch;
	gap: 10px;
	max-width: 420px;
	margin: 0 auto;
}

.cozy-subscribe-form input[type="email"] {
	flex: 1;
	min-width: 0;
	border-radius: 999px;
	border-color: var(--wp--preset--color--theme-3);
	background-color: var(--wp--preset--color--theme-1);
}

.cozy-subscribe-form button {
	white-space: nowrap;
	border: none;
	cursor: pointer;
}

@media (max-width: 480px) {
	.cozy-subscribe-form {
		flex-direction: column;
	}
}

/* Responsive: collapse fixed 2-column grids (hero + story cards) to a single column on small screens. */

@media (max-width: 782px) {
	.is-layout-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Responsive: tighten hero/card inner padding so it doesn't eat the narrow viewport. */

@media (max-width: 600px) {
	.wp-block-post-template.is-layout-grid {
		gap: var(--wp--preset--spacing--40) !important;
	}
}
