/* ── Custom properties ── */
:root {
    --color-main: #FE2D85;
    --color-black-900: #121212;
    --font-head: "Source Sans Pro", sans-serif;
    --font-content: "Source Sans Pro", sans-serif;
}

/* ── Base ── */
body {
    font-family: var(--font-content);
    color: var(--color-black-900);
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--color-black-900);
}
a {
    color: var(--color-main);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ── Layout ── */
.site-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f9fafb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.site-main {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.site-main--tight {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* ── Site header ── */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.site-logo { flex-shrink: 0; }

.site-logo__img {
    height: 2rem;
    width: auto;
    display: block;
}

.site-nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}
.menu-toggle:hover { background-color: #f3f4f6; }

.menu-toggle .icon {
    width: 1.25rem;
    height: 1.25rem;
}

.mobile-menu {
    border-top: 1px solid #f3f4f6;
    background-color: #ffffff;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

@media (min-width: 768px) {
    .site-nav { display: flex; }
    .menu-toggle,
    .mobile-menu { display: none !important; }
}

/* ── Site footer ── */
.site-footer {
    background-color: rgba(209, 213, 219, 0.3);
    padding: 1rem;
    margin-top: auto;
}

.site-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
}

@media (min-width: 640px) {
    .site-footer__inner {
        flex-direction: row;
        padding: 0 1rem;
    }
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
    font-weight: 600;
}

.site-footer__link {
    margin-right: 1rem;
    color: var(--color-main);
}
.site-footer__link:hover { text-decoration: underline; }

/* ── Single/page entry ── */
.entry {
    width: 100%;
    margin-bottom: 4rem;
}

.entry__header { margin-bottom: 2rem; }

.entry__title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    font-family: var(--font-head);
    color: var(--color-black-900);
}

.entry__excerpt {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--color-black-900);
}

.entry__date {
    margin-top: 0.75rem;
    display: block;
}

.entry__thumbnail {
    margin-bottom: 2rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
}

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

/* ── Author page: layout (articles + categories sidebar) ── */
.author-header { margin-bottom: 2rem; }

.author-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 3rem;
    align-items: start;
}

.author-layout__main .post-grid { grid-template-columns: repeat(2, 1fr); }

.author-layout__sidebar { position: sticky; top: 5.5rem; }

.author-categories {
    background-color: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.author-categories__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-black-900);
    margin-bottom: 0.875rem;
}

.author-categories__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.author-categories__link {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    background-color: #fdf2f8;
    color: var(--color-main);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.author-categories__link:hover {
    background-color: var(--color-main);
    color: #ffffff;
}

/* ── Header category nav (desktop) ── */
.header-cat-link {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.header-cat-link:hover {
    background-color: #fdf2f8;
    color: var(--color-main);
}
.header-cat-link--active {
    background-color: var(--color-main);
    color: #ffffff !important;
}
.header-cat-link--active:hover {
    background-color: #F3227A;
    color: #ffffff;
}

/* ── Mobile category nav ── */
.mobile-cat-link {
    display: block;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #4b5563;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.mobile-cat-link:hover {
    background-color: #fdf2f8;
    color: var(--color-main);
}
.mobile-cat-link--active {
    background-color: #fdf2f8;
    color: var(--color-main);
}

/* ── Category filter tabs (home / archive) ── */
.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.cat-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    background-color: #f3f4f6;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.cat-tab:hover {
    background-color: #fdf2f8;
    color: var(--color-main);
}
.cat-tab--active {
    background-color: var(--color-main);
    color: #ffffff;
}
.cat-tab--active:hover {
    background-color: #F3227A;
    color: #ffffff;
}

/* ── Post card category badge ── */
.post-card__category {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    background-color: #fdf2f8;
    color: var(--color-main);
    text-decoration: none;
    align-self: flex-start;
    transition: background-color 0.15s;
    letter-spacing: 0.01em;
}
.post-card__category:hover {
    background-color: var(--color-main);
    color: #ffffff;
}

/* ── Entry content (single post) ── */
.entry-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-black-900);
    margin: 1rem 0;
}
.entry-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-black-900);
    margin-bottom: 0.75rem;
}
.entry-content p {
    color: #374151;
    line-height: 1.625;
    margin-bottom: 1.5rem;
    font-size: 16px;
}
.entry-content ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
    color: #374151;
}
.entry-content ol {
    list-style: decimal;
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
    color: #374151;
}
.entry-content li { margin-bottom: 0.5rem; }
.entry-content a {
    color: var(--color-main);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.entry-content blockquote {
    border-left: 4px solid var(--color-main);
    padding-left: 1rem;
    font-style: italic;
    color: #4b5563;
    margin: 1.5rem 0;
}
.entry-content pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}
.entry-content code {
    font-size: 0.875rem;
}

/* ── Post grid (home / archive) ── */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-card {
    display: flex;
    flex-direction: column;
}

.post-card__image-wrap {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

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

.post-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.post-card__title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-black-900);
    margin: 0;
    line-height: 1.35;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.post-card__title a {
    color: var(--color-black-900);
    text-decoration: none;
    transition: color 0.2s;
}

.post-card__title a:hover {
    color: var(--color-main);
    text-decoration: underline;
}

.post-card__excerpt {
    color: #555;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}

.post-card__date {
    font-size: 13px;
    color: #888;
}

/* ── Pagination ── */
.post-pagination {
    max-width: 1280px;
    margin: 3rem auto 0 auto;
    padding: 0 20px;
}

.post-pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.post-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 9999px;
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    background: transparent;
    border: 1.5px solid #e5e7eb;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}

.post-pagination .page-numbers:hover {
    background-color: #fdf2f8;
    border-color: var(--color-main);
    color: var(--color-main);
}

.post-pagination .page-numbers.current {
    background-color: var(--color-main);
    border-color: var(--color-main);
    color: #ffffff;
}

.post-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: #9ca3af;
    letter-spacing: 0.05em;
}

.post-pagination .page-numbers.prev,
.post-pagination .page-numbers.next {
    padding: 0 16px;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ── Comments pagination ── */
.comment-navigation .nav-links {
    display: flex;
    gap: 8px;
    margin-top: 1.5rem;
}

.comment-navigation .page-numbers,
.comment-navigation a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 9999px;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-main);
    border: 1.5px solid var(--color-main);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

/* ── Archive header ── */
.archive-header {
    max-width: 1280px;
    margin: 0 auto 2rem auto;
}

.archive-title {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 700;
    color: var(--color-black-900);
    margin: 0 0 0.5rem 0;
}

.archive-description {
    color: #555;
    font-size: 16px;
}

/* ── Comments ── */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.comments-title {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-black-900);
    margin: 0 0 1.5rem 0;
}

/* Comment list */
.comment-list {
    list-style: none;
    margin: 0 0 2.5rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-list .children {
    list-style: none;
    padding-left: 3rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item { display: block; }

.comment-body {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.comment-author-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-avatar img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: block;
}

.comment-author-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-black-900);
    display: block;
}

.comment-date {
    font-size: 12px;
    color: #9ca3af;
    display: block;
}

.comment-text p {
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.comment-reply {
    margin-top: 0.75rem;
}

.comment-reply-link {
    font-size: 13px;
    color: var(--color-main);
    text-decoration: none;
    font-weight: 600;
}

.comment-reply-link:hover { text-decoration: underline; }

.comment-awaiting {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

/* Comment form */
.comment-respond { margin-top: 0.5rem; }

.comment-form-field {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.comment-form-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-black-900);
}

.comment-form-field .required { color: var(--color-main); }

.comment-form-field input,
.comment-form-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 15px;
    font-family: var(--font-content);
    color: var(--color-black-900);
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s;
    outline: none;
}

.comment-form-field input:focus,
.comment-form-field textarea:focus {
    border-color: var(--color-main);
}

.comment-form-field textarea { resize: vertical; min-height: 120px; }

.comment-submit-btn {
    display: inline-flex;
    align-items: center;
    height: 46px;
    padding: 0 24px;
    background-color: var(--color-main);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-content);
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-submit-btn:hover { background-color: #F3227A; }

/* ── Breadcrumbs ── */
.breadcrumb {
    margin-bottom: 1.25rem;
}

.breadcrumb__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #9ca3af;
}

.breadcrumb__link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb__link:hover {
    color: var(--color-main);
}

.breadcrumb__sep {
    color: #d1d5db;
    font-size: 12px;
}

.breadcrumb__item--current {
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }

    .author-layout { grid-template-columns: 1fr; }
    .author-layout__sidebar { position: static; }
}

@media (max-width: 640px) {
    .post-grid,
    .author-layout__main .post-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}
