/* Global resets and box-sizing */
* {
  box-sizing: border-box;
}

:root {
  --cell  : 10;        /* square size (px)  */
  --gap   :  3;        /* gap between cells */
  --labelW: 28;        /* width of label column */
  --lived : rgba(233, 199, 68, 1);   /* dark grey  */
  --future: #777;   /* light grey */
  --label : rgba(233, 199, 68, 1);      /* label colour */
}

svg .lived  { fill: var(--lived);  }
svg .future { fill: var(--future); }
svg text.year-label {
  fill: var(--label);
  font: 16px/1 "EXCELSIOR SANS", sans-serif;
  text-anchor: end;          /* right‑align to label column */
  dominant-baseline: middle; /* vertically centred */
  pointer-events: none;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-image: url(/bg.png);
  background-size: cover;
  background-position: 0 -150px;
  width: 100%;
  height: 100vh;
  overflow-y: hidden;
  padding-top: 2em;
  padding-left: 2em;
  padding-right: 2em;
  padding-bottom: 0.5em;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2em;
}

/* Headings and fonts */
h1 {
  font-family: "EXCELSIOR SANS", sans-serif;
  color: rgba(233, 199, 68, 1);
  margin-top: 0;
}

h2 {
  font-family: "EXCELSIOR SANS", sans-serif;
  margin: 0.5em 0;
  color: rgba(10, 10, 10, 1);
}

/* Link styles */
a {
  font-family: "Liberation Sans", sans-serif;
  color: rgba(10, 10, 10, 1);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Left Panel */
#left-panel {
  width: 69vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* Navigation Links Container */
#links {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
}

/* Individual link containers */
.link-container {
  background-image: url(/link-bg.png);
  background-size: 100% 100%;
  padding: 1.5em;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

/* Flexible width to auto-adjust, but can unify widths */
.link-container h2 {
  margin-bottom: 0.5em;
}

.link-container ul {
  list-style: inside;
  margin: 0;
  padding: 0;
}

.link-container li::marker {
  font-family: "Liberation Sans", sans-serif;
}

/* Header for each link container */
.link-header {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.5em;
}

.link-header > img {
  width: 3em;
  height: auto;
}

/* The window image */
#window {
  position: relative;
  min-height: 0;
  flex: 1;
  margin-bottom: 1em;
  margin-top: 1em;
  transform: translate(-180px, 0);
  width: 65vw;
}

#window .background {
  height: 100%;
  width: 100%;
}

#window .content {
  position: absolute;
  top: 8.1vh;
  left: 13.7vw;
  transform: rotate(-1.65deg);
  border-radius: 8px;
  width: 44vw;
  height: 48.3vh;
  object-fit: fill;
}

/* Clock and Quote */
#lower-left {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

#clock {
  font-family: "EXCELSIOR SANS", sans-serif;
  color: rgba(229, 202, 166, 1);
  font-size: 3em;
  white-space: nowrap;
}

#quote {
  font-family: "Liberation Sans", sans-serif;
  color: rgba(229, 202, 166, 1);
  font-size: 1.5em;
  margin: 0;
}

#widget-wrapper {
  width: 31vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

#grid-content {
  display: flex;
  justify-content: center;
}

#labels {
  color: rgba(233, 199, 68, 1);
  display: flex;
  flex-direction: column;
  margin-right: 10px;
  text-align: right;
  font-size: 14px;
}

#grid {
  display: grid;
  grid-template-columns: repeat(52, 7px);
  gap: 2px;
}

.year-label {
  font-family: "EXCELSIOR SANS", sans-serif;
  font-size: 12px;
  height: 8px;
  margin: 1px 0;
  white-space: nowrap;
}

.week {
  width: 7px;
  height: 7px;
  background-color: #777;
}

.lived {
  background-color: rgba(233, 199, 68, 1);
}

#events {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  height: 100%;
  width: 100%;
}

.event-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}

.event-card img {
  min-height: 0;
  min-width: 0;
  max-width: 50%;
}

.event-card span {
  min-height: 0;
  font-family: "Liberation Sans", sans-serif;
  color: rgba(233, 199, 68, 1);
  text-align: center;
}

.countdown {
  min-height: 0;
  font-size: 1.75em;
  font-family: "EXCELSIOR SANS", sans-serif !important;
}

#buttons * {
  min-height: 0;
}

#buttons {
  display: flex;
  gap: 0.25em;
  height: 6%;
  width: 100%;
}

#buttons button {
  border: none;
  background-color: transparent;
  cursor: pointer;
  height: 100%;
  aspect-ratio: 1/1;
}

#buttons img {
  width: 100%;
  height: 100%;
}

/* Optional: style the containers. Adjust to your liking. */
#life-calendar-container,
#events-container {
  width: 100%;
  height: 94%;
  margin-bottom: 0.25em;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3.75em 3em;
  background-image: url(/grid-bg.png);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

#timeline {
  width: 100%;
  height: 100%;
}

#timeline svg {
  width: 100%;
  height: 100%;
}

#events-container *,
#life-calendar-container * {
  min-height: 0;
}
