/* Stung Eye — main.css */

/* --- Custom Properties --- */
:root {
  --sans-font:
    -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir, "Nimbus Sans L",
    Roboto, Noto, "Segoe UI", Arial, Helvetica, "Helvetica Neue", sans-serif;
  --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  --bg: #fff;
  --accent-bg: #f5f7ff;
  --text: #212121;
  --text-light: #585858;
  --border: #d8dae1;
  --accent: #0d47a1;
  --code: #d81b60;
  --preformatted: #444;
  --marked: #ffdd33;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--sans-font);
  scroll-behavior: smooth;
}

body {
  color: var(--text);
  background: var(--bg);
  background-image: url(/assets/images/sidebar.jpg);
  font-size: 1.15rem;
  line-height: 1.5;
  display: grid;
  grid-template-columns: 1fr min(47rem, 90%) 1fr;
  margin: 0;
}

body > * {
  grid-column: 2;
}

/* --- Header --- */
body > header {
  background: var(--accent-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem 1rem;
  margin-top: 2rem;
  border-radius: 0.5rem 0.5rem 0 0;
  position: relative;
}

body > header h1 {
  margin: 1rem 0;
}

body > header h1 a {
  color: var(--text);
  text-decoration: none;
}

body > header h1 a:hover {
  text-decoration: underline;
}

body > header h4 {
  margin: 1rem 0;
  font-weight: normal;
}

body > header .links {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 0.9rem;
}

/* --- Main --- */
main {
  padding: 0 2rem 1rem;
  background: var(--bg);
}

/* --- Footer --- */
body > footer {
  background: var(--bg);
  margin-top: 0;
  margin-bottom: 2rem;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 0 2rem 1rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
}

body > footer .navigation {
  font-size: 0.9rem;
  padding: 0.75rem 0;
}

.footer-about,
.footer-archives {
  margin-top: 1.5rem;
}

.footer-about {
  font-size: 1.15rem;
}

.footer-archives {
  font-size: 0.95rem;
}

.footer-about h3,
.footer-archives h3 {
  font-size: 2rem;
  margin: 0 0 1rem;
}

.footer-about p {
  margin: 0.4rem 0;
}

.footer-archives p {
  margin: 0.3rem 0;
}

/* --- Typography --- */
h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.6rem;
  margin-top: 1.5rem;
}

h3 {
  font-size: 2rem;
  margin-top: 1rem;
}

h4 {
  font-size: 1.44rem;
}

h5 {
  font-size: 1.15rem;
}

h6 {
  font-size: 0.96rem;
}

h1,
h2,
h3 {
  line-height: 1.1;
}

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

a:hover {
  text-decoration: none;
}

body > header a {
  text-decoration: none;
}

body > header a:hover {
  text-decoration: underline;
}

ul {
  padding-left: 1.5rem;
}

ul li {
  margin-bottom: 0.5rem;
}

/* --- Pagination links --- */
.pagination a {
  font-weight: normal;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  padding: 0.5rem;
  margin: 0.4rem 0;
  border-radius: 0.25rem;
  text-decoration: none;
}

.pagination a:hover {
  text-decoration: underline;
}

/* --- Buttons --- */
button,
[role="button"],
input[type="submit"],
input[type="reset"],
input[type="button"] {
  border: none;
  border-radius: 5px;
  background: var(--accent);
  font-size: 1rem;
  color: var(--bg);
  padding: 0.7rem 0.9rem;
  margin: 0.5rem 0;
  cursor: pointer;
}

button:focus,
button:enabled:hover,
[role="button"]:focus,
[role="button"]:not([aria-disabled="true"]):hover,
input[type="submit"]:focus,
input[type="submit"]:enabled:hover,
input[type="reset"]:focus,
input[type="reset"]:enabled:hover,
input[type="button"]:focus,
input[type="button"]:enabled:hover {
  filter: brightness(1.4);
}

/* --- Details / Summary --- */
details {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 1rem;
}

summary {
  cursor: pointer;
  font-weight: bold;
  padding: 0.6rem 1rem;
}

details[open] {
  padding: 0.6rem 1rem 0.75rem;
}

details[open] summary + * {
  margin-top: 0;
}

details[open] summary {
  margin-bottom: 0.5rem;
  padding: 0;
}

details[open] > *:last-child {
  margin-bottom: 0;
}

/* --- Tables --- */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
}

td,
th {
  border: 1px solid var(--border);
  text-align: left;
  padding: 0.5rem;
}

th {
  background: var(--accent-bg);
  font-weight: bold;
}

tr:nth-child(even) {
  background: var(--accent-bg);
}

table caption {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* --- Code --- */
code,
pre,
pre span,
kbd,
samp {
  font-family: var(--mono-font);
  color: var(--code);
}

kbd {
  color: var(--preformatted);
  border: 1px solid var(--preformatted);
  border-bottom: 3px solid var(--preformatted);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
}

pre {
  padding: 1rem 1.4rem;
  max-width: 100%;
  overflow: auto;
  color: var(--preformatted);
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
}

pre code {
  color: var(--preformatted);
  background: none;
  margin: 0;
  padding: 0;
}

/* --- Misc Body Elements --- */
hr {
  color: var(--border);
  border-top: 1px;
  margin: 1rem auto;
}

mark {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--marked);
}

main img,
main video {
  margin-top: 1rem;
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}

figure {
  margin: 0;
  text-align: center;
}

figcaption {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

blockquote {
  margin: 2rem 0 2rem 2rem;
  padding: 0.4rem 0.8rem;
  border-left: 0.35rem solid var(--accent);
  color: var(--text-light);
  font-style: italic;
}

cite {
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: normal;
}

iframe {
  margin-top: 1rem;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

iframe[src*="youtube.com"],
iframe[src*="vimeo.com"],
iframe[src*="nfb.ca"],
iframe[src*="kickstarter.com"] {
  width: 100%;
  aspect-ratio: 16 / 9;
}

iframe[src*="spotify.com"] {
  width: 100%;
  aspect-ratio: 5 / 4;
}

iframe[src*="soundcloud.com"] {
  width: 100%;
  aspect-ratio: 3 / 1;
}

iframe[src*="mixcloud.com"] {
  width: 100%;
  aspect-ratio: 3.5 / 1;
}

iframe[src*="maps.google.com"] {
  width: 100%;
  aspect-ratio: 2 / 1;
}

iframe[src*="slideshare.net"] {
  width: 100%;
  aspect-ratio: 4 / 3;
}

iframe[src*="openprocessing.org"] {
  width: 100%;
  aspect-ratio: 4 / 3;
}

/* --- Day page --- */
.day-page .day-header h1 {
  font-size: 2.6rem;
  margin: 1.5rem 0 0.15rem;
  line-height: 1.1;
}

.day-page .day-header time {
  color: var(--text-light);
  font-size: 0.9rem;
}

.day-content,
.day-block-content {
  margin-top: 1.5rem;
}

/* --- Day blocks (homepage / month pages) --- */
.day-block {
  margin-bottom: 2.5rem;
}

.day-block:first-child {
  margin-top: 1.5rem;
}

.day-block-header h2 {
  margin: 0 0 0.15rem;
}

.day-block-header h2 a {
  text-decoration: none;
}

.day-block-header h2 a:hover {
  text-decoration: underline;
}

.day-block-header time {
  color: var(--text-light);
  font-size: 0.9rem;
}

.day-separator {
  margin: 2.5rem 0;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 3rem 0 1rem;
  font-size: 0.95rem;
}

.pagination-info {
  color: var(--text-light);
}

/* --- Responsive --- */
@media only screen and (max-width: 700px) {
  body {
    background-image: none;
    grid-template-columns: 1fr;
  }

  body > header {
    margin: 0;
    border-radius: 0;
  }

  body > footer {
    padding: 0 1rem 1rem;
  }
}

@media only screen and (max-width: 525px) {
  body > header .links {
    position: inherit;
    top: 0;
    right: 0;
  }
}

.archive-index h1 {
  margin-bottom: 1rem;
}

.archive-index p {
  margin: 0.4rem 0;
}

.archive-index ul {
  list-style: none;
  padding: 0;
}

.archive-index li {
  margin: 0.3rem 0;
}

/* --- Legacy viewer (assets/js/legacy-viewer.js) --- */
/* Photos and galleries from 2003–2004 posts, shown in a dialog instead of the old popups. */
.legacy-viewer {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem 1rem;
  max-width: min(94vw, 1100px);
  max-height: 94vh;
  color: var(--text);
  background: var(--bg);
}
.legacy-viewer::backdrop {
  background: rgba(0, 0, 0, 0.75);
}
.legacy-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.legacy-viewer-title {
  margin: 0;
  font-size: 1.1rem;
}
.legacy-viewer-close {
  border: 0;
  background: none;
  color: var(--text-light);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.legacy-viewer-close:hover,
.legacy-viewer-close:focus-visible {
  color: var(--text);
}
.legacy-viewer-body {
  text-align: center;
}
.legacy-viewer-body img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  /* max-height is set by legacy-viewer.js from the measured space left in the dialog. */
  width: auto;
  height: auto;
}
.legacy-viewer-note {
  max-width: 32rem;
  margin: 1rem auto;
  color: var(--text-light);
}
.legacy-viewer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
.legacy-viewer-nav[hidden] {
  display: none;
}
.legacy-viewer-nav button {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font: inherit;
}
.legacy-viewer-nav button:disabled {
  color: var(--text-light);
  cursor: default;
  opacity: 0.5;
}
.legacy-viewer-counter {
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}
