/* ==========================================================================
   banjo magpi - Global Styles
   ========================================================================== */

/* Fonts
   ========================================================================== */
@font-face {
  font-family: 'Gowun Batang';
  src: url('/fonts/GowunBatang-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gowun Batang';
  src: url('/fonts/GowunBatang-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Variables
   ========================================================================== */
:root {
  --bg: #f5f7f6;
  --text: #1a3a3a;
  --text-muted: #3d5a5a;
  --accent: #c45a42;
  --accent-hover: #a84832;
  --teal: #1f5252;
  --teal-light: #2d7a7a;
  --coral: #c45a42;
  --green: #3a5a4a;
  --slate: #4a5a6a;
  --amber: #7a5a2a;
  --rose: #8b5a7a;
  --border: #b8c8c8;
  --code-bg: #e8f0ef;
  --focus: #c45a42;
}

/* Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Layout
   ========================================================================== */
body {
  font-family: 'Gowun Batang', serif;
  background: var(--bg);
  color: var(--text);
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  line-height: 1.7;
  font-size: 16px;
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-template-rows: auto 1fr;
  gap: 2rem;
}

.content-area {
  grid-column: 2;
}

/* Skip Link
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Sidebar & Navigation
   ========================================================================== */
.sidebar {
  grid-row: 1 / -1;
  padding-top: 0.5rem;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.sidebar a:hover {
  color: var(--teal);
}

.sidebar nav a::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: middle;
  -webkit-mask-image: url('/images/brush-dab.svg');
  mask-image: url('/images/brush-dab.svg');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.nav-teal::before { background: #1a3a3a; }
.nav-coral::before { background: var(--coral); }
.nav-green::before { background: var(--green); }
.nav-slate::before { background: var(--slate); }
.nav-amber::before { background: var(--amber); }
.nav-rose::before { background: var(--rose); }

.sidebar .section-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.sidebar .section-label:first-child {
  margin-top: 0;
}

.sidebar a.section-link {
  text-decoration: none;
  transition: opacity 0.2s;
}

.sidebar a.section-link:hover {
  opacity: 1;
  text-decoration: none;
}

/* Links & Focus States
   ========================================================================== */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus,
button:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

a:focus:not(:focus-visible) {
  outline: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Typography
   ========================================================================== */
h1 {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

h2 {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 2.5rem 0 1rem;
  color: var(--teal);
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

p {
  margin-bottom: 1rem;
}

/* Lists
   ========================================================================== */
ul {
  list-style: none;
  margin: 0;
}

li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

li:last-child {
  border-bottom: none;
}

/* Articles
   ========================================================================== */
article {
  margin-bottom: 2rem;
}

.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.webmention-count {
  opacity: 0.4;
}

/* Status badges
   ========================================================================== */
.status {
  display: inline-block;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-active {
  background: #c8e6c9;
  color: #2e7d32;
}

.status-paused {
  background: #fff3cd;
  color: #856404;
}

.status-done {
  background: #bbdefb;
  color: #1565c0;
}

.status-idea {
  background: #e1bee7;
  color: #7b1fa2;
}

/* Code
   ========================================================================== */
pre {
  font-family: 'Gowun Batang', serif;
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

code {
  font-family: 'Gowun Batang', serif;
  font-size: 0.9em;
}

/* Tables
   ========================================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.75rem 0;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Haiku
   ========================================================================== */
.haiku {
  font-family: 'Gowun Batang', serif;
  font-size: 1.2rem;
  line-height: 2;
  font-style: italic;
  padding: 1rem 0;
}

/* Brushstroke Headings
   ========================================================================== */
.brushstroke {
  position: relative;
  display: inline-block;
  color: var(--bg);
  padding: 0.2rem 0.6rem;
}

.brushstroke::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5%;
  width: 110%;
  height: 180%;
  transform: translateY(-50%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: -1;
}

.brushstroke-teal::before {
  background-image: url('/images/brushstroke.svg');
}

.brushstroke-coral::before {
  background-image: url('/images/brushstroke-coral.svg');
}

.brushstroke-green::before {
  background-image: url('/images/brushstroke-green.svg');
}

.brushstroke-slate::before {
  background-image: url('/images/brushstroke-slate.svg');
}

.brushstroke-amber::before {
  background-image: url('/images/brushstroke-amber.svg');
}

.brushstroke-rose::before {
  background-image: url('/images/brushstroke-rose.svg');
}

/* Keynote Grid (list page)
   ========================================================================== */
.keynote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.keynote-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s;
}

.keynote-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
}

.keynote-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.keynote-card-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--border);
  border-radius: 4px;
}

.keynote-card-title {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.3;
}

.keynote-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Keynote Content (single page)
   ========================================================================== */
.keynote-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
  clear: both;
}

.keynote-content p {
}

.keynote-content figure {
  margin: 1.5rem 0;
  clear: both;
}

.keynote-content figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

.keynote-content .img-left {
  float: left;
  clear: none;
  max-width: 45%;
  margin: 0.5rem 1.5rem 1rem 0;
}

.keynote-content .img-right {
  float: right;
  clear: none;
  max-width: 45%;
  margin: 0.5rem 0 1rem 1.5rem;
}

.keynote-content .img-wrap-right {
  float: right;
  clear: none;
  max-width: 30%;
  margin: 0.15rem 0 1rem 1.5rem;
}

.keynote-content .img-wrap-right img {
  margin: 0;
}

.keynote-content .img-wrap-left {
  float: left;
  clear: none;
  max-width: 30%;
  margin: 0.15rem 1.5rem 1rem 0;
}

.keynote-content .img-wrap-left img {
  margin: 0;
}

.keynote-content .img-spread {
  clear: both;
  max-width: 100%;
  margin: 1.5rem 0;
}

.keynote-content .img-spread img {
  width: 100%;
  margin: 0;
}

.keynote-content .img-small {
  max-width: 60%;
  margin: 1.5rem auto;
}

.keynote-content .img-thumb {
  max-width: 40%;
  margin: 1.5rem auto;
}

.keynote-content .clear {
  clear: both;
}

.keynote-content .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.keynote-content .gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin: 0;
  cursor: pointer;
  transition: transform 0.2s;
}

.keynote-content .gallery img:hover {
  transform: scale(1.02);
}

.keynote-content .two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.keynote-content .two-up img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 0;
}

.keynote-content table {
  width: 100%;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.keynote-content th,
.keynote-content td {
  padding: 0.5rem 0.75rem;
  text-align: right;
}

.keynote-content th:first-child,
.keynote-content td:first-child {
  text-align: left;
}

.keynote-content tbody tr:nth-child(odd) {
  background: var(--code-bg);
}

.keynote-content tbody tr:hover {
  background: var(--border);
}

/* Dashboard (shared between solstice & 2026)
   ========================================================================== */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
}

.dashboard .section {
  position: relative;
}

.dashboard .section-title {
  font-size: 1.1rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  text-decoration: none;
  display: inline-block;
}

.dashboard .section-title::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: middle;
  -webkit-mask-image: url('/images/brush-dab.svg');
  mask-image: url('/images/brush-dab.svg');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.dashboard .section-title:hover {
  text-decoration: underline;
}

.dashboard .section-title.amber { color: var(--amber); }
.dashboard .section-title.amber::before { background: var(--amber); }
.dashboard .section-title.teal { color: var(--teal); }
.dashboard .section-title.teal::before { background: var(--teal); }
.dashboard .section-title.green { color: var(--green); }
.dashboard .section-title.green::before { background: var(--green); }
.dashboard .section-title.slate { color: var(--slate); }
.dashboard .section-title.slate::before { background: var(--slate); }
.dashboard .section-title.rose { color: var(--rose); }
.dashboard .section-title.rose::before { background: var(--rose); }
.dashboard .section-title.coral { color: var(--coral); }
.dashboard .section-title.coral::before { background: var(--coral); }

.stat {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

.stat-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

.mini-stat {
  font-size: 1.5rem;
  line-height: 1;
}

/* Color strip (distance visualization)
   ========================================================================== */
.color-strip {
  display: flex;
  gap: 2px;
  margin: 1rem 0;
  height: 24px;
  flex-wrap: wrap;
}

.color-strip .day {
  width: 18px;
  height: 18px;
  -webkit-mask-image: url('/images/brush-dab.svg');
  mask-image: url('/images/brush-dab.svg');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* Dashboard lists
   ========================================================================== */
.haiku-preview {
  font-style: italic;
  line-height: 1.8;
  margin-top: 0.75rem;
}

.bird-list {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.6;
}

.recent {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.75rem;
  line-height: 1.5;
}

.book-list {
  margin-top: 0.75rem;
}

.book-item {
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.book-item:last-child {
  border-bottom: none;
}

.book-author {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.content-list {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.content-item {
  padding: 0.25rem 0;
}

.snippet-title {
  font-style: italic;
}

/* Info Box (radio interaction pattern)
   ========================================================================== */
.info-box {
  background: var(--code-bg);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  min-height: 4rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.info-content {
  display: none;
}

/* Solstice note
   ========================================================================== */
.solstice-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}

/* Screen reader only
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Footer
   ========================================================================== */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cc-license {
  display: inline-flex;
  gap: 0.25rem;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.cc-license:hover {
  opacity: 0.7;
  text-decoration: none;
}

.cc-license svg {
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

.colophon-link {
  opacity: 0.4;
  font-size: 0.75rem;
  margin-left: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: opacity 0.2s;
}

.colophon-link:hover {
  opacity: 0.7;
  text-decoration: none;
}

/* Responsive
   ========================================================================== */
@media (max-width: 600px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-row: auto;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .sidebar .section-label {
    width: 100%;
    margin-top: 0.5rem;
  }

  .content-area {
    grid-column: 1;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .keynote-content .two-up {
    grid-template-columns: 1fr;
  }

  .keynote-content img {
    margin: 1rem 0;
  }

  .keynote-content .img-left,
  .keynote-content .img-right,
  .keynote-content .img-wrap-right,
  .keynote-content .img-wrap-left {
    float: none;
    max-width: 100%;
    margin: 1rem 0;
  }

  .keynote-content .img-small {
    max-width: 100%;
  }
}

@media (max-width: 500px) {
  .keynote-content .two-up {
    grid-template-columns: 1fr;
  }
}

/* 404 Page
   ========================================================================== */
.not-found {
  text-align: center;
  padding: 6rem 1rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 2.2;
}

.not-found p {
  margin: 0;
}

/* Caw Page
   ========================================================================== */
.caw-page {
  text-align: center;
}

.caw-page img {
  max-width: 100%;
  height: auto;
}

/* Accessibility
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.not-found .home-link {
  margin-top: 3rem;
}

.not-found .home-link a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.not-found .home-link a:hover {
  color: var(--coral);
  border-color: var(--coral);
}
