/*
 * DTT Typography System v2
 *
 * A final, low-risk typography layer over the legacy theme. The site has
 * hundreds of component-level px declarations, so changing body font-size
 * alone does not materially improve readability.
 *
 * Scale:
 * - desktop body: 16px
 * - mobile body: 15px
 * - long-form: 17px
 * - metadata / utility text: never below 12px
 */

:root {
    --dtt-type-body: 16px;
    --dtt-type-body-mobile: 15px;
    --dtt-type-longform: 17px;
    --dtt-type-meta: 12px;
    --dtt-type-button: 13px;
    --dtt-type-card-title: 15px;
    --dtt-type-input: 14px;
    --dtt-leading-body: 1.68;
    --dtt-leading-copy: 1.66;
    --dtt-leading-longform: 1.86;
    --dtt-leading-meta: 1.5;
    --dtt-leading-tight: 1.35;
}

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

body {
    font-size: var(--dtt-type-body) !important;
    line-height: var(--dtt-leading-body);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tailwind arbitrary-size utilities found in legacy PHP templates. */
body [class~="text-[7px]"]:not(.material-symbols-outlined),
body [class~="text-[8px]"]:not(.material-symbols-outlined),
body [class~="text-[9px]"]:not(.material-symbols-outlined),
body [class~="text-[10px]"]:not(.material-symbols-outlined),
body [class~="text-[11px]"]:not(.material-symbols-outlined) {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

/* Header + search ------------------------------------------------------ */
.mkm-nav > a,
.mkm-nav > button {
    font-size: 14px !important;
    line-height: 1.35 !important;
}

.mkm-search-form input,
.mkm-mobile-search input {
    font-size: var(--dtt-type-input) !important;
    line-height: 1.45 !important;
}

.dtt-nav-unread {
    min-width: 22px !important;
    height: 22px !important;
    padding-inline: 6px !important;
    font-size: var(--dtt-type-meta) !important;
}

.mkm-search-suggestion-meta,
.mkm-search-suggestion-badge,
.mkm-search-suggestion-footer,
.mkm-search-suggestions-submit {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

body.dtt-premium-subpage .mkm-nav > a,
body.dtt-premium-subpage .mkm-nav > button {
    font-size: 14px !important;
}

/* Homepage ------------------------------------------------------------- */
.dtt-home-ticker__label,
.dtt-home-ticker__group a,
.dtt-home-hero__eyebrow,
.dtt-home-hero__chips a,
.dtt-home-hero__facts small,
.dtt-home-hero__stats span,
.dtt-home-hero__cover-mark,
.dtt-home-hero__floating-card small,
.dtt-home-kicker,
.dtt-home-discover__genres a,
.dtt-home-discover__genres small,
.dtt-home-quick-action small,
.dtt-home-section__more,
.dtt-story-card__badge,
.dtt-story-card__time,
.dtt-story-card__genres a,
.dtt-story-card__status,
.dtt-story-card__meta span,
.dtt-story-card__meta a,
.dtt-home-trending__head small,
.dtt-home-rank-card__body small,
.dtt-home-rank-card__body span,
.dtt-home-trending__all,
.dtt-home-editorial__feature-label,
.dtt-home-editorial__meta,
.dtt-home-editorial__read,
.dtt-home-editorial-card__body > a,
.dtt-home-community__eyebrow,
.dtt-home-community__social,
.dtt-home-trending__tab,
.dtt-home-trending__data-label {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

.dtt-home-button,
.dtt-home-hero__start,
.dtt-story-card__actions a,
.dtt-reader-install,
.dtt-reader-push {
    font-size: var(--dtt-type-button) !important;
    line-height: 1.3 !important;
}

.dtt-home-hero__facts strong,
.dtt-home-hero__floating-card strong,
.dtt-home-quick-action strong,
.dtt-home-rank-card__body strong {
    font-size: 13px !important;
    line-height: var(--dtt-leading-tight) !important;
}

.dtt-home-section__head p,
.dtt-home-hero__excerpt,
.dtt-home-editorial__feature-body p,
.dtt-home-community p {
    font-size: 13px !important;
    line-height: var(--dtt-leading-copy) !important;
}

.dtt-story-card__title,
.dtt-home-editorial-card__body h3 {
    font-size: var(--dtt-type-card-title) !important;
    line-height: 1.45 !important;
}

.dtt-story-card__meta {
    row-gap: 6px !important;
}

.dtt-story-card__actions a {
    min-height: 38px !important;
    padding-block: 8px !important;
    padding-inline: 10px !important;
}

/* Story detail --------------------------------------------------------- */
.dtt-story-breadcrumb,
.dtt-story-cover__brand,
.dtt-story-badge,
.dtt-story-eyebrow,
.dtt-story-genre,
.dtt-story-fact small,
.dtt-story-reader__head small,
.dtt-story-reader__head p,
.dtt-story-reader__progress-row span,
.dtt-story-reader__stat small,
.dtt-story-tool,
.dtt-story-panel__kicker,
.dtt-story-summary__toggle,
.dtt-story-chapter__index,
.dtt-story-chapter__meta,
.dtt-story-chapter__continue,
.dtt-story-sidecard__head small,
.dtt-story-status-item small,
.dtt-story-utility button,
.dtt-story-utility a,
.dtt-story-unread-badge,
.dtt-story-comment__top time,
.dtt-story-comment__stars,
.dtt-story-comment-form__rating,
.dtt-story-comment-form__bottom small,
.dtt-story-related-card__tag {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

.dtt-story-btn,
.dtt-story-comment-submit {
    font-size: var(--dtt-type-button) !important;
    line-height: 1.3 !important;
}

.dtt-story-fact strong,
.dtt-story-reader__progress-row strong,
.dtt-story-status-item strong,
.dtt-story-chapter__body strong,
.dtt-story-comment__top strong {
    font-size: 13px !important;
    line-height: var(--dtt-leading-tight) !important;
}

.dtt-story-intro,
.dtt-story-panel__head p,
.dtt-story-comment__bubble p,
.dtt-story-comments__empty,
.dtt-story-related-card__body p {
    font-size: 13px !important;
    line-height: 1.7 !important;
}

.dtt-story-search input,
.dtt-story-sort,
.dtt-story-comment-form input,
.dtt-story-comment-form textarea {
    font-size: var(--dtt-type-input) !important;
    line-height: 1.5 !important;
}

.dtt-story-chapter__body strong,
.dtt-story-related-card__body h3 {
    font-size: 14px !important;
}

.dtt-story-chapter__continue {
    padding: 4px 8px !important;
}

/* Personalization / library / history --------------------------------- */
.dtt-reader-personalized__eyebrow,
.dtt-reader-for-you__eyebrow,
.dtt-reader-sync-pill,
.dtt-reader-continue-card__cover > span,
.dtt-reader-continue-card__eyebrow,
.dtt-reader-continue-card__meta,
.dtt-reader-reco-card__badge,
.dtt-reader-reco-card__body > div,
.dtt-reader-story-unread,
.dtt-reader-reco-card__reason,
.dtt-reader-reco-card__meta,
.dtt-reader-feedback-actions button,
.dtt-library-kicker,
.dtt-history-kicker,
.dtt-library-section-head > div > span,
.dtt-library-tabs a,
.dtt-library-stats small,
.dtt-library-stats span,
.dtt-library-featured__body > span,
.dtt-library-featured__meta,
.dtt-library-section-head > a,
.dtt-library-card__unread,
.dtt-library-card__status,
.dtt-history-hero > a,
.dtt-history-toolbar > div,
.dtt-history-toolbar button,
.dtt-history-item__top small,
.dtt-history-item__top button,
.dtt-history-item__bottom {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

.dtt-reader-continue-card__body > p,
.dtt-reader-empty p,
.dtt-library-sync-banner p,
.dtt-history-privacy p,
.dtt-library-featured__body p,
.dtt-library-featured-empty p,
.dtt-library-card__body p,
.dtt-library-empty p,
.dtt-history-empty p,
.dtt-history-item__body > p {
    font-size: 12.5px !important;
    line-height: 1.65 !important;
}

.dtt-reader-empty > a,
.dtt-library-sync-banner button,
.dtt-history-privacy button,
.dtt-library-card__read,
.dtt-library-empty a,
.dtt-history-empty a {
    font-size: var(--dtt-type-button) !important;
    line-height: 1.3 !important;
}

.dtt-reader-reco-card h3,
.dtt-library-card__body h3,
.dtt-history-item__top h2 {
    font-size: 14px !important;
    line-height: 1.45 !important;
}

/* Directory / completed / taxonomy / ranking / cards ----------------- */
body.dtt-premium-subpage .dtt-subpage-hero__stat,
body.dtt-subpage-ranking .dtt-ranking-podium::before,
.mkm-badge-tl,
.mkm-card-meta,
.truyen-comic-status,
.translator-card .rank-badge i,
.translator-card .translator-stats,
.translator-card .stat-label,
.story-stats-grid .stat-item,
.story-stats-grid .stat-item i,
.dang-nhap-social-text,
.dang-nhap-social-btn {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

body.dtt-premium-subpage .dtt-subpage-hero__stat strong {
    font-size: 18px !important;
    line-height: 1.12 !important;
}

body.dtt-premium-subpage .mkm-btn-card,
.mkm-btn-card {
    min-height: 38px !important;
    padding: 8px 7px !important;
    font-size: var(--dtt-type-button) !important;
    line-height: 1.25 !important;
}

.mkm-card-title,
.mkm-card p[style*="font-size:14px"],
.mkm-card p[style*="font-size: 14px"] {
    font-size: var(--dtt-type-card-title) !important;
    line-height: 1.45 !important;
}

/* Target the known legacy inline metadata in story cards. */
.mkm-card span[style*="font-size:8px"],
.mkm-card span[style*="font-size:9px"],
.mkm-card span[style*="font-size:10px"],
.mkm-card span[style*="font-size:11px"],
.mkm-card div[style*="font-size:8px"],
.mkm-card div[style*="font-size:9px"],
.mkm-card div[style*="font-size:10px"],
.mkm-card div[style*="font-size:11px"] {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

.mkm-pagination a,
.mkm-pagination span {
    font-size: 14px !important;
    line-height: 1 !important;
}

/* Articles + Wiki ------------------------------------------------------ */
.dtt-article-sync .dtt-post-content,
.dtt-kiem-lai-wiki .dtt-post-content,
.dtt-single-post .entry-content {
    font-size: var(--dtt-type-longform) !important;
    line-height: var(--dtt-leading-longform) !important;
}

.dtt-article-sync .dtt-post-content p,
.dtt-kiem-lai-wiki .dtt-post-content p,
.dtt-single-post .entry-content p {
    margin-bottom: 1.16em;
    line-height: var(--dtt-leading-longform) !important;
}

.dtt-article-sync__back,
.dtt-article-sync__status,
.dtt-article-sync .dtt-post-kicker,
.dtt-article-sync .dtt-post-tags a,
.dtt-article-sync .dtt-related-meta,
.dtt-article-sync .dtt-related-excerpt,
.dtt-article-sync .dtt-related-read,
.dtt-kiem-lai-breadcrumb,
.dtt-kiem-lai-hero__stat span,
.dtt-kiem-lai-wiki .dtt-toc-rail nav[aria-label^="Mục lục"] li,
.dtt-article-sync .dtt-toc-rail nav[aria-label^="Mục lục"] li {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

.dtt-article-sync .dtt-post-meta,
.dtt-article-sync .dtt-post-footer,
.dtt-article-sync .dtt-related-subtitle,
.dtt-article-sync #respond .comment-notes,
.dtt-article-sync #respond .logged-in-as,
.dtt-article-sync #respond .must-log-in,
.dtt-article-sync #respond .comment-form label {
    font-size: 13px !important;
    line-height: var(--dtt-leading-copy) !important;
}

/* Editorial archive / Bài viết hub. */
body.dtt-subpage-articles .dtt-article-hero__eyebrow,
body.dtt-subpage-articles .dtt-article-hero__category,
body.dtt-subpage-articles .dtt-article-hero__meta,
body.dtt-subpage-articles .dtt-article-archive-card__category,
body.dtt-subpage-articles .dtt-article-archive-card__meta,
body.dtt-subpage-articles .dtt-article-sidebar__cat-count,
body.dtt-subpage-articles .dtt-article-sidebar__meta,
body.dtt-subpage-articles .dtt-article-sidebar__meta-cat,
body.dtt-subpage-articles .dtt-article-sidebar__count,
body.dtt-subpage-articles .dtt-article-sidebar__rank,
body.dtt-subpage-articles .dtt-article-sidebar__cta-eyebrow {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

body.dtt-subpage-articles .dtt-article-sidebar__cta-button {
    font-size: var(--dtt-type-button) !important;
    line-height: 1.3 !important;
}

/* Chapter reader: preserve user-selected novel text size; lift chrome. */
.r-mob-nav-item,
.r-mob-nav-center,
.r-mob-nav-center span.chap-progress,
.r-cmt-count,
.r-cmt-date {
    font-size: var(--dtt-type-meta) !important;
    line-height: var(--dtt-leading-meta) !important;
}

.r-nav a,
.r-toc-item,
.r-toc-search,
.r-set-btn,
.r-cmt-form textarea,
.r-cmt-submit,
.r-cmt-text {
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* Footer --------------------------------------------------------------- */
.mkm-footer-brand > p {
    font-size: 14px !important;
    line-height: 1.78 !important;
}

.mkm-footer-trust-copy strong {
    font-size: 13px !important;
    line-height: 1.4 !important;
}

.mkm-footer-trust-copy span,
.mkm-footer-connect-copy,
.mkm-footer-app-label,
.mkm-footer-apps a span,
.mkm-footer-disclaimer p,
.mkm-footer-bottom {
    font-size: var(--dtt-type-meta) !important;
    line-height: 1.6 !important;
}

.mkm-footer-col h4 {
    font-size: 15px !important;
    line-height: 1.35 !important;
}

.mkm-footer-col ul li a,
.mkm-footer-social a,
.mkm-footer-apps a,
.mkm-footer-apps a strong {
    font-size: 13px !important;
    line-height: 1.45 !important;
}

.mkm-footer-col ul li a {
    min-height: 42px !important;
}

@media (min-width: 769px) and (max-width: 1280px) {
    body.dtt-premium-subpage .mkm-nav > a,
    body.dtt-premium-subpage .mkm-nav > button {
        font-size: 13px !important;
    }
}

/* Mobile --------------------------------------------------------------- */
@media (max-width: 768px) {
    body {
        font-size: var(--dtt-type-body-mobile) !important;
        line-height: 1.68;
    }

    .mkm-mobile-menu a {
        font-size: 15px !important;
        line-height: 1.45 !important;
    }

    body.dtt-premium-subpage .mkm-nav > a,
    body.dtt-premium-subpage .mkm-nav > button {
        font-size: 13px !important;
    }

    .dtt-home-section__head p,
    .dtt-home-hero__excerpt,
    .dtt-story-intro,
    .dtt-story-panel__head p {
        font-size: 13px !important;
    }

    .dtt-home-hero__stats strong {
        font-size: 23px !important;
    }

    .dtt-home-hero__stats span {
        max-width: 112px;
        font-size: var(--dtt-type-meta) !important;
        line-height: 1.4 !important;
    }

    .dtt-story-comment__avatar {
        font-size: var(--dtt-type-meta) !important;
    }

    .dtt-story-card__title,
    .dtt-home-editorial-card__body h3,
    .mkm-card-title,
    .mkm-card p[style*="font-size:14px"],
    .mkm-card p[style*="font-size: 14px"] {
        font-size: 14px !important;
    }

    .dtt-story-card__actions a,
    body.dtt-premium-subpage .mkm-btn-card,
    .mkm-btn-card {
        min-height: 38px !important;
        padding-inline: 5px !important;
        font-size: 12px !important;
    }

    .dtt-article-sync .dtt-post-content,
    .dtt-kiem-lai-wiki .dtt-post-content,
    .dtt-single-post .entry-content {
        font-size: var(--dtt-type-longform) !important;
        line-height: 1.82 !important;
    }

    .mkm-footer-brand > p {
        font-size: 13px !important;
    }

    .mkm-footer-col ul li a,
    .mkm-footer-social a,
    .mkm-footer-apps a,
    .mkm-footer-apps a strong {
        font-size: 12.5px !important;
    }
}
