:root {
  --color-primary: #2a2a2a; /* dark steel gray */
  --color-secondary: #ffd23f; /* bold yellow */
  --color-accent: #e63946; /* accent red */
  --color-bg: #f8f9fa;
  --color-text: #1c1c1c;
  --color-primary-accent: #ececec;
  --gap: 1.5rem;
  --font-body: "Helvetica Neue", Arial, sans-serif;
}

/* ===== Reset ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100vh;
  overflow: hidden;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-primary);
  color: #fff;
  padding: 1.5rem;
  text-align: center;
}
.site-header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 1px;
}

/* ===== Navigation ===== */
.site-nav {
  background: var(--color-secondary);
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.nav-wrapper,
.nav-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.nav-main {
  list-style: none;
}

.nav-main > li {
  position: relative;
}

.nav-main > li > a {
  text-decoration: none;
  font-weight: bold;
  color: var(--color-primary);
  background: var(--color-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: color 0.3s ease, background 0.3s ease;
}

.nav-main > li > a:hover {
  background: #fff6cc;
  color: var(--color-accent);
}

/* ===== Group Label (non-link dropdown header) ===== */
.nav-group-title {
  display: inline-block;
  font-weight: bold;
  color: var(--color-primary);
  background: var(--color-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: default;
  transition: background 0.3s ease, color 0.3s ease;
}
.nav-group-title:hover {
  background: #fff6cc;
  color: var(--color-accent);
}

/* ===== Dropdown menus (desktop default) ===== */
.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  list-style: none;
  background: #fff;
  border: 2px solid var(--color-secondary);
  border-radius: 8px;
  padding: 0.5rem 0;
  z-index: 100;
  min-width: 220px;
}

.has-sub:hover > .sub-menu {
  display: block;
}

.sub-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.sub-menu li a:hover {
  background: var(--color-secondary);
  color: var(--color-primary);
}

/* ===== Main Content ===== */
main.content-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gap);
  padding: 2rem 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--color-bg);
}

/* ===== Sidebar (Ad Area) ===== */
.sidebar {
  background: none;
  padding: 0;
  border-radius: 0;
  overflow: visible;
}

.ad-slot {
  background: #ddd;
  margin: 0 auto 0.5rem;
  padding: 0.5rem 1rem;
  border: 2px dashed var(--color-secondary);
  color: var(--color-primary);
  text-align: center;
  font-weight: bold;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Article Body ===== */
.article-body:target {
  outline: none;
  border: none;
}.article-body {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  text-align: justify;
  overflow-y: auto;
  box-shadow: none;
}
.article-body p {
  text-indent: 2em;
  margin-top: 1em;
}
.article-body h1 {
  color: var(--color-accent);
}
.article-body h2, .article-body h3 {
  color: var(--color-primary);
  margin: 1rem 0;
}
.article-body ul {
  padding-left: -2em;
  list-style-position: inside;
}
.article-body ul li {
  text-indent: .5em;   /* pull first line back to left */
}

/* ===== Body Ad (inside article) ===== */
.ad-slot.body-ad {
  width: fit-content;
  max-width: 100%;
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  border: 2px dashed var(--color-secondary);
  border-radius: 6px;
  background: #ddd;
  font-weight: bold;
  color: var(--color-primary);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 1.5rem;
}
.ad-slot.footer-ad {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 0.5rem;
  padding: 0.5rem 1rem;
  border: 2px dashed var(--color-accent);
  border-radius: 6px;
  background: #444;
  color: #fff;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.site-footer .ad-slot {
  background: #444;
  border-color: var(--color-accent);
  color: #fff;
}
.footer-links {
  list-style: none;
}
.footer-links a {
  text-decoration: none;
  font-weight: bold;
  color: var(--color-secondary);
  transition: color 0.3s ease;
}
.footer-links a:hover,
.footer-links a:focus {
  color: var(--color-accent);
}

/* ===== Responsive ===== */

/* --- Layout and nav adjustments for mobile --- */
@media (max-width: 960px) {

  main.content-grid {
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	padding: 1rem;
  }

  .sidebar {
	order: 1;
	overflow: visible;
	height: auto;
	margin-bottom: 1rem;
  }

  .article-body {
	order: 2;
	overflow-y: visible;
	max-height: none;
  }

  /* Flatten navigation for mobile view */
  .nav-main {
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	padding: 0.5rem 0;
  }

  .nav-main > li {
	margin: 0;
  }

 /* Disable dropdown hover and show sub-items inline */
  .sub-menu {
	display: block;
	position: static;
	background: none;
	border: none;
	border-radius: 0;
	padding: 0;
	margin-left: 1rem;
  }

  .sub-menu li a {
	padding: 0;
	font-weight: normal;
	color: var(--color-primary);
	background: none;
  }

  .sub-menu li a:hover {
	background: #fff6cc;
	color: var(--color-accent);
  }

  .nav-group-title {
	color: var(--color-accent);
	background: none;
	padding: 0;
	cursor: default;
  }
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-evenly;
  align-items: center;
  margin-top: 1rem;
}
.social-links img {
  height: 100px;
  width: auto;
}

/* --- Handle small screen height overflow --- */
@media (max-height: 1000px) {
  html,
  body {
	overflow-y: auto;
  }
  body {
	min-height: auto;
  }
  main.content-grid {
	overflow: visible;
	height: auto;
  }
}