/* Blog Post Styling */
body {
    background-color: #B8D4D4;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    margin: 0;
    padding: 40px 20px;
}

/* Header with logo */
.header {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.logo-link {
    display: block;
}

.logo {
    height: 50px;
    width: auto;
    filter: invert(1) brightness(0.3); /* Convert white logo to dark */
    transition: filter 0.3s ease;
}

.logo:hover {
    filter: invert(1) brightness(0.5);
}

.post-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px;
    background: #f3f2de;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.post-meta time {
    color: #666;
    font-size: 0.9rem;
}

.post-header {
    margin-top: 0;
    margin-bottom: 40px;
}

.back-link, .top-back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #8fa9aa;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.back-link:hover, .top-back-link:hover {
    color: #423737;
}

.top-back-link {
    margin-top: 0;
    margin-bottom: 30px;
}

.post-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 20px;
}

.post-subtitle {
    font-size: 1.3rem;
    color: #423737;
    margin-bottom: 20px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0px; /* Remove space between date and headline */
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.post-author-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.post-author-name {
    font-weight: 500;
    color: #1a1a1a;
}

.post-date {
    color: #666;
    font-size: 0.9rem;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content p {
    margin-bottom: 1em;
}

.post-content h1,
.post-content h2,
.post-content h3,
h1.header-anchor-post {
    font-family: 'Playfair Display', serif;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
}

.post-content h1,
h1.header-anchor-post {
    font-size: 2rem;
    font-weight: 700;
    color: #423737;
}

.post-content h2 {
    font-size: 1.8rem;
}

.post-content h3 {
    font-size: 1.4rem;
}


.post-content a {
    color: #8fa9aa;
    text-decoration: underline;
}

.post-content a:hover {
    color: #423737;
}

.post-content blockquote {
    border-left: 4px solid #8fa9aa;
    padding-left: 20px;
    margin: 2em 0;
    font-style: italic;
    color: #423737;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.post-content li {
    margin-bottom: 0.5em;
}

/* Hide Substack UI elements */
.post-ufi,
.like-button-container,
button[aria-label*="Like"],
button[aria-label*="comment"],
button[aria-label*="Share"],
.pencraft.post-ufi-button,
.visibility-check,
.byline-wrapper,
.profile-hover-card-target,
[class*="pencraft"],
[class*="pc-"],
[role="region"][aria-label="Post UFI"] {
    display: none !important;
}

/* Hide duplicate H1s and H3 subtitles inside Substack post-header divs */
.post-header h1:not(.post-title),
div[aria-label="Post header"] h1,
.post-header h3:not(.post-subtitle),
div[aria-label="Post header"] h3 {
    display: none !important;
}

/* Hide Substack audio players (don't work on our domain) */
div[aria-label="Audio embed player"],
div[data-component-name="AudioEmbedPlayer"] {
    display: none !important;
}

/* Style bold paragraph text as section headers when they're section titles */
.post-content p > strong:only-child,
.post-content p > em:only-child > strong:only-child {
    display: block;
    font-family: 'Playfair Display', serif !important;
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    font-style: normal !important;
    color: #423737 !important;
    margin: 2.5rem 0 1.5rem 0 !important;
    line-height: 1.3 !important;
}

/* Force correct fonts on all headings */
article h1,
.post-header h1,
h1[class*="title"],
h1[dir="auto"] {
    font-family: 'Playfair Display', serif !important;
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    line-height: 1.2 !important;
    margin-bottom: 20px !important;
}

.subtitle.subtitle-HEEcLo,
h3[class*="subtitle"] {
    display: block !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 1.3rem !important;
    font-weight: 400 !important;
    color: #423737 !important;
    margin-bottom: 20px !important;
}

@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    .post-container {
        padding: 40px 20px;
    }

    .post-title {
        font-size: 2rem;
    }

    .post-subtitle {
        font-size: 1.1rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.2rem;
    }
}


/* Keyword Tags Section - Collage Cloud Design */
.post-keywords {
    margin: 3rem 0 2rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(122, 153, 153, 0.08), rgba(66, 55, 55, 0.05));
    border-radius: 16px;
    border: 2px solid rgba(122, 153, 153, 0.3);
}

.post-keywords h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #423737;
    margin: 0 0 2rem 0;
    text-align: center;
    text-transform: lowercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    line-height: 2.5;
}

.keyword-tag {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: rgba(122, 153, 153, 0.25);
    color: #423737;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(122, 153, 153, 0.4);
    cursor: default;
}

/* Variable font sizes - cloud effect */
.keyword-tag:nth-child(3n+1) {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    padding: 0.7rem 1.4rem;
}

.keyword-tag:nth-child(3n+2) {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

.keyword-tag:nth-child(3n+3) {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    padding: 0.6rem 1.2rem;
}

.keyword-tag:hover {
    background: rgba(122, 153, 153, 0.45);
    border-color: rgba(122, 153, 153, 0.7);
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-keywords {
        padding: 1.5rem;
        margin: 2rem 0 1.5rem;
    }

    .post-keywords h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .keyword-cloud {
        gap: 0.6rem;
        line-height: 2;
    }

    .keyword-tag {
        padding: 0.5rem 1rem;
    }

    .keyword-tag:nth-child(3n+1) {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .keyword-tag:nth-child(3n+2) {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }

    .keyword-tag:nth-child(3n+3) {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

/* FORCE keyword visibility with highest specificity */
.post-container .post-keywords {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 3rem 0 2rem !important;
    padding: 2.5rem !important;
    background: linear-gradient(135deg, rgba(122, 153, 153, 0.08), rgba(66, 55, 55, 0.05)) !important;
    border-radius: 16px !important;
    border: 2px solid rgba(122, 153, 153, 0.3) !important;
    position: relative !important;
    z-index: 100 !important;
}

.post-container .post-keywords h3 {
    display: block !important;
    visibility: visible !important;
}

.post-container .keyword-cloud {
    display: flex !important;
    visibility: visible !important;
}

.post-container .keyword-tag {
    display: inline-block !important;
    visibility: visible !important;
}

/* Footer */
.footer {
    width: 100%;
    background-color: #bad4d4;
    padding: 40px 20px;
    text-align: center;
    margin-top: 40px;
}

.footer-booking {
    margin-bottom: 20px;
}

.book-guru-button {
    padding: 10px 25px;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    color: #ffffff;
    background-color: red;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    display: inline-block;
}

.book-guru-button:hover {
    background-color: #cc0000;
    transform: scale(1.05);
}

.footer-copyright {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    color: #31302C;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Footer links */
.footer-links {
    margin: 10px 0;
    font-size: 0.9rem;
}

.footer-links a {
    color: #31302C;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #000000;
    text-decoration: underline;
}

.footer-links span {
    margin: 0 10px;
    color: #31302C;
}

.post-content img {
    max-width: 1000px !important;
    width: 100% !important;
    height: auto !important;
    margin: 2em auto;
    border-radius: 20px;
    display: block;
}

/* Force proper scaling for captioned images */
.captioned-image-container img,
.captioned-image-container picture,
.captioned-image-container figure img {
    max-width: 1000px !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 20px;
}

/* Clickable keywords - different background for keywords with 2+ instances */
.clickable-keyword {
    background: rgba(66, 102, 102, 0.75) !important;
    border-color: rgba(66, 102, 102, 0.9) !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.clickable-keyword:hover {
    background: rgba(66, 102, 102, 0.95) !important;
    transform: scale(1.08) translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(66, 102, 102, 0.6) !important;
}

.clickable-keyword:active {
    transform: scale(1.02) !important;
}

/* Keyword modal */
.keyword-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.keyword-modal-content {
    background: #ffffff;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.keyword-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.keyword-modal-close:hover {
    color: #423737;
}

.keyword-modal-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #423737;
    margin: 0 0 0.5rem 0;
    text-transform: capitalize;
}

.keyword-count {
    color: #7a9999;
    font-size: 1rem;
    margin: 0 0 2rem 0;
}

.related-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-post-item {
    display: block;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(122, 153, 153, 0.08), rgba(66, 55, 55, 0.05));
    border-radius: 12px;
    border: 2px solid rgba(122, 153, 153, 0.2);
    text-decoration: none;
    transition: all 0.3s ease;
}

.related-post-item:hover {
    border-color: rgba(122, 153, 153, 0.6);
    background: linear-gradient(135deg, rgba(122, 153, 153, 0.15), rgba(66, 55, 55, 0.08));
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-post-item h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #423737;
    margin: 0 0 0.8rem 0;
    line-height: 1.4;
}

.related-post-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.mini-keyword-tag {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: rgba(122, 153, 153, 0.2);
    color: #5a7979;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .keyword-modal-content {
        padding: 2rem;
        max-height: 85vh;
    }

    .keyword-modal-content h2 {
        font-size: 1.5rem;
    }

    .related-post-item h3 {
        font-size: 1.1rem;
    }
}

/* Related Posts Grid - Blog Matrix Style */
.related-posts-grid {
    margin: 3rem 0 2rem;
}

.related-posts-grid h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #423737;
    margin: 0 0 2rem 0;
    text-align: center;
    letter-spacing: 1px;
    font-weight: 700;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.post-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1;
    text-decoration: none;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.post-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px 15px 15px;
    color: white;
    transition: opacity 0.3s ease;
}

.post-card:hover .post-card-overlay {
    opacity: 0.95;
}

.post-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .related-posts-grid h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .post-card-title {
        font-size: 0.9rem;
    }

    .post-card-overlay {
        padding: 15px 10px 10px;
    }
}

/* Spotify Embed Styling */
iframe.spotify-wrap,
iframe.podcast,
iframe[src*="spotify.com"] {
    width: 100%;
    height: 352px;
    border-radius: 12px;
    margin: 2em 0;
    border: none;
}

/* Compact Spotify player for shorter embeds */
iframe.spotify-wrap.compact,
iframe[src*="spotify.com/embed/track"] {
    height: 152px;
}
