/*
Theme Name: Diễm Ngôn Cố Sự
Theme URI: https://diemngoncosu.com
Author: Diễm Ngôn Cố Sự
Description: Giao diện website đọc truyện Diễm Ngôn Cố Sự
Version: 1.0
Text Domain: diem-ngon-co-su
*/

/* ==============================
   CÀI ĐẶT CHUNG
============================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #0e1828;
    color: #f5f7fb;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}


/* ==============================
   HEADER
============================== */

.site-header {
    width: 100%;
    background: #1d2a3d;
    border-bottom: 1px solid #35445a;
}

.header-inner {
    width: min(1380px, calc(100% - 80px));
    min-height: 112px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    gap: 34px;
}

.site-logo {
    width: 315px;
    flex-shrink: 0;

    display: flex;
    flex-direction: column;
}

.logo-main {
    color: #ffffff;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 900;
}

.logo-sub {
    margin-top: 7px;

    color: #8996a9;
    font-size: 9px;
    letter-spacing: 3px;
    font-weight: 700;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;

    white-space: nowrap;
}

.main-nav a {
    color: #f1f4f8;
    font-size: 15px;
    font-weight: 900;

    transition: 0.2s ease;
}

.main-nav a:hover {
    color: #ff91aa;
}


/* SEARCH */

.header-search {
    width: 260px;
    height: 43px;

    margin-left: auto;

    display: flex;
    align-items: center;

    background: #152033;
    border: 1px solid #405069;
    border-radius: 25px;

    overflow: hidden;
}

.header-search input {
    width: 100%;
    min-width: 0;
    height: 100%;

    padding: 0 5px 0 18px;

    background: transparent;
    border: 0;
    outline: 0;

    color: #ffffff;
    font-size: 14px;
}

.header-search input::placeholder {
    color: #8794a8;
}

.header-search button {
    width: 45px;
    height: 100%;

    flex-shrink: 0;

    background: transparent;
    border: 0;

    color: #aeb9c8;
    font-size: 20px;

    cursor: pointer;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 18px;

    flex-shrink: 0;
}

.user-icon,
.moon-icon {
    color: #e8edf4;
    font-size: 23px;
}


/* ==============================
   TRANG CHỦ
============================== */

.site-main {
    width: min(1380px, calc(100% - 80px));
    margin: 0 auto;

    padding: 15px 0 70px;
}

.home-section {
    margin-bottom: 50px;
}

.section-heading {
    min-height: 58px;

    margin-bottom: 20px;
    padding-bottom: 10px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 2px solid #572137;
}

.section-heading h2 {
    margin: 0;

    color: #ff91aa;

    font-size: 28px;
    font-weight: 900;
}

.section-heading > a {
    color: #ff91aa;

    font-size: 12px;
    font-weight: 900;
}

.green-heading {
    border-bottom-color: #155046;
}

.green-heading h2 {
    color: #64e6bd;
}


/* ==============================
   TRUYỆN HOT THÁNG NÀY
============================== */

.top-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 18px;
}

.top-card {
    min-width: 0;

    overflow: hidden;

    background: #1d2a3d;

    border: 1px solid #37465c;
    border-radius: 13px;

    transition: 0.2s ease;
}

.top-card:hover {
    transform: translateY(-4px);
    border-color: #ff91aa;
}

.cover-wrap {
    position: relative;

    display: block;

    width: 100%;
    height: 300px;

    overflow: hidden;

    background: #182437;
}

.story-cover {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.no-cover {
    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #293b57,
            #111a29
        );

    color: #74839a;

    text-align: center;

    font-size: 18px;
    font-weight: 900;
}

.rank-badge {
    position: absolute;

    top: 0;
    left: 0;

    padding: 8px 14px;

    background: #ff91aa;
    color: #ffffff;

    border-radius: 0 0 10px 0;

    font-size: 11px;
    font-weight: 900;
}

.audio-badge {
    position: absolute;

    top: 0;
    right: 0;

    padding: 8px 11px;

    background: #7168f5;
    color: #ffffff;

    border-radius: 0 0 0 10px;

    font-size: 11px;
    font-weight: 900;
}

.top-info {
    padding: 14px;
}

.top-info h3 {
    min-height: 44px;

    margin: 0 0 8px;

    color: #ffffff;

    font-size: 15px;
    line-height: 1.45;
    font-weight: 900;

    text-transform: uppercase;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

.story-views {
    color: #8997aa;
    font-size: 12px;
}


/* ==============================
   ĐỀ XUẤT HAY
============================== */

.recommended-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.recommend-card {
    min-width: 0;
    min-height: 115px;

    padding: 12px;

    display: flex;
    align-items: center;
    gap: 14px;

    background: #1d2a3d;

    border: 1px solid #37465c;
    border-radius: 12px;

    transition: 0.2s ease;
}

.recommend-card:hover {
    border-color: #64e6bd;
    transform: translateY(-2px);
}

.recommend-cover {
    width: 75px;
    height: 90px;

    flex: 0 0 75px;

    overflow: hidden;

    border-radius: 7px;

    background: #162236;
}

.recommend-cover img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.recommend-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #26364d;

    font-size: 26px;
}

.recommend-info {
    min-width: 0;
    flex: 1;
}

.recommend-info h3 {
    margin: 0 0 6px;

    color: #ffffff;

    font-size: 15px;
    line-height: 1.4;
    font-weight: 900;

    text-transform: uppercase;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recommend-category {
    margin-bottom: 10px;

    color: #8997aa;

    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-tags {
    display: flex;
    align-items: center;
    gap: 7px;

    flex-wrap: wrap;
}

.complete-tag,
.small-audio {
    display: inline-flex;
    align-items: center;

    padding: 4px 9px;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 900;
}

.complete-tag {
    background: #d8f8e7;
    color: #08783f;
}

.small-audio {
    background: #e4e1ff;
    color: #524be0;
}


/* ==============================
   TRUYỆN HOÀN THÀNH
============================== */

.latest-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 18px;
}

.latest-card {
    min-width: 0;

    overflow: hidden;

    background: #1d2a3d;

    border: 1px solid #37465c;
    border-radius: 13px;

    transition: 0.2s ease;
}

.latest-card:hover {
    transform: translateY(-4px);
    border-color: #ff91aa;
}

.latest-cover {
    display: block;

    width: 100%;
    height: 280px;

    overflow: hidden;

    background: #172337;
}

.latest-cover img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.latest-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #293b57,
            #111a29
        );

    color: #728099;

    text-align: center;
    font-weight: 900;
}

.latest-info {
    padding: 13px;
}

.latest-info h3 {
    min-height: 42px;

    margin: 0 0 7px;

    color: #ffffff;

    font-size: 14px;
    line-height: 1.4;
    font-weight: 900;

    text-transform: uppercase;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

.latest-category {
    margin-bottom: 10px;

    color: #8997aa;

    font-size: 11px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ==============================
   TRANG ĐỌC TRUYỆN
============================== */

.single-story-page {
    width: min(1180px, calc(100% - 40px));

    margin: 0 auto;

    padding: 30px 0 70px;
}

.single-story {
    width: 100%;
}


/* BREADCRUMB */

.story-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;

    flex-wrap: wrap;

    margin-bottom: 24px;

    color: #8390a3;

    font-size: 13px;
}

.story-breadcrumb a {
    color: #ff91aa;
    font-weight: 800;
}


/* ==============================
   THÔNG TIN TRUYỆN
============================== */

.story-detail-box {
    display: grid;

    grid-template-columns:
        230px minmax(0, 1fr);

    gap: 35px;

    padding: 28px;

    background: #1d2a3d;

    border: 1px solid #35465d;
    border-radius: 15px;
}

.story-detail-cover {
    width: 230px;
    height: 325px;

    overflow: hidden;

    background: #142033;

    border-radius: 12px;
}

.detail-cover-image {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.detail-no-cover {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #293c59,
            #111a29
        );

    color: #71809a;

    text-align: center;

    font-size: 20px;
    line-height: 1.5;
    font-weight: 900;
}

.story-detail-info {
    min-width: 0;
}

.detail-badge {
    display: inline-flex;

    margin-bottom: 14px;

    padding: 5px 11px;

    background: #7168f5;
    color: #ffffff;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 900;
}

.story-detail-info h1 {
    margin: 0 0 22px;

    color: #ffffff;

    font-size: 32px;
    line-height: 1.3;
    font-weight: 900;
}

.detail-meta {
    margin-bottom: 25px;
}

.detail-meta p {
    margin: 0 0 12px;

    color: #a4afbf;

    font-size: 14px;
}

.detail-meta strong {
    color: #e9edf3;
}

.detail-meta a {
    color: #ff91aa;
}


/* NÚT ĐỌC */

.detail-buttons {
    margin-top: 25px;
}

.read-now-button {
    min-height: 46px;

    padding: 0 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #ff91aa;
    color: #ffffff;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 900;

    transition: 0.2s ease;
}

.read-now-button:hover {
    background: #ff7898;

    transform: translateY(-2px);
}


/* ==============================
   NỘI DUNG ĐỌC TRUYỆN
============================== */

.story-reading-area {
    margin-top: 30px;

    overflow: hidden;

    background: #172337;

    border: 1px solid #35465d;
    border-radius: 15px;
}

.reading-heading {
    padding: 20px 25px;

    display: flex;
    align-items: center;
    gap: 12px;

    background: #1d2a3d;

    border-bottom: 1px solid #35465d;
}

.reading-heading span {
    font-size: 22px;
}

.reading-heading h2 {
    margin: 0;

    color: #ffffff;

    font-size: 21px;
    line-height: 1.4;
}

.story-content {
    max-width: 900px;

    margin: 0 auto;

    padding: 45px 55px 60px;

    color: #d8dee8;

    font-size: 18px;
    line-height: 2;
}

.story-content p {
    margin: 0 0 24px;
}

.story-content h2,
.story-content h3,
.story-content h4 {
    margin: 35px 0 18px;

    color: #ffffff;
}

.story-content a {
    color: #ff91aa;
}

.story-content img {
    max-width: 100%;
    height: auto;

    margin: 25px auto;

    border-radius: 10px;
}


/* TRUYỆN TRƯỚC / TIẾP */

.story-navigation {
    margin-top: 25px;

    display: grid;

    grid-template-columns:
        1fr auto 1fr;

    align-items: center;

    gap: 15px;
}

.story-navigation a {
    min-height: 43px;

    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #1d2a3d;
    color: #dce3ed;

    border: 1px solid #35465d;
    border-radius: 8px;

    font-size: 13px;
    font-weight: 800;

    transition: 0.2s ease;
}

.story-navigation a:hover {
    color: #ffffff;

    background: #25344a;

    border-color: #ff91aa;
}

.previous-story {
    text-align: left;
}

.next-story {
    text-align: right;
}

.back-home {
    white-space: nowrap;
}


/* ==============================
   FOOTER
============================== */

.site-footer {
    margin-top: 40px;

    background: #1d2a3d;

    border-top: 1px solid #35445a;
}

.footer-inner {
    width: min(1380px, calc(100% - 80px));

    min-height: 150px;

    margin: 0 auto;

    padding: 30px 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

.footer-inner strong {
    display: block;

    margin-bottom: 7px;

    color: #ffffff;

    font-size: 21px;
    font-weight: 900;
}

.footer-inner p {
    margin: 0;

    color: #a1adbd;

    font-size: 14px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;

    color: #a1adbd;

    font-size: 13px;
}

.footer-links a {
    color: #ffffff;
}

.footer-links a:hover {
    color: #ff91aa;
}


/* ==============================
   TABLET
============================== */

@media (max-width: 1150px) {

    .header-inner {
        width: calc(100% - 40px);
        flex-wrap: wrap;
        padding: 20px 0;
    }

    .site-logo {
        width: auto;
        margin-right: auto;
    }

    .main-nav {
        order: 3;
        width: 100%;
    }

    .top-grid,
    .latest-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

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


/* ==============================
   MOBILE
============================== */

@media (max-width: 760px) {

    .header-inner {
        width: calc(100% - 24px);

        gap: 18px;

        padding: 18px 0;
    }

    .logo-main {
        font-size: 24px;
    }

    .main-nav {
        gap: 15px;
        flex-wrap: wrap;
    }

    .main-nav a {
        font-size: 12px;
    }

    .header-search {
        order: 4;

        width: 100%;

        margin-left: 0;
    }

    .header-icons {
        margin-left: auto;
    }


    .site-main {
        width: calc(100% - 24px);
    }

    .section-heading h2 {
        font-size: 21px;
    }


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

        gap: 12px;
    }

    .cover-wrap {
        height: 240px;
    }

    .latest-cover {
        height: 230px;
    }


    .recommended-grid {
        grid-template-columns: 1fr;
    }


    /* TRANG ĐỌC */

    .single-story-page {
        width: calc(100% - 24px);

        padding-top: 20px;
    }

    .story-detail-box {
        grid-template-columns: 1fr;

        padding: 18px;

        gap: 22px;
    }

    .story-detail-cover {
        width: 190px;
        height: 270px;

        margin: 0 auto;
    }

    .story-detail-info {
        text-align: center;
    }

    .story-detail-info h1 {
        font-size: 24px;
    }

    .detail-meta {
        text-align: left;
    }

    .story-content {
        padding: 28px 20px 40px;

        font-size: 17px;
        line-height: 1.9;
    }

    .reading-heading {
        padding: 17px;
    }

    .reading-heading h2 {
        font-size: 18px;
    }

    .story-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .back-home {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .previous-story,
    .next-story {
        width: 100%;
    }

    .story-navigation a {
        width: 100%;
    }


    /* FOOTER */

    .footer-inner {
        width: calc(100% - 24px);

        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ==============================
   MOBILE NHỎ
============================== */

@media (max-width: 420px) {

    .top-grid,
    .latest-grid {
        gap: 10px;
    }

    .cover-wrap {
        height: 215px;
    }

    .latest-cover {
        height: 210px;
    }

    .top-info {
        padding: 10px;
    }

    .top-info h3 {
        font-size: 13px;
    }
}