/* ==========================================================================
   ISSI Ghost Blog Theme - screen.css
   Blog-specific styles only.
   Header/footer/nav styling comes from issi.com CSS loaded in default.hbs.
   Legacy version with all styles: screen-legacy.css
   ========================================================================== */

/* ---------- Layout fix ---------- */
/* issi.com sets body { margin-top: -16px } which clips the top of the page.
   Override only this one property; all other issi.com styles apply as-is. */
body {
    margin-top: 0;
}

/* ---------- Anniversary Badge (not in issi.com CSS) ---------- */
div.annilogo {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 2;
    padding: 0 20px 20px 0;
}

div.annilogo img {
    width: 120px;
    height: auto;
    display: block;
}

/* ---------- Mega Menu Hover (issi.com uses jQuery for this, which we strip) ---------- */
/* issi.com's style-jquery.js sets right:0 on each .sub-div and uses
   jQuery .hover() with fadeIn/hide. We replicate this with pure CSS. */
#main-nav .sub-div {
    right: 0;
}

#main-nav li.first-list:hover > .sub-div {
    display: block;
}

/* ---------- Site Main / Content Area ---------- */
.site-main {
    min-height: 50vh;
}

.site-main img {
    max-width: 100%;
    height: auto;
}

.content-area {
    width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ---------- Blog Header ---------- */
.blog-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #b31f36;
}

.blog-title {
    font-size: 28px;
    font-weight: 300;
    color: #a3201f;
    margin-bottom: 6px;
}

.blog-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ---------- Author Header ---------- */
.author-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #b31f36;
}

.author-header-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}

/* ---------- Post Feed (Card Grid) ---------- */
.post-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* ---------- Post Card ---------- */
.post-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-card.featured {
    border-color: #b31f36;
}

.post-card-image-link {
    display: block;
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.post-card:hover .post-card-image {
    transform: scale(1.03);
}

.post-card-content {
    padding: 16px;
}

.post-card-tags {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-card-tags a {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: #b31f36;
    letter-spacing: 0.5px;
}

.post-card-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.post-card-title a {
    color: #1f2227;
}

.post-card-title a:hover {
    color: #b31f36;
    text-decoration: none;
}

.post-card-excerpt {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 12px;
}

.post-card-meta {
    font-size: 11px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.post-card-meta span:not(:last-child)::after {
    content: "\00b7";
    margin-left: 4px;
}

.featured-badge {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
    background: #b31f36;
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

/* ---------- Single Post ---------- */
.post-full {
    max-width: 100%;
}

.post-full-header {
    margin-bottom: 24px;
}

.post-full-tags {
    font-size: 12px;
    color: #b31f36;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.post-full-tags a {
    color: #b31f36;
}

.post-full-title {
    margin: 10px 0 12px 2px;
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
    font-size: 130%;
    color: #a3201f;
    font-weight: bold;
    line-height: 1.3;
}

.post-full-meta {
    font-size: 90%;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 5px 12px 24px 12px;
    line-height: 24px;
}

.post-full-meta span:not(:last-child)::after {
    content: "\00b7";
    margin-left: 6px;
}

.post-full-meta a {
    color: #a3201f;
}

.post-full-meta a:hover {
    color: #000;
}

.post-full-image {
    margin: 0 0 30px;
    border-radius: 3px;
    overflow: hidden;
}

.post-full-image img {
    width: 100%;
    display: block;
}

/* Post Content */
.post-full-content {
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
    font-size: 90%;
    line-height: 24px;
    color: #1f2227;
    max-width: 720px;
    margin: 5px 12px 24px 12px;
}

.post-full-content h1 {
    margin: 10px 0 12px 2px;
    font-size: 130%;
    font-weight: bold;
    color: #a3201f;
}

.post-full-content h2 {
    margin: 60px 0 10px 0;
    font-size: 110%;
    font-weight: bold;
    color: #1f2227;
}

.post-full-content h3 {
    font-size: 100%;
    font-weight: bold;
    margin: 28px 0 12px;
}

.post-full-content h4 {
    font-size: 100%;
    font-weight: bold;
    margin: 24px 0 10px;
}

.post-full-content p {
    margin: 0 0 20px;
}

.post-full-content p a {
    color: #a3201f;
}

.post-full-content p a:hover {
    color: #000;
}

.post-full-content ul,
.post-full-content ol {
    margin: 0 0 20px 24px;
}

.post-full-content ul {
    list-style: disc;
}

.post-full-content ol {
    list-style: decimal;
}

.post-full-content li {
    margin-bottom: 6px;
    line-height: 24px;
}

.post-full-content blockquote {
    margin: 20px 0;
    padding: 12px 20px;
    border-left: 4px solid #b31f36;
    background: #f9f9f9;
    font-style: italic;
    color: #555;
}

.post-full-content pre {
    margin: 20px 0;
    padding: 16px;
    background: #f4f4f4;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.post-full-content code {
    font-size: 13px;
    background: #f4f4f4;
    padding: 2px 5px;
    border-radius: 3px;
}

.post-full-content pre code {
    background: none;
    padding: 0;
}

.post-full-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

.post-full-content a {
    color: #a3201f;
    text-decoration: underline;
}

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

.post-full-content table {
    width: 1000px;
    border-collapse: collapse;
    margin: 20px 0;
}

.post-full-content th,
.post-full-content td {
    text-align: left;
    padding: 5px 9px;
    font-size: 78%;
    line-height: 16px;
    vertical-align: middle;
    border: 1px solid #e5e5e5;
}

.post-full-content th {
    background-color: #b31f36;
    color: #fff;
    font-weight: bold;
    padding: 9px 9px;
    font-size: 80%;
}

.post-full-content tr:nth-child(even) {
    background: #f0f0f0;
}

.post-full-content hr {
    border: 1px solid #d1d0d0;
    margin: 30px 0;
}

.post-full-content figure {
    margin: 20px 0;
}

.post-full-content figcaption {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-top: 8px;
}

/* ---------- Author Card ---------- */
.post-full-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
}

.author-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.author-card-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-card-name {
    font-size: 15px;
    margin-bottom: 4px;
}

.author-card-name a {
    color: #1f2227;
}

.author-card-name a:hover {
    color: #b31f36;
}

.author-card-bio {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* ---------- Post Navigation ---------- */
.post-nav {
    display: flex;
    margin-top: 40px;
    border-top: 1px solid #e5e5e5;
    padding-top: 24px;
    gap: 24px;
}

.post-nav-prev,
.post-nav-next {
    flex: 1;
    display: block;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    transition: border-color 0.2s;
}

.post-nav-prev:hover,
.post-nav-next:hover {
    border-color: #b31f36;
    text-decoration: none;
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.post-nav-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1f2227;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 30px 0;
    border-top: 1px solid #e5e5e5;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    background: #b31f36;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 3px;
    transition: background 0.2s;
}

.pagination a:hover {
    background: #8e1829;
    text-decoration: none;
    color: #fff;
}

.pagination .page-number {
    font-size: 13px;
    color: #888;
}

/* ---------- Error Page ---------- */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-code {
    font-size: 96px;
    font-weight: 700;
    color: #b31f36;
    line-height: 1;
    margin-bottom: 12px;
}

.error-message {
    font-size: 24px;
    color: #1f2227;
    margin-bottom: 8px;
}

.error-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.error-link {
    display: inline-block;
    padding: 10px 24px;
    background: #b31f36;
    color: #fff;
    font-weight: 600;
    border-radius: 3px;
    transition: background 0.2s;
}

.error-link:hover {
    background: #8e1829;
    color: #fff;
    text-decoration: none;
}

/* ---------- Ghost-specific: kg cards ---------- */
.kg-card {
    margin: 20px 0;
}

.kg-image-card img {
    max-width: 100%;
}

.kg-width-wide {
    max-width: 1000px;
    margin-left: calc(50% - 500px);
    margin-right: calc(50% - 500px);
}

.kg-width-full {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-bookmark-card {
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: #1f2227;
}

.kg-bookmark-content {
    flex: 1;
    padding: 16px;
}

.kg-bookmark-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.kg-bookmark-description {
    font-size: 13px;
    color: #666;
    max-height: 44px;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.kg-bookmark-thumbnail {
    width: 200px;
    flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.kg-gallery-row {
    display: flex;
    gap: 4px;
    width: 100%;
}

.kg-gallery-image img {
    width: 100%;
    height: auto;
}

/* ---------- Mobile Menu Toggle ---------- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 0;
    position: absolute;
    top: 20px;
    right: 20px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #B31F36;
    margin: 4px 0;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
    .content-area {
        width: auto;
        max-width: 1000px;
    }
}

@media (max-width: 900px) {
    .post-feed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    /* Mobile nav toggle */
    .mobile-menu-toggle {
        display: block;
    }

    /* Content */
    .content-area {
        width: auto;
        padding: 20px 12px;
    }

    .post-feed {
        grid-template-columns: 1fr;
    }

    .post-full-title {
        font-size: 26px;
    }

    .blog-title {
        font-size: 22px;
    }

    .post-nav {
        flex-direction: column;
    }

    .post-nav-next {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 20px 12px;
    }

    .post-card-image {
        height: 150px;
    }

    .error-code {
        font-size: 64px;
    }
}
