/* Blog - matches diary.css styling */
html {
    background-color: var(--white);
    box-sizing: border-box;
}

a {
    color: var(--darkbrown);
    text-decoration: 1px dotted underline;
    -webkit-transition: 0.25s;
}

a:hover {
    opacity: 70%;
    -webkit-transition: 0.25s;
}

body {
    padding-top: 20px;
    display: block;
    margin: auto;
    width: 850px;
}

/* Blog layout with artwork */
.blog-layout {
    display: block;
}

.blog-content {
    display: block;
}

/* Desktop: show artwork sidebar */
@media (min-width: 1100px) {
    body {
        width: 1100px;
    }

    .blog-layout {
        display: flex;
        gap: 25px;
    }

    .blog-content {
        flex: 1;
        max-width: 850px;
    }

    .separator {
        width: 1px;
        border-left: 1px dotted var(--darkbrown);
    }

    .blog-artwork {
        width: 420px;
        flex-shrink: 0;
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }

    .artwork-box {
        border: 1px dotted var(--darkbrown);
    }

    .artwork-box img {
        width: 100%;
        height: auto;
        display: block;
    }

    .artwork-note {
        font-size: 10px;
        font-style: italic;
        color: #888;
        padding: 5px;
        border-top: 1px dotted var(--darkbrown);
    }
}

/* Hide artwork on mobile */
.separator,
.blog-artwork {
    display: none;
}

@media (min-width: 1100px) {
    .separator,
    .blog-artwork {
        display: block;
    }
}

.breadcrumb {
    font-size: 14px;
    padding-bottom: 5px;
    border-bottom: 1px dotted var(--darkbrown);
    margin-bottom: 15px;
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb a:hover {
    letter-spacing: 1px;
    -webkit-transition: 0.25s;
}

.breadcrumb .sep {
    margin: 0 5px;
    opacity: 0.5;
}

/* Page title */
.page-title {
    font-size: 18px;
    /* font-style: italic; */
    margin: 0 0 15px;
}

/* Post date */
.post-date {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

/* Posts list */
.posts-list {
    margin: 0;
    padding: 0;
}

.post-entry {
    display: flex;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px dotted var(--darkbrown);
    align-items: baseline;
}

.post-entry:last-child {
    border-bottom: none;
}

.post-entry .date {
    font-size: 12px;
    color: #888;
    width: 80px;
    flex-shrink: 0;
}

.post-entry a {
    text-decoration: none;
}

.post-entry a:hover {
    text-decoration: 1px dotted underline;
}

/* Topics */
.topics-list {
    margin: 0;
    padding: 0;
}

.topic-link {
    display: block;
    padding: 5px 0;
    border-bottom: 1px dotted var(--darkbrown);
    text-decoration: none;
}

.topic-link:hover {
    letter-spacing: 0.5px;
}

.topic-link:last-child {
    border-bottom: none;
}

/* Post content */
.post-content {
    text-align: justify;
    /* line-height: 1.5; */
}

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

.post-content h2 {
    font-size: 16px;
    font-style: italic;
    margin: 1.5em 0 0.5em;
}

.post-content blockquote {
    margin: 1em 0;
    padding-left: 15px;
    border-left: 1px dotted var(--darkbrown);
    font-style: italic;
}

.post-content pre {
    background: #f5f5f5;
    padding: 10px;
    overflow-x: auto;
    font-size: 13px;
}

/* Bibliography */
.bibliography {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dotted var(--darkbrown);
}

.bibliography h2 {
    font-size: 14px;
    font-style: italic;
    margin: 0 0 10px;
}

.bibliography ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bibliography li {
    margin-bottom: 8px;
    font-size: 13px;
}

/* Backlinks */
.backlinks {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px dotted var(--darkbrown);
    font-size: 13px;
}

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

.backlinks a:hover {
    text-decoration: 1px dotted underline;
}

/* Mobile */

body,
p,
.blog-content {
    font-family: "Libre Baskerville", "Amiri", "Times", serif !important;
    font-size: unset !important;
}

@media (max-width: 700px) {
    body,
    p,
    .blog-content {
        font-family: "Libre Baskerville", "Amiri", "Times", serif !important;
        font-size: unset !important;
    }

    body {
        width: 100%;
        padding: 15px;
        box-sizing: border-box;
    }

    .post-entry {
        flex-direction: column;
        gap: 2px;
    }

    .post-entry .date {
        width: auto;
    }

    .post-content {
        text-align: left;
    }
}

/* Footnotes - inline number and text */
.footnotes .footnote-definition {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.footnotes .footnote-definition sup {
    flex-shrink: 0;
}

.footnotes .footnote-definition p {
    margin: 0;
    display: inline;
}

h1,
h2,
h3,
h4,
h5,
h6,
h7,
h8 {
    unicode-bidi: plaintext !important;
}

p {
    unicode-bidi: plaintext !important;
}

/* Verse blocks - centered with preserved line breaks */
.verse {
    text-align: center !important;
    white-space: pre-line;
    font-style: italic;
    margin: 1.5em auto;
    max-width: 90%;
    line-height: 1.8;
}

/* Verse blocks - centered with preserved line breaks */
.verse-block {
    text-align: center !important;
    font-style: italic;
    margin: 1.5em auto;
    max-width: 90%;
    line-height: 2;
    font-style: normal;
    color: #292929;
    margin: 2em 0;
    text-align: center;
    font-size: 1.1em;
    line-height: 1.6;
    border: none !important;
    background: none;
    position: relative;
    padding: 2em 0;
}

.verse-block::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background-image: url("/style/svg/-236.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: grayscale(80%) brightness(0.5) opacity(0.08);
    z-index: -1;
}

.verse-block p {
    white-space: pre-wrap;
    text-align: center !important;
}

/* Fonts */
body,
.blog-content {
    font-family:
        "Times New Roman", "Amiri", "Libre Baskerville", "Amiri", serif;
}

/* Arabic text uses Amiri */
:lang(ar),
[lang="ar"],
.arabic {
    font-family: "Amiri", serif;
}

/* Auto-detect RTL text */
.verse-block,
.post-content p,
blockquote {
    font-family: "Times New Roman", "Libre Baskerville", "Amiri", serif;
}

/* Topics showcase - creative flowing design */
.topics-showcase {
    margin: 20px 0 30px;
    padding: 15px 0;
    border-top: 1px dotted var(--darkbrown, #2a2420);
    border-bottom: 1px dotted var(--darkbrown, #2a2420);
    line-height: 2;
    text-align: center;
}

.topics-label {
    font-style: italic;
    opacity: 0.6;
    margin-right: 8px;
}

.topic-pill {
    display: inline-block;
    padding: 3px 12px;
    margin: 3px;
    border: 1px dotted var(--darkbrown, #2a2420);
    border-radius: 15px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.topic-pill:hover {
    background: var(--darkbrown, #2a2420);
    color: var(--white, #faf9f7);
    border-style: solid;
}

.topic-sep {
    opacity: 0.3;
    margin: 0 2px;
}

/* Topics footer - old-school flowing style */
.topics-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dotted var(--darkbrown, #2a2420);
    line-height: 1.8;
    font-size: 14px;
}

.topics-header {
    font-style: italic;
    margin-right: 8px;
}

.topics-footer a {
    text-decoration: none;
}

.topics-footer a:hover {
    text-decoration: 1px dotted underline;
}

/* Footnotes styling */
.footnotes {
    font-size: 13px;
    line-height: 1.6;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dotted var(--darkbrown, #2a2420);
}

.footnotes hr {
    display: none;
}

.footnotes ol {
    padding-left: 20px;
    margin: 0;
}

.footnotes li {
    margin-bottom: 10px;
}

.footnotes li p {
    margin: 0;
    display: inline;
}

/* Diary title styling */
.diary-title {
    font-size: 18px;
    font-weight: normal;
    font-style: italic;
    margin: 5px 0 15px 0;
    color: var(--darkbrown, #2a2420);
}

/* Mobile/Desktop backlinks visibility */
.backlinks-mobile {
    display: block;
    margin-bottom: 20px;
}

.backlinks-desktop {
    display: none;
}

@media (min-width: 1100px) {
    .backlinks-mobile {
        display: none;
    }

    .backlinks {
        border-top: unset;
    }

    .backlinks-desktop {
        display: block;

        /* background: rgba(125, 85, 72, 0.03); */
        /* box-shadow: 0 0 0 4px rgba(125, 85, 32, 0.03); */

        /* margin-top: 25px; */
        /* padding-top: 20px; */
        /* border-top: 1px dotted var(--darkbrown, #2a2420); */
        /* background-color: bisque; */
    }

    .backlinks-desktop .backlinks {
        font-size: 13px;
        line-height: 1.6;
    }

    .backlinks-desktop .backlinks-title {
        font-style: italic;
    }

    .backlinks-desktop .backlinks a {
        display: inline;
    }
}
