/* =========================================================
   Web public content page
   - 1-page works
   - serialized episode pages
   ========================================================= */

html {
    scroll-behavior: smooth;
}

.web-public-episode-page {
    margin-bottom: 40px;
}

.web-episode-public-panel {
    width: 100%;
    max-width: none;
}

.web-episode-public-panel > .panel-body {
    padding: 42px 48px 46px;
}

/* ---------------------------------------------------------
   Header image
   --------------------------------------------------------- */
.web-episode-header-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 6;
    overflow: hidden;
    background: #f5f5f5;
}

.web-episode-header-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    border-radius: 5px 5px 0 0;
}

/* ---------------------------------------------------------
   Title, subtitle, summary and metadata
   --------------------------------------------------------- */
.web-episode-title {
    margin: 12px 0 40px;
    color: #333;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.web-episode-title.has-subtitle {
    margin-bottom: 10px;
}

.web-public-subtitle {
    margin-bottom: 16px;
    color: #666;
    font-size: 18px;
    line-height: 1.7;
}

.web-public-subtitle + .web-episode-author-meta {
    margin-top: 0;
}

.web-public-summary {
    margin-bottom: 0;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #f8f8f8;
    color: #555;
    line-height: 1.8;
    white-space: pre-wrap;
}

.web-episode-author-meta {
    margin: -18px 0 28px;
}

.web-episode-author-meta__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 24px;
    width: 100%;
    min-width: 0;
}

.web-episode-author-meta__name {
    grid-column: 1;
    grid-row: 1;
    color: #334155;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

.web-episode-author-meta__dates {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    row-gap: 1px;
    margin-top: 0;
    text-align: right;
}

.web-episode-author-meta__date-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
    color: #666;
    font-size: 12px;
    line-height: 1.45;
}

.web-episode-author-meta__date-label {
    flex: 0 0 66px;
    color: #666;
}

.web-episode-author-meta__date-value {
    color: #666;
    white-space: nowrap;
}

/* ---------------------------------------------------------
   Reader area and font-size menu
   --------------------------------------------------------- */
.web-episode-reader-area {
    width: 100%;
    max-width: 1100px;
    margin-right: auto;
    margin-left: 0;
    box-sizing: border-box;
}

.web-episode-reader-area > .text-reader-tools,
.web-episode-reader-area > .web-episode-body {
    width: 100%;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
    box-sizing: border-box;
}

.text-reader-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
    color: #4b5563;
    font-size: 12px;
}

.text-reader-tools-label {
    margin-right: 2px;
    color: #6b7280;
    font-weight: 700;
}

.text-reader-tool-btn {
    padding: 5px 9px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    line-height: 1.2;
}

.text-reader-tool-btn:hover,
.text-reader-tool-btn:focus {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.text-reader-tool-value {
    min-width: 38px;
    color: #6b7280;
    text-align: center;
}

/* ---------------------------------------------------------
   Table of contents
   --------------------------------------------------------- */
.web-episode-toc {
    margin: 0 0 34px;
    overflow: hidden;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    background: #fff;
}

.web-episode-toc__header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 18px 22px;
    border: 0;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.web-episode-toc__header:hover,
.web-episode-toc__header:focus {
    background: #fafafa;
    outline: none;
}

.web-episode-toc__caret {
    color: #666;
    font-size: 12px;
    line-height: 1;
}

.web-episode-toc__title {
    color: #333;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.web-episode-toc__body {
    border-top: 1px solid #f0f0f0;
}

.web-episode-toc__body[hidden] {
    display: none;
}

.web-episode-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.web-episode-toc__item {
    margin: 0;
    color: #444;
    line-height: 1.65;
}

.web-episode-toc__item + .web-episode-toc__item {
    border-top: 1px solid #f1f1f1;
}

.web-episode-toc__link,
.web-episode-toc__locked-row {
    display: grid;
    grid-template-columns: 3.8em minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    width: 100%;
    padding: 16px 22px;
    box-sizing: border-box;
}

.web-episode-toc__link {
    color: #444;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.web-episode-toc__link:hover,
.web-episode-toc__link:focus {
    background: #fafafa;
    color: #111;
    text-decoration: none;
    outline: none;
}

.web-episode-toc__number {
    color: #666;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.web-episode-toc__text {
    min-width: 0;
    word-break: break-word;
}

.web-episode-toc__item--level-2 .web-episode-toc__number {
    color: #444;
    font-weight: 500;
}

.web-episode-toc__item--level-3 .web-episode-toc__link,
.web-episode-toc__item--level-3 .web-episode-toc__locked-row {
    padding-left: 52px;
    font-size: 0.95em;
}

.web-episode-toc__paid-preview {
    position: relative;
    max-height: 176px;
    overflow: hidden;
    border-top: 1px solid #f1f1f1;
    background: #fff;
}

.web-episode-toc__paid-preview::after {
    content: "";
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 0;
    left: 0;
    height: 78%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.76) 54%,
        #fff 94%
    );
    pointer-events: none;
}

.web-episode-toc__paid-label {
    position: relative;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    margin: 12px 22px 4px;
    padding: 3px 9px;
    border: 1px solid #ead9aa;
    border-radius: 999px;
    background: #fffbeb;
    color: #8a6417;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.web-episode-toc__list--paid,
.web-episode-toc__item--paid,
.web-episode-toc__item--paid .web-episode-toc__number,
.web-episode-toc__item--paid .web-episode-toc__text {
    color: #999;
}

/* ---------------------------------------------------------
   Body typography
   --------------------------------------------------------- */
.web-episode-body {
    margin-top: 0;
    color: #444;
}

.web-episode-body h2 {
    margin: 2.2em 0 0.8em;
    color: #444;
    font-size: 1.65em;
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
}

.web-episode-body h3 {
    margin: 1.1em 0 0.7em;
    color: #444;
    font-size: 1.3em;
    font-weight: 500;
    line-height: 1.6;
    word-break: break-word;
}

.web-episode-body h2[id],
.web-episode-body h3[id] {
    scroll-margin-top: 24px;
}

.web-episode-body .text-emphasis {
    -webkit-text-emphasis-style: filled dot;
    text-emphasis-style: filled dot;
    -webkit-text-emphasis-color: currentColor;
    text-emphasis-color: currentColor;
    -webkit-text-emphasis-position: over right;
    text-emphasis-position: over right;
}

/* Compatibility with the older character-by-character emphasis output. */
.web-episode-body .text-emphasis-char {
    position: static;
    display: inline;
    padding-top: 0;
}

.web-episode-body .text-emphasis-char::before {
    content: none;
}

.web-episode-body a {
    color: #337ab7;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.web-episode-body a:hover,
.web-episode-body a:focus {
    color: #23527c;
}

/* ---------------------------------------------------------
   Inline images
   --------------------------------------------------------- */
.web-episode-body .text-inline-image {
    width: 100%;
    margin: 2.2em auto;
    text-align: center;
}

.web-episode-body .text-inline-image--small {
    max-width: 360px;
}

.web-episode-body .text-inline-image--medium {
    max-width: 680px;
}

.web-episode-body .text-inline-image--large {
    max-width: 100%;
}

.web-episode-body .text-inline-image img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 780px;
    height: auto;
    margin: 0 auto;
    border-radius: 3px;
}

.web-episode-body .text-inline-image figcaption {
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

/* ---------------------------------------------------------
   Paid-content notice
   --------------------------------------------------------- */
.web-episode-access-box {
    max-width: 680px;
    margin: 32px auto 16px;
    padding: 24px 22px;
    border: 1px dashed #e3d4ab;
    border-radius: 8px;
    background: #fffcf4;
    text-align: center;
}

.web-episode-access-title {
    margin: 0 0 10px;
    color: #6b4a12;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
}

.web-episode-access-price {
    margin: 0 0 14px;
    color: #d9534f;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.web-episode-access-note {
    margin: 10px 0 14px;
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

.web-episode-access-box .btn {
    margin-top: 4px;
}

.web-episode-access-box .mt15 {
    margin-top: 15px;
}

.web-episode-access-box .alert {
    max-width: 500px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

/* ---------------------------------------------------------
   Series navigation
   --------------------------------------------------------- */
.is-series .web-episode-nav {
    margin-top: 0;
    padding-top: 22px;
    border-top: 1px solid #e5e9ed;
}

.is-series .web-episode-nav-inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
}

.is-series .web-episode-nav-link {
    display: inline-block;
    padding: 6px 8px;
    color: #337ab7;
    font-size: 15px;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
}

.is-series .web-episode-nav-link:hover,
.is-series .web-episode-nav-link:focus {
    color: #23527c;
    text-decoration: underline;
}

.is-series .web-episode-nav-link--previous {
    justify-self: start;
}

.is-series .web-episode-nav-link--top {
    justify-self: center;
}

.is-series .web-episode-nav-link--next {
    justify-self: end;
}

.is-series .web-episode-nav-placeholder {
    visibility: hidden;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 767px) {
    .web-episode-public-panel > .panel-body {
        padding: 24px 20px 28px;
    }

    .web-episode-title {
        margin-bottom: 26px;
        font-size: 28px;
        line-height: 1.45;
    }

    .web-episode-title.has-subtitle {
        margin-bottom: 8px;
    }

    .web-episode-author-meta {
        margin-top: -12px;
        margin-bottom: 22px;
    }

    .web-public-subtitle + .web-episode-author-meta {
        margin-top: 0;
    }

    .web-episode-author-meta__body {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 4px;
    }

    .web-episode-author-meta__dates {
        grid-column: 1;
        grid-row: 2;
        justify-self: end;
    }

    .web-episode-toc {
        margin-bottom: 26px;
        border-radius: 6px;
    }

    .web-episode-toc__header {
        padding: 14px 16px;
    }

    .web-episode-toc__link,
    .web-episode-toc__locked-row {
        grid-template-columns: 3.25em minmax(0, 1fr);
        gap: 8px;
        padding: 10px 16px;
    }

    .web-episode-toc__item--level-3 .web-episode-toc__link,
    .web-episode-toc__item--level-3 .web-episode-toc__locked-row {
        padding-left: 30px;
    }

    .web-episode-toc__paid-label {
        margin-right: 16px;
        margin-left: 16px;
    }

    .web-episode-access-box {
        margin-top: 24px;
        padding: 20px 16px;
    }

    .web-episode-access-title {
        font-size: 17px;
    }

    .web-episode-access-price {
        font-size: 20px;
    }

    .is-series .web-episode-nav {
        margin-top: 34px;
        padding-top: 18px;
    }

    .is-series .web-episode-nav-link {
        padding: 5px 4px;
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .text-reader-tools {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

.web-episode-owner-notice {
	margin: 15px;
}