/* Font Definition */
@font-face {
  font-family: 'CascadiaMono';
  src: url('/https/www.zetcode.com/fonts/CascadiaMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap; /* Use fallback font during load */
}

/* Base Styles */
body {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.6;
  background: #2b2e33;
  color: #d8dce3;
  text-align: center;
  margin: 0;
}

a, .blu {
  color: #0099f7;
}

/* Common Layout Elements */

.note {
  border-radius: 4px;
  background: #26362a; 
  padding: 15px 12px;
  margin-bottom: 1em;
}

.explanation {
  line-height: 1.5;
  padding: 5px 10px;
  border-radius: 4px;
  background: #2a2e34; /* Darker, more distinct */
  color: #d8dce3;
}


.content {
  border: 1px solid #4a5059;
  border-top: none;
  border-bottom: none;
  padding: 5px 20px;
  background: #33373e;
  text-align: left;
  min-width: 50px;
}

.center {
  text-align: center;
}

.gray {
  background: #efefef;
}

/* Typography */
code, pre {
  font-family: 'CascadiaMono', monospace;
}

pre {
  font-size: 11pt;
  overflow: auto;
}

caption, .last_mod {
  font-style: italic;
}

caption {
  text-align: left;
}

.compact {
  line-height: 1.3;
}

ul {
  line-height: 1.7;
}

.keyword {
  color: #074685;
}

/* Images and Figures */
img {
  object-fit: cover;
  width: 100%; /* Ensure responsiveness */
  height: auto; /* Maintain aspect ratio */
}

img.medium {
  width: 75%;
  height: 75%;
}

figure {
  margin: 0;
  max-width: 700px;
  display: inline-block;
}


figcaption {
  color: #d8dce3; /* Matches body text for high contrast */
}

/* Code Blocks */
.code {
  line-height: 1.4;
  margin-top: 0;
  padding: 10px;
  background: #1e2125;
  color: #d8dce3;
  border-radius: 0 0 4px 4px;
}

.codehead {
  font-family: Consolas, monospace;
  font-weight: 600;
  color: #b8e1b8;
  background: #243524;
  border-radius: 4px 4px 0 0;
  padding: 4px 40px 4px 20px;
  margin-bottom: 0;
  position: relative;
}

/* Tables */
table {
  border: 1px solid #4a5059;
  border-right: none;
  border-bottom: none;
  border-collapse: collapse;
  color: #d8dce3;
  background: #2b2e33;
}

.table {
  margin: 15px 0 20px;
  color: #a0a5ad;
}

tr:nth-child(odd) {
  background: #3a3f47;
}

tr:nth-child(even) {
  background: #2b2e33;
}

td, th {
  border: 1px solid #4a5059;
  border-top: none;
  border-left: none;
  padding: 8px;
  background: transparent;
}

th {
  font-family: Georgia, serif;
  font-size: 1em;
  background: #40454d;
}

/* Navigation and Structure */
nav a {
  margin-right: 0.5em;
}

header {
  text-align: center;
  background: #1e2125;
  padding-top: 8px;
}

header nav {
  background: #2e3136;
  padding: 10px;
}

header div {
  padding: 5px 0;
}

header div a {
  padding: 0 15px;
}

header div a[title="Home"] {
  font-family: Georgia, serif;
  font-weight: bold;
  text-decoration: none;
  font-size: 2em;
  color: #d8dce3;
}

footer {
  padding: 15px;
  background: #1e2125;
  color: white;
}

footer div {
  font-size: 0.8em;
}

footer div span {
  margin-right: 1em;
}

/* Sidebar Towers */
.ltow, .rtow {
  width: 300px;
  padding: 0 5px;
}

.ltow {
  text-align: left;
}

.ltow #ad-vert {
  padding-left: 0;
}

.vert-ad {
  margin-bottom: 1em;
}

/* Grid Container */
.container {
  display: grid;
  gap: 0;
  justify-content: center;
  align-content: center;
  margin: 0 auto;
}

/* Multi-Column Layout */
.cols-2 {
  column-count: 2;
  -webkit-column-count: 2;
  -moz-column-count: 2;
}

.cols-3 {
  column-count: 3;
  -webkit-column-count: 3;
  -moz-column-count: 3;
}

.cols-1 li, .cols-2 li, .cols-3 li {
  list-style-type: none;
}

.cols-1 ul, .cols-2 ul, .cols-3 ul {
  padding-left: 0;
}

.cols-1 ul:first-child, .cols-2 ul:first-child, .cols-3 h2:first-child {
  margin: 0;
  padding: 0;
}

/* Scrollbars */
body::-webkit-scrollbar, pre::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track {
  background: #2b2e33;
}

body::-webkit-scrollbar-thumb {
  background: #4a5059;
  border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
  background: #606670;
}

pre::-webkit-scrollbar {
  width: 12px;
}

pre::-webkit-scrollbar-track {
  background: #1e2125;
}

pre::-webkit-scrollbar-thumb {
  background: #4a5059;
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
  background: #606670;
}

/* Copy Icon */
.copy-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  cursor: pointer;
  color: #228B22;
  font-size: 16px;
}

.copy-icon:hover {
  color: #006400;
}

.copy-icon.fa-check {
  color: #32CD32;
}

/* Media Queries */
@media (max-width: 769px) {
  .container {
    margin: 0;
    min-width: 50px;
  }
  .ltow, .rtow {
    display: none;
  }
  .cols-2 {
    column-count: 1;
    -webkit-column-count: 1;
    -moz-column-count: 1;
  }
}

@media (min-width: 770px) and (max-width: 1389px) {
  .content {
    width: 770px;
  }
  .container {
    grid-template-columns: 770px;
  }
  .ltow, .rtow {
    display: none;
  }
}

@media (min-width: 1390px) {
  .content {
    width: 730px;
  }
  .container {
    grid-template-columns: 310px 770px 310px;
  }
  .ltow, .rtow {
    display: block;
  }
}

/* Specific Overrides */
#ebooks ul {
  list-style-type: none;
  padding-left: 0;
}

/* Inline Style Override */
.content a {
  font-size: 1em;
}

.hero {
  padding: 20px;
  background: #3a3f47;
  border-radius: 4px;
  margin-bottom: 20px;
}

h1, h2 {
  text-wrap: balance;
}

.hero h1 {
  margin: 0;
  font-size: 2em;
}

.hero p {
  margin: 10px 0;
}

.cta {
  display: inline-block;
  padding: 10px 20px;
  background: #606670;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

.cta:hover {
  background: #4a5059;
}

.link-list p {
  margin: 0;
  padding: 0 0 0 20px;
  line-height: 1.7;
}