/* ==========================================================================
   Deodatus — a Ghost theme
   Personal portfolio, text-forward, informed by late-period web design
   circa 2003–2008. Scaled up for photo/video showcases.
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

:root {
  --bg:           #efebe1;
  --surface:      #f6f2e7;
  --ink:          #1e1e1e;
  --ink-soft:     #5a5a5a;
  --rule:         #bfbaa8;
  --rule-soft:    #dcd6c5;

  --accent:       #b05020;
  --accent-alt:   #2a4566;
  --link:         #4a6b2b;
  --date:         #7a7a7a;

  --font-body:    var(--gh-font-body, "Verdana", "Geneva", "Tahoma", sans-serif);
  --font-heading: var(--gh-font-heading, "Verdana", "Geneva", "Tahoma", sans-serif);
  --font-mono:    "Courier New", "Courier", monospace;

  --size-xs:      12px;
  --size-sm:      13px;
  --size-base:    14px;
  --size-md:      16px;
  --size-lg:      20px;
  --size-xl:      32px;

  --max-w:        1240px;
  --sidebar-w:    180px;
}

/* Mint — off-white background with mint-green accents */
body.accent-mint {
  --bg:         #f2f5ef;       /* off-white with a hint of warmth */
  --surface:    #ffffff;
  --ink:        #1a1a1a;
  --ink-soft:   #5a5a5a;
  --rule:       #c4d1c6;
  --rule-soft:  #e0e6df;
  --accent:     #3a8e6e;        /* mint/sage green — current */
  --accent-alt: #6b7a62;        /* olive-gray — section */
  --link:       #2d6b55;        /* darker mint — links */
  --date:       #7a7a7a;
}

body.accent-terminal {
  --bg: #0d0d0d; --surface: #111; --ink: #c8c8c8; --ink-soft: #888;
  --rule: #333; --rule-soft: #222;
  --accent: #ffb000; --accent-alt: #33ff66; --link: #33ff66; --date: #666;
}
body.accent-newsprint {
  --bg: #f1ede4; --accent: #a51e1e; --accent-alt: #222; --link: #a51e1e;
}
body.accent-blueprint {
  --bg: #e8ecef; --surface: #f4f6f8;
  --accent: #b8501e; --accent-alt: #1e3a5f; --link: #1e3a5f;
  --rule: #aab4c0; --rule-soft: #d4dae2;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  padding: 22px 28px 50px;
}

.page {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ----- Masthead row 1: SITE NAME + CLOCK ----- */
.masthead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.site-name {
  font-family: var(--font-heading);
  font-size: var(--size-xl);
  font-weight: bold;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.datestamp {
  font-family: var(--font-mono);
  font-size: var(--size-sm);
  color: var(--date);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ----- Masthead row 2: BREADCRUMB (/PORTFOLIO/NEWS/TITLE.) ----- */
.breadcrumb {
  font-family: var(--font-heading);
  font-size: var(--size-xl);
  font-weight: bold;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  word-break: break-word;
}
.breadcrumb .crumb      { color: var(--accent); }
.breadcrumb .crumb-alt  { color: var(--accent-alt); }
.breadcrumb .slash      { color: var(--ink); }
.breadcrumb .terminal   { color: var(--ink); }

/* ----- Nav ----- */
.nav-primary {
  font-size: var(--size-sm);
  margin: 4px 0 8px;
}
.nav-primary a {
  color: var(--ink);
  margin-right: 14px;
  transition: color 0.1s;
}
.nav-primary a.nav-current { color: var(--accent); font-weight: bold; }
.nav-primary a:hover       { color: var(--link); }

.nav-secondary {
  font-size: var(--size-sm);
  padding: 4px 0 7px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.nav-secondary a {
  color: var(--link);
  margin: 0 3px;
}
.nav-secondary a.active { color: var(--accent); font-weight: bold; }
.nav-secondary a:hover  { color: var(--accent); }
.nav-secondary .sep     { color: var(--ink); margin: 0 3px; }

/* ----- Layout ----- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 28px;
  align-items: flex-start;
}

.sidebar {
  font-size: var(--size-sm);
  line-height: 1.75;
  padding-top: 4px;
}
.sidebar .sidebar-title {
  color: var(--accent-alt);
  font-weight: bold;
  margin-bottom: 4px;
  font-size: var(--size-base);
}
.sidebar ul { list-style: none; }
.sidebar li a {
  color: var(--link);
  display: block;
  padding: 0 3px;
}
.sidebar li a:hover { color: var(--accent); }
.sidebar li a.active {
  color: var(--accent);
  font-weight: bold;
}

/* ----- Content frame ----- */
.content {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 22px 26px 28px;
  min-height: 400px;
}

/* ----- Post content ----- */
.post-title,
.page-title {
  font-family: var(--font-heading);
  font-size: var(--size-xl);
  font-weight: bold;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.15;
}
.post-meta {
  font-size: var(--size-xs);
  color: var(--ink-soft);
  margin-bottom: 18px;
  font-family: var(--font-mono);
}
.post-meta a { color: var(--link); }
.post-meta a:hover { color: var(--accent); }

.post-feature-image {
  margin: 0 0 14px;
  border: 1px solid var(--rule);
  padding: 0;
  line-height: 0;
}
.post-feature-image img { width: 100%; height: auto; }

.post-content,
.page-content {
  font-size: var(--size-md);
  color: var(--link);
  line-height: 1.65;
}
.post-content p,
.page-content p { margin-bottom: 1em; color: var(--link); }
.post-content h1,
.post-content h2,
.post-content h3,
.page-content h1,
.page-content h2,
.page-content h3 {
  font-family: var(--font-heading);
  color: var(--ink);
  font-weight: bold;
  margin: 1.4em 0 0.5em;
  line-height: 1.25;
}
.post-content h1 { font-size: var(--size-xl); }
.post-content h2 { font-size: var(--size-lg); }
.post-content h3 { font-size: var(--size-md); text-transform: uppercase; letter-spacing: 0.08em; }
.post-content a { color: var(--accent); text-decoration: underline; }
.post-content a:hover { color: var(--accent-alt); }
.post-content img { margin: 14px 0; border: 1px solid var(--rule); max-width: 100%; height: auto; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 14px 0;
  color: var(--ink-soft);
  font-style: italic;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--rule-soft);
  padding: 1px 5px;
  word-break: break-word;
}
.post-content pre {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  padding: 14px;
  overflow-x: auto;
  margin: 14px 0;
  -webkit-overflow-scrolling: touch;
}
.post-content ul,
.post-content ol { margin: 0.6em 0 1em 24px; }
.post-content hr { border: 0; border-top: 1px dashed var(--rule); margin: 22px 0; }

/* ----- Koenig cards ----- */
.post-content .kg-image-card,
.page-content .kg-image-card { margin: 16px 0; }
.post-content .kg-image,
.page-content .kg-image {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--rule);
}
.post-content .kg-width-wide .kg-image,
.page-content .kg-width-wide .kg-image {
    max-width: 115%;
    margin-left: -7.5%;
}
.post-content .kg-width-full .kg-image,
.page-content .kg-width-full .kg-image {
    max-width: calc(100vw - 56px);
    margin-left: calc(-50vw + 50% + 28px);
}
.post-content figcaption,
.page-content figcaption {
    text-align: center;
    font-size: var(--size-xs);
    color: var(--ink-soft);
    margin-top: 8px;
    font-family: var(--font-mono);
}
.post-content .kg-gallery-container,
.page-content .kg-gallery-container {
    display: flex;
    flex-direction: column;
    margin: 16px 0;
}
.post-content .kg-gallery-row,
.page-content .kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}
.post-content .kg-gallery-image img,
.page-content .kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 1px solid var(--rule);
}
.post-content .kg-embed-card,
.page-content .kg-embed-card {
    margin: 16px 0;
    width: 100%;
}
.post-content .kg-embed-card > iframe,
.page-content .kg-embed-card > iframe {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 1px solid var(--rule);
    display: block;
}
/* Non-video embeds (tweets, instagram posts, etc.) — keep them centered, not stretched */
.post-content .kg-embed-card > blockquote,
.page-content .kg-embed-card > blockquote,
.post-content .kg-embed-card > .twitter-tweet,
.page-content .kg-embed-card > .twitter-tweet,
.post-content .kg-embed-card > .instagram-media,
.page-content .kg-embed-card > .instagram-media {
    margin-left: auto !important;
    margin-right: auto !important;
}
/* Video card (Ghost's native video upload) — match the iframe treatment */
.post-content .kg-video-card,
.page-content .kg-video-card {
    margin: 16px 0;
    width: 100%;
}
.post-content .kg-video-card .kg-video-container,
.page-content .kg-video-card .kg-video-container {
    border: 1px solid var(--rule);
}
.post-content .kg-video-card video,
.page-content .kg-video-card video {
    width: 100%;
    height: auto;
    display: block;
}
/* Audio card */
.post-content .kg-audio-card,
.page-content .kg-audio-card {
    margin: 16px 0;
    border: 1px solid var(--rule);
    padding: 12px;
    background: var(--bg);
}
.post-content .kg-audio-card audio,
.page-content .kg-audio-card audio { width: 100%; }
.post-content .kg-bookmark-card,
.page-content .kg-bookmark-card {
    margin: 16px 0;
    border: 1px solid var(--rule);
    background: var(--bg);
    font-size: var(--size-sm);
}
.post-content .kg-bookmark-container,
.page-content .kg-bookmark-container {
    display: flex;
    color: var(--ink);
    text-decoration: none;
    min-height: 140px;
}
.post-content .kg-bookmark-content,
.page-content .kg-bookmark-content {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.post-content .kg-bookmark-title,
.page-content .kg-bookmark-title {
    font-weight: bold;
    color: var(--ink);
    margin-bottom: 5px;
}
.post-content .kg-bookmark-description,
.page-content .kg-bookmark-description {
    color: var(--ink-soft);
    font-size: var(--size-xs);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-content .kg-bookmark-metadata,
.page-content .kg-bookmark-metadata {
    font-size: var(--size-xs);
    color: var(--ink-soft);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}
.post-content .kg-bookmark-icon,
.page-content .kg-bookmark-icon { width: 16px; height: 16px; }
.post-content .kg-bookmark-author,
.page-content .kg-bookmark-author { color: var(--link); }
.post-content .kg-bookmark-publisher,
.page-content .kg-bookmark-publisher { color: var(--ink-soft); }
.post-content .kg-bookmark-thumbnail,
.page-content .kg-bookmark-thumbnail {
    min-width: 160px;
    max-width: 220px;
    overflow: hidden;
}
.post-content .kg-bookmark-thumbnail img,
.page-content .kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border: 0;
}
.post-content .kg-callout-card,
.page-content .kg-callout-card {
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    background: var(--bg);
    margin: 16px 0;
    font-size: var(--size-md);
}
.post-content .kg-callout-emoji,
.page-content .kg-callout-emoji { margin-right: 8px; }
.post-content .kg-toggle-card,
.page-content .kg-toggle-card {
    border: 1px dashed var(--rule);
    padding: 12px 16px;
    margin: 16px 0;
}
.post-content .kg-toggle-heading,
.page-content .kg-toggle-heading {
    font-weight: bold;
    color: var(--ink);
    cursor: pointer;
}
.post-content .kg-button-card,
.page-content .kg-button-card { margin: 16px 0; text-align: center; }
.post-content .kg-btn,
.page-content .kg-btn {
    display: inline-block;
    padding: 7px 18px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: var(--size-sm);
    font-family: var(--font-mono);
    text-decoration: none;
}
.post-content .kg-btn:hover,
.page-content .kg-btn:hover { background: var(--accent); color: var(--surface); }
.post-content .kg-header-card,
.page-content .kg-header-card {
    padding: 28px;
    background: var(--bg);
    text-align: center;
    margin: 16px 0;
}
.post-content .kg-product-card,
.page-content .kg-product-card {
    border: 1px solid var(--rule);
    padding: 16px;
    margin: 16px 0;
}
.post-content .kg-file-card,
.page-content .kg-file-card {
    border: 1px solid var(--rule);
    padding: 14px;
    margin: 16px 0;
    font-size: var(--size-sm);
}
.post-content .kg-nft-card,
.page-content .kg-nft-card {
    border: 1px solid var(--rule);
    padding: 16px;
    margin: 16px 0;
}
.post-content .kg-signup-card,
.page-content .kg-signup-card {
    border: 1px dashed var(--rule);
    padding: 18px;
    margin: 16px 0;
    background: var(--bg);
}

/* ----- Thumbnail grid ----- */
.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
}
.thumbnail-grid .thumb {
  display: block;
  position: relative;
  /* No overflow:hidden here — tooltip needs to escape */
  transition: z-index 0s 0.2s;
}
.thumbnail-grid .thumb:hover {
  z-index: 10;
  transition: z-index 0s;
}
/* The clipping wrapper that crops the image to a square */
.thumbnail-grid .thumb .thumb-clip {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg);
  transition: border-color 0.12s;
}
.thumbnail-grid .thumb:hover .thumb-clip {
  border-color: var(--accent);
}
.thumbnail-grid .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;             /* crops to center square */
  object-position: center;
  display: block;
  transition: transform 0.25s ease;
}
.thumbnail-grid .thumb:hover img {
  transform: scale(1.04);
}

/* Upward-arrow tooltip on hover */
.thumbnail-grid .thumb .thumb-tooltip {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 4px);
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  padding: 5px 9px;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 20;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  margin-top: 6px;
}
/* The upward-pointing arrow */
.thumbnail-grid .thumb .thumb-tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--ink);
}
.thumbnail-grid .thumb:hover .thumb-tooltip,
.thumbnail-grid .thumb:focus-visible .thumb-tooltip {
  opacity: 1;
  transform: translate(-50%, 8px);
}

/* ----- [NEW] tag on sidebar items (added by JS for posts <30 days old) ----- */
.sidebar-list li.is-new > a::after {
  content: " [NEW]";
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.04em;
  margin-left: 4px;
  vertical-align: middle;
}

/* ----- Post list ----- */
.post-list {
  list-style: none;
  font-size: var(--size-md);
}
.post-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule-soft);
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: baseline;
}
.post-list li:last-child { border-bottom: none; }
.post-list .pl-date {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  color: var(--ink-soft);
}
.post-list .pl-title a {
  color: var(--link);
}
.post-list .pl-title a:hover { color: var(--accent); }
.post-list .pl-tag {
  font-size: var(--size-xs);
  color: var(--accent-alt);
}

/* ----- Pagination ----- */
.pagination {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule-soft);
  font-size: var(--size-sm);
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  gap: 14px;
  flex-wrap: wrap;
}
.pagination a { color: var(--link); }
.pagination a:hover { color: var(--accent); }
.pagination .page-number { color: var(--ink-soft); font-family: var(--font-mono); }

/* ----- Footer ----- */
.site-footer {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: var(--size-xs);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a { color: var(--link); }
.site-footer a:hover { color: var(--accent); }

.social-links {
  display: flex;
  gap: 14px;
  align-items: center;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--link);
  text-decoration: none;
  transition: color 0.1s;
  padding: 4px 2px;
}
.social-links a:hover { color: var(--accent); }
.social-links svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

/* ----- Error ----- */
.error {
  text-align: center;
  padding: 80px 20px;
  font-family: var(--font-mono);
}
.error .error-code { font-size: 64px; color: var(--accent); }
.error .error-msg  { font-size: var(--size-md); margin-top: 14px; }

/* ----- Subscribe ----- */
.subscribe {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed var(--rule);
  font-size: var(--size-sm);
  background: var(--bg);
}
.subscribe input[type="email"] {
  font-family: var(--font-body);
  font-size: var(--size-sm);
  padding: 5px 7px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  width: 260px;
  max-width: 100%;
}
.subscribe button {
  font-family: var(--font-body);
  font-size: var(--size-sm);
  padding: 5px 12px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.subscribe button:hover { color: var(--accent); border-color: var(--accent); }


/* ==========================================================================
   MOBILE OPTIMIZATIONS
   ========================================================================== */

/* Tablet */
@media (max-width: 960px) {
  :root {
    --sidebar-w: 150px;
    --size-xl: 26px;
  }
  body { padding: 18px 20px 40px; }
  .layout { gap: 20px; }
  .content { padding: 18px 20px 22px; }
}

/* Mobile */
@media (max-width: 680px) {
  :root {
    --size-xs: 11px;
    --size-sm: 12px;
    --size-base: 15px;   /* slightly bigger for mobile readability */
    --size-md: 16px;
    --size-lg: 19px;
    --size-xl: 22px;
  }

  body {
    padding: 12px 14px 28px;
    line-height: 1.6;
  }

  /* Masthead: stack site name and clock */
  .masthead-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 0;
  }
  .site-name { font-size: 22px; }
  .datestamp {
    font-size: 11px;
  }
  .breadcrumb {
    font-size: 17px;
    line-height: 1.2;
    margin-bottom: 10px;
  }

  /* Primary nav: touch-friendly spacing */
  .nav-primary {
    font-size: 13px;
    margin: 6px 0 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
  }
  .nav-primary a {
    margin-right: 0;
    padding: 6px 10px 6px 0;
    display: inline-block;
    min-height: 32px;
    line-height: 20px;
  }

  /* Secondary nav: horizontal scroll instead of wrap */
  .nav-secondary {
    font-size: 12px;
    padding: 6px 0 8px;
    margin-bottom: 14px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
  }
  .nav-secondary::-webkit-scrollbar { display: none; }
  .nav-secondary a { padding: 2px 0; }

  /* Layout: single column, sidebar becomes a compact collapsible-style panel */
  .layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .sidebar {
    order: 2;                  /* move sidebar BELOW content on mobile */
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--rule);
    line-height: 1.8;
    font-size: 13px;
  }
  .sidebar .sidebar-title {
    font-size: 14px;
    margin-bottom: 6px;
  }
  .sidebar ul { columns: 2; column-gap: 14px; }
  .sidebar li { break-inside: avoid; }
  .sidebar li a {
    padding: 4px 3px;
    min-height: 28px;
  }

  .content {
    order: 1;
    padding: 14px 14px 18px;
  }

  /* Post content tighter */
  .post-title,
  .page-title { font-size: 22px; line-height: 1.2; }
  .post-meta { font-size: 11px; }

  /* Post list: stack date / title / tag vertically */
  .post-list li {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 12px 0;
  }

  /* Thumbnail grid: smaller squares, tooltip becomes a static caption on tap */
  .thumbnail-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
    margin-bottom: 14px;
  }
  .thumbnail-grid .thumb .thumb-tooltip {
    font-size: 10px;
    padding: 4px 7px;
    max-width: 200px;
  }
  .post-list .pl-date { font-size: 11px; order: -1; }
  .post-list .pl-title { font-size: 16px; line-height: 1.35; }
  .post-list .pl-title a { padding: 4px 0; display: inline-block; }
  .post-list .pl-tag { font-size: 11px; }

  /* Koenig full-width images: neutralize on mobile (no negative margins) */
  .post-content .kg-width-wide .kg-image,
  .page-content .kg-width-wide .kg-image,
  .post-content .kg-width-full .kg-image,
  .page-content .kg-width-full .kg-image {
    max-width: 100%;
    margin-left: 0;
  }

  /* Bookmark cards: stack vertically */
  .post-content .kg-bookmark-container,
  .page-content .kg-bookmark-container {
    flex-direction: column-reverse;
  }
  .post-content .kg-bookmark-thumbnail,
  .page-content .kg-bookmark-thumbnail {
    max-width: 100%;
    min-width: 0;
    max-height: 160px;
  }

  /* Pagination: stack */
  .pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
  }
  .pagination a {
    padding: 6px 0;
    display: inline-block;
    min-height: 32px;
    line-height: 20px;
  }

  /* Footer: stack, bigger touch targets */
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .social-links {
    gap: 16px;
  }
  .social-links a {
    padding: 8px 4px;
    min-height: 40px;
  }
  .social-links svg { width: 16px; height: 16px; }

  /* Subscribe form: full-width input on mobile */
  .subscribe input[type="email"] {
    width: 100%;
    margin-bottom: 8px;
  }
  .subscribe button {
    padding: 8px 16px;
    min-height: 40px;
  }
}

/* Small mobile */
@media (max-width: 380px) {
  :root { --size-xl: 20px; }
  body { padding: 10px 12px 24px; }
  .site-name { font-size: 20px; }
  .breadcrumb { font-size: 15px; }
  .sidebar ul { columns: 1; }
}
