/*!
 * STORY theme v1.0.0 — animelovestory.com
 * หน้าตาแบบ Anime Love Story: พื้นลายชมพู, แบนเนอร์ส่วนหัว, การ์ดหัวไล่สีฟ้า-ชมพู, โปสเตอร์กรอบเส้นประ
 */

:root,
[data-bs-theme] {
    --st-pink: #ffc0cb;
    --st-pink-soft: #fcd3e5;
    --st-pink-bg: #ffe5ef;
    --st-pink-ring: #ffd6e6;
    --st-pink-deep: #e8608a;
    --st-rose: #e68481;
    --st-blue: #2196f3;
    --st-sky: #00c2ff;
    --st-sky-glow: #2cafec;
    --st-text: #4a4a5e;
    --st-muted: #8a8aa0;
    --st-radius: 16px;
    --st-font: "Varela Round", "Itim", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --bs-body-bg: #fff;
    --bs-body-color: var(--st-text);
    --bs-emphasis-color: #222;
    --bs-secondary-color: var(--st-muted);
    --bs-border-color: #f3d9e4;
    --bs-link-color: var(--st-blue);
    --bs-link-color-rgb: 33, 150, 243;
    --bs-link-hover-color: var(--st-pink-deep);
    --bs-link-hover-color-rgb: 232, 96, 138;
    --bs-tertiary-bg: #fff6f9;
    color-scheme: light;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--st-font);
    color: var(--st-text);
    background: #fff url(../img/bgBodyL.jpg) repeat center top;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--st-blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--st-pink-deep); }

h1, h2, h3, h4, h5, h6 { font-family: var(--st-font); font-weight: 400; }

img { vertical-align: middle; }

.story-muted { color: var(--st-muted) !important; }

/* ---------- Header / Logo ---------- */
.story-header {
    padding: 15px 0;
    background: #fff url(../img/header.jpg) center center / cover no-repeat;
}
.story-logo { display: inline-block; }
.story-logo img {
    max-width: 100%;
    max-height: 150px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(232, 96, 138, .25));
    transition: transform .25s ease;
}
.story-logo:hover img { transform: scale(1.03) rotate(-1deg); }

/* ---------- Navbar ---------- */
.story-nav {
    position: sticky;
    top: 0;
    z-index: 1020;
    font-size: 14px;
    padding: .4rem 0;
    background-image: linear-gradient(180deg, var(--st-rose) 0%, #f2a1b4 100%);
    box-shadow: 0 1px 2px rgba(255, 255, 255, .3), 0 4px 14px rgba(230, 132, 129, .25);
}
.story-nav .navbar-brand { font-size: 1rem; color: #fff; }
.story-nav .nav-link {
    color: #fff !important;
    border-radius: 999px;
    padding: .45rem .9rem !important;
    transition: background-color .15s ease;
}
.story-nav .nav-link:hover,
.story-nav .nav-link.active,
.story-nav .nav-link.show { background-color: rgba(255, 255, 255, .22); }
.story-nav .nav-link i { margin-right: 3px; }
.story-nav .navbar-toggler { border-color: rgba(255, 255, 255, .6); }
.story-nav .dropdown-menu {
    border: 0;
    border-radius: 12px;
    padding: .4rem;
    box-shadow: 0 6px 20px rgba(230, 132, 129, .3);
}
.story-nav .dropdown-item { border-radius: 8px; color: var(--st-text); font-size: 14px; }
.story-nav .dropdown-item:hover { background: var(--st-pink-bg); color: var(--st-pink-deep); }
.mainmenu.sticky { box-shadow: 0 6px 18px rgba(230, 132, 129, .4); }

@media (max-width: 991.98px) {
    .story-nav .navbar-collapse { padding: .5rem 0; }
}

/* ---------- Announce / ads ---------- */
.story-announce {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    padding: 8px 18px;
    box-shadow: 0 0 5px var(--st-sky-glow);
    color: var(--st-pink-deep);
    overflow: hidden;
}
.story-announce__text { white-space: nowrap; overflow-x: auto; font-size: 14px; }
.ad-zone .item { margin-bottom: .5rem; text-align: center; }
.ad-zone img { max-width: 100%; border-radius: 10px; }

/* ---------- Breadcrumb ---------- */
.story-main { padding-top: 6px; flex: 1 0 auto; }
.story-breadcrumb {
    padding: 12px 4px;
    font-size: 14px;
    color: var(--st-muted);
}
.story-breadcrumb a { color: var(--st-blue); }
.story-breadcrumb .sep { margin: 0 8px; color: var(--st-pink); }
.story-breadcrumb [aria-current] { color: var(--st-text); }

/* ---------- Cards ---------- */
.story-card {
    border: 0;
    border-radius: var(--st-radius);
    box-shadow: 0 0 5px var(--st-sky-glow);
    background: #fff;
}
.story-card > .card-header {
    border: 0;
    padding: .65rem 1rem;
    border-top-left-radius: var(--st-radius);
    border-top-right-radius: var(--st-radius);
    background-color: var(--st-blue);
    background-image: linear-gradient(-225deg, var(--st-sky) 0%, #e9f8f7 56%, #ffbac3 100%);
}
.story-card--inner { box-shadow: 0 0 4px rgba(44, 175, 236, .7); }
.story-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #2f3d5c;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}
.story-title i { color: #fff; text-shadow: 0 0 4px rgba(0, 120, 200, .6); margin-right: 2px; }
.story-title small { font-size: 85%; color: #5a6a8a; }
.story-title a { color: inherit; }
.story-title a:hover { color: var(--st-pink-deep); }
.story-title__ep { color: var(--st-pink-deep); margin-left: 6px; }
.story-title-lg { font-size: 1.25rem; color: var(--st-text); }

/* ---------- Poster (เรื่อง) ---------- */
.poster { position: relative; }
.poster__link { position: relative; display: block; color: inherit; }
.poster__link:hover { color: inherit; }

.poster.post .poster_image {
    padding: 2px;
    background-color: var(--st-pink-soft);
    border: 1px dashed #fff;
    box-shadow: var(--st-pink-soft) 0 0 0 2px;
    border-radius: 28px;
    overflow: hidden;
    transition: box-shadow .2s ease-in-out;
}
.poster.post .poster_image img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 26px;
    background: #fff;
    transition: transform .25s ease;
}
.poster.post .title {
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 3px;
    height: 36px;
    padding: 0 8px;
    text-align: center;
    color: #fff;
    font-size: 12px;
    line-height: 1.25;
    border-radius: 0 0 26px 26px;
    background: rgba(255, 192, 203, .92);
    text-shadow: 0 1px 1px rgba(200, 80, 120, .45);
    overflow: hidden;
    transition: opacity .2s ease;
}
.poster.post .title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    padding-top: 4px;
}
.poster.post .ribbon-right {
    position: absolute;
    left: 3px;
    bottom: 39px;
    padding: 3px 6px;
    font-size: 12px;
    line-height: 1.3;
    color: #fff;
    background-color: rgba(0, 194, 255, .75);
    max-width: 70%;
    white-space: nowrap;
    transition: opacity .2s ease;
}
.poster.post .ribbon-right::after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: 0;
    border-left: 22px solid rgba(0, 194, 255, .75);
    border-top: 22px solid transparent;
}
.poster.post .ribbon-left {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 1px 8px;
    font-size: 11px;
    border-radius: 999px;
    color: #fff;
    background: rgba(232, 96, 138, .85);
    transition: opacity .2s ease;
}
.poster.post .ribbon-left:empty,
.poster.post .ribbon-right:empty { display: none; }
.ribbon-top {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 1px 8px;
    font-size: 11px;
    border-radius: 999px;
    color: #fff;
    background: #ff5151;
    box-shadow: 0 2px 6px rgba(255, 81, 81, .45);
}
.poster.post:hover .poster_image { box-shadow: var(--st-sky) 0 0 0 2px, 0 4px 14px rgba(44, 175, 236, .35); }
.poster.post:hover .poster_image img { transform: scale(1.07); }
.poster.post:hover .title,
.poster.post:hover .ribbon-right,
.poster.post:hover .ribbon-left { opacity: 0; }

/* ---------- Poster (ตอน) ---------- */
.poster.episode .poster_image {
    position: relative;
    padding: 2px;
    background-color: var(--st-pink-soft);
    border: 1px dashed #fff;
    box-shadow: var(--st-pink-soft) 0 0 0 2px;
    border-radius: 18px;
    overflow: hidden;
}
.poster.episode .poster_image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 16px;
    background: #fff;
    transition: transform .25s ease;
}
.poster.episode .poster_image .placeholder { display: block; aspect-ratio: 16 / 9; border-radius: 16px; }
.poster.episode .poster__ep {
    position: absolute;
    left: 2px;
    bottom: 2px;
    padding: 3px 10px;
    font-size: 12px;
    color: #fff;
    background-color: rgba(0, 194, 255, .8);
    border-radius: 0 12px 0 16px;
}
.poster.episode .poster__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 81, 81, .9);
    opacity: 0;
    transform: scale(.6);
    transition: all .2s ease;
}
.poster.episode .poster__title { padding: 8px 4px 0; text-align: center; line-height: 1.3; }
.poster.episode .title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    color: var(--st-text);
}
.poster.episode .poster__cate { display: block; font-size: 12px; color: var(--st-pink-deep); }
.poster.episode:hover .poster_image { box-shadow: var(--st-sky) 0 0 0 2px; }
.poster.episode:hover .poster_image img { transform: scale(1.06); }
.poster.episode:hover .poster__play { opacity: 1; transform: scale(1); }
.poster.episode:hover .title { color: var(--st-pink-deep); }

/* ---------- Trending row ---------- */
.story-trend-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 4px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--st-pink) transparent;
}
.story-trend {
    flex: 0 0 118px;
    width: 118px;
    min-width: 0;
    scroll-snap-align: start;
    text-align: center;
    color: var(--st-text);
}
.story-trend img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 18px;
    padding: 2px;
    background: var(--st-pink-soft);
    border: 1px dashed #fff;
    box-shadow: var(--st-pink-soft) 0 0 0 2px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.story-trend:hover img { transform: translateY(-3px); box-shadow: var(--st-sky) 0 0 0 2px; }
.story-trend__title {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.story-trend__type { display: block; font-size: 11px; color: var(--st-pink-deep); }

/* ---------- Slider ---------- */
.story-slider { border-radius: 12px; overflow: hidden; }
.story-slider img { aspect-ratio: 16 / 7; object-fit: cover; }
.story-slider .carousel-caption {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 16px 26px;
    text-align: left;
    background: linear-gradient(transparent, rgba(232, 96, 138, .75));
}
.story-slider .carousel-caption p { font-size: 1.1rem; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.story-slider .carousel-indicators { margin-bottom: .4rem; }

/* ---------- Sidebar ---------- */
.story-list .list-group-item {
    border: 0;
    border-radius: 10px !important;
    margin-bottom: 2px;
    padding: .45rem .75rem;
    font-size: 14px;
    color: var(--st-text);
    background: transparent;
}
.story-list .list-group-item:hover { background: var(--st-pink-bg); color: var(--st-pink-deep); }
.story-hit { display: flex !important; align-items: center; gap: 10px; }
.story-hit__img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--st-pink);
}
.story-hit__body { min-width: 0; }
.story-hit__title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-hit small { color: var(--st-muted); }
.story-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.story-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 999px;
    color: #fff;
    background: var(--st-blue);
    transition: background-color .15s ease;
}
.story-tag:hover { color: #fff; background: var(--st-pink-deep); }
.story-social {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
}
.story-social:last-child { margin-bottom: 0; }
.story-social i { font-size: 1.3rem; }
.story-social:hover { filter: brightness(1.08); }

/* ---------- Info box ---------- */
.story-cover {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 28px;
    padding: 2px;
    background: #fff;
    box-shadow: 0 0 10px hsla(199, 67%, 50%, .7);
}
.story-tabs { border-bottom-color: var(--st-pink-ring); }
.story-tabs .nav-link {
    border: 0;
    border-radius: 10px 10px 0 0;
    color: var(--st-muted);
    font-size: 14px;
    padding: .45rem .8rem;
}
.story-tabs .nav-link:hover { color: var(--st-pink-deep); }
.story-tabs .nav-link.active {
    color: var(--st-pink-deep);
    background: var(--st-pink-bg);
    box-shadow: inset 0 -2px 0 var(--st-pink-deep);
}
.story-summary { max-height: 220px; overflow-y: auto; font-size: 14px; line-height: 1.75; padding: 2px 4px; }
.story-subtitle { color: var(--st-pink-deep); margin-bottom: .4rem; }
.story-meta > div { padding: 4px 0; font-size: 14px; }
.story-meta .badge { width: 26px; margin-right: 4px; }
.story-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.story-labels { font-size: 13px; color: var(--st-muted); }
.story-labels a {
    display: inline-block;
    margin: 2px;
    padding: 1px 8px;
    border-radius: 4px;
    background: var(--st-blue);
    color: #fff;
}
.story-labels a:hover { background: var(--st-pink-deep); color: #fff; }

/* ---------- Buttons ---------- */
.story-btn,
.story-btn:focus {
    color: #fff;
    background: var(--st-blue);
    border: 0;
    border-radius: 999px;
    padding: .45rem 1.1rem;
    box-shadow: 0 2px 6px rgba(33, 150, 243, .35);
}
.story-btn:hover { color: #fff; background: var(--st-pink-deep); }
.story-btn-outline {
    color: var(--st-pink-deep);
    background: #fff;
    border: 1px solid var(--st-pink);
    border-radius: 999px;
    padding: .4rem 1rem;
}
.story-btn-outline:hover,
.story-btn-outline.active { color: #fff; background: var(--st-pink-deep); border-color: var(--st-pink-deep); }
.btn.btn-danger, .btn.btn-warning { border-radius: 999px; padding: .45rem 1.1rem; }
.btn.btn-warning { color: #fff; }
#load-more { min-width: 220px; }

/* ---------- WATCH ONLINE box ---------- */
.watch {
    position: relative;
    margin: 25px 7px 7px;
    padding-top: 6px;
    background: var(--st-pink-bg);
    border: 2px dashed #fff;
    border-radius: 6px;
    box-shadow: 0 0 0 5px var(--st-pink-ring);
}
.watch--plain { margin-top: 7px; }
.watch-title,
.watch-view {
    position: absolute;
    top: -16px;
    z-index: 1;
}
.watch-title { left: 5px; }
.watch-view { right: 5px; }
.watch-title span,
.watch-view span {
    display: inline-block;
    font-size: .85em;
    letter-spacing: normal;
    padding: 4px 14px 4px 30px;
    color: #fff;
    border-radius: 4px;
    background: #16adff url(../img/play.png) no-repeat 6px center / 18px 18px;
    white-space: nowrap;
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
.watch-view span { background-image: url(../img/view.png); }
.watch-ul { margin: 14px 6px 6px; }
.watch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px;
}
.watch-li {
    display: flex;
    align-items: center;
    min-height: 30px;
    background: #fff;
    border-radius: 4px;
    color: #16a402;
    font-size: 14px;
    overflow: hidden;
    transition: background-color .15s ease;
}
.watch-li:hover { background: #fff6d6; color: #0e7d00; }
.watch-li.active { background: var(--st-pink-deep); color: #fff; }
.watch-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border-radius: 4px;
    background: #ff5151 url(../img/play.png) no-repeat center / 18px;
}
.watch-li.active .watch-icon { background-color: #16adff; }
.watch-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.ep-btn { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.btn-season {
    font-size: 13px;
    padding: .25rem .8rem;
    border-radius: 999px;
    color: var(--st-pink-deep);
    background: #fff;
    border: 1px solid var(--st-pink);
}
.btn-season.active,
.btn-season:hover { color: #fff; background: var(--st-pink-deep); border-color: var(--st-pink-deep); }

/* ---------- Player ---------- */
.story-player-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.btn-player {
    border: 0;
    border-radius: 6px 6px 0 0;
    padding: .4rem .9rem;
    font-size: 14px;
    color: #ff5b5b;
    background: rgba(255, 255, 255, .7);
    font-family: var(--st-font);
}
.btn-player:hover { background: #fff; }
.btn-player.current { color: #fff; background: #ff5b5b; }
.story-player { border-radius: 8px; overflow: hidden; background: #000; }
.story-player iframe { border: 0; }
.story-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ---------- Search / filter ---------- */
.story-search { position: relative; }
.story-search > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--st-pink-deep);
}
.story-search .form-control {
    padding: .7rem 1rem .7rem 2.6rem;
    border-radius: 999px;
    border: 2px solid var(--st-pink-ring);
}
.story-search .form-control:focus,
.story-filter .form-select:focus {
    border-color: var(--st-pink);
    box-shadow: 0 0 0 .2rem rgba(255, 192, 203, .45);
}
.story-filter .form-select { border-radius: 12px; border-color: var(--st-pink-ring); }
.story-filter .form-floating > label { color: var(--st-muted); }
.story-search-result .col-lg-2 { flex: 0 0 auto; }
#searchshow { color: var(--st-pink-deep); }

/* ---------- Pagination ---------- */
.pagination { gap: 4px; flex-wrap: wrap; justify-content: center; }
.pagination .page-link {
    border: 0;
    border-radius: 999px !important;
    min-width: 38px;
    text-align: center;
    color: var(--st-pink-deep);
    background: #fff;
    box-shadow: 0 0 4px rgba(44, 175, 236, .6);
}
.pagination .page-link:hover { color: #fff; background: var(--st-pink); }
.pagination .page-item.active .page-link { color: #fff; background: var(--st-blue); }
.pagination .page-item.dot .page-link { box-shadow: none; background: transparent; }

/* ---------- Blog / 404 ---------- */
.story-blog { line-height: 1.8; }
.story-blog img { max-width: 100%; height: auto; border-radius: 10px; }
.story-404 {
    font-size: 6rem;
    line-height: 1;
    color: var(--st-pink);
    text-shadow: 3px 3px 0 var(--st-sky), 6px 6px 0 var(--st-pink-ring);
    margin-bottom: 1rem;
}

/* ---------- Modal ---------- */
.story-modal .modal-content { border: 0; border-radius: var(--st-radius); overflow: hidden; }
.story-modal .modal-header {
    color: #fff;
    border: 0;
    background-image: linear-gradient(-225deg, var(--st-sky) 0%, #ff9fb3 100%);
}

/* ---------- Footer ---------- */
.story-footer-text {
    padding: 1rem 1.25rem;
    font-size: 13px;
    color: var(--st-muted);
    background: rgba(255, 255, 255, .85);
    border-radius: var(--st-radius);
}
.story-footer {
    margin-top: 1.5rem;
    padding: 18px 0;
    font-size: 14px;
    color: #4d5f7a;
    box-shadow: 0 0 10px #75ddfb;
    background-color: #fff;
    background-image: linear-gradient(rgba(0, 194, 255, .32), #daf8f8 60%, rgba(252, 195, 203, .36));
}
.story-footer__name { font-size: 15px; color: #2f3d5c; }
.story-footer__desc { font-size: 13px; color: var(--st-muted); }
.story-footer__copy {
    display: inline-block;
    padding: 2px 12px;
    font-size: 12px;
    border-radius: 999px;
    color: #fff;
    background: var(--st-blue);
}

/* ---------- Floating ads ---------- */
.ads-fixed { position: fixed; z-index: 1030; max-width: 160px; }
.ads-fixed img { max-width: 100%; }
.ads-left { left: 6px; top: 30%; }
.ads-right { right: 6px; top: 30%; }
.ads-bottom { left: 50%; bottom: 0; transform: translateX(-50%); max-width: 728px; width: 100%; }
.ads-close { cursor: pointer; font-size: 12px; background: #fff; border-radius: 6px 6px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .story-sidebar { margin-top: .5rem; }
}
@media (max-width: 767.98px) {
    .story-header { padding: 10px 0; background-image: url(../img/bg_02.png); background-size: auto; background-repeat: repeat; }
    .story-logo img { max-height: 110px; }
    .story-cover { max-width: 200px; }
    .story-slider img { aspect-ratio: 16 / 9; }
    .watch-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .ads-left, .ads-right { display: none; }
}
@media (max-width: 480px) {
    .story-logo img { max-height: 84px; }
    .story-card > .card-body { padding: .75rem; }
    .poster.post .title { font-size: 11px; }
}
