/*
 * SOFON Books Modern
 * Moderní vizuální vrstva pro Twenty Twelve + WP Books Gallery Premium.
 */

:root {
    --sofon-books-ink: #182035;
    --sofon-books-ink-soft: #4e5870;
    --sofon-books-card: rgba(255, 255, 255, 0.95);
    --sofon-books-line: rgba(31, 43, 66, 0.11);
    --sofon-books-copper: #bd7640;
    --sofon-books-copper-dark: #8b4c27;
    --sofon-books-gold: #d6a75f;
    --sofon-books-green: #2f5d55;
    --sofon-books-green-dark: #193f3a;
    --sofon-books-shadow-soft: 0 10px 28px rgba(18, 28, 43, 0.10);
    --sofon-books-radius-xl: 30px;
    --sofon-books-radius-lg: 22px;
    --sofon-books-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --sofon-books-serif: Georgia, "Times New Roman", serif;
}

html {
    scroll-behavior: smooth;
}

body.sofon-books-modern {
    color: var(--sofon-books-ink);
    font-family: var(--sofon-books-ui);
    background-color: #17232b;
    background-attachment: fixed;
}

body.sofon-books-modern::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 12%, rgba(214, 167, 95, 0.18), transparent 28rem),
        radial-gradient(circle at 84% 18%, rgba(54, 111, 101, 0.22), transparent 31rem),
        linear-gradient(135deg, rgba(15, 30, 35, 0.80), rgba(31, 42, 52, 0.72) 48%, rgba(48, 33, 27, 0.76));
}

body.sofon-books-modern #page.site {
    box-sizing: border-box;
    width: min(1480px, calc(100% - 44px));
    max-width: none;
    margin: 30px auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: var(--sofon-books-radius-xl);
    background: rgba(249, 247, 241, 0.95);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body.sofon-books-modern a,
body.sofon-books-modern a:visited {
    color: var(--sofon-books-green-dark);
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

body.sofon-books-modern a:hover,
body.sofon-books-modern a:focus {
    color: var(--sofon-books-copper-dark);
}

body.sofon-books-modern button,
body.sofon-books-modern input,
body.sofon-books-modern select,
body.sofon-books-modern textarea {
    font-family: var(--sofon-books-ui);
}

/* Hero */
body.sofon-books-modern .site-header {
    position: relative;
    display: grid;
    grid-template-areas: "hero";
    min-height: 360px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #1e2d31;
}

body.sofon-books-modern .site-header > hgroup,
body.sofon-books-modern .site-header > .main-navigation,
body.sofon-books-modern .site-header > a[rel="home"] {
    grid-area: hero;
}

body.sofon-books-modern .site-header > a[rel="home"] {
    position: relative;
    z-index: 0;
    display: block;
    align-self: stretch;
    min-height: 360px;
}

body.sofon-books-modern .site-header > a[rel="home"]::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(7, 17, 24, 0.76) 0%, rgba(7, 17, 24, 0.20) 44%, rgba(8, 21, 23, 0.78) 100%),
        linear-gradient(90deg, rgba(14, 39, 37, 0.56), transparent 58%);
}

body.sofon-books-modern .site-header .header-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: center;
    filter: saturate(0.84) contrast(1.04) brightness(0.86);
    transform: scale(1.015);
}

body.sofon-books-modern .site-header > hgroup {
    position: relative;
    z-index: 2;
    align-self: end;
    width: min(860px, calc(100% - 64px));
    margin: 0 32px 34px;
    padding: 0;
}

body.sofon-books-modern .site-header h1.site-title,
body.sofon-books-modern .site-header h2.site-description {
    margin: 0;
    padding: 0;
    color: #fff;
    text-align: left;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.38);
}

body.sofon-books-modern .site-header h1.site-title {
    font-family: var(--sofon-books-serif);
    font-size: clamp(2.2rem, 4vw, 4.35rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

body.sofon-books-modern .site-header h1.site-title a,
body.sofon-books-modern .site-header h1.site-title a:visited {
    color: #fff;
}

body.sofon-books-modern .site-header h1.site-title a:hover {
    color: #fff3d4;
    text-decoration: none;
}

body.sofon-books-modern .site-header h2.site-description {
    width: min(740px, 100%);
    margin-top: 13px;
    color: rgba(255, 255, 255, 0.86);
    font-family: var(--sofon-books-ui);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

/* Navigation */
body.sofon-books-modern .main-navigation {
    position: relative;
    z-index: 4;
    align-self: start;
    box-sizing: border-box;
    width: calc(100% - 48px);
    margin: 22px 24px 0;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.19);
    border-radius: 18px;
    background: rgba(13, 25, 31, 0.52);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body.sofon-books-modern .main-navigation ul.nav-menu,
body.sofon-books-modern .main-navigation div.nav-menu > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: auto;
    border: 0;
}

body.sofon-books-modern .main-navigation li {
    margin: 0;
}

body.sofon-books-modern .main-navigation li a,
body.sofon-books-modern .main-navigation li a:visited {
    display: block;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-decoration: none;
}

body.sofon-books-modern .main-navigation li a:hover,
body.sofon-books-modern .main-navigation li a:focus {
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
    transform: translateY(-1px);
}

body.sofon-books-modern .main-navigation .current-menu-item > a,
body.sofon-books-modern .main-navigation .current_page_item > a {
    color: #fff;
    background: linear-gradient(135deg, rgba(189, 118, 64, 0.96), rgba(139, 76, 39, 0.96));
    box-shadow: 0 8px 18px rgba(94, 50, 29, 0.25);
}

body.sofon-books-modern .menu-toggle {
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: none;
    font-size: 0.88rem;
    font-weight: 700;
}

/* Content */
body.sofon-books-modern #main.wrapper {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: clamp(24px, 3vw, 44px);
    border: 0;
    background:
        radial-gradient(circle at top right, rgba(214, 167, 95, 0.08), transparent 22rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(248, 245, 238, 0.98));
}

body.sofon-books-modern #primary.site-content,
body.sofon-books-modern .site-content,
body.sofon-books-modern #content {
    float: none;
    width: 100%;
    margin: 0;
}

body.sofon-books-modern article {
    border-bottom: 0;
}

body.sofon-books-modern .entry-header {
    margin: 0 0 24px;
}

body.sofon-books-modern .entry-header .entry-title {
    margin: 0;
    color: var(--sofon-books-ink);
    font-family: var(--sofon-books-serif);
    font-size: clamp(2rem, 3vw, 3.15rem);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.035em;
}

body.sofon-books-modern .entry-header .entry-title a,
body.sofon-books-modern .entry-header .entry-title a:visited {
    color: var(--sofon-books-ink);
}

body.sofon-books-modern .entry-content,
body.sofon-books-modern .entry-summary,
body.sofon-books-modern .mu_register {
    color: var(--sofon-books-ink);
    font-size: 1rem;
    line-height: 1.72;
}

body.sofon-books-modern .entry-content p {
    margin-bottom: 1.35em;
}

body.sofon-books-modern .entry-content h1,
body.sofon-books-modern .entry-content h2,
body.sofon-books-modern .entry-content h3,
body.sofon-books-modern .entry-content h4 {
    color: var(--sofon-books-ink);
    font-family: var(--sofon-books-serif);
    letter-spacing: -0.02em;
}

body.sofon-books-modern .entry-content img {
    border-radius: 12px;
}

body.sofon-books-modern .entry-content blockquote {
    margin: 1.6rem 0;
    padding: 18px 22px;
    border-left: 4px solid var(--sofon-books-gold);
    border-radius: 0 14px 14px 0;
    background: rgba(214, 167, 95, 0.09);
}

/* Forms */
body.sofon-books-modern input[type="text"],
body.sofon-books-modern input[type="email"],
body.sofon-books-modern input[type="url"],
body.sofon-books-modern input[type="password"],
body.sofon-books-modern input[type="search"],
body.sofon-books-modern input[type="number"],
body.sofon-books-modern textarea,
body.sofon-books-modern select {
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid rgba(31, 43, 66, 0.16);
    border-radius: 12px;
    color: var(--sofon-books-ink);
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(24, 32, 53, 0.03);
    outline: none;
}

body.sofon-books-modern input:focus,
body.sofon-books-modern textarea:focus,
body.sofon-books-modern select:focus {
    border-color: rgba(47, 93, 85, 0.62);
    box-shadow: 0 0 0 4px rgba(47, 93, 85, 0.10);
}

body.sofon-books-modern button,
body.sofon-books-modern input[type="submit"],
body.sofon-books-modern input[type="button"],
body.sofon-books-modern input[type="reset"] {
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--sofon-books-green), var(--sofon-books-green-dark));
    box-shadow: 0 8px 18px rgba(25, 63, 58, 0.18);
    text-shadow: none;
}

body.sofon-books-modern button:hover,
body.sofon-books-modern input[type="submit"]:hover,
body.sofon-books-modern input[type="button"]:hover,
body.sofon-books-modern input[type="reset"]:hover {
    color: #fff;
    background: linear-gradient(135deg, #397066, #214a44);
    transform: translateY(-1px);
}

/* WP Books Gallery */
body.sofon-books-modern .wbg-parent-wrapper {
    box-sizing: border-box !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body.sofon-books-modern .wbg-search-container {
    box-sizing: border-box;
    margin: 0 0 28px !important;
    padding: clamp(16px, 2vw, 24px) !important;
    border: 1px solid var(--sofon-books-line) !important;
    border-radius: var(--sofon-books-radius-lg) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 241, 230, 0.96)) !important;
    box-shadow: var(--sofon-books-shadow-soft);
}

body.sofon-books-modern .wbg-search-container .wbg-search-item input[type="text"],
body.sofon-books-modern .selectize-control.single .selectize-input {
    min-height: 48px !important;
    padding: 11px 14px !important;
    border: 1px solid rgba(31, 43, 66, 0.14) !important;
    border-radius: 13px !important;
    color: var(--sofon-books-ink) !important;
    background: #fff !important;
    box-shadow: none !important;
    font-family: var(--sofon-books-ui) !important;
    font-size: 0.95rem !important;
}

body.sofon-books-modern .selectize-dropdown {
    overflow: hidden;
    border: 1px solid var(--sofon-books-line);
    border-radius: 13px;
    box-shadow: var(--sofon-books-shadow-soft);
}

body.sofon-books-modern .selectize-dropdown [data-selectable].option {
    color: var(--sofon-books-ink) !important;
    background: #fff !important;
    font-size: 0.92rem !important;
}

body.sofon-books-modern .wbg-search-container .wbg-search-item .submit-btn {
    min-height: 46px;
    padding: 0 18px;
    border: 0 !important;
    border-radius: 12px !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--sofon-books-green), var(--sofon-books-green-dark)) !important;
    box-shadow: 0 8px 18px rgba(25, 63, 58, 0.17);
    font-size: 0.84rem !important;
    font-weight: 800 !important;
}

body.sofon-books-modern .wbg-search-container .wbg-search-item a#wbg-search-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px !important;
    min-height: 46px;
    border: 0 !important;
    border-radius: 12px !important;
    color: var(--sofon-books-copper-dark) !important;
    background: rgba(189, 118, 64, 0.11) !important;
}

body.sofon-books-modern .wbg-main-wrapper {
    gap: 18px;
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item {
    box-sizing: border-box;
    padding: 14px !important;
    overflow: hidden;
    border: 1px solid var(--sofon-books-line) !important;
    border-radius: 18px !important;
    background: var(--sofon-books-card) !important;
    box-shadow: 0 8px 25px rgba(25, 34, 49, 0.08);
    transition: transform 190ms ease, box-shadow 190ms ease, border-color 190ms ease;
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item:hover {
    border-color: rgba(189, 118, 64, 0.28) !important;
    box-shadow: 0 18px 38px rgba(25, 34, 49, 0.14);
    transform: translateY(-4px);
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item .wgb-item-link {
    display: block;
    color: var(--sofon-books-ink) !important;
    font-family: var(--sofon-books-serif);
    font-size: 1rem !important;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item .wgb-item-link:hover {
    color: var(--sofon-books-copper-dark) !important;
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item .wgb-item-link img {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(19, 28, 41, 0.15);
    transition: transform 220ms ease, filter 220ms ease;
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item:hover .wgb-item-link img {
    transform: scale(1.018);
    filter: saturate(1.05);
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item span.loop-category,
body.sofon-books-modern .wbg-main-wrapper .wbg-item span.loop-author,
body.sofon-books-modern .wbg-main-wrapper .wbg-item span.loop-edition,
body.sofon-books-modern .wbg-main-wrapper .wbg-item span.loop-publish-date,
body.sofon-books-modern .wbg-main-wrapper .wbg-item span.book-format {
    display: block;
    margin-top: 7px;
    color: var(--sofon-books-ink-soft) !important;
    font-family: var(--sofon-books-ui);
    font-size: 0.78rem !important;
    line-height: 1.45;
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item span.loop-category a,
body.sofon-books-modern .wbg-main-wrapper .wbg-item span.loop-author a,
body.sofon-books-modern .wbg-main-wrapper .wbg-item span.book-format a {
    color: var(--sofon-books-green) !important;
    font-size: inherit !important;
    font-weight: 650;
}

body.sofon-books-modern .wbg-main-wrapper .wbg-item a.wbg-btn {
    padding: 9px 12px;
    border-radius: 10px;
    color: #fff !important;
    background: linear-gradient(135deg, var(--sofon-books-copper), var(--sofon-books-copper-dark)) !important;
    box-shadow: 0 7px 16px rgba(139, 76, 39, 0.17);
    font-size: 0.76rem !important;
    font-weight: 750;
}

body.sofon-books-modern .wbg-main-wrapper.list .wbg-item-list-wrapper {
    margin-bottom: 16px;
    padding: 18px !important;
    border: 1px solid var(--sofon-books-line) !important;
    border-radius: 18px;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(25, 34, 49, 0.07);
}

/* WP Books Gallery pagination */
body.sofon-books-modern .wbg-pagination {
    margin-top: 28px;
}

body.sofon-books-modern .wbg-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

body.sofon-books-modern .wbg-pagination .page-numbers li {
    overflow: hidden;
    border: 1px solid var(--sofon-books-line);
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(25, 34, 49, 0.06);
}

body.sofon-books-modern .wbg-pagination .page-numbers li a,
body.sofon-books-modern .wbg-pagination .page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 0 9px;
    color: var(--sofon-books-ink) !important;
    background: transparent !important;
    font-size: 0.82rem !important;
    font-weight: 700;
}

body.sofon-books-modern .wbg-pagination .page-numbers li > span.current {
    color: #fff !important;
    background: linear-gradient(135deg, var(--sofon-books-green), var(--sofon-books-green-dark)) !important;
}

/* Single/detail pages */
body.sofon-books-modern.single-books [class*="wbg-single"],
body.sofon-books-modern.single-books [class*="wbg-details"] {
    box-sizing: border-box;
}

body.sofon-books-modern.single-books .wbg-single-wrapper,
body.sofon-books-modern.single-books .wbg-single-book,
body.sofon-books-modern.single-books .wbg-details-wrapper,
body.sofon-books-modern.tax-book_author .wbga-author-wrapper,
body.sofon-books-modern.tax-book_author .wbga-single-author {
    border-color: var(--sofon-books-line) !important;
    border-radius: var(--sofon-books-radius-lg) !important;
    background: #fff !important;
    box-shadow: var(--sofon-books-shadow-soft);
}

body.sofon-books-modern.single-books [class*="wbg-single"] img,
body.sofon-books-modern.tax-book_author img {
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(19, 28, 41, 0.14);
}

body.sofon-books-modern.single-books [class*="wbg-single"] h1,
body.sofon-books-modern.single-books [class*="wbg-single"] h2,
body.sofon-books-modern.single-books [class*="wbg-single"] h3,
body.sofon-books-modern.tax-book_author h1,
body.sofon-books-modern.tax-book_author h2,
body.sofon-books-modern.tax-book_author h3 {
    color: var(--sofon-books-ink) !important;
    font-family: var(--sofon-books-serif);
}

/* Authors */
.sofon-authors {
    --authors-gap: 16px;
    position: relative;
}

.sofon-authors.is-loading::after {
    content: "";
    position: absolute;
    inset: 78px 0 0;
    z-index: 8;
    border-radius: 18px;
    background: rgba(248, 245, 238, 0.62);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sofon-authors-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid var(--sofon-books-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--sofon-books-shadow-soft);
}

.sofon-authors-search {
    position: relative;
    flex: 1 1 520px;
    margin: 0;
}

.sofon-authors-search__icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    display: inline-flex;
    color: #7b8393;
    transform: translateY(-50%);
    pointer-events: none;
}

body.sofon-books-modern .sofon-authors-search input[type="search"] {
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 46px 0 45px;
    border: 1px solid rgba(31, 43, 66, 0.13);
    border-radius: 14px;
    color: var(--sofon-books-ink);
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(24, 32, 53, 0.03);
    font-size: 0.96rem;
}

body.sofon-books-modern .sofon-authors-search input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

body.sofon-books-modern .sofon-authors-search__clear {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 2;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #6c7484;
    background: transparent;
    box-shadow: none;
    font-size: 1.45rem;
    line-height: 1;
    transform: translateY(-50%);
}

body.sofon-books-modern .sofon-authors-search__clear:hover {
    color: var(--sofon-books-ink);
    background: rgba(31, 43, 66, 0.07);
    transform: translateY(-50%);
}

.sofon-authors-status {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid rgba(47, 93, 85, 0.12);
    border-radius: 999px;
    color: var(--sofon-books-green-dark);
    background: rgba(47, 93, 85, 0.08);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.sofon-authors-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--authors-gap);
}

.sofon-author-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    margin: 0 !important;
    padding: 16px;
    border: 1px solid var(--sofon-books-line);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 243, 0.96));
    box-shadow: 0 7px 20px rgba(24, 32, 53, 0.065);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.sofon-author-card:hover {
    border-color: rgba(189, 118, 64, 0.28);
    box-shadow: 0 14px 32px rgba(24, 32, 53, 0.11);
    transform: translateY(-2px);
}

.sofon-author-card__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    overflow: hidden;
    border-radius: 18px;
    color: #fff !important;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.20), transparent 45%),
        linear-gradient(135deg, var(--sofon-books-green), var(--sofon-books-green-dark));
    box-shadow: 0 8px 20px rgba(25, 63, 58, 0.15);
    text-decoration: none;
}

.sofon-author-card__media img {
    width: 100%;
    height: 100%;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: cover;
    transition: transform 220ms ease;
}

.sofon-author-card:hover .sofon-author-card__media img {
    transform: scale(1.045);
}

.sofon-author-card__initials {
    font-family: var(--sofon-books-serif);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.sofon-author-card__body {
    min-width: 0;
    align-self: center;
}

.sofon-author-card__title-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

body.sofon-books-modern .sofon-author-card__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0;
    font-family: var(--sofon-books-serif);
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.018em;
}

body.sofon-books-modern .sofon-author-card__title a,
body.sofon-books-modern .sofon-author-card__title a:visited {
    color: var(--sofon-books-ink);
    text-decoration: none;
}

body.sofon-books-modern .sofon-author-card__title a:hover {
    color: var(--sofon-books-copper-dark);
}

.sofon-author-card__count {
    flex: 0 0 auto;
    min-width: 27px;
    padding: 4px 8px;
    border: 1px solid rgba(189, 118, 64, 0.13);
    border-radius: 999px;
    color: var(--sofon-books-copper-dark);
    background: rgba(189, 118, 64, 0.10);
    font-size: 0.69rem;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
}

body.sofon-books-modern .sofon-author-card__bio {
    display: -webkit-box;
    margin: 7px 0 0 !important;
    overflow: hidden;
    color: var(--sofon-books-ink-soft);
    font-size: 0.79rem;
    line-height: 1.52;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.sofon-authors-empty,
.sofon-authors-error {
    padding: 34px 20px;
    border: 1px dashed rgba(31, 43, 66, 0.18);
    border-radius: 18px;
    color: var(--sofon-books-ink-soft);
    background: rgba(255, 255, 255, 0.62);
    text-align: center;
}

.sofon-authors-pagination-wrap {
    margin-top: 24px;
}

.sofon-authors-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sofon-authors-pagination__numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

body.sofon-books-modern .sofon-authors-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 40px;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid var(--sofon-books-line);
    border-radius: 10px;
    color: var(--sofon-books-ink);
    background: #fff;
    box-shadow: 0 4px 12px rgba(25, 34, 49, 0.05);
    font-size: 0.78rem;
    font-weight: 800;
}

body.sofon-books-modern .sofon-authors-page:hover:not(:disabled) {
    border-color: rgba(47, 93, 85, 0.25);
    color: var(--sofon-books-green-dark);
    background: rgba(47, 93, 85, 0.08);
    transform: translateY(-1px);
}

body.sofon-books-modern .sofon-authors-page.is-current {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--sofon-books-green), var(--sofon-books-green-dark));
    box-shadow: 0 7px 17px rgba(25, 63, 58, 0.18);
}

body.sofon-books-modern .sofon-authors-page:disabled {
    opacity: 0.38;
    cursor: default;
}

.sofon-authors-pagination__dots {
    padding: 0 2px;
    color: #8b92a0;
}

/* Fallback stylování původního výpisu */
body.sofon-books-modern .wbga-author-list-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

body.sofon-books-modern .wbga-author-items {
    box-sizing: border-box;
    margin: 0 !important;
    padding: 16px !important;
    border: 1px solid var(--sofon-books-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(24, 32, 53, 0.065);
}

/* Footer */
body.sofon-books-modern #colophon {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: clamp(28px, 3vw, 42px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.80);
    background:
        radial-gradient(circle at 90% 0%, rgba(214, 167, 95, 0.11), transparent 24rem),
        linear-gradient(135deg, #172f2d, #1b2730 55%, #2a2525);
}

body.sofon-books-modern #colophon .site-info {
    width: 100%;
    max-width: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.74);
}

body.sofon-books-modern #colophon .widget-title {
    margin: 0 0 16px;
    color: #fff;
    font-family: var(--sofon-books-serif);
    font-size: 1.3rem;
    font-weight: 700;
}

body.sofon-books-modern #colophon .tagcloud ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

body.sofon-books-modern #colophon .tagcloud li {
    margin: 0;
}

body.sofon-books-modern #colophon .tagcloud a,
body.sofon-books-modern #colophon .tagcloud a:visited {
    display: inline-flex;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78) !important;
    background: rgba(255, 255, 255, 0.055);
    font-size: 0.72rem !important;
    line-height: 1.2;
    text-decoration: none;
}

body.sofon-books-modern #colophon .tagcloud a:hover {
    border-color: rgba(214, 167, 95, 0.34);
    color: #fff !important;
    background: rgba(214, 167, 95, 0.12);
    transform: translateY(-1px);
}

body.sofon-books-modern #colophon a,
body.sofon-books-modern #colophon a:visited {
    color: #f1d5a7;
}

/* Generic archives */
body.sofon-books-modern.archive #content > article,
body.sofon-books-modern.search #content > article {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--sofon-books-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(24, 32, 53, 0.06);
}

body.sofon-books-modern :focus-visible {
    outline: 3px solid rgba(214, 167, 95, 0.55);
    outline-offset: 3px;
}

@media screen and (max-width: 900px) {
    body.sofon-books-modern #page.site {
        width: min(100% - 24px, 1480px);
        margin: 12px auto;
        border-radius: 24px;
    }

    body.sofon-books-modern .site-header,
    body.sofon-books-modern .site-header > a[rel="home"],
    body.sofon-books-modern .site-header .header-image {
        min-height: 330px;
    }

    .sofon-authors-grid,
    body.sofon-books-modern .wbga-author-list-wrapper {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    body.sofon-books-modern #page.site {
        width: 100%;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    body.sofon-books-modern .site-header,
    body.sofon-books-modern .site-header > a[rel="home"],
    body.sofon-books-modern .site-header .header-image {
        min-height: 310px;
    }

    body.sofon-books-modern .site-header > hgroup {
        width: calc(100% - 36px);
        margin: 0 18px 22px;
    }

    body.sofon-books-modern .site-header h1.site-title {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    body.sofon-books-modern .main-navigation {
        width: calc(100% - 28px);
        margin: 14px 14px 0;
        padding: 6px;
    }

    body.sofon-books-modern .main-navigation ul.nav-menu,
    body.sofon-books-modern .main-navigation div.nav-menu > ul {
        display: none;
        margin-top: 7px;
    }

    body.sofon-books-modern .main-navigation.toggled-on ul.nav-menu,
    body.sofon-books-modern .main-navigation.toggled-on div.nav-menu > ul {
        display: flex;
        flex-direction: column;
    }

    body.sofon-books-modern #main.wrapper {
        padding: 22px 15px 28px;
    }

    body.sofon-books-modern .entry-header .entry-title {
        font-size: 2rem;
    }

    .sofon-authors-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .sofon-authors-status {
        align-self: flex-start;
    }

    .sofon-author-card {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 13px;
        padding: 13px;
    }

    .sofon-author-card__media {
        width: 70px;
        height: 70px;
        border-radius: 15px;
    }

    .sofon-authors-pagination {
        flex-wrap: wrap;
    }

    .sofon-authors-page--prev,
    .sofon-authors-page--next {
        order: 2;
    }

    .sofon-authors-pagination__numbers {
        flex-basis: 100%;
        order: 1;
    }

    body.sofon-books-modern #colophon {
        padding: 26px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    body.sofon-books-modern *,
    body.sofon-books-modern *::before,
    body.sofon-books-modern *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* SOFON BOOKS PHASE 02B START */
/* ==========================================================================
   SOFON BOOKS – PHASE 02B FIXES
   Managed block: footer width, pagination alignment, book cover proportions
   ========================================================================== */

/* 1) Twenty Twelve keeps a desktop max-width on the footer.
      Force the SOFON footer to span the complete site card. */
body.sofon-books-modern #colophon,
body.sofon-books-modern #colophon.site-footer,
body.sofon-books-modern footer#colophon[role="contentinfo"] {
    box-sizing: border-box !important;
    display: block !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
}

body.sofon-books-modern #colophon .site-info {
    box-sizing: border-box !important;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
}

/* 2) WP Books Gallery writes an inline height + object-fit:fill on covers.
      Preserve the intended cover proportions instead of stretching to card width. */
body.sofon-books-modern .wbg-main-wrapper .wbg-item .wgb-item-link > img,
body.sofon-books-modern .wbg-main-wrapper.grid .wbg-item .wgb-item-link > img {
    display: block !important;
    width: auto !important;
    height: 220px !important;
    max-width: 100% !important;
    max-height: 220px !important;
    margin: 0 auto 13px !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* Keep the image visually stable on hover without changing its geometry. */
body.sofon-books-modern .wbg-main-wrapper .wbg-item:hover .wgb-item-link > img {
    transform: scale(1.015);
}

/* 3) Normalize book-gallery pagination geometry.
      The original plugin/theme line-height rules otherwise move the digits vertically. */
body.sofon-books-modern .wbg-pagination ul.page-numbers,
body.sofon-books-modern .wbg-pagination .page-numbers {
    align-items: center !important;
}

body.sofon-books-modern .wbg-pagination .page-numbers li {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
    vertical-align: middle !important;
}

body.sofon-books-modern .wbg-pagination .page-numbers li > a,
body.sofon-books-modern .wbg-pagination .page-numbers li > span {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 12px !important;
    line-height: 1 !important;
    text-align: center !important;
    vertical-align: middle !important;
}

/* Apply the same precise centering to the new author pagination. */
body.sofon-books-modern .sofon-authors-page {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    text-align: center !important;
}
/* SOFON BOOKS PHASE 02B END */
