/*
Theme Name: Astra Child
Theme URI: https://oldmagazinearticles.com/astra-child
Description: A child theme for Astra for Old Magazine Articles.
Author: Jay Ligda
Author URI: http://jay.ligda.net
Template: astra
Version: 1.1.6
*/

/* -------------------------------------------------------------------------
   Single article: wider content + no wasted side margins
   ------------------------------------------------------------------------- */

body.single-post.ast-no-sidebar .site-content > .ast-container,
body.single-post .site-content > .ast-container {
	max-width: 1400px;
	width: 100%;
}

body.single-post #primary {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

body.single-post #secondary {
	display: none;
}

/* -------------------------------------------------------------------------
   Single article two-column layout (replaces Astra Custom Layouts 1–6)
   ------------------------------------------------------------------------- */

.single .oma-article-single {
	overflow: visible;
}

.oma-article-layout {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: 1.5rem;
	row-gap: 1.5rem;
	align-items: start;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	clear: both;
	position: relative;
}

#left-post-column.oma-article-main,
#right-post-column.oma-article-aside {
	grid-column: auto;
	float: none !important;
	position: relative !important;
	left: auto !important;
	right: auto !important;
	width: auto !important;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	box-sizing: border-box;
	overflow-x: hidden; /* keep floats/images inside their column */
	z-index: 1;
}

#left-post-column.oma-article-main {
	grid-column: 1;
}

#right-post-column.oma-article-aside {
	grid-column: 2;
	text-align: center;
}

#right-post-column.oma-article-aside p {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

#right-post-column.oma-article-aside img {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

#left-post-column.oma-article-main::after,
#right-post-column.oma-article-aside::after {
	content: "";
	display: table;
	clear: both;
}

.oma-article-main img,
.oma-article-aside img,
.oma-article-main .wp-post-image,
.oma-article-content img {
	max-width: 100% !important;
	height: auto !important;
	float: none !important;
}

.oma-article-content {
	clear: both;
	overflow-wrap: anywhere;
	word-wrap: break-word;
}

.oma-article-title-wrap {
	margin-top: -10px;
	margin-bottom: 20px;
}

.oma-read-free {
	margin: 1em 0;
	clear: both;
}

.oma-keywords {
	margin: 1em 0 0;
	text-align: center;
	line-height: 2;
	clear: both;
}

/* Desktop: keywords under Read Free (left). Tablet/phone: keywords under gallery (right). */
.oma-keywords-desktop {
	display: block;
}

.oma-keywords-mobile {
	display: none;
}

.oma-keyword-tag {
	display: inline-block;
	margin: 0.2em 0.35em;
	padding: 0.35em 0.75em;
	font-size: 0.9em;
	font-style: italic;
	line-height: 1.3;
	color: #4b5563;
	background-color: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	vertical-align: middle;
}

/* Tablet / phone: single column */
@media (max-width: 921px) {
	.oma-article-layout {
		grid-template-columns: 1fr;
	}

	#left-post-column.oma-article-main,
	#right-post-column.oma-article-aside {
		grid-column: 1;
	}

	.oma-keywords-desktop {
		display: none;
	}

	.oma-keywords-mobile {
		display: block;
	}

	/* Never show a second Read Free button in the stacked right column */
	#right-post-column .oma-read-free,
	#right-post-column img[src*="read_full.gif"] {
		display: none !important;
	}

	/* No JPGs: hide the empty right column on tablet/phone (keywords use left/desktop hide rules) */
	#right-post-column.oma-aside-no-gallery {
		display: none;
	}

	/* Keywords still needed on mobile when there is no gallery — show under left Read Free */
	#right-post-column.oma-aside-no-gallery .oma-keywords-mobile {
		display: none;
	}

	.oma-article-layout:has(#right-post-column.oma-aside-no-gallery) .oma-keywords-desktop {
		display: block;
	}
}
