/*
Theme Name: Radio
Theme URI: https://wemakethings.xyz/rad
Author: Loyd Schutte
Description: A Radio Userland style micro-blog theme for ClassicPress. Posts carry no titles: they are grouped under a single day heading in reverse chronological order, and the time of posting sits above each post and doubles as its permalink. Ships with the day-linking calendar widget from the original stand-alone app.
Version: 1.0.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: radio
Tags: blog, microblog, one-column, two-columns, right-sidebar, custom-menu, rtl-language-support
*/

/* Reset and base styles */
/* Test comment to push upload. 2:40 pm.*/

* {
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	line-height: 1.6;
	margin: 0;
	padding: 0;
	color: #333;
	background-color: #fff;
}

/* Container wrapper */
.container {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: auto 1fr;
	grid-template-areas:
		"header"
		"main"
		"sidebar";
	min-height: 100vh;
	max-width: 1200px;
	margin: 0 auto;
}

/* Tablet and desktop layout */
@media (min-width: 768px) {
	.container {
		grid-template-columns: 1fr 300px;
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"header header"
			"main sidebar";
		gap: 20px;
		padding: 0 20px;
	}
}

/* Large desktop layout */
@media (min-width: 1024px) {
	.container {
		grid-template-columns: 1fr 350px;
	}
}

/* Header styles */
.header {
	grid-area: header;
	text-align: center;
	background-color: #f8f9fa;
	padding: 2rem 1rem;
	border-bottom: 2px solid #e9ecef;
	margin-bottom: 20px;
}

@media (min-width: 768px) {
	.header {
		padding: 3rem 2rem;
		margin-bottom: 0;
	}
}

.header h1 {
	color: #2c3e50;
	margin: 0 0 0.5rem 0;
	font-size: 2rem;
	font-weight: 700;
}

@media (min-width: 768px) {
	.header h1 {
		font-size: 2.5rem;
	}
}

.header p {
	color: #6c757d;
	font-style: italic;
	margin: 0;
	font-size: 1.1rem;
}

/* Main content area */
.main-content {
	grid-area: main;
	padding: 0 1rem;
	margin-bottom: 2rem;
}

@media (min-width: 768px) {
	.main-content {
		padding: 0;
		margin-bottom: 0;
	}
}

/* Day section styles */
.day-section {
	margin-bottom: 3rem;
}

.day-header {
	font-size: 1.5rem;
	font-weight: 600;
	color: #2c3e50;
	margin: 0 0 1.5rem 0;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #e9ecef;
}

.day-permalink {
	font-size: 1.2rem;
	font-weight: normal;
	color: #adb5bd;
	margin-left: 0.5rem;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

.day-permalink:hover {
	opacity: 1;
	text-decoration: none;
}

/* Post styles */
.post {
	margin-bottom: 2rem;
	padding: 0;
	border: none;
	background: transparent;
	box-shadow: none;
}

/* Post time styles */
.post-time {
	font-size: 0.875rem;
	font-weight: 500;
	color: #6c757d;
	margin-bottom: 0.5rem;
}

.time-permalink {
	font-size: 0.875rem;
	color: #adb5bd;
	margin-left: 0.5rem;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

.time-permalink:hover {
	opacity: 1;
	text-decoration: none;
}

/* Post content styles */
.post-content {
	color: #212529;
	font-size: 1rem;
	line-height: 1.7;
}

.post-content p {
	margin: 0.8rem 0;
}

.post-content p:first-child {
	margin-top: 0;
}

.post-content p:last-child {
	margin-bottom: 0;
}

/* Legacy outline styles for backwards compatibility */
.post-content ul {
	padding-left: 0;
	margin: 0;
}

.post-content li {
	list-style: none;
	margin: 0.5rem 0;
	position: relative;
	padding-left: 1.5rem;
}

.post-content li:before {
	content: "•";
	color: #3498db;
	font-weight: bold;
	position: absolute;
	left: 0;
}

.post-content .level-1 {
	margin-left: 1.5rem;
}

.post-content .level-2 {
	margin-left: 3rem;
}

.post-content .level-3 {
	margin-left: 4.5rem;
}

/* Sidebar styles */
.sidebar {
	grid-area: sidebar;
	background: #f8f9fa;
	padding: 1.5rem;
	border-top: 2px solid #e9ecef;
}

@media (min-width: 768px) {
	.sidebar {
		border-top: none;
		border-left: 1px solid #e9ecef;
		position: sticky;
		top: 20px;
		height: fit-content;
	}
}

/* Calendar widget */
.calendar-widget {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1rem;
}

.calendar-widget th,
.calendar-widget td {
	text-align: center;
	padding: 0.5rem;
	border: 1px solid #e9ecef;
}

.calendar-widget th {
	background-color: #f1f3f5;
	font-weight: 600;
	font-size: 0.9rem;
}

.calendar-widget td {
	height: 2.5rem;
}

.calendar-widget .has-post {
	background-color: #e3f2fd;
	font-weight: 600;
}

.calendar-widget .has-post a {
	display: block;
	width: 100%;
	height: 100%;
	color: #1976d2;
}

/* RSS link */
.rss-link {
	border-top: 1px solid #e9ecef;
}

.rss-link a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: #333;
	font-weight: 500;
	text-decoration: none;
}

.rss-link a:hover {
	text-decoration: underline;
}

.rss-link svg {
	width: 40px;
	height: 40px;
	display: inline-block;
	vertical-align: middle;
}

/* Link styles */
a {
	color: #3498db;
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: #2c7fb8;
	text-decoration: underline;
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
	.post {
		padding: 1rem;
	}
	
	.post-content {
		font-size: 0.95rem;
	}
	
	.sidebar h3 {
		font-size: 1.2rem;
		margin-top: 0;
	}
}

/* Print styles */
@media print {
	.sidebar {
		display: none;
	}

	.container {
		display: block;
	}

	.post {
		break-inside: avoid;
		box-shadow: none;
		border: 1px solid #000;
	}
}

/* Responsive embedded video player (YouTube). 16:9 wrapper, capped width. */
.video-embed {
	position: relative;
	width: 100%;
	max-width: 600px;
	aspect-ratio: 16 / 9;
	margin: 1.5rem 0;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	background: #000;
}

.video-embed iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
/* ------------------------------------------------------------------
   Additions for the ClassicPress build. Everything above this line is
   the original stand-alone app's stylesheet, kept verbatim.
   ------------------------------------------------------------------ */

/* Anchor target that the "back to top" button jumps to. */
#top {
	position: absolute;
	top: -100px;
}

/* Media dropped in by the editor never breaks the column. */
.post-content img,
.post-content video,
.post-content iframe {
	max-width: 100%;
	height: auto;
}

.post-content iframe {
	border: 0;
}

.post-content blockquote {
	margin: 1rem 0;
	padding: 0.25rem 0 0.25rem 1rem;
	border-left: 3px solid #e9ecef;
	color: #495057;
}

.post-content pre {
	overflow-x: auto;
	padding: 1rem;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 4px;
	font-size: 0.9rem;
}

.post-content code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

.post-content pre code {
	font-size: inherit;
}

.post-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
}

.post-content th,
.post-content td {
	border: 1px solid #e9ecef;
	padding: 0.5rem;
	text-align: left;
}

/* WordPress / ClassicPress required alignment + caption classes. */
.alignleft {
	float: left;
	margin: 0.5rem 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.5rem 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin: 1rem auto;
}

.alignnone {
	margin: 1rem 0;
}

.wp-caption {
	max-width: 100%;
	margin-bottom: 1rem;
}

.wp-caption-text,
.wp-caption p.wp-caption-text {
	font-size: 0.85rem;
	color: #6c757d;
	margin: 0.4rem 0 0;
	text-align: center;
}

.sticky .day-header,
.gallery-caption,
.bypostauthor {
	/* Required by the theme review handbook; no visual change needed. */
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	clip: auto;
	white-space: normal;
}

/* Skip link so keyboard users can bypass the header. */
.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 100;
	padding: 0.75rem 1rem;
	background: #2c3e50;
	color: #fff;
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
	color: #fff;
	text-decoration: none;
}

/* Calendar navigation. In the stand-alone app these were inline styles. */
.calendar {
	margin-top: 1.5rem;
}

.calendar-nav h3 {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 1.05rem;
	color: #2c3e50;
	margin: 0;
}

.nav-btn {
	margin-left: auto;
	min-width: 1.75rem;
	padding: 0 0.4rem;
	line-height: 1.6;
	font-size: 1rem;
	color: #495057;
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 3px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.nav-btn + .nav-btn {
	margin-left: 0;
}

.nav-btn:hover,
.nav-btn:focus {
	background: #e9ecef;
}

.calendar-widget td:empty {
	background: #fbfcfd;
}

/* Sidebar widgets. */
.sidebar-content {
	margin-top: 1.5rem;
}

.sidebar .widget {
	margin-bottom: 1.5rem;
}

.sidebar .widget-title,
.sidebar .widget h2 {
	font-size: 1.05rem;
	color: #2c3e50;
	margin: 0 0 0.6rem;
}

.sidebar .widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sidebar .widget li {
	margin: 0.3rem 0;
}

.sidebar select,
.sidebar input[type="search"],
.sidebar input[type="text"] {
	max-width: 100%;
}

/* Header navigation menu, when one is assigned. */
.header-nav {
	margin-top: 0.75rem;
}

.header-nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.95rem;
}

/* Archive / search heading, styled like a day header. */
.page-header {
	margin-bottom: 2rem;
}

.page-title {
	font-size: 1.4rem;
	font-weight: 600;
	color: #2c3e50;
	margin: 0 0 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #e9ecef;
}

.page-description {
	color: #6c757d;
	margin: 0;
}

/* Pagination between pages of days, and between single posts. */
.radio-pagination,
.post-navigation {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	margin: 3rem 0 1rem;
	padding-top: 1.5rem;
	border-top: 2px solid #e9ecef;
	font-size: 0.95rem;
}

.radio-pagination .page-numbers {
	padding: 0.25rem 0.55rem;
	border: 1px solid #e9ecef;
	border-radius: 3px;
}

.radio-pagination .page-numbers.current {
	background: #e3f2fd;
	color: #1976d2;
	font-weight: 600;
}

.radio-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}

.post-navigation .nav-next {
	margin-left: auto;
	text-align: right;
}

/* Comments, kept deliberately plain. */
.comments-area {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 2px solid #e9ecef;
}

.comments-title,
.comment-reply-title {
	font-size: 1.2rem;
	color: #2c3e50;
}

.comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .children {
	list-style: none;
	margin: 0 0 0 1.5rem;
	padding: 0;
}

.comment-body {
	margin-bottom: 1.5rem;
}

.comment-meta {
	font-size: 0.85rem;
	color: #6c757d;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	max-width: 40rem;
	padding: 0.5rem;
	border: 1px solid #dee2e6;
	border-radius: 3px;
	font: inherit;
}

/* Back to top button. Inline styles in the original; class-based here. */
#backToTop {
	display: none;
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99;
	width: 50px;
	height: 50px;
	padding: 15px;
	font-size: 18px;
	line-height: 1;
	color: #fff;
	background-color: #333;
	border: none;
	outline: none;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.3s;
}

#backToTop:hover,
#backToTop:focus {
	background-color: #555;
}

#backToTop.is-visible {
	display: block;
}

@media print {
	#backToTop,
	.radio-pagination,
	.skip-link {
		display: none;
	}
}
