/* ====================================================
   Destroyere1107's Home Page - Stylesheet
   Style inspired by Microsoft Expression Web 4 templates
   (I couldn't be bothered to actually use EW4 though)
   Dark mode default, optional light mode
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');




:root {
  /* Font stacks */
  --font-body:         "Open Sans", Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
  --font-heading:      "Merriweather", Georgia, "Times New Roman", Times, serif;
  --font-mono:         Consolas, Monaco, "Courier New", Courier, monospace;
}

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--bg-page);
}

a {
  color: var(--accent-blue);
  text-decoration: underline;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

a:visited {
  color: var(--accent-visited);
}

#navigation ul,
#sidebar ul,
.sidebar-section ul {
  list-style: none;
}

/* --- Wrapper --- */
#wrapper {
  width: 940px;
  margin: 20px auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: var(--wrapper-shadow);
}

/* --- Header --- */
#header {
  background: var(--grad-header);
  color: var(--text-primary);
  padding: 25px 30px 20px 30px;
  border-bottom: 3px solid var(--header-bottom);
  display: flex;
  align-items: center;
}

.header-photo {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border: 2px solid var(--header-border);
  overflow: hidden;
}

.header-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-text {
  flex: 1;
  text-align: right;
}

#header h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: normal;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  color: var(--text-heading);
}

#header .tagline {
  font-size: 11px;
  color: var(--accent-blue-muted);
  margin-top: 4px;
  font-style: italic;
}

.header-contacts {
  margin-top: 10px;
  font-size: 20px;
}

.header-contacts a {
  display: inline-block;
  color: var(--accent-blue-muted);
  margin-left: 18px;
  text-decoration: none;
}

.header-contacts a:hover {
  color: var(--text-primary);
}

/* --- Navigation --- */
#navigation {
  background: var(--grad-nav);
  border-bottom: 1px solid var(--nav-border-bottom);
  padding: 0 20px;
  display: flow-root;
}

#navigation ul li {
  float: left;
}

#navigation ul li a {
  display: block;
  padding: 8px 18px;
  color: var(--text-nav);
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
  border-right: 1px solid var(--border-default);
  border-left: 1px solid var(--border-default);
}

#navigation ul li:first-child a {
  border-left: none;
}

#navigation ul li a:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

#nav-calculator-museum {
  background: linear-gradient(135deg, #b8860b, #ffd700, #fffacd, #ffd700, #b8860b, #ffd700, #fffacd, #ffd700, #b8860b);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
  animation: gold-sheen 30s linear infinite;
}

@keyframes gold-sheen {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

#nav-calculator-museum:hover {
  background: linear-gradient(135deg, #b8860b, #ffd700, #fffacd, #ffd700, #b8860b);
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #5a3a00;
  color: #5a3a00;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.8));
}

#navigation ul li a.active {
  background-color: var(--navy);
  color: #ffffff;
}

/* --- Content Wrapper --- */
#content-wrapper {
  padding: 20px;
  display: flow-root;
}

/* --- Main Content --- */
#content {
  float: left;
  width: 620px;
  padding-right: 25px;
  border-right: 1px solid var(--border-default);
}

#content h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--accent-blue);
  font-weight: normal;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-blue);
}

#content h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--accent-blue);
  font-weight: normal;
  margin-top: 18px;
  margin-bottom: 8px;
}

#content p {
  margin-bottom: 10px;
  text-align: justify;
}

#content pre {
  background-color: var(--bg-deep);
  border: 1px solid var(--border-default);
  padding: 10px;
  overflow-x: auto;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}

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

.shout {
  font-size: 20px;
  font-weight: bold;
}

/* --- News Items --- */
.news-item {
  background-color: var(--bg-deep);
  border: 1px solid var(--border-blue);
  padding: 10px 14px;
  margin-bottom: 12px;
}

/* Ensure images never spill out of their containers 
I had to add this after the switch to Markdown via Markdig */
.news-item img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px auto; /* Centers the image */
}

.news-item .date {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: bold;
  text-transform: uppercase;
}

.news-item p {
  margin-top: 4px;
  margin-bottom: 0;
}

/* --- Sidebar --- */
#sidebar {
  float: right;
  width: 230px;
}

.sidebar-section {
  margin-bottom: 20px;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-blue);
  padding: 12px;
}

.sidebar-section h3 {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-primary);
  background: var(--grad-sidebar-h3);
  padding: 5px 8px;
  margin: -12px -12px 10px -12px;
}

.sidebar-section ul {
  padding-left: 5px;
}

.sidebar-section ul li {
  padding: 3px 0;
  border-bottom: 1px dotted var(--border-blue);
}

.sidebar-section ul li:last-child {
  border-bottom: none;
}

.sidebar-section ul li a {
  font-size: 11px;
  text-decoration: none;
}

.sidebar-section ul li a:hover {
  text-decoration: underline;
}

.sidebar-section p {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* --- Footer --- */
#footer {
  clear: both;
  background: var(--grad-footer);
  border-top: 1px solid var(--border-default);
  padding: 12px 20px;
  text-align: center;
}

#footer-buttons {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.button-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-default);
  padding: 8px 12px;
  max-width: 500px;
  width: 100%;
}

.button-card a {
  flex-shrink: 0;
  text-decoration: none;
}

.button-card img {
  display: block;
  image-rendering: pixelated;
}

.button-card p {
  font-size: 10px;
  color: var(--text-muted);
  margin: 0;
  text-align: left;
}

.button-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  max-width: 500px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto 12px auto;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-default);
  padding: 8px 12px;
}

.button-grid a {
  display: inline-block;
}

.button-grid img {
  display: block;
  image-rendering: pixelated;
}

#footer p {
  font-size: 10px;
  color: var(--text-footer);
  margin-bottom: 2px;
}

#footer a {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 10px;
}

#footer a:hover {
  text-decoration: underline;
}

.powered-by {
  font-size: 9px !important;
  color: var(--text-powered) !important;
  margin-top: 4px;
  font-style: italic;
}

/* --- Theme Toggle --- */
#theme-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-nav);
}

#theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* --- Content Lists --- */
.content-list {
  padding-left: 20px;
  margin-bottom: 12px;
  list-style: square;
}

.content-list li {
  padding: 3px 0;
  font-size: 12px;
}

/* --- Specimen Table (Calculator Museum) --- */
.specimen-table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 12px;
}

.specimen-table td,
.specimen-table th {
  padding: 4px 8px;
  border: 1px solid #999999;
}

.specimen-table thead tr,
.specimen-table tr:first-child {
  background-color: #cccccc;
  color: #000000;
}

.specimen-table th {
  text-align: left;
}

.specimen-table td img {
  max-width: 150px !important;
  height: auto;
  display: block;
  margin: 4px 0;
}

/* --- License Notice (Calculator Museum) --- */
.license-notice {
  font-size: 0.85em;
  color: var(--text-dim);
}

/* --- Note Text --- */
.note-text {
  margin-top: 15px;
  font-size: 11px;
  color: var(--text-dim);
}

/* --- Theme Dialog --- */
#theme-dialog {
  background-color: var(--bg-deep);
  border: 1px solid var(--border-default);
  color: var(--text-body);
  padding: 20px;
  max-width: 300px;
  width: 100%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  position: fixed;
  inset: 0;
  margin: auto;
}

/* Backdrop behind the dialog (dims the rest of the page) */
#theme-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}

/* The individual theme buttons inside the dialog */
.theme-select-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.theme-select-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--accent-hover);
}

/* Highlight the currently active theme */
.theme-select-btn.active {
  border-color: var(--accent-blue);
  background-color: rgba(30, 144, 255, 0.1);
  font-weight: bold;
}

/* The close button */
.theme-dialog-close {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-body);
  padding: 5px 15px;
  cursor: pointer;
  font-family: var(--font-body);
}

.theme-dialog-close:hover {
  background: var(--bg-hover);
  color: var(--accent-hover);
}
