/*
Theme Name: KISSS 2005
Theme URI: https://kisss.org.uk
Author: Live Art Ireland
Description: The original KISSS site as archived. The recovered pages contain the design themselves, a fixed 903px table layout with the banner and the bracketed navigation, so on a wide screen this theme adds nothing. Below 900px the tables are unpicked into a single column so the site can be read on a phone.
Version: 1.2
License: GNU General Public License v2 or later
Text Domain: kisss-2005
*/

/* ------------------------------------------------------------------
   Base, from the original sidenav.css, maintxt.css, littlecaptions.css
   ------------------------------------------------------------------ */

body {
	margin: 0;
	padding: 0;
	background-color: #FFFFFF;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
	-webkit-text-size-adjust: 100%;
}

#kisss-page {
	width: 935px;
	margin: 0 auto;
	padding: 0;
}

.sidenav,
a:link,
a:visited {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
	text-decoration: none;
}

a:active,
a:hover {
	color: #66FF33;
	text-decoration: none;
}

.maintxt {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
	text-decoration: none;
	text-align: justify;
	border: none;
	list-style-type: none;
}

.littlecaptions {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	line-height: 1.4;
	color: #666666;
}

#kisss-page table { border-collapse: collapse; }
#kisss-page img   { border: 0; }

/* ------------------------------------------------------------------
   Wide screens
   The design is a fixed 935px from 2005, which strands it in the middle
   of a modern laptop screen. Rather than rebuild the tables, the whole
   page is scaled up in proportion, so the layout stays exactly as it
   was drawn and simply gets larger.
   ------------------------------------------------------------------ */

@media screen and (min-width: 1150px) {
	#kisss-page { zoom: 1.2; }
}

@media screen and (min-width: 1450px) {
	#kisss-page { zoom: 1.45; }
}

@media screen and (min-width: 1750px) {
	#kisss-page { zoom: 1.7; }
}

/* ------------------------------------------------------------------
   Narrow screens
   The pages are hand-built tables with fixed pixel widths, so they are
   taken apart into a single column: every cell becomes a block, the
   spacer and decorative-background cells are dropped, and the
   navigation becomes a wrapping row of links.
   ------------------------------------------------------------------ */

@media screen and (max-width: 900px) {

	body {
		font-size: 15px;
		line-height: 1.5;
	}

	#kisss-page {
		width: auto;
		max-width: 100%;
		padding: 0 12px 30px;
		box-sizing: border-box;
		overflow-x: hidden;
	}

	/* Unpick the outer layout tables. */
	#kisss-page table,
	#kisss-page tbody,
	#kisss-page tr,
	#kisss-page td {
		display: block;
		width: auto !important;
		height: auto !important;
		max-width: 100%;
		box-sizing: border-box;
	}

	/* Spacer cells and the decorative side column serve no purpose here. */
	#kisss-page td:empty { display: none; }
	#kisss-page td[background] { display: none !important; }

	/* Pictures scale rather than forcing sideways scrolling. */
	#kisss-page img {
		max-width: 100% !important;
		height: auto !important;
	}

	/* The banner. */
	#kisss-page img[src*="TOPHEAD"],
	#kisss-page img[src*="tophead"] {
		width: 100% !important;
		margin-bottom: 6px;
	}

	/* The navigation bar becomes a wrapping row. */
	#kisss-page tr:has(td.sidenav) {
		display: flex;
		flex-wrap: wrap;
		gap: 4px 14px;
		padding: 10px 0 14px;
		border-bottom: 1px solid #dddddd;
		margin-bottom: 14px;
	}

	#kisss-page td.sidenav {
		display: inline-block;
		width: auto !important;
		font-size: 16px;
		line-height: 2;
	}

	#kisss-page td.sidenav:empty { display: none; }

	/* Give the links a decent tap target. */
	#kisss-page td.sidenav a {
		display: inline-block;
		padding: 4px 2px;
		font-size: 16px;
	}

	.maintxt {
		font-size: 15px;
		line-height: 1.5;
		text-align: left; /* justified text reads badly in a narrow column */
	}

	.littlecaptions { font-size: 12px; }

	#kisss-page blockquote {
		margin-left: 0;
		margin-right: 0;
	}

	/* The filler paragraphs that gave the 2005 layout its spacing. */
	#kisss-page p:empty,
	#kisss-page .kisss-spacer { display: none !important; }

	/* Cells holding a single space, mostly in the navigation bar. */
	#kisss-page td.sidenav:last-child { display: none; }

	/* The tables carry align="left", which floats them. Undo that or a
	   width-auto block shrinks to fit and spills. */
	#kisss-page table { float: none !important; }

	#kisss-page p { margin: 0 0 0.8em; }
	#kisss-page blockquote p:last-child { margin-bottom: 0; }
}

/* Older browsers without :has() still need the bar not to collapse. */

@media screen and (max-width: 900px) {
	#kisss-page td.sidenav {
		float: left;
		margin-right: 14px;
	}

	#kisss-page tr:has(td.sidenav) td.sidenav {
		float: none;
		margin-right: 0;
	}
}
