/*
Theme Name: Story of Bangladesh
Theme URI: https://www.storyofbangladesh.com/
Author: Story of Bangladesh
Description: A modern bilingual historical publication and digital library.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.3
Requires PHP: 8.0
Text Domain: storyofbangladesh
*/

/* --------------------------------------------------
   Design system
-------------------------------------------------- */

:root {
    --sbd-paper: #f7f5ef;
    --sbd-white: #ffffff;
    --sbd-ink: #252923;
    --sbd-muted: #6c7069;
    --sbd-green: #193d35;
    --sbd-green-light: #28574b;
    --sbd-gold: #a9864d;
    --sbd-line: #e4e0d6;
    --sbd-content: 1160px;
    --sbd-reading: 780px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--sbd-paper);
    color: var(--sbd-ink);
    font-family: Georgia, "Noto Serif Bengali", "Noto Serif",
                 "SolaimanLipi", serif;
    font-size: 17px;
    line-height: 1.75;
}

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

a {
    color: var(--sbd-green);
    text-decoration: none;
}

a:hover {
    color: var(--sbd-gold);
}

button,
input,
textarea {
    font: inherit;
}

.container {
    width: min(calc(100% - 40px), var(--sbd-content));
    margin-inline: auto;
}

.reading-width {
    width: min(calc(100% - 40px), var(--sbd-reading));
    margin-inline: auto;
}

.site-header {
    background: var(--sbd-white);
    border-bottom: 1px solid var(--sbd-line);
}

.site-branding {
    padding: 25px 0 18px;
}

.site-title {
    margin: 0;
    font-size: clamp(25px, 4vw, 36px);
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.site-description {
    margin: 5px 0 0;
    color: var(--sbd-muted);
    font-size: 14px;
}

.primary-navigation {
    border-top: 1px solid var(--sbd-line);
}

.primary-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-navigation a {
    display: block;
    padding: 13px 0;
    color: var(--sbd-ink);
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a {
    color: var(--sbd-gold);
}

.site-main {
    min-height: 65vh;
    padding: 48px 0 70px;
}

.page-heading {
    margin: 0 0 30px;
    color: var(--sbd-green);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.3;
}

.entry-content {
    overflow-wrap: break-word;
}

.entry-content p {
    margin: 0 0 1.35em;
}

.entry-content h2,
.entry-content h3 {
    color: var(--sbd-green);
    line-height: 1.4;
    margin-top: 1.8em;
}

.site-footer {
    padding: 30px 0;
    background: var(--sbd-green);
    color: #e9eee9;
    font-size: 14px;
}

.site-footer a {
    color: #f0d7a7;
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .container,
    .reading-width {
        width: min(calc(100% - 28px), var(--sbd-content));
    }

    .site-branding {
        padding: 19px 0 14px;
    }

    .primary-navigation ul {
        gap: 0 19px;
    }

    .site-main {
        padding-top: 30px;
    }
}

/* =========================================
   eBooks catalogue
   ========================================= */

.ebooks-page {
    padding-top: 54px;
    padding-bottom: 76px;
}

.ebooks-intro {
    max-width: 760px;
    margin: 0 auto 48px;
    text-align: center;
}

.ebooks-intro .section-eyebrow {
    margin: 0 0 12px;
    color: var(--sbd-gold);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.ebooks-intro h1 {
    margin: 0 0 15px;
    color: var(--sbd-green);
    font-family: Georgia, "Noto Serif Bengali", serif;
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    font-weight: 600;
    line-height: 1.2;
}

.ebooks-intro > p:last-child {
    margin: 0;
    color: var(--sbd-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.ebooks-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 38px 30px;
    align-items: stretch;
}

.ebook-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--sbd-white);
    border: 1px solid var(--sbd-line);
    border-radius: 5px;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.ebook-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(37, 41, 35, 0.09);
}

.ebook-cover {
    height: 310px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eeece5;
    border-bottom: 1px solid var(--sbd-line);
}

.ebook-cover img {
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.14);
}

.ebook-text-cover {
    width: 100%;
    height: 100%;
    padding: 25px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    color: #f7f5ef;
    background: var(--sbd-green);
    border: 5px double var(--sbd-gold);
}

.ebook-text-cover span,
.ebook-text-cover small {
    font-size: 0.62rem;
    letter-spacing: 0.13em;
    line-height: 1.6;
}

.ebook-text-cover strong {
    font-family: Georgia, "Noto Serif Bengali", serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.ebook-details {
    flex: 1;
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
}

.ebook-details h2 {
    margin: 0 0 13px;
    font-family: Georgia, "Noto Serif Bengali", serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.55;
}

.ebook-details h2 a {
    color: var(--sbd-green);
    text-decoration: none;
}

.ebook-details h2 a:hover {
    color: var(--sbd-gold);
}

.ebook-description {
    flex: 1;
    margin: 0 0 23px;
    color: var(--sbd-muted);
    font-size: 0.91rem;
    line-height: 1.75;
}

.ebook-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ebook-actions a {
    display: inline-block;
    padding: 9px 13px;
    border: 1px solid var(--sbd-green);
    border-radius: 3px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease;
}

.ebook-read {
    color: #fff;
    background: var(--sbd-green);
}

.ebook-read:hover {
    color: #fff;
    background: var(--sbd-green-light);
}

.ebook-download {
    color: var(--sbd-green);
    background: transparent;
}

.ebook-download:hover {
    color: #fff;
    background: var(--sbd-green);
}

@media (max-width: 900px) {
    .ebooks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 25px;
    }
}

@media (max-width: 560px) {
    .ebooks-page {
        padding-top: 35px;
        padding-bottom: 45px;
    }

    .ebooks-intro {
        margin-bottom: 30px;
    }

    .ebooks-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .ebook-card {
        display: grid;
        grid-template-columns: 115px minmax(0, 1fr);
        align-items: stretch;
    }

    .ebook-cover {
        height: 100%;
        min-height: 190px;
        padding: 10px;
        border-bottom: 0;
        border-right: 1px solid var(--sbd-line);
    }

    .ebook-details {
        padding: 15px;
    }

    .ebook-details h2 {
        font-size: 1.05rem;
    }

    .ebook-description {
        font-size: 0.84rem;
        line-height: 1.6;
    }

    .ebook-actions {
        gap: 7px;
    }

    .ebook-actions a {
        padding: 8px 9px;
        font-size: 0.75rem;
    }
}


/* =========================================
   Original branding and homepage slideshow
   ========================================= */

.site-branding {
    padding: 25px 0 20px;
}

.site-branding-link {
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--sbd-ink);
}

.site-logo-image {
    display: block;
    width: min(435px, 100%);
    height: auto;
    object-fit: contain;
}

.site-branding-text {
    display: flex;
    flex-direction: column;
}

.site-branding-text .site-title {
    font-size: clamp(23px, 3vw, 32px);
}

.site-branding-text .site-description {
    margin-top: 4px;
}

.home-banner {
    padding-top: 30px;
    padding-bottom: 10px;
}

.home-slider {
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 80px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.home-slide.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
}

.home-slide img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

.home-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(25, 61, 53, 0.85);
    color: #fff;
    cursor: pointer;
    font-size: 17px;
}

.home-slider-prev {
    left: 5px;
}

.home-slider-next {
    right: 5px;
}

.home-slider-arrow:hover {
    background: var(--sbd-gold);
}

.home-slider-dots {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 9px;
}

.home-slider-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c8c3b7;
    cursor: pointer;
}

.home-slider-dots button.is-active {
    background: var(--sbd-green);
}

.homepage-content {
    padding-top: 40px;
}

@media (max-width: 640px) {
    .site-branding-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .site-logo-image {
        width: min(298px, 100%);
        height: auto;
    }

    .home-banner {
        padding-top: 20px;
    }

    .home-slider {
        min-height: 80px;
    }

    .homepage-content {
        padding-top: 35px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-slide {
        transition: none;
    }
}

/* =====================================================
   ARTICLE COMMENTS
   Visually separates reader discussion from article text
   ===================================================== */

.sbd-comments-area {
    margin-top: 65px;
    padding: 38px 34px 34px;
    background: #f3f1e9;
    border-top: 4px solid var(--sbd-green);
    border-radius: 3px;
}

.sbd-comments-heading {
    margin-bottom: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid #d9d5c9;
}

.sbd-comments-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--sbd-gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.sbd-comments-heading h2 {
    margin: 0;
    color: var(--sbd-green);
    font-size: 28px;
}

.sbd-comment-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 29px;
    height: 29px;
    margin-left: 7px;
    padding: 0 7px;
    border-radius: 50px;
    background: #e5e1d5;
    color: var(--sbd-green);
    font-size: 14px;
    vertical-align: middle;
}

.sbd-comments-heading > p {
    margin: 9px 0 0;
    color: #68675f;
    font-size: 14px;
}

.sbd-comments-area .comment-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sbd-comments-area .comment-list > li {
    margin: 0;
    padding: 22px 0;
    border-bottom: 1px solid #dedbd1;
    list-style: none;
}

.sbd-comments-area .comment-body {
    position: relative;
}

.sbd-comments-area .comment-author {
    color: var(--sbd-green);
    font-weight: 700;
}

.sbd-comments-area .comment-author img {
    float: left;
    margin: 0 13px 8px 0;
    border-radius: 50%;
}

.sbd-comments-area .comment-author .says {
    color: #77736a;
    font-weight: 400;
}

.sbd-comments-area .comment-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #77736a;
}

.sbd-comments-area .comment-content {
    clear: both;
    padding-top: 10px;
    color: #343630;
    line-height: 1.75;
}

.sbd-comments-area .reply {
    margin-top: 8px;
    font-size: 13px;
}

.sbd-comments-area .children {
    margin: 18px 0 0 25px;
    padding-left: 20px;
    border-left: 2px solid #d9d5c9;
    list-style: none;
}

.sbd-comments-area .comment-navigation {
    margin: 22px 0;
}

.sbd-no-comments,
.sbd-comments-closed {
    color: #68675f;
    font-style: italic;
}

.sbd-comment-form-panel {
    margin-top: 35px;
    padding: 27px 28px;
    background: #faf9f5;
    border: 1px solid #e0ddd3;
    border-radius: 3px;
}

.sbd-comment-form-panel .comment-reply-title {
    margin: 0 0 20px;
    color: var(--sbd-green);
    font-size: 22px;
}

.sbd-comment-form-panel .comment-form {
    margin: 0;
}

.sbd-comment-form-panel .comment-form label {
    display: block;
    margin-bottom: 7px;
    color: #45463f;
    font-size: 14px;
    font-weight: 600;
}

.sbd-comment-form-panel .comment-form input:not([type="submit"]),
.sbd-comment-form-panel .comment-form textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d5d1c6;
    border-radius: 2px;
    background: #fff;
    color: #30332d;
    font: inherit;
}

.sbd-comment-form-panel .comment-form textarea {
    min-height: 145px;
    resize: vertical;
}

.sbd-comment-form-panel .comment-form input:focus,
.sbd-comment-form-panel .comment-form textarea:focus {
    outline: 2px solid rgba(25, 61, 53, 0.18);
    border-color: var(--sbd-green);
}

.sbd-comment-form-panel .form-submit {
    margin-top: 20px;
}

.sbd-comment-form-panel .comment-form input[type="submit"] {
    padding: 12px 22px;
    border: 0;
    border-radius: 2px;
    background: var(--sbd-green);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sbd-comment-form-panel .comment-form input[type="submit"]:hover {
    background: var(--sbd-gold);
}

@media (max-width: 640px) {
    .sbd-comments-area {
        margin-top: 42px;
        padding: 26px 18px;
    }

    .sbd-comment-form-panel {
        padding: 22px 16px;
    }

    .sbd-comments-heading h2 {
        font-size: 24px;
    }

    .sbd-comments-area .children {
        margin-left: 10px;
        padding-left: 12px;
    }
}

/* Stronger visual distinction for the comments section */
.sbd-comments-area {
    background: #e8eee8 !important;
    border-top: 5px solid var(--sbd-green);
    padding: 42px 34px 36px;
}

.sbd-comment-form-panel {
    background: #faf9f5 !important;
    border: 1px solid #d2dbd1;
}

/* Article preview and Show more control */
.entry-content.sbd-article-preview.is-collapsed {
    position: relative;
    max-height: 850px;
    overflow: hidden;
}

.entry-content.sbd-article-preview.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent, var(--sbd-background, #f8f6ef));
    pointer-events: none;
}

.entry-content.sbd-article-preview.is-expanded {
    max-height: none;
    overflow: visible;
}

.sbd-show-more {
    display: inline-block;
    margin: 18px 0 25px;
    padding: 11px 25px;
    border: 1px solid var(--sbd-green);
    border-radius: 2px;
    background: var(--sbd-green);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sbd-show-more:hover {
    background: var(--sbd-gold);
    border-color: var(--sbd-gold);
}

.sbd-show-more[hidden] {
    display: none;
}

/* Articles archive */
.sbd-articles-header {
    margin-bottom: 35px;
    padding-bottom: 22px;
    border-bottom: 1px solid #dedbd1;
}

.sbd-articles-header > p {
    color: #68675f;
    line-height: 1.7;
}

.sbd-articles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.sbd-article-card {
    padding: 25px;
    background: #f3f1e9;
    border-top: 3px solid var(--sbd-green);
}

.sbd-article-author {
    margin: 0 0 10px;
    color: var(--sbd-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sbd-article-card h2 {
    margin: 0 0 10px;
    font-size: 21px;
    line-height: 1.45;
}

.sbd-article-card h2 a {
    color: var(--sbd-green);
    text-decoration: none;
}

.sbd-article-card h2 a:hover {
    color: var(--sbd-gold);
}

.sbd-article-date {
    margin: 0 0 14px;
    color: #77736a;
    font-size: 12px;
}

.sbd-article-excerpt {
    color: #41423c;
    line-height: 1.7;
    font-size: 14px;
}

.sbd-read-article {
    display: inline-block;
    margin-top: 18px;
    color: var(--sbd-green);
    font-weight: 700;
    text-decoration: none;
}

.sbd-read-article:hover {
    color: var(--sbd-gold);
}

@media (max-width: 640px) {
    .sbd-articles-grid {
        grid-template-columns: 1fr;
    }
}
