/*
Theme Name: Cretamel
Theme URI: https://iam.yiannismakrakis.gr
Description: Cretamel is a fast, standalone WordPress theme built for Elementor. It supports the full Elementor Theme Builder: header, footer, single, archive, search, 404 and WooCommerce locations. No parent theme required.
Author: Yiannis M
Author URI: https://iam.yiannismakrakis.gr
Version: 3.9.12
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: cretamel
Tags: elementor, page-builder, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks, rtl-language-support
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/

/* ==========================================================================
   Add your custom styles below.
   The theme base styles live in assets/css/. Do not edit those on updates -
   override them here instead.
   ========================================================================== */

/* Keep the home footer newsletter fields aligned when Turnstile inserts its
   widget inside Elementor's narrow submit column. The widget remains visible
   and part of the form, on a full row beneath the email and submit button. */
#newsletter_form .elementor-form-fields-wrapper {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
	align-items: center;
}

#newsletter_form .elementor-field-group-email {
	grid-column: 1;
	grid-row: 1;
	width: 100%;
}

#newsletter_form .e-form__buttons {
	display: contents;
}

#newsletter_form .e-form__buttons > button {
	grid-column: 2;
	grid-row: 1;
	justify-self: start;
}

#newsletter_form .e-form__buttons > .elementor-turnstile-field {
	grid-column: 1 / -1;
	grid-row: 2;
	width: 100% !important;
	margin: 12px 0 0 !important;
	display: flex !important;
	justify-content: left;
}

@media (max-width: 767px) {
	#newsletter_form .elementor-form-fields-wrapper {
		grid-template-columns: minmax(0, 1fr);
	}

	#newsletter_form .e-form__buttons > button {
		grid-column: 1;
		grid-row: 2;
		margin-top: 12px;
	}

	#newsletter_form .e-form__buttons > .elementor-turnstile-field {
		grid-column: 1;
		grid-row: 3;
	}
}

/* ==========================================================================
   News articles (single post)
   Only the article text (Theme Post Content widget) and the featured image.
   ========================================================================== */

/* Featured image: soft shadow. */
.single-post .elementor-widget-theme-post-featured-image img {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
	border-radius: 4px;
}

/* Headings inside the article only: big space above, small space below. */
.single-post .elementor-location-single .elementor-widget-theme-post-content :is(h2, h3, h4) {
	margin-block: 1.1em 0.2em;
	line-height: 1.25;
}

.single-post .elementor-location-single .elementor-widget-theme-post-content :is(h2, h3, h4):first-child {
	margin-block-start: 0;
}

/* Remove the big gaps: empty paragraphs, loose lists, stacked images. */
.single-post .elementor-widget-theme-post-content p:empty,
.single-post .elementor-widget-theme-post-content p > br:only-child {
	display: none;
}

.single-post .elementor-widget-theme-post-content :is(ul, ol) {
	margin-block: 0 1rem;
	padding-inline-start: 1.25em;
}

.single-post .elementor-widget-theme-post-content li {
	margin-block: 0 0.3em;
}

.single-post .elementor-widget-theme-post-content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-block: 1.5rem;
	border-radius: 4px;
}

/* An image inside a figure or caption: the figure owns the spacing. */
.single-post .elementor-widget-theme-post-content figure {
	margin-block: 1.5rem;
	margin-inline: 0;
}

.single-post .elementor-widget-theme-post-content :is(figure, .wp-caption) img {
	margin-block: 0;
	border-radius: 4px;
}

.single-post .elementor-widget-theme-post-content > :last-child {
	margin-block-end: 0;
}

@media (max-width: 767px) {
	.single-post .elementor-location-single .elementor-widget-theme-post-content :is(h2, h3, h4) {
		margin-block-start: 0.9em;
	}
}

/* Galleries inside the article. The theme has no WordPress gallery CSS, so the
   photos stacked in one column. Grid: columns from the gallery-columns-N class,
   2 columns on tablet, 1 column on a small phone (2 and 4 stay at 2). */
.single-post .elementor-location-single .elementor-widget-theme-post-content .gallery {
	display: grid;
	grid-template-columns: repeat(var(--gallery-cols, 3), minmax(0, 1fr));
	gap: 12px;
	margin-block: 1.5rem;
}

.single-post .elementor-widget-theme-post-content .gallery-columns-1 { --gallery-cols: 1; }
.single-post .elementor-widget-theme-post-content .gallery-columns-2 { --gallery-cols: 2; }
.single-post .elementor-widget-theme-post-content .gallery-columns-3 { --gallery-cols: 3; }
.single-post .elementor-widget-theme-post-content .gallery-columns-4 { --gallery-cols: 4; }
.single-post .elementor-widget-theme-post-content .gallery-columns-5 { --gallery-cols: 5; }

.single-post .elementor-widget-theme-post-content .gallery .gallery-item {
	margin: 0;
	padding: 0;
	width: auto;
	max-width: none;
}

.single-post .elementor-widget-theme-post-content .gallery .gallery-icon,
.single-post .elementor-widget-theme-post-content .gallery .gallery-icon a {
	display: block;
}

.single-post .elementor-widget-theme-post-content .gallery img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	margin: 0;
	border-radius: 4px;
}

@media (max-width: 1025px) {
	.single-post .elementor-widget-theme-post-content .gallery[class*="gallery-columns-"] {
		--gallery-cols: 2;
	}
}

@media (max-width: 479px) {
	.single-post .elementor-widget-theme-post-content .gallery[class*="gallery-columns-"] {
		--gallery-cols: 1;
	}

	/* Galleries of 2 and 4 stay in 2 columns on a phone. */
	.single-post .elementor-widget-theme-post-content .gallery.gallery-columns-2,
	.single-post .elementor-widget-theme-post-content .gallery.gallery-columns-4 {
		--gallery-cols: 2;
		gap: 8px;
	}
}

/* Article sidebar ("Read More" list): headings with no margin and no padding.
   Add the CSS class article_sidebar to the sidebar container in Elementor.
   !important: the Elementor Custom CSS rule .type-post .elementor-widget-container
   h3:not(.elementor-heading-title) is stronger and sets margin on these titles. */
.article_sidebar :is(h1, h2, h3, h4, h5, h6),
.article_sidebar .elementor-post__title,
.article_sidebar .elementor-post__text {
	margin: 0 !important;
	padding: 0 !important;
}
