/* ==========================================================================
   Release Notes Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables
   ========================================================================== */

:root {
	/* Branded Colours (from Colours_base.scss) */
	--covarity-midnight-color: #00205b;
	--covarity-silver-gray-color: #bbbcbc;
	--covarity-slate-gray-color: #545859;
	--covarity-cobalt-color: #003594;
	--covarity-goldenrod-color: #F1C400;

	/* Standard Colours (from Colours_base.scss) */
	--covarity-very-light-gray: #efefef;
	--covarity-white-smoke: #f5f5f5;
	--covarity-very-light-yellow: #ffc;
	--covarity-light-blue: #e6ebf4; /* cobalt 10% on white*/

	/* Semantic Colours */
	--color-border-light: var(--covarity-silver-gray-color);
	--color-background-subtle: var(--covarity-white-smoke);
	--color-callout-border: var(--covarity-silver-gray-color);
	--color-warning-background: var(--covarity-very-light-yellow);
	--color-warning-border: var(--covarity-goldenrod-color);
	--color-warning-text: var(--covarity-cobalt-color);

	/* Typography */
	--font-family-base: "Segoe UI", Arial, system-ui, sans-serif;
	--font-family-mono: monospace;

	/* Spacing */
	--spacing-unit: 1rem;
}

/* ==========================================================================
   2. Normalize / Reset
   Based on BrowserReset_base.scss patterns
   ========================================================================== */

html, body, div, header, main, footer, section,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, code, em, img, small, strong, sub, sup,
dl, dt, dd, ol, ul, li,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font-family: inherit;
	vertical-align: baseline;
}

/* HTML5 display definitions for older browsers */
header, main, footer, section {
	display: block;
}

/* Remove list styles - will restore selectively */
ol, ul {
	list-style: none;
}

/* Tables */
table {
	border-collapse: collapse;
	border-spacing: 0;
}

th {
	font-weight: normal;
	text-align: inherit;
}

/* Box sizing */
*, *::before, *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   3. Chrome User Agent Defaults (for elements used in release notes)
   ========================================================================== */

/* Document */
html {
	line-height: 1.15;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 8px;
	font-family: var(--font-family-base);
}

/* Headings */
h1 {
	font-size: 2em;
	font-weight: bold;
	margin: 0.67em 0;
}

h2 {
	font-size: 1.5em;
	font-weight: bold;
	margin: 0.83em 0;
}

h3 {
	font-size: 1.17em;
	font-weight: bold;
	margin: 1em 0;
}

h4 {
	font-size: 1em;
	font-weight: bold;
	margin: 1.33em 0;
}

h5 {
	font-size: 0.83em;
	font-weight: bold;
	margin: 1.67em 0;
}

h6 {
	font-size: 0.67em;
	font-weight: bold;
	margin: 2.33em 0;
}

/* Paragraphs */
p {
	margin: 1em 0;
}

/* Lists */
ul, ol {
	margin: 1em 0;
	padding-left: 40px;
}

ul {
	list-style-type: disc;
}

ol {
	list-style-type: decimal;
}

li {
	display: list-item;
}

/* Nested lists - no top/bottom margin */
ul ul, ul ol, ol ul, ol ol {
	margin-top: 0;
	margin-bottom: 0;
}

/* Links */
a {
	text-decoration: underline;
	cursor: pointer;
}

a:visited {
	color: VisitedText;
}

/* Text formatting */
strong, b {
	font-weight: 600;
}

em, i {
	font-style: italic;
}

small {
	font-size: smaller;
}

code {
	font-family: var(--font-family-mono);
}

/* Images */
img {
	border-style: none;
}

/* Tables - Chrome defaults */
table {
	border-collapse: separate;
	border-spacing: 2px;
}

th, td {
	padding: 1px;
}

th {
	font-weight: bold;
	text-align: center;
}

/* Blockquote */
blockquote {
	margin: 1em 40px;
}

button {
  /* 1. Remove background and border */
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  
  /* 2. Inherit font settings from parent */
  font: inherit;
  color: inherit;
  line-height: normal;
  
  /* 3. Make it feel interactive */
  cursor: pointer;
  text-align: inherit;
  
  /* 4. Remove Safari/iOS specific styling */
  -webkit-appearance: none;
  appearance: none;
}

/* ==========================================================================
   4. Release Notes Custom Styles
   ========================================================================== */

/* Layout */
body {
	max-width: 900px;
	margin: 0 auto;
	padding: 2rem;
	line-height: 1.6;
}

/* Typography overrides */
h1, h2, h3 {
	color: var(--covarity-slate-gray-color);
	font-weight: 600;
}

h2 {
	margin-top: 2em;
	margin-bottom: 0.75em;
	padding-top: 1.5em;
	border-top: 1px solid var(--color-border-light);
}

/* First h2 in main content shouldn't have border */
section:first-of-type h2 {
	border-top: none;
	padding-top: 0;
}

h3 {
	margin-top: 1.5em;
	margin-bottom: 0.5em;
	font-weight: normal;
	color: var(--covarity-midnight-color);
}

/* Links */
a {
	color: var(--covarity-cobalt-color);
}

a:visited {
	color: var(--covarity-cobalt-color);
}

a:hover {
	text-decoration: none;
}

a:focus {
	outline: 2px solid var(--covarity-cobalt-color);
	outline-offset: 2px;
}

/* Lists */
ul, ol {
	line-height: 1.8;
}

/* Issue keys */
.issue-key {
	font-family: var(--font-family-mono);
	color: var(--covarity-slate-gray-color);
}

/* Responsive images */
.responsive-img {
	max-width: 100%;
	height: auto;
}

.img-width-100 {
	width: 100%;
}

.img-width-75 {
	width: 75%;
}

.img-width-50 {
	width: 50%;
}

.img-width-35 {
	width: 35%;
}

.img-centered {
	display: block;
	margin: auto;
}

figcaption {
	font-size: .7rem;
	display: block;
	text-align: center;
}

/* Tables */
.release-notes-table {
	border-collapse: collapse;
}

.release-notes-table th,
.release-notes-table td {
	text-align: left;
	padding: 0.5rem;
	vertical-align: top;
}

.release-notes-table thead tr {
	border-bottom: solid 1px black;
}

/* ==========================================================================
   Release Cards
   ========================================================================== */

/* Release groups - major release + its hotfixes */
.release-group {
	margin-bottom: 2.5rem;
	padding-bottom: 2.5rem;
	border-bottom: 1px solid var(--covarity-very-light-gray);
}

.release-group:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.release-card-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.release-card {
	border: 1px solid var(--color-border-light);
	border-radius: 4px;
	padding: 1.5rem;
	background-color: white;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.2s ease;
}

.release-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.release-card-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--covarity-very-light-gray);
}

.release-card-version {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--covarity-midnight-color);
	margin: 0;
}

.release-card-date {
	font-size: 0.9rem;
	color: var(--covarity-slate-gray-color);
}

.release-card-summary {
	margin-bottom: 1rem;
}

.release-card-summary p {
	margin: 0 0 0.75rem 0;
}

.release-card-summary p:last-child {
	margin-bottom: 0;
}

.release-card-summary ul {
	margin: 0.5rem 0 0 0;
	padding-left: 1.5rem;
	line-height: 1.6;
}

.release-card-summary li {
	margin-bottom: 0.25rem;
}

.release-card-footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--covarity-very-light-gray);
}

.release-card-link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-weight: 500;
	text-decoration: none;
}

.release-card-link:hover {
	text-decoration: underline;
}

.release-card-link::after {
	content: " →";
}

/* Hotfix compact list */
.hotfix-list-container {
	margin-top: 1.5rem;
}

.hotfix-list-header {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--covarity-slate-gray-color);
	margin-bottom: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.hotfix-list {
	list-style: none;
	padding: 0;
	margin: 0;
	border: 1px solid var(--covarity-very-light-gray);
	border-radius: 4px;
}

.hotfix-list .hotfix-version-list-item {
	border-bottom: 1px solid var(--covarity-very-light-gray);
}

	.hotfix-list .hotfix-version-list-item:last-child {
		border-bottom: none;
	}

.hotfix-row {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	padding: 0.6rem 1rem;
	font-size: 0.95rem;
	line-height: 1.4;
	text-decoration: none;
	color: inherit;
}

.hotfix-row:hover {
	background-color: var(--covarity-white-smoke);
}

.hotfix-row:focus {
	outline: 2px solid var(--covarity-cobalt-color);
	outline-offset: -2px;
}

.hotfix-version {
	font-weight: 600;
	min-width: 4rem;
	
}

[href].hotfix-row .hotfix-version {
	color: var(--covarity-cobalt-color);
}

[href].hotfix-row:hover .hotfix-version {
	text-decoration: underline;
}

.hotfix-row:not([href]) {
	cursor: default;
}

.hotfix-date {
	color: var(--covarity-slate-gray-color);
	min-width: 6rem;
}

.hotfix-summary {
	flex: 1;
}

/* Callout notes - paragraphs that are entirely italicised */
p > em:only-child, .callout-container {
	display: block;
	padding: 0.75em 1em;
	background-color: var(--color-background-subtle);
	border-left: 3px solid var(--color-callout-border);
	font-size: .9em;
}

em {
	font-style: italic;
}

/* Utility classes */
.hidden-review {
	display: none;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden, .is-loading {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* WIP or Low-Impact - hide these items */

[data-status], .low-impact {
	display: none;
}

/* Expand/Collapse */
.collapsed {
	display: none;
}

/* Immediate/Activate badges */

.badge {
	display: inline-block;
	padding: 1px 3px;
	font-size: 0.6rem;
	font-weight: 600;
	
	border-radius: .5rem;
	/*text-transform: uppercase;*/
	letter-spacing: 0.02em;
}

.badge-immediate {
	background-color: var(--covarity-very-light-gray);
	color: var(--covarity-slate-gray-color);
}

.badge-activate {
	background-color: var(--covarity-light-blue);
	color: var(--covarity-cobalt-color);
}

h1:has(> .badge), h2:has(> .badge), h3:has(> .badge), h4:has(> .badge), h5:has(> .badge), h6:has(> .badge) {
	display: flex;
	align-items: center;
	gap: 3px;
}
/* ==========================================================================
   5. Print Styles
   ========================================================================== */
.header-and-print-container, .header-and-language-container {
	display: flex;
	align-items: start;
	justify-content: space-between;
	flex-wrap: wrap;
}

.print-container.language-container {
	display: flex;
	gap: .5rem;
	flex-wrap: wrap;
}

.print-container.language-container .language-toggle{
	margin-left: .5rem;
}

.print-container.language-container .language-toggle-wrapper{
	
	border-left: 1px solid var(--covarity-cobalt-color);
}

.print-button {
	display: flex;
	align-items: center;
	gap: .25rem;
	text-decoration: underline;
	color: var(--covarity-cobalt-color);
}

.print-button:hover, .print-button:focus {
	text-decoration: none;
}


@media print {
	.no-print {
		display: none !important;
	}
	
	.collapsed {
		display: initial !important;
	}

	#header {
		display: none;
	}

	/* Keep sections together where possible */
	h2, h3 {
		page-break-after: avoid;
	}

	section {
		page-break-inside: auto;
	}

	/* Show URLs after links */
	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		color: var(--covarity-slate-gray-color);
	}

	/* Don't show URL for internal links */
	a[href^="#"]::after,
	a[href^="releases"]::after {
		content: none;
	}

	/* Remove decorative borders */
	h2 {
		border-top: none;
		padding-top: 0.5em;
	}
}
