/*
Theme Name: Festivus Gastronomicus
Theme URI: https://festivusgastronomicus.laurentmartin.org/
Author: Laurent Martin
Description: Modern block-theme port of the original 2006 customized-Kubrick design of Festivus Gastronomicus. Design authority: the 2016 site backup (themes/default) and Wayback Machine captures.
Version: 1.0.7
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: festivusgastronomicus
*/

/* ---------- Kubrick chrome (values from the original style.css/header.php) ---------- */

body {
	/* CSS port of kubrickbgcolor.jpg (sampled stops), stretched over the FULL
	   document height so the gradient never "runs out" on long pages. */
	background: #f1f1f1 linear-gradient(180deg,
		#033568 0%, #466a8e 18%, #879db4 36%, #b9c3cf 58%, #dee1e6 83%, #f1f1f1 100%);
}

/* Cancel WP's automatic block-gap margins between root blocks and inside the
   page shell — they land on the template-part WRAPPER divs (footer gap) and
   between header and columns; spacing is owned by our own paddings instead. */
.wp-site-blocks > * + *,
.fg-page > * + *,
.fg-columns > * + * {
	margin-block-start: 0 !important;
}

/* #page: 760px centered white box. The original used raster strips
   (kubrickbg*.jpg) for the sidebar/rails; painted in CSS here so the grey
   always matches the real column. */
.fg-page {
	max-width: 760px;
	margin: 20px auto 0;
	background: #fff;
	border: 1px solid #959596;
	border-bottom: none;
	box-sizing: border-box;
}

/* Header: khaki box, 10px navy border, logo + name + dots as one home link */
.fg-header {
	background-color: #cccc99;
	border: 10px solid #003366;
	padding: 25px 10px 10px 35px;
	min-height: 175px;
	box-sizing: border-box;
}
.fg-header a {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #003366;
	text-decoration: none;
	font-family: Arial, Verdana, sans-serif;
	font-size: 2.5rem; /* original: 4.0em on a 62.5% root = 40px */
	font-weight: normal;
	line-height: 1.1;
}
.fg-header a:hover,
.fg-header a:visited {
	color: #003366;
}
.fg-header img {
	display: block;
	flex: 0 0 auto;
}

/* Two-column body: 450px content (45px left pad) + 190px sidebar */
.fg-columns {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	/* full-height sidebar tint, aligned exactly to the 210px sidebar column */
	background: linear-gradient(to left, #f8f8f8 210px, #ffffff 210px);
}
.fg-content {
	flex: 1 1 auto;
	min-width: 0; /* flex items otherwise refuse to shrink below their widest child (large images) */
	padding: 10px 0 20px;
	overflow-wrap: break-word;
}
/* Center the 450px content column within its channel */
.fg-content > * {
	max-width: 450px;
	margin-left: auto !important;
	margin-right: auto !important;
}
/* Template parts render inside an unstyled div.wp-block-template-part wrapper —
   THAT div is the real flex child, so size the column there. */
.fg-columns > .wp-block-template-part {
	flex: 0 0 210px;
	min-width: 0;
	margin-left: auto;
}
.fg-sidebar {
	min-width: 0;
	padding: 20px 15px 10px 15px; /* symmetric within the 210px rail */
	font-size: 0.8rem;
}
/* Keep the search widget inside the 210px rail */
.fg-sidebar .wp-block-search__inside-wrapper {
	flex-wrap: wrap;
	gap: 6px;
}
.fg-sidebar .wp-block-search__input {
	min-width: 0;
	width: 100%;
	flex: 1 1 auto;
}
.fg-sidebar .wp-block-search__button {
	margin-left: 0;
}

/* Single posts: wide column, no sidebar (original .widecolumn, centered) */
.fg-widecolumn {
	max-width: 450px;
	min-width: 0;
	margin: 5px auto 0;
	padding: 10px 0 20px 0;
	overflow-wrap: break-word;
}

/* Contain modern (Gutenberg-converted) content inside the classic columns:
   alignfull/alignwide get max-width:none from WP layout styles and would
   otherwise escape the 450px column and overlap the sidebar. */
.fg-content .alignfull,
.fg-content .alignwide,
.fg-widecolumn .alignfull,
.fg-widecolumn .alignwide {
	max-width: 100% !important;
	width: auto !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
.fg-content img,
.fg-widecolumn img {
	max-width: 100% !important;
	height: auto;
}
.fg-content figure,
.fg-widecolumn figure {
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Post presentation */
.fg-content h2 a,
.fg-widecolumn h2 a {
	color: #333;
	text-decoration: none;
}
.fg-content h2 a:hover,
.fg-widecolumn h2 a:hover {
	color: #0066cc;
}
.fg-postdate,
.postmetadata {
	color: #777;
	font-size: 0.8rem;
}
.postmetadata > * {
	display: inline;
}
.fg-singlemeta {
	color: #777;
	font-size: 0.8rem;
	margin-top: 1.5em;
}
.fg-singlemeta > * {
	display: inline;
}
.wp-block-post-content a:visited {
	color: #b85b5a; /* original .entry p a:visited */
}

/* Featured image */
.fg-featured {
	margin: 0.8em 0;
}
.fg-featured img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Review ratings list (original ul.post-meta) */
ul.post-meta {
	list-style: none;
	padding-left: 0;
	margin: 1em 0;
}
.post-meta-key {
	font-weight: bold;
}

/* Sidebar internals (original #sidebar) */
.fg-sidebar h2 {
	font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, sans-serif;
	font-size: 1rem;
	margin: 1.2em 0 0.3em;
	color: #333;
}
.fg-sidebar ul {
	list-style: none;
	padding-left: 0;
	margin: 0 0 0.8em;
}
.fg-sidebar ul li {
	margin: 0.25em 0;
	color: #777;
}
.fg-sidebar .wp-block-search__button {
	font-size: 0.8rem;
}
/* Original blogroll showed only on home + pages */
body.archive .fg-blogroll,
body.search .fg-blogroll {
	display: none;
}

/* Footer: attaches seamlessly to the page box (no raster cap image;
   margin-top:0 cancels the root block-gap WP inserts between root blocks) */
.fg-footer {
	max-width: 760px;
	margin: 0 auto !important;
	background: #fff;
	border: 1px solid #959596;
	border-top: 1px solid #ddd;
	text-align: center;
	padding: 15px 0 25px;
	font-size: 0.75rem;
	color: #333;
	box-sizing: border-box;
}
.fg-footer p {
	margin: 0;
}

/* ---------- Responsive adaptation (R5: responsive-faithful) ---------- */
@media (max-width: 780px) {
	.fg-page {
		margin: 0;
		border-left: none;
		border-right: none;
		background-image: none;
	}
	.fg-header {
		padding: 15px;
		min-height: 0;
	}
	.fg-header a {
		font-size: 1.5rem;
		flex-wrap: wrap;
	}
	.fg-header img.logo {
		width: 74px;
		height: 75px;
	}
	.fg-header img.dots {
		display: none;
	}
	.fg-columns {
		flex-direction: column;
		background: none; /* horizontal sidebar tint makes no sense stacked */
	}
	.fg-sidebar {
		background: #f8f8f8;
	}
	.fg-content,
	.fg-widecolumn {
		max-width: none;
		margin: 0;
		padding: 10px 20px 20px;
	}
	.fg-sidebar {
		flex: 0 0 auto;
		width: auto;
		margin-left: 0;
		padding: 0 20px 20px;
	}
	.fg-footer {
		border-left: none;
		border-right: none;
	}
}
