/*
Theme Name: Publisher Blog
Theme URI: https://example.com/
Author: Publisher
Author URI: https://example.com/
Description: Адаптивна WordPress блог тема с конфигурируем десен сайдбар за страници.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: publisher-blog
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    line-height: 1.6;
}

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

a {
    color: var(--brand);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover,
a:focus {
    color: var(--brand-2);
}

button,
input,
select,
textarea {
    font: inherit;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    word-wrap: normal !important;
    border: 0;
}

.screen-reader-text:focus {
    z-index: 100000;
    top: 8px;
    left: 8px;
    display: block;
    width: auto;
    height: auto;
    padding: 12px 16px;
    clip: auto;
    color: var(--ink);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.site-header__inner,
.site-footer__inner,
.site-main {
    width: min(100% - 32px, 1180px);
    margin-inline: auto;
}

.site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding-block: 16px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    max-width: 230px;
}

.site-logo img {
    display: block;
    width: auto;
    max-height: 48px;
}

.site-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.2;
    font-weight: 800;
}

.site-title a {
    color: var(--ink);
    text-decoration: none;
}

.site-description {
    margin: 4px 0 0;
    color: var(--ink-muted);
    font-size: 0.92rem;
}

.menu-toggle {
    width: 44px;
    height: 44px;
    display: inline-grid;
    gap: 5px;
    align-content: center;
    justify-content: center;
    padding: 0;
    color: var(--ink);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.menu-toggle:hover,
.menu-toggle:focus {
    color: var(--brand);
    background: var(--bg-soft);
    border-color: var(--brand);
}

.menu-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
}

.primary-navigation {
    display: none;
    grid-column: 1 / -1;
}

.primary-navigation.is-open {
    display: block;
}

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

.primary-navigation a {
    display: inline-flex;
    align-items: center;
    width: 100%;
    padding: 0px 12px;
    color: var(--ink);
    text-decoration: none;
}

.primary-navigation a:hover,
.primary-navigation a:focus,
.primary-navigation .current-menu-item > a,
.primary-navigation .current_page_item > a { 
    color: var(--brand);
}

.site-main {
    flex: 1;
    padding-block: 28px 44px;
}

.breadcrumbs {
    margin-bottom: 18px;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.breadcrumbs p {
    margin: 0;
}

.breadcrumbs a {
    color: inherit;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus {
    color: var(--brand);
}

.layout {
    display: grid;
    gap: 24px;
}

.layout--no-sidebar {
    width: 100%;
}

.home-latest {
    margin-bottom: 34px;
}

.home-latest__grid {
    display: grid;
    gap: 16px;
}

.latest-featured-card {
    min-width: 0;
}

.latest-featured-card__link {
    display: grid;
    position: relative;
    min-height: 240px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background: var(--ink);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(25, 35, 48, 0.08);
}

.latest-featured-card__media,
.latest-featured-card__media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.latest-featured-card__media img {
    object-fit: cover;
    transition: transform 180ms ease;
}

.latest-featured-card__link::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(25, 35, 48, 0.18), rgba(25, 35, 48, 0.78));
}

.latest-featured-card__link:hover,
.latest-featured-card__link:focus {
    color: #fff;
}

.latest-featured-card__link:hover .latest-featured-card__media img,
.latest-featured-card__link:focus .latest-featured-card__media img {
    transform: scale(1.035);
}

.latest-featured-card__overlay {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    align-self: end;
    padding: 18px;
}

.latest-featured-card__category {
    width: max-content;
    max-width: 100%;
    padding: 6px 10px;
    overflow: hidden;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--brand);
    border-radius: 999px;
}

.latest-featured-card__title {
    display: block;
    color: #fff;
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.18;
}

.latest-featured-card--large .latest-featured-card__title {
    font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem);
}

.home-top-posts {
    display: grid;
    gap: 22px;
}

.home-top-posts__header {
    display: grid;
    gap: 6px;
}

.home-top-posts__eyebrow {
    margin: 0;
    color: var(--brand-2);
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
}

.home-top-posts__title {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.9rem, 1.35rem + 2vw, 3rem);
    line-height: 1.08;
}

.home-top-posts__grid {
    display: grid;
    gap: 18px;
}

.top-voted-card {
    overflow: hidden;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(25, 35, 48, 0.06);
}

.top-voted-card__media {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--chip);
}

.top-voted-card__media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.top-voted-card__category {
    position: absolute;
    top: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 6px 10px;
    overflow: hidden;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--brand);
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(25, 35, 48, 0.18);
}

.top-voted-card__body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.top-voted-card__title {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.25;
}

.top-voted-card__title a {
    color: var(--ink);
    text-decoration: none;
}

.top-voted-card__title a:hover,
.top-voted-card__title a:focus {
    color: var(--brand);
}

.top-voted-card__date {
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.content-area {
    min-width: 0;
}

.post-card,
.entry,
.sidebar .widget,
.comments-area,
.no-results,
.not-found {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(25, 35, 48, 0.06);
}

.post-card,
.entry,
.comments-area,
.no-results,
.not-found {
    padding: 20px;
}

.post-card + .post-card,
.entry + .comments-area {
    margin-top: 20px;
}

.entry-header,
.page-header {
    margin-bottom: 16px;
}

.page-title,
.entry-title {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.65rem, 1.25rem + 1.4vw, 2.35rem);
    line-height: 1.12;
    letter-spacing: 0;
}

.entry-title a {
    color: inherit;
    text-decoration: none;
}

.entry-title a:hover,
.entry-title a:focus {
    color: var(--brand);
}

.entry-meta,
.entry-footer,
.comment-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.entry-meta a,
.entry-footer a:not(.read-more),
.comment-metadata a {
    color: inherit;
}

.post-thumbnail {
    display: block;
    margin: 0 0 16px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--chip);
}

.post-thumbnail img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.entry-content > *:first-child,
.entry-summary > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child,
.entry-summary > *:last-child {
    margin-bottom: 0;
}

.entry-content,
.entry-summary {
    color: var(--ink);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    line-height: 1.2;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
}

.entry-content th,
.entry-content td {
    padding: 10px;
    border: 1px solid var(--line);
}

.entry-content blockquote {
    margin-inline: 0;
    padding: 4px 0 4px 18px;
    color: var(--ink-muted);
    border-left: 4px solid var(--brand);
}

.read-more,
.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    color: #fff;
    text-decoration: none;
    background: var(--brand);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.read-more:hover,
.read-more:focus,
.button:hover,
.button:focus,
button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
    color: #fff;
    background: var(--brand-2);
}

.sidebar {
    display: grid;
    gap: 16px;
    align-content: start;
}

.sidebar .widget {
    padding: 18px;
}

.widget-title,
.widget_block h2,
.wp-block-search__label {
    display: block;
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 800;
}

.widget ul {
    padding-left: 18px;
    margin: 0;
}

.widget li + li {
    margin-top: 8px;
}

.latest-posts-widget {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.latest-posts-widget .latest-posts-widget__item {
    margin: 0;
}

.latest-posts-widget__link {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

.latest-posts-widget__link:hover,
.latest-posts-widget__link:focus {
    color: var(--brand);
}

.latest-posts-widget__thumb {
    display: block;
    overflow: hidden;
    width: 64px;
    height: 64px;
    background: var(--chip);
    border-radius: 6px;
}

.latest-posts-widget__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.latest-posts-widget__title {
    color: inherit;
    font-weight: 700;
    line-height: 1.3;
}

.wp-block-search__inside-wrapper,
.search-form {
    display: flex;
    gap: 8px;
}

.search-field,
.wp-block-search__input,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

textarea {
    min-height: 140px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 22px;
}

.post-navigation .nav-links {
    justify-content: space-between;
}

.nav-links a,
.nav-links .page-numbers {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 12px;
    color: var(--ink);
    text-decoration: none;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.nav-links .current,
.nav-links a:hover,
.nav-links a:focus {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.article-vote {
    margin-top: 20px;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(1, 84, 172, 0.1), rgba(232, 42, 0, 0.08)),
        var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(25, 35, 48, 0.06);
}

.article-vote__button {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 10px 14px 10px 10px;
    color: #fff;
    text-align: left;
    background: var(--brand);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(1, 84, 172, 0.22);
}

.article-vote__button:hover,
.article-vote__button:focus {
    color: #fff;
    background: var(--brand-2);
}

.article-vote__button:disabled {
    cursor: default;
    opacity: 1;
}

.article-vote__button.is-voted {
    background: var(--good);
    box-shadow: 0 14px 28px rgba(31, 191, 117, 0.2);
}

.article-vote__button.is-loading {
    cursor: wait;
}

.article-vote__icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    background: #fff;
    border-radius: 50%;
}

.article-vote__button.is-voted .article-vote__icon {
    color: var(--good);
}

.article-vote__text {
    min-width: 0;
    font-weight: 800;
}

.article-vote__count {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding-inline: 9px;
    color: var(--ink);
    font-weight: 800;
    background: #fff;
    border-radius: 999px;
}

.article-vote__message {
    min-height: 1.4em;
    margin: 10px 0 0;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.comments-title,
.comment-reply-title {
    margin-top: 0;
    line-height: 1.2;
}

.share-buttons {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(25, 35, 48, 0.06);
}

.share-buttons__title {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.25;
}

.share-buttons__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.share-buttons__link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: #fff;
    text-decoration: none;
    background: var(--brand);
    border-radius: 6px;
}

.share-buttons__link:hover,
.share-buttons__link:focus {
    color: #fff;
    background: var(--brand-2);
}

.author-box {
    display: grid;
    gap: 16px;
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(25, 35, 48, 0.06);
}

.author-box__avatar img {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 50%;
}

.author-box__title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.25;
}

.author-box__title a {
    color: var(--ink);
    text-decoration: none;
}

.author-box__title a:hover,
.author-box__title a:focus {
    color: var(--brand);
}

.author-box__description {
    margin: 8px 0 0;
    color: var(--ink-muted);
}

.author-box__description p {
    margin: 0;
}

.author-box__social {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 14px 0 0;
    list-style: none;
}

.author-box__social a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 7px 11px;
    color: var(--ink);
    text-decoration: none;
    background: var(--chip);
    border-radius: 6px;
}

.author-box__social a:hover,
.author-box__social a:focus {
    color: #fff;
    background: var(--brand);
}

.comment-list {
    padding: 0;
    margin: 0 0 20px;
    list-style: none;
}

.comment-list .children {
    margin-top: 14px;
    padding-left: 18px;
}

.comment-body {
    padding-block: 14px;
    border-bottom: 1px solid var(--line);
}

.comment-author {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-form {
    display: grid;
    gap: 12px;
}

.comment-form p {
    margin: 0;
}

.site-footer {
    color: var(--ink-muted);
    background: #fff;
    border-top: 1px solid var(--line);
}

.site-footer__inner {
    display: grid;
    gap: 24px;
    padding-block: 32px;
}

.footer-brand-column,
.footer-widget-area {
    min-width: 0;
}

.footer-brand {
    max-width: 220px;
}

.footer-brand img {
    display: block;
    width: auto;
    max-height: 44px;
    object-fit: contain;
}

.footer-brand .custom-logo-link {
    display: inline-flex;
    align-items: center;
}

.footer-description {
    margin: 14px 0 0;
    color: var(--ink-muted);
}

.footer-widget-area .widget + .widget {
    margin-top: 18px;
}

.footer-widget-area .widget-title,
.footer-widget-area .widget_block h2 {
    color: var(--ink);
    font-size: 1rem;
}

.footer-widget-area ul {
    padding-left: 18px;
    margin: 0;
}

.footer-widget-area li + li {
    margin-top: 8px;
}

.footer-widget-area a {
    color: var(--ink-muted);
}

.footer-widget-area a:hover,
.footer-widget-area a:focus {
    color: var(--brand);
}

.wp-caption,
.gallery-caption {
    max-width: 100%;
}

.wp-caption-text {
    margin-top: 6px;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.alignleft {
    float: left;
    margin: 0 18px 18px 0;
}

.alignright {
    float: right;
    margin: 0 0 18px 18px;
}

.aligncenter {
    display: block;
    margin-inline: auto;
}

.bypostauthor {
    display: block;
}

@media (min-width: 760px) {
    .site-header__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .menu-toggle {
        display: none;
    }

    .primary-navigation {
        display: block;
        grid-column: auto;
    }

    .primary-navigation ul {
        flex-direction: row;
    }

    .primary-navigation a {
        width: auto;
    }

    .home-latest__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .latest-featured-card--large {
        grid-row: span 2;
    }

    .latest-featured-card__link {
        min-height: 220px;
    }

    .latest-featured-card--large .latest-featured-card__link {
        min-height: 456px;
    }

    .home-top-posts__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .layout--right-sidebar {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
        align-items: start;
    }

    .post-card,
    .entry,
    .article-vote,
    .share-buttons,
    .author-box,
    .comments-area,
    .no-results,
    .not-found {
        padding: 28px;
    }

    .author-box {
        grid-template-columns: 96px minmax(0, 1fr);
        align-items: start;
    }

    .author-box__avatar img {
        width: 96px;
        height: 96px;
    }

    .site-footer__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

@media (min-width: 1040px) {
    .site-header__inner,
    .site-footer__inner,
    .site-main {
        width: min(100% - 48px, 1180px);
    }

    .site-main {
        padding-block: 40px 64px;
    }

    .site-footer__inner {
        grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(0, 1fr));
    }

    .home-latest__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .latest-featured-card--large {
        grid-row: span 2;
    }

    .home-top-posts__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
