:root {
  /* --- COLOR VARIABLES (Easier to change later, e.g., for a 'night mode') --- */
  --color-pink-primary: #FF84B2;        /* Bright Pink (borders, 'i' text) */
  --color-pink-secondary: #FEB2CE;      /* Header background/border accent */
  --color-pink-light: #FFEDFB;          /* Title background fill */
  --color-accent-green: #5BC0AE;        /* Menu background, 'b' text, scrollbar */
  --color-text-primary: #888;           /* Default body text color */
  --color-text-secondary: #555;         /* Link color */
  --color-text-hover: #999;             /* Hover link color */
  --color-background-paper: #fff;       /* White box background */
  --border-radius: 15px;
}

/* -------------------------------------------------------------------------- */
/* 1. GLOBAL & TYPOGRAPHY                                                     */
/* -------------------------------------------------------------------------- */

body {
  background: #f5f5f5 url(https://64.media.tumblr.com/b9569ba34daca64ccb84bcff77b6efeb/5b2b6fc3dc12a5a9-93/s75x75_c1/63c7804d1621093de86680a3393164e86340c096.gifv) fixed;
  font-family: Consolas;
  font-size: 14px;
  color: var(--color-text-primary);
  cursor: url('https://comfcomf.blog/images/pixel_cursor32.png'), auto;
}

a:link, a:visited, a:active {
  color: var(--color-text-secondary);
  text-decoration: none;
}
a:hover {
  color: var(--color-text-hover);
}

b {
  color: var(--color-accent-green);
  font-weight: bold;
}
i {
  color: var(--color-pink-primary);
  font-style: normal;
}

/* Scrollbar styles - Kept as is, vendor prefix required */
::-webkit-scrollbar-thumb {
  background-color: var(--color-accent-green);
  border-radius: 5px;
  border: 0px solid #6ECA7A;
}
::-webkit-scrollbar {
  width: 5px; height: 0px;
  background: transparent;
}

.symbol-font-fix {
  font-family: Arial, Verdana, sans-serif;
  font-weight: bold;
  font-size: 12px;
}

/* -------------------------------------------------------------------------- */
/* 2. LAYOUT CONTAINER (CSS Grid Structure - Dynamic Widths)                  */
/* -------------------------------------------------------------------------- */

.container {
  display: grid;
  
  /* NEW DYNAMIC COLUMNS (6 columns total): 
     1fr (flex space) | 20vw (Sidebar) | 8px (Gap) | 45vw (Content) | 15vw (Menu) | 1fr (flex space) */
  grid-template-columns: 1fr 20vw 20px 45vw 15vw 1fr; 
  
  /* Rows: Top spacer (100px), the main content row (auto height) */
  grid-template-rows: 100px auto; 

  grid-template-areas:
    "top top top top top top" /* 6 columns wide */
    ". sidebar gap content menu ." 
    ". footer footer footer footer .";
    
  position: relative;
  margin: 0 auto;
  min-width: 800px; /* Setting a minimum width prevents the layout from collapsing on very small screens */
}

/* -------------------------------------------------------------------------- */
/* 3. GRID AREA PLACEMENT AND ALIGNMENT                                       */
/* -------------------------------------------------------------------------- */

#header {
  grid-column: 2 / span 3; /* Spans sidebar, gap, and content columns */
  grid-row: 2; 
  
  /* WIDTHS NOW RELATIVE TO THE GRID COLUMN SIZE */
  width: 250px; /* Fixed width header is fine here for the bubble look */
  height: 40px;
  background: var(--color-pink-secondary);
  border-radius: var(--border-radius);
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  text-align: center;
  color: #fff;
  padding: 4px;
  font: calc(1.5rem + 1vw) 'pixelify sans', monospace;
  line-height: 40px;
  
  justify-self: left; 
  align-self: start; 
  margin-top: -50px; 
}

/* The 8px gap column will now sit between sidebar (col 2) and content (col 4) */
.gap {
    grid-column: 3;
    grid-row: 2;
}

#sidebar {
  grid-column: 2;
  grid-row: 2;
  align-self: start; 
  
  /* NEW DYNAMIC WIDTH */
  width: 20vw; 
  
  background: var(--color-background-paper);
  padding: 10px 4px 4px 4px; 
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  border: 1px solid var(--color-pink-primary);
  border-right: 1px solid var(--color-pink-primary);
}

#content {
  grid-column: 4; /* Shifted to column 4 */
  grid-row: 2;
  align-self: start;
  
  /* NEW DYNAMIC WIDTH */
  width: 45vw; 
  
  background: var(--color-background-paper);
  padding: 10px 4px 4px 4px;
  border-top-right-radius: var(--border-radius);
  border-top-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
  border: 1px solid var(--color-pink-primary);
  border-left: 1px solid var(--color-pink-primary);
  
  /* Margin fix is removed as the 8px column handles the gap */
  margin-left: 0; 
}

#menu {
  grid-column: 5; /* Shifted to column 5 */
  grid-row: 2;
  align-self: start; 
  
  /* NEW DYNAMIC WIDTH */
  width: 15vw; 
  
  justify-self: center; 
  padding-top: 4px; 
  
  font-size: 0; /* Shrinks the whitespace between <a> tags to zero */
  line-height: 0; /* Ensure no line height is contributing to the gap */
}

/* -------------------------------------------------------------------------- */
/* 4. ELEMENT STYLES (Adjusting nested fixed widths to be relative to parent) */
/* -------------------------------------------------------------------------- */

.sideimg {
  /* Must be 100% of its new dynamic parent (sidebar) */
  width: 100%; 
  max-width: 170px; /* Optional cap if 20vw gets too big */
  display: block;
  margin: 0 auto;
}

.comicimg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.sidetitle {
  background: var(--color-pink-light);
  font: 20px 'pixelify sans', arial;
  color: var(--color-accent-green);
  border-radius: var(--border-radius);
  text-align: center;
  border-bottom: 4px solid var(--color-pink-secondary);
  margin-bottom: 4px;
}

.contenttitle {
  background: var(--color-pink-light);
  font: 26px 'pixelify sans', arial;
  color: var(--color-accent-green);
  border-radius: var(--border-radius);
  text-align: center;
  border-bottom: 4px solid var(--color-pink-secondary);
  margin-bottom: 4px;
}

#menu a {
  display: block;
  background: var(--color-accent-green);
  padding: 4px 1px;
  margin-bottom: 2px;
  
  /* Must be a percentage of its new dynamic parent (menu) */
  width: 80%; 
  
  line-height: 12px;
  font: normal 14px monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  color: #fff;
}


/* --- Blog Archive Link Reset --- */
.archive-list a {
  /* Remove the button look */
  background: none; 
  border-radius: 0;
  text-align: left;
  text-transform: none; 
  letter-spacing: normal; 
  
  /* Reset link block formatting */
  display: inline; 
  width: auto; 
  padding: 0;
  margin: 0;
  line-height: inherit; /* Inherit the normal line height */
  font: inherit; /* Use the main body font style */
  
  /* Use the standard link color */
  color: var(--color-text-secondary); 
}

/* Ensure the date span is not getting unexpected formatting */
.archive-date {
  font: inherit; 
  color: inherit;
  letter-spacing: normal;
}

/* Fix the overall list alignment if needed */
.archive-list {
  /* This ensures the list markers (bullets) are visible */
  margin-left: 20px; 
}




/* -------------------------------------------------------------------------- */
/* 5. MOBILE STYLES (These will override the dynamic desktop styles)           */
/* -------------------------------------------------------------------------- */

@media screen and (max-width: 900px) { 
  /* Force the container to stack everything vertically on small screens */
  .container {
    grid-template-columns: 1fr; /* Single column */
    grid-template-rows: auto;
    grid-template-areas:
      "header"
      "menu"
      "sidebar"
      "content"
      "footer";
    min-width: 0; 
    padding-top: 20px; 
  }

  /* Reset layout properties for stacking */
  #header, #sidebar, #content, #menu {
    width: 96%;
    margin: 10px auto; 
    position: static; 
    justify-self: stretch;
    align-self: stretch;
    grid-column: 1; 
    grid-row: auto;
  }
  
  /* Reset Header specific styles for mobile */
  #header {
    width: 90%;
    margin: 10px auto;
    font-size: 2rem; 
    line-height: normal;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-pink-primary); 
    margin-top: 0; /* Remove negative margin on mobile */
  }

  /* Sidebar/Content Adjustments */
  #sidebar, #content {
    /* Use fixed pixel padding on mobile */
    padding: 8px; 
    /* Remove vw width for mobile */
    width: 96%; 
  }
  
  /* Mobile-specific fixes for stacked boxes */
  #content {
    border-left: 1px solid var(--color-pink-primary); 
    margin-left: auto; 
  }

  /* Adjust menu links to be full-width */
  #menu a {
    width: 98%;
    border-radius: var(--border-radius);
  }

  .sideimg {
    width: 100%;
    max-width: 300px;
    border-radius: var(--border-radius);
  }

  .sidetitle {
    margin-left: 0;
    width: 100%;
    border-radius: var(--border-radius);
  }
}