/* ==========================================================================
   Handle layout — recreates the narrow, mobile-first "profile blog" look
   (dark hero + overlapping avatar + tabbed nav + full post feed cards)
   ========================================================================== */

:root {
    --hde-ink: #111111;
    --hde-body-bg: #f5f5f5;
    --hde-card-bg: #ffffff;
    --hde-border: #e5e5e5;
    --hde-muted: #666666;
}

body.handle-theme {
    background-color: var(--hde-body-bg);
    margin: 0;
}

.hde-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 8vmin;
}

.hde-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-top: 3vmin;
    background-color: var(--hde-card-bg);
}

@media (min-width: 768px) {
    .hde-card {
        margin-top: 8vmin;
        max-width: 680px;
        border-radius: 20px;
        box-shadow: 0 25px 50px -12px rgba(0,0,0,0.10);
    }
}

/* ---- Hero ---- */

.hde-hero {
    height: 23.33rem;
    margin: -4vmin 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-wash);
    background-size: cover;
    background-position: center center;
    overflow: hidden;
}
@media (min-width: 768px) {
    .hde-hero { border-radius: 20px 20px 0 0; }
}

.hde-hero-logo {
    height: 7.5rem;
    width: auto;
    max-width: 70%;
    object-fit: contain;
}

.hde-hero-logo-masked {
    display: block;
    height: 7.5rem;
    width: 12rem;
    max-width: 70%;
    -webkit-mask-image: var(--hde-logo-mask-url);
    mask-image: var(--hde-logo-mask-url);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    background-color: var(--hde-logo-color);
}

/* ---- Header ---- */
.hde-header {
    padding: 0 5rem;
}

.hde-avatar,
.hde-avatar-fallback {
    display: block;
    width: 7.2rem;
    height: 7.2rem;
    margin: -3.6rem 0 1.4rem 0.4rem;
    position: static;
    left: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
    border-radius: 999px;
    box-shadow: 0 0 0 4px var(--hde-card-bg);
    object-fit: cover;
    background: var(--color-wash);
}

.hde-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hde-muted);
    font-weight: 700;
    font-size: 1.25rem;
}

.hde-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 0.75rem;
}
.hde-title-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.hde-name {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 3rem;
    color: var(--hde-ink);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hde-actions {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    flex-shrink: 0;
}
.hde-icon-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    width: 2.25rem;
    color: var(--hde-muted);
    background: transparent;
    border: 1px solid var(--hde-border);
    border-radius: 999px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.hde-icon-btn:hover {
    color: color-mix(in srgb, var(--hde-ink) 80%, transparent);
    background: color-mix(in srgb, var(--hde-ink) 4%, transparent);
}

.hde-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    color: var(--color-darkgrey);
    font-size: 1.3rem;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.hde-continue-btn svg {
    width: 1.3rem;
    height: 1.3rem;
}

.hde-continue-btn .nav-arrow {
    transform: rotate(-90deg);
}

.hde-back-arrow {
    transform: rotate(90deg);
}

.hde-continue-btn:hover, 
.hde-continue-btn svg:hover,
.hde-continue-btn .nav-arrow:hover {
    color: var(--ghost-accent-color);
}

.hde-icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.hde-continue-btn svg path {
    stroke-width: 0.8;
}

.hde-icon-btn[aria-label="Search"],
.hde-icon-btn[aria-label="Email"],
.hde-icon-btn[aria-label="Contact"] {
    width: 4rem;
    height: 4rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hde-icon-btn[aria-label="Search"] svg,
.hde-icon-btn[aria-label="Email"] svg,
.hde-icon-btn[aria-label="Contact"] svg {
    width: 1.5rem;
    height: 1.5rem;
}

.hde-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: var(--ghost-accent-color);
    color: var(--hde-card-bg);
    font-size: 1.3rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 999px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.hde-subscribe-btn:hover { opacity: 0.90; }

.hde-post-count {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--hde-muted);
}

.hde-bio {
    margin: 15px 0 20px;
    color: var(--hde-ink);
    line-height: 1.55;
}

/* ---- Nav tabs ---- */
.hde-nav-wrap {
    position: relative;
    margin-top: 1.25rem;
}
.hde-nav {
    padding: 0 5rem;
    margin-bottom: -1px;
    border-bottom: 1px solid var(--hde-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.hde-nav::-webkit-scrollbar { display: none; }

.hde-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}
.hde-nav li {
  margin: 0;
  padding: 0;
}
.hde-nav a {
    display: inline-block;
    padding-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--hde-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.hde-nav a:hover { color: var(--hde-ink); border-color: var(--hde-border); }
.hde-nav li.nav-current a {
    color: var(--hde-ink);
    border-color: var(--hde-ink);
}

/* ---- Feed ---- */
.hde-feed {
    display: flex;
    flex-direction: column;
}

.hde-article {
    position: relative;
    padding: 4vmin;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid var(--hde-border);
    padding: 5rem;
}
.hde-article:first-child { border-top: 0; }

.hde-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    color: var(--hde-muted);
    line-height: 1;
}
.hde-post-author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.875rem;
    min-width: 0;
}
.hde-post-author img {
    width: 4rem;
    height: 4rem;
    border-radius: 999px;
    object-fit: cover;
}
.hde-post-author-name {
    color: var(--hde-ink);
    font-weight: 500;
    font-size: 1.4rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hde-post-author-avatar-fallback {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--hde-border);
}

.hde-post-tag {
    color: var(--hde-ink);
    font-size: 1.4rem;
    font-weight: 500;
    text-decoration: none;
    flex-shrink: 0;
}

.hde-post-tag:hover {
    color: var(--ghost-accent-color);
}

.hde-post-tag-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hde-post-title {
    font-weight: 700;
    line-height: 1.3;
    font-size: 1.15rem;
    color: var(--hde-ink);
    margin: 0;
}
.hde-post-title a {
  color: inherit;
  text-decoration: none;
  font-size: 1.8rem;
  font-weight: 700;
}

.hde-post-excerpt {
    color: var(--hde-ink);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hde-post-image-link {
  display: block;
  margin-top: 1.25rem;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 2;
  max-height: none;
}

.hde-post-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: var(--color-wash);
}

.hde-post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--hde-muted); /* date, dash, read time icon */
    font-size: 1.3rem;
    margin-top: 0.75rem;
}

.hde-post-footer-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hde-post-footer-meta time,
.hde-post-footer-meta > span {
    font-size: 1.3rem;
    font-weight: 400;
}

.hde-footer-icon-btn { 
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--hde-muted); /* comment icon */
    background: none;
    border: none;
    padding: 0.25rem;
    text-decoration: none;
    cursor: pointer;
    font-size: 1.3rem;
    border-radius: 999px;
}
.hde-footer-icon-btn:hover { color: var(--hde-ink); }
.hde-footer-icon-btn svg { width: 1.3rem; height: 1.3rem; }

.hde-featured-icon {
    display: inline-flex;
    align-items: center;
    color: #eab308;
}
.hde-featured-icon svg {
    width: 1rem;
    height: 1rem;
}

.article-tag .post-card-featured svg {
    width: 1.5rem;
    height: 1.5rem;
}

.article-tag .post-card-featured {
    display: inline-flex;
    align-items: center;
}

/* ---- Empty state ---- */
.hde-empty {
    padding: 4vmin;
    color: var(--hde-muted);
    text-align: center;
}

.hde-post-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.hde-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 999px;
    color: var(--hde-muted);
    background: transparent;
    border: 1px solid var(--hde-border);
    text-decoration: none;
    cursor: pointer;
}
.hde-back-btn:hover {
    color: color-mix(in srgb, var(--hde-ink) 80%, transparent);
    background: color-mix(in srgb, var(--hde-ink) 4%, transparent);
}
.hde-back-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

.hde-back-btn svg path {
    stroke-width: 0.8;
}

.hde-post-bottombar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5rem;
    padding: 0 5rem 5rem;
    color: var(--hde-muted); /* date, dash, read time icon */
    font-size: 1.3rem;
    border-bottom: 1px solid var(--hde-border); 
}

.hde-post-bottombar-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hde-post-bottombar-meta time,
.hde-post-bottombar-meta > span {
    font-size: 1.3rem;
    font-weight: 400;
}

.hde-post-bottombar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hde-no-border {
    border-bottom: none;
}

.hde-comment-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--hde-muted); /* comment icon */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
}
.hde-comment-icon:hover { color: var(--hde-ink); }

.hde-comment-icon svg {
    width: 1.3rem;
    height: 1.3rem;
}

.hde-share-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--hde-muted); /* share icon */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1;
}
.hde-share-icon:hover { color: var(--hde-ink); }

.hde-share-icon svg {
    width: 1.3rem;
    height: 1.3rem;
}

.hde-share-icon span {
    font-size: 1.3rem;
    font-weight: 400;
}

/* ---- Footer ---- */
.hde-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    max-width: 100%;
    font-size: 0.75rem;
    color: var(--color-midgrey);
    margin-top: 1rem;
}


.hde-footer .gh-powered-by,
  .hde-footer .gh-powered-by a {
    font-size: 1.3rem;
    margin-top: 7rem;
  }

/* ---- About page footer (social links + "since" date) ---- */
.hde-about-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5rem;
    border-top: 1px solid var(--hde-border);
}

.hde-about-footer-social {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hde-about-footer-social .social-link {
    display: inline-flex;
    color: var(--hde-ink);
}

.hde-about-footer-social .social-link:hover {
    color: 	var(--hde-muted);
}

.hde-about-footer-social .social-link .icon {
    width: 1.8rem;
    height: 1.8rem;
}

.hde-about-footer-since {
    font-size: 1.3rem;
    color: var(--hde-muted);
    white-space: nowrap;
}

/* ---- Individual tag page (/tag/{slug}/) header ---- */
.hde-tag-header {
    border-bottom: 1px solid var(--hde-border);
    padding: 3rem 0;
    margin-bottom: 0;
}

.hde-tag-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.hde-tag-count {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--hde-muted);
    white-space: nowrap;
}

/* ---- Tags index page (/tags/) ---- */
.tags-list {
    margin-bottom: 5rem;
}

.tag-row-page {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    text-decoration: none;
}

.tag-name,
.tag-count {
    color: var(--hde-ink);
    font-size: 1.4rem;
    font-weight: 500;
}

.tag-row-page:hover .tag-name,
.tag-row-page:hover .tag-count {
    color: var(--ghost-accent-color);
}

.tag-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0;
}

/* Untagged, non-featured posts: no tag/featured chip above title, so
   restore breathing room on the title itself (see .article-tag margin) */
.article-title.hde-no-tag {
    padding-top: 2.5rem;
}

.page-title {
    color: var(--hde-ink);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 3rem;
}

.tag-template .page-title {
    font-size: 1.6rem;
}

/* ---- Post title (moved here from screen.css — this is now the only
   .article-title rule in the theme) ---- */
.article-title {
    color: var(--hde-ink);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0;
}

/* Koenig headings (h1-h4 in post/page body) — scoped via .page-template /
   .post-template since .gh-content is shared markup with no page/post
   class of its own. */

.page-template .gh-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
}

.page-template .gh-content h2 {
    font-size: 2rem;
    font-weight: 700;
}

.page-template .gh-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
}

.page-template .gh-content h4 {
    font-size: 1.6rem;
    font-weight: 700;
}

.post-template .gh-content h1 {
    font-size: 3rem;
    font-weight: 700;
}

.post-template .gh-content h2 {
    font-size: 2.7rem;
    font-weight: 700;
}

.post-template .gh-content h3 {
    font-size: 2.4rem;
    font-weight: 700;
}

.post-template .gh-content h4 {
    font-size: 2.1rem;
    font-weight: 700;
}

/* Premium/locked post paywall box — markup generated entirely by Ghost
   (not in any .hbs file); these are the only rules touching it. Ghost
   inline-styles the background and button text color, so those two need
   !important — nothing else here does. */

.gh-post-upgrade-cta-content {
    border: 1px solid var(--hde-border) !important;
    padding: 4rem!important;
    background: transparent !important;
}

.gh-post-upgrade-cta h2 {
    color: var(--hde-ink)!important;
}

.gh-post-upgrade-cta .gh-btn {
    background-color: var(--ghost-accent-color) !important;
    color: var(--hde-card-bg) !important;
    font-weight: 600!important;
    font-size: 1.6rem!important;
    padding: 10px 20px!important;
    border-radius: 999px!important;
    text-decoration: none!important;
    margin: 30px 0 20px !important;
}

.gh-post-upgrade-cta .gh-btn:hover { opacity: 0.90 !important; }

.gh-post-upgrade-cta p {
    color: var(--hde-muted) !important;
    font-size: 1.4rem !important;
    margin-top: 0 !important;
}

.gh-post-upgrade-cta p a {
    color: var(--ghost-accent-color) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}


.gh-post-upgrade-cta p a:hover { opacity: 0.90 !important; }

.gh-post-upgrade-cta small {
    font-size: 1.3rem !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
}


