/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v8.4.14,
* Autoprefixer: v10.4.7
* Browsers: last 4 version
*/

/* FONT IMPORT */
/* Ensure this URL correctly points to a CSS file with @font-face or directly to a font if using @font-face here */
@import url('https://files.catbox.moe/hq1nqt.ttf'); /* Assuming this is a CSS file or a service that provides the font */

/* Alternatively, if hq1nqt.ttf is a direct font file URL:
@font-face {
  font-family: 'WimpyKid';
  src: url('https://files.catbox.moe/hq1nqt.ttf') format('truetype');
}
*/
  
/* -------------------------------------------------------- */
/* VARIABLES */
/* -------------------------------------------------------- */

/* Variables are used like this: var(--text-color) */
:root {
  /* Background Colors: */
  --background-color: #FFFFFF; /* Wimpy Kid: White background */
  --content-background-color: #FFFFFF;
  --sidebar-background-color: #FFFFFF;

  /* Text Colors: */
  --text-color: #000000; /* Wimpy Kid: Black text */
  --sidebar-text-color: #000000;
  --link-color: #000000; /* Wimpy Kid: Black links */
  --link-color-hover: #555555; /* Dark grey for hover */

  /* Text: */
  --font: 'Lucida Console', monospace; /* Keep for contrast or change to a simple sans-serif */
  --heading-font: 'WimpyKid', sans-serif; /* Crucial for Wimpy Kid style */
  --font-size: 14px;

  /* Other Settings: */
  --margin: 20px;
  --padding: 16px;
  --border: 2px solid #000000; /* Wimpy Kid: Solid black border, slightly thinner */
  --round-borders: 0px; /* Wimpy Kid: No rounded borders */
  --sidebar-width: 230px;
}

/* -------------------------------------------------------- */
/* BASICS */
/* -------------------------------------------------------- */

* {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

body {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  min-height: 100vh;
  font-size: var(--font-size);
  margin: 0;
  padding: var(--margin);
  color: var(--text-color);
  font-family: var(--font);
  line-height: 1.3; /* Adjusted for readability */
  background: var(--background-color);
  /* background-image: url("https://sadhost.neocities.org/images/tiles/stars.gif"); -- Removed for Wimpy Kid theme */
}

::-moz-selection {
  /* (Text highlighted by the user) */
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-color);
}

::selection {
  /* (Text highlighted by the user) */
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-color);
}

mark {
  /* Text highlighted by using the <mark> element */
  background-color: #ffd342; /* Using the header yellow as highlight */
  color: var(--text-color);
  padding: 0.1em 0.2em;
}

/* Links: */
a {
  text-decoration: underline;
  font-weight: bold; /* Make links stand out a bit more */
}

a,
a:visited {
  color: var(--link-color);
}

a:hover,
a:focus {
  color: var(--link-color-hover);
  text-decoration: none; /* Remove underline on hover for a cleaner effect */
}

/* -------------------------------------------------------- */
/* LAYOUT */
/* -------------------------------------------------------- */

.layout {
  width: 1000px;
  max-width: 95%; /* Ensure it doesn't touch screen edges on slightly smaller than 1000px views */
  display: -ms-grid;
  display: grid;
  grid-gap: var(--margin);
  -ms-grid-rows: auto var(--margin) auto var(--margin) auto;
  -ms-grid-columns: var(--sidebar-width) var(--margin) auto;
      grid-template: "header header" auto "leftSidebar main" auto "footer footer" auto / var(--sidebar-width) auto;
}

main {
  -ms-grid-row: 3;
  -ms-grid-column: 3;
  grid-area: main;
  overflow-y: auto; /* Keep scroll for content if it overflows */
  padding: var(--padding);
  background: var(--content-background-color);
  border: var(--border);
  border-radius: var(--round-borders);
}

/* -------------------------------------------------------- */
/* HEADER */
/* -------------------------------------------------------- */

header {
  -ms-grid-row: 1;
  -ms-grid-column: 1;
  -ms-grid-column-span: 3;
  grid-area: header;
  /* font-size: 1.2em; -- Using heading font for titles within if any */
  border: var(--border);
  border-radius: var(--round-borders);
  background: var(--content-background-color); /* Header itself is white, image and content div have colors */
  overflow: hidden; /* To contain the border radius if it were > 0 */
}

.header-content {
  padding: var(--padding);
  /* background-color:#ffd342; is set inline */
}

.header-title { /* If you add a title in .header-content */
  font-family: var(--heading-font);
  font-size: 2em; /* Make it prominent */
  font-weight: bold;
  color: #000000;
  margin: 0;
  padding-bottom: 10px; /* Space below title */
}

.header-image img {
  width: 100%; /* Image already has inline styles, this is a fallback */
  height: auto;
  display: block; /* Ensure it behaves as a block */
}

/* -------------------------------------------------------- */
/* SIDEBARS */
/* -------------------------------------------------------- */

aside {
  /* grid-area: aside; -- Not used directly, specific sidebars are used */
  border: var(--border);
  border-radius: var(--round-borders);
  overflow: hidden; /* For border-radius if any, and to contain content */
  background: var(--sidebar-background-color);
  padding: var(--padding);
  color: var(--sidebar-text-color);
}

.left-sidebar {
  -ms-grid-row: 3;
  -ms-grid-column: 1;
  grid-area: leftSidebar;
}

/* .right-sidebar { -- Not used in this layout
  grid-area: rightSidebar;
} */

.sidebar-title {
  font-weight: bold;
  font-size: 1.3em; /* Slightly larger */
  font-family: var(--heading-font);
  margin-bottom: 0.5em; /* Space below title */
  padding-bottom: 0.2em;
  border-bottom: var(--border); /* Separator for title */
}

.sidebar-section:not(:last-child) {
  margin-bottom: 1.5em; /* Consistent spacing */
}

.sidebar-section ul,
.sidebar-section ol {
  padding-left: 1.5em;
  margin-top: 0.5em;
}
.sidebar-section p {
    margin-top: 0.3em;
    margin-bottom: 0.3em;
    line-height: 1.4;
}


/* Sidebar Blockquote (if user adds one later): */
.sidebar-section blockquote {
  background: #f0f0f0; /* Light grey background */
  padding: 10px;
  margin: 1em 0;
  border-left: 3px solid #000000; /* Black left border */
  font-style: italic;
}

/* Removed site button and other specific styles not needed now */

/* -------------------------------------------------------- */
/* FOOTER */
/* -------------------------------------------------------- */

footer {
  -ms-grid-row: 5;
  -ms-grid-column: 1;
  -ms-grid-column-span: 3;
  grid-area: footer;
  border: var(--border);
  border-radius: var(--round-borders);
  overflow: hidden;
  font-size: 0.85em; /* Slightly larger for readability */
  padding: var(--padding);
  background: var(--content-background-color);
  text-align: center; /* Center footer content */
}

footer a,
footer a:visited {
  color: var(--link-color);
  font-weight: bold;
}

footer a:hover,
footer a:focus {
  color: var(--link-color-hover);
}

/* -------------------------------------------------------- */
/* NAVIGATION */
/* -------------------------------------------------------- */

nav {
  margin-bottom: 1.5em; /* Spacing after nav block */
}

nav .sidebar-title {
  margin-bottom: 0.5em;
}

nav ul {
  margin: 0; /* Remove default margin */
  padding: 0;
  list-style: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

nav ul li {
  margin-bottom: 0.2em; /* Space between nav items */
}

nav > ul > li > a,
nav > ul > li > details > summary, /* Target summary directly for padding and block display */
nav > ul > li > strong { /* Though strong isn't typical for nav items */
  display: block; /* Make links and summary full width for easier clicking */
  padding: 8px 10px; /* More clickable area */
  text-decoration: none; /* Remove underline from nav links by default */
  font-weight: bold;
  color: var(--link-color);
}

nav > ul > li > a:hover,
nav > ul > li > details > summary:hover {
  background-color: #f0f0f0; /* Light grey background on hover */
  color: #000000;
}

nav > ul > li > a.active,
nav > ul > li > details.active > summary { /* Style summary when details is active */
  background-color: #000000; /* Black background for active */
  color: #FFFFFF; /* White text for active */
  font-weight: bold;
}
nav > ul > li > details[open] > summary { /* Style for open summary */
    background-color: #e0e0e0; /* Slightly darker grey when open */
}


nav ul summary {
  cursor: pointer;
  position: relative; /* For custom marker */
}
nav ul summary::marker { /* Hide default marker if using custom */
    content: ""; 
}
nav ul summary::before { /* Custom marker */
    content: '+ '; /* Default state */
    display: inline-block;
    margin-right: 4px;
}
nav ul details[open] > summary::before {
    content: '- '; /* Open state */
}


nav ul ul {
  margin-left: 15px; /* Indent sub-menu */
  padding-top: 5px;
}

nav ul ul li > a {
  padding: 6px 10px 6px 25px; /* Indent sub-menu items more */
  font-weight: normal; /* Sub-items less bold */
}
nav ul ul li > a.active {
    background-color: #333333; /* Darker grey for active sub-item */
    color: #FFFFFF;
    font-weight: bold;
}


/* -------------------------------------------------------- */
/* CONTENT */
/* -------------------------------------------------------- */

main {
  line-height: 1.6; /* Increased for better readability */
}

main a,
main a:visited {
  color: var(--link-color);
  font-weight: bold; 
  /* text-decoration: underline; -- Already set globally */
}

main a:hover,
main a:focus {
  color: var(--link-color-hover);
  text-decoration-style: wavy; /* Keep this nice touch */
}

main p,
main .image,
main .full-width-image,
main .two-columns {
  margin-top: 0.5em;
  margin-bottom: 1em;
}

main ol,
main ul {
  margin: 0.5em 0 1em 0;
  padding-left: 2em; /* Standard padding for lists */
}

main ol li,
main ul li {
  margin-bottom: 0.3em;
  line-height: 1.5;
}

main blockquote {
  background: #f0f0f0; /* Light grey, consistent with sidebar */
  padding: 15px;
  margin: 1.5em 0;
  border-left: 3px solid #000000; /* Black left border */
  border-radius: var(--round-borders); /* Keep consistent with theme */
}
main blockquote p {
    margin-bottom: 0.5em;
}
main blockquote p:last-child {
    margin-bottom: 0;
}


main pre {
  background: #f0f0f0; /* Light grey for code blocks */
  border: 1px solid #ccc; /* Subtle border */
  padding: var(--padding);
  overflow-x: auto; /* Scroll for long code lines */
  margin: 1em 0 1.5em;
  border-radius: var(--round-borders);
}

main code {
  font-family: 'Courier New', Courier, monospace; /* Classic monospaced font */
  background: #f0f0f0;
  padding: 0.1em 0.3em;
  border-radius: 3px; /* Slight rounding for inline code */
  font-size: 0.9em;
}
pre code { /* Code inside pre should not have extra padding/bg */
    background: none;
    padding: 0;
    border-radius: 0;
}

main center {
  margin: 1em 0;
  padding: 0 1em;
}

main hr {
  border: 0;
  border-top: var(--border); /* Use theme border */
  margin: 2em 0; /* More spacing for hr */
}

/* HEADINGS: */

main h1,
main h2,
main h3,
main h4,
main h5,
main h6 {
  font-family: var(--heading-font);
  color: #000000;
  margin-top: 1.5em; /* Space above headings */
  margin-bottom: 0.5em; /* Space below headings */
  line-height: 1.3;
}

main h1:first-child,
main h2:first-child,
main h3:first-child,
main h4:first-child,
main h5:first-child,
main h6:first-child {
  margin-top: 0;
}

main h1 { font-size: 2.2em; }
main h2 { font-size: 1.8em; }
main h3 { font-size: 1.5em; }
main h4 { font-size: 1.3em; }
main h5 { font-size: 1.1em; }
main h6 { font-size: 1em; font-weight: bold; }


/* COLUMNS: */
.two-columns {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: var(--margin); /* Use gap for spacing */
}
.two-columns > * {
  -webkit-box-flex: 1;
      -ms-flex: 1 1 0px;
          flex: 1 1 0;
  margin: 0; /* Remove default margins from children */
}
/* Removed padding adjustments for first/last child as gap handles it */

/* -------------------------------------------------------- */
/* CONTENT IMAGES */
/* -------------------------------------------------------- */

.image { /* For individual images that aren't full-width */
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1em auto; /* Center images by default */
  border: var(--border); /* Add border to images */
}

.full-width-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 1em 0; /* Standard margin */
  border: var(--border);
}

.images { /* For a flex row of images */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 10px; /* Space between images */
  margin: 1em 0;
  flex-wrap: wrap; /* Allow wrapping */
}

.images img {
  width: auto; /* Let flexbox handle sizing or set specific flex properties */
  max-width: 100%; /* Prevent overflow if flex basis is large */
  height: auto;
  border: var(--border);
  -webkit-box-flex: 1;
      -ms-flex: 1 1 150px; /* Example: grow, shrink, basis of 150px */
          flex: 1 1 150px;
}

/* -------------------------------------------------------- */
/* ACCESSIBILITY */
/* -------------------------------------------------------- */

#skip-to-content-link {
  position: fixed;
  top: 0;
  left: 0;
  display: inline-block;
  padding: 0.5rem 1rem; /* Adjusted padding */
  line-height: 1;
  font-size: 1.1rem; /* Adjusted size */
  background-color: var(--content-background-color);
  color: var(--text-color);
  border: var(--border);
  border-top: 0; /* No top border as it's at the top */
  -webkit-transform: translateY(-100%); /* Hide completely off-screen */
      -ms-transform: translateY(-100%);
          transform: translateY(-100%);
  -webkit-transition: -webkit-transform 0.2s ease-in-out;
  transition: -webkit-transform 0.2s ease-in-out;
  -o-transition: transform 0.2s ease-in-out;
  transition: transform 0.2s ease-in-out;
  transition: transform 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
  z-index: 99999999999;
}

#skip-to-content-link:focus,
#skip-to-content-link:focus-within {
  -webkit-transform: translateY(0);
      -ms-transform: translateY(0);
          transform: translateY(0);
}

/* -------------------------------------------------------- */
/* MOBILE RESPONSIVE */
/* -------------------------------------------------------- */

@media (max-width: 1000px) { /* Adjust breakpoint slightly for the layout width */
    .layout {
        width: 100%; /* Full width for tablets and smaller */
        -ms-grid-columns: var(--sidebar-width) var(--margin) minmax(0, 1fr); /* Allow main content to shrink */
            grid-template-columns: var(--sidebar-width) minmax(0, 1fr); /* minmax for main area */
    }
}


@media (max-width: 800px) {
  body {
    font-size: 14px; /* Base font size for mobile */
    padding: calc(var(--margin) / 2); /* Reduced padding on body for mobile */
  }

  .layout {
    width: 100%;
    display: -ms-grid;
    display: grid;
    grid-gap: calc(var(--margin) / 2); /* Reduced gap */
    -ms-grid-rows: auto var(--margin-mobile, 10px) auto var(--margin-mobile, 10px) auto var(--margin-mobile, 10px) auto; /* Custom mobile margin or calc */
    -ms-grid-columns: 1fr;
        grid-template: "header" auto  "leftSidebar" auto "main" auto "footer" auto / 1fr;
  }
  
  /* .right-sidebar { display: none; } -- Already not in use */

  header, aside, main, footer {
    padding: calc(var(--padding) / 1.5); /* Reduced padding inside containers */
  }
  
  aside { /* Sidebar specific adjustments for mobile */
    /* border-bottom: 1px solid; -- Theme border is already applied */
    font-size: 0.95em; /* Slightly adjust font size if needed */
  }
  
  nav {
    padding: 0; /* Nav itself doesn't need padding if items have it */
    margin-bottom: 1em;
  }

  nav > ul li > a,
  nav > ul li > details > summary {
    padding: 10px 8px; /* Adjust padding for touch targets */
  }

  main {
    max-height: none; /* Remove max-height if it was set */
  }

  .images { /* Image gallery on mobile */
    -ms-flex-wrap: wrap;
        flex-wrap: wrap; /* Already set, ensure it works */
  }

  .images img {
    width: 100%; /* Stack images in gallery */
    -ms-flex: 1 1 100%;
        flex: 1 1 100%; /* Make them full width of the container */
    margin-bottom: 10px; /* Space between stacked images */
  }
  .images img:last-child {
      margin-bottom: 0;
  }

  #skip-to-content-link {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }

  /* Explicit grid area assignments for MS Grid fallback in media query */
  main { -ms-grid-row: 5; -ms-grid-column: 1; }
  header { -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-column-span: 1; }
  .left-sidebar { -ms-grid-row: 3; -ms-grid-column: 1; }
  footer { -ms-grid-row: 7; -ms-grid-column: 1; -ms-grid-column-span: 1; }

  main h1 { font-size: 1.8em; }
  main h2 { font-size: 1.5em; }
  main h3 { font-size: 1.3em; }

  .two-columns {
      -webkit-box-orient: vertical;
      -webkit-box-direction: normal;
          -ms-flex-direction: column;
              flex-direction: column; /* Stack columns on mobile */
  }
}