/* =====================
   SKIP NAVIGATION
   ===================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary-color);
  color: var(--secondary-color);
  padding: 0.5rem 1rem;
  font-size: 85%;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.1s;
}

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

/* =====================
   TESS GROSSMAN — CUSTOM CSS
   All site customisations live here.
   This file loads after the plugin CSS and bypasses the media cache.
   ===================== */


/* =====================
   COLOURS & VARIABLES
   ===================== */

:root {
  --primary-color: #020202;
  --secondary-color: #f6f6f6;
  --accent: #020202;
  --accent-blue: #020202;
  --accent-sand: #d0d0d0;
  --font-family: 'Bona Nova', ui-serif, Georgia, serif;
  --font-family-sans: 'PP Mori', ui-sans-serif, system-ui, sans-serif;
  --font-weight: 400;
  --font-size: clamp(15px, 1.6vw, 17px);
  --max-site-width: 768px;
}

/* Dark mode — system preference */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #f0f0f0;
    --secondary-color: #111111;
    --accent: #f0f0f0;
    --accent-blue: #aaaaaa;
    --accent-sand: #333333;
  }
}

/* Dark mode — manual toggle */
[data-theme="dark"] {
  --primary-color: #f0f0f0;
  --secondary-color: #111111;
  --accent: #f0f0f0;
  --accent-blue: #aaaaaa;
  --accent-sand: #333333;
}

[data-theme="light"] {
  --primary-color: #020202;
  --secondary-color: #f6f6f6;
  --accent: #020202;
  --accent-blue: #020202;
  --accent-sand: #d0d0d0;
}


/* =====================
   BASE STYLES
   ===================== */

body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size);
  background-color: var(--secondary-color);
  color: var(--primary-color);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--secondary-color);
  text-shadow: none;
}

blockquote {
  background: none !important;
  border-left: 4px solid #aaaaaa !important;
  padding: 0.5rem 0 0.5rem 1.25rem !important;
  color: var(--primary-color) !important;
  font-size: 90% !important;
  line-height: 1.6 !important;
  font-style: italic !important;
  margin: 1.5rem 0 !important;
}

figcaption {
  font-size: 80% !important;
  opacity: 0.55 !important;
  margin-top: 0.5rem !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.4 !important;
  font-style: italic !important;
  text-align: center !important;
}


/* =====================
   HEADINGS
   ===================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  font-weight: 700;
  display: block;
  background: none;
  padding: 0 !important;
}

h1 { font-size: 200%; line-height: 1.2; letter-spacing: 0.04em; }
h2 { font-size: 160%; line-height: 1.2; letter-spacing: 0.04em; }
h3 { font-size: 130%; line-height: 1.2; letter-spacing: 0.03em; }
h4, h5, h6 { font-size: 100%; }

/* Space above and below headings inside post/page body */
.post-body h1, .post-body h2, .post-body h3,
.default-page-content h1, .default-page-content h2, .default-page-content h3 {
  display: block;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}


/* =====================
   SIDEBAR LAYOUT
   ===================== */

body:has(.home-layout) {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.home-layout {
  display: flex;
  min-height: 100vh;
}

.home-sidebar {
  width: 280px;
  min-width: 280px;
  padding: 3rem 2.5rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: hidden;
  border-right: 1px solid var(--accent-sand);
}

.sidebar-utilities {
  padding-bottom: 1rem;
}

.sidebar-utilities {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: auto;
  flex-shrink: 0;
}

.theme-toggle {
  margin: 0;
}

.sidebar-intro {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Reset line-height for sidebar text */
.home-sidebar p,
.home-sidebar .flow,
.home-sidebar .site-description,
.home-sidebar .sidebar-nav a {
  line-height: 1.6 !important;
  display: block !important;
  font-family: var(--font-family-sans) !important;
}

/* Site title wrap */
.siteTitle-wrap {
  display: block;
}

.siteTitle-img {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 !important;
}

[data-theme="dark"] .siteTitle-img {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  .siteTitle-img {
    filter: invert(1);
  }
}

/* =====================
   SIDEBAR WATERMARK
   ===================== */

.sidebar-watermark {
  width: 100%;
  pointer-events: none;
  opacity: 0.08;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-watermark img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 !important;
  max-width: 100% !important;
}

[data-theme="dark"] .sidebar-watermark img {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  .sidebar-watermark img {
    filter: invert(1);
  }
}



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

.sidebar-nav a {
  text-decoration: none;
  color: var(--primary-color);
  font-size: 100%;
  opacity: 0.5;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-nav a::before {
  content: '';
  display: inline-block;
  width: 1em;
  transition: opacity 0.15s ease;
  opacity: 0;
  flex-shrink: 0;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  opacity: 1;
  text-decoration: none;
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
  content: '→';
  opacity: 1;
}

.home-content {
  flex: 1;
  padding: 3rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 760px;
}

/* Mobile */
@media (max-width: 640px) {
  .home-layout { flex-direction: column; }
  .home-sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--accent-sand);
    padding: 2rem 1.5rem;
  }
  .home-content { padding: 2rem 1.5rem; }
}


/* =====================
   BLOG POST LIST
   ===================== */

.blog-post-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0 0.5rem 0;
}



.blog-post-meta time {
  font-size: 70%;
  opacity: 0.4;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}



.blog-post-title-wrap {
  display: block;
  line-height: 1.2;
  margin-top: 0.5rem;
}

.blog-post-title {
  font-size: 120%;
  line-height: 1.2 !important;
  display: block;
  background: none;
  font-weight: 700;
}

.blog-post-title a {
  text-decoration: none;
  color: inherit;
}

.blog-post-title a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.blog-post-excerpt {
  font-size: 90%;
  line-height: 1.6;
  opacity: 0.75;
}

.blog-post-readmore {
  font-size: 85%;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
}

.blog-post-readmore:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.blog-empty {
  opacity: 0.45;
  font-size: 90%;
}

.post-body img,
.default-page-content img {
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1.5rem;
  margin-bottom: 0;
  display: block;
}


/* =====================
   FEED SYSTEM
   ===================== */

.feed-card + .feed-card {
  border-top: 1px solid var(--accent-sand);
  padding-top: 1.5rem !important;
  margin-top: 1rem !important;
}

.feed-page-card {
  animation: fadeIn 0.25s ease;
}

.feed-page-active .feed-card { display: none; }
.feed-page-active .feed-page-card { display: block !important; }

.feed-page-card .inline-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.default-page-content {
  font-size: 90%;
  line-height: 1.7;
}

.default-page-content p + p,
.post-body p + p {
  margin-top: 1rem;
}

.feed-loader {
  font-size: 80%;
  opacity: 0.4;
  padding: 2rem 0;
}


/* =====================
   TAGS
   ===================== */

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.tag {
  font-size: 80%;
  background: transparent;
  color: var(--accent-blue);
  padding: 0;
  border: none;
  border-radius: 0;
  text-transform: lowercase;
  text-decoration: none;
  display: inline-block;
  transition: color 0.15s;
}

.tag::before {
  content: '#';
}

.tag:hover {
  color: var(--accent);
  background: transparent;
  border: none;
}

.tag-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--accent-sand);
  margin-bottom: 2.5rem;
}

.tag-label {
  font-size: 80%;
  opacity: 0.45;
  margin: 0;
}


/* =====================
   CLOSE BUTTON
   ===================== */

.feed-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 85%;
  opacity: 0.45;
  padding: 0;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: block;
}

.feed-close-btn:hover { opacity: 1; }

/* =====================
   BLOG POST COVER IMAGE
   ===================== */

/* Two-column layout when cover image is present */
.feed-card--has-image {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2.5rem;
  align-items: center;
}

.blog-post-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0 12px 0 12px; /* top-right and bottom-left only */
  flex-shrink: 0;
}

.blog-post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0 !important;
  max-width: 100% !important;
}

.blog-post-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Mobile — stack vertically, image below text */
@media (max-width: 640px) {
  .feed-card--has-image {
    grid-template-columns: 1fr;
  }

  .blog-post-cover {
    order: 2;
    aspect-ratio: 16 / 9;
  }

  .blog-post-content {
    order: 1;
  }
}

/* =====================
   LINK HOVER HIGHLIGHT
   ===================== */



/* =====================
   DARK MODE TOGGLE
   ===================== */

.theme-toggle {
  background: none;
  border: none;
  color: var(--primary-color);
  font-family: var(--font-family-sans);
  font-size: 110%;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.theme-toggle:hover {
  opacity: 1;
}

/* =====================
   SIDEBAR PHOTO
   ===================== */

.sidebar-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 !important;
  max-width: 72px !important;
  border: 2px solid var(--accent-sand);
}





/* =====================
   RSS LINK
   ===================== */





/* =====================
   AJAX FADE TRANSITION
   ===================== */

.feed-page-card {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* =====================
   BACK TO TOP BUTTON
   ===================== */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: var(--secondary-color);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent-blue);
}

/* =====================
   PAPER TEXTURE
   ===================== */

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}








/* =====================
   THEME TOGGLE FLIP
   ===================== */

.theme-toggle {
  transition: transform 0.15s ease;
}

.theme-toggle.flipping {
  transform: rotateY(90deg);
}





/* =====================
   LINK STYLES
   ===================== */

/* All links — body text colour, underlined by default */
a {
  color: var(--primary-color);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* Visited — slightly faded */
a:visited {
  color: var(--primary-color);
  opacity: 0.6;
}

/* Hover — remove underline, explicitly use primary colour */
a:hover {
  text-decoration: none;
  background: none !important;
  color: var(--primary-color) !important;
  opacity: 0.7;
}

/* Nav links, tags, Read More — override to no underline by default */
.sidebar-nav a,
.tag,
.blog-post-readmore,
.blog-post-title a,
.siteTitle-wrap a {
  text-decoration: none;
}

.sidebar-nav a:hover,
.blog-post-title a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
