/*
Theme Name: Astra Child
Template: astra
Description: Child theme for Astra
Version: 1.0.0
Text Domain: astra-child
*/

/* ---- Old astro-photography.net look ---------------------------------- */

:root {
	--astro-text: #f5f5f5;
	--astro-panel: #8f8f8f url("assets/images/mottled-grey2.jpg") repeat left top;
	--astro-font: Verdana, Geneva, sans-serif;
}

body,
body.ast-plain-container,
body.ast-separate-container,
body.ast-page-builder-template {
	background: #000 url("assets/images/stars.jpg") repeat left top;
	color: var(--astro-text);
	font-family: var(--astro-font);
	font-size: 10pt;
	line-height: 1.5;
}

body,
button,
input,
select,
textarea,
.entry-content,
h1, h2, h3, h4, h5, h6,
.entry-title {
	font-family: var(--astro-font);
	color: var(--astro-text);
}

#page h1, #page h2, #page h3, #page h4, #page h5, #page h6,
#page .entry-title {
	font-family: var(--astro-font);
	color: var(--astro-text);
}

/* 850px page centred on the star field */
#page.site {
	max-width: 850px;
	margin: 40px auto 20px;
	background: transparent;
}

/* Banner replaces Astra's header and footer */
#masthead,
.site-footer {
	display: none;
}

.astro-banner img {
	display: block;
	width: 100%;
	height: auto;
}

/* Grey panel holding the left column and the content */
#content.site-content {
	background: var(--astro-panel);
	padding: 0;
}

#content.site-content > .ast-container {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	max-width: none;
	padding: 0;
	margin: 0;
}

#content #secondary {
	flex: 0 0 auto;
	width: auto;
	min-width: 140px;
	max-width: 160px;
	order: 0;
	margin: 0;
	padding: 5px;
	border: 0;
	background: transparent;
}

#content #primary {
	flex: 1 1 auto;
	width: auto;
	min-width: 0; /* lets wide tables scroll inside the panel instead of widening the page */
	order: 1;
	margin: 0;
	padding: 20px;
	border: 0;
	background: transparent;
}

#secondary .sidebar-main,
.ast-separate-container #primary .ast-article-single,
.ast-separate-container #primary .ast-article-post,
.ast-separate-container .ast-article-single,
.ast-separate-container .comments-area,
.ast-plain-container #primary article,
#primary .site-main > article {
	background: transparent;
	padding: 0;
	margin: 0;
	border: 0;
	box-shadow: none;
}

/* Left navigation */
.astro-left-nav ul {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
}

.astro-left-nav li {
	margin: 0 0 10px;
	font-size: 10pt;
	line-height: 1.3;
	overflow-wrap: normal;
	word-break: normal;
}

.astro-left-nav a,
.astro-left-nav a:visited,
.astro-left-nav a:hover {
	color: var(--astro-text);
	font-weight: bold;
	text-decoration: none;
}

.astro-left-nav a:hover,
.astro-left-nav .current-menu-item > a {
	text-decoration: underline;
}

.astro-copyright {
	margin-top: 30px;
	text-align: left;
	font-size: 8pt;
	color: whitesmoke;
}

/* Links, as on the old site */
#primary a:link {
	color: #fff;
	text-decoration: underline;
}

#primary a:visited {
	color: #ff0;
	text-decoration: underline;
}

#primary a:hover,
#primary a:active {
	color: #f00;
	text-decoration: none;
}

/* Page titles look like the old centred h2 headings */
#page .entry-header,
#page .entry-title {
	margin-bottom: 1em;
	text-align: center;
}

/* Main photos were shown 600px wide on the old site; click opens the full size */
.entry-content .wp-block-image.aligncenter img {
	max-width: 600px;
	width: 100%;
	height: auto;
}

/* Data tables in articles */
.entry-content .wp-block-table table {
	border-collapse: collapse;
}

.entry-content .wp-block-table td,
.entry-content .wp-block-table th {
	border: 1px solid rgba(245, 245, 245, 0.5);
	padding: 4px 8px;
}

/* Messier table keeps the old row colours, so its text is dark.
   On narrow screens it scrolls sideways while the Messier number column stays put. */
.entry-content .astro-messier {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
}

.entry-content .astro-messier table {
	width: 100%;
	min-width: 620px;
	font-size: 9pt;
	color: #000;
	background: #fff;
	border-collapse: separate;
	border-spacing: 0;
}

.entry-content .astro-messier tr {
	background-color: #fff;
}

.entry-content .astro-messier th {
	background: #ddd;
	color: #000;
}

.entry-content .astro-messier tr > :first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	background-color: inherit;
	box-shadow: 2px 0 3px rgba(0, 0, 0, 0.25);
	width: 4.5em;
	min-width: 4.5em;
	padding: 4px 8px;
}

.entry-content .astro-messier th:first-child {
	background-color: #ddd;
}

#primary .astro-messier a:link,
#primary .astro-messier a:visited {
	color: #000;
}

#primary .astro-messier a:hover {
	color: #f00;
}

.entry-content .astro-messier td.astro-m-img,
.entry-content .astro-messier th.astro-m-img {
	padding: 2px;
	text-align: center;
}

.entry-content .astro-messier img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	display: inline-block;
}

.entry-title,
.entry-content h2 {
	font-size: 1.5em;
	font-weight: bold;
}

.entry-content p {
	margin-bottom: 1em;
}

/* Home page "Latest Added Images" rows: tight like the old tables */
.entry-content .wp-block-columns.is-not-stacked-on-mobile {
	gap: 20px;
	margin: 0 0 20px;
	padding: 0;
}

.entry-content .wp-block-columns .wp-block-image {
	margin: 0;
}

/* Calibration strip and contact link at the bottom of each page */
.astro-panel-footer {
	margin-top: 30px;
	text-align: center;
	font-size: 8pt;
}

.astro-panel-footer p {
	margin: 0 0 10px;
}

.astro-panel-footer img {
	max-width: 100%;
	height: auto;
}

/* Narrow screens: navigation above the content */
@media (max-width: 768px) {
	#page.site {
		margin-top: 0;
	}

	#content.site-content > .ast-container {
		flex-direction: column;
	}

	#content #secondary {
		flex-basis: auto;
		width: 100%;
		max-width: none;
		order: 2; /* menu and copyright below the page content */
		border-top: 1px solid rgba(245, 245, 245, 0.3);
		padding: 10px 16px;
	}

	#content #primary {
		padding: 16px;
	}

	.astro-left-nav ul {
		display: flex;
		flex-wrap: wrap;
		gap: 6px 14px;
		margin: 0;
	}

	.astro-left-nav li {
		margin: 0;
	}

	.astro-copyright {
		margin-top: 12px;
		font-size: 8pt;
	}
}
