/* =========================================================
   GG Drama - main stylesheet (dark, cinema style)
   Plain CSS on top of Bootstrap 5.3
   ========================================================= */

/* ---------- 1. Colors and fonts in one place ----------
   Change a color here and it changes everywhere.
   (Like a shared constants file in .NET.) */
:root {
    --bg: #0b0d12;          /* page background (almost black) */
    --bg-soft: #141821;     /* cards, navbar when scrolled */
    --bg-softer: #1c2130;   /* hover / input background */
    --line: #262c3a;        /* borders */
    --text: #e9ecf2;        /* main text */
    --text-muted: #9aa3b5;  /* secondary text */
    --accent: #e50914;      /* main red (buttons, highlights) */
    --accent-hover: #ff2a35;
    --gold: #f5c518;        /* small highlights (new / hot badge) */
    --radius: 14px;

    --font-head: "Kanit", sans-serif;
    --font-body: "Noto Sans Thai", sans-serif;
}

/* ---------- 2. Base ---------- */
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
}

h1, h2, h3, h4, h5, .navbar-brand {
    font-family: var(--font-head);
    font-weight: 500;
}

a {
    color: var(--text);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ---------- 3. Navbar ----------
   Transparent over the hero; gets a solid background
   when the page scrolls (class "scrolled" is added by jQuery). */
.gg-navbar {
    background: linear-gradient(to bottom, rgba(11, 13, 18, 0.9), rgba(11, 13, 18, 0));
    transition: background 0.3s;
}

.gg-navbar.scrolled {
    background: rgba(20, 24, 33, 0.97);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.gg-navbar .navbar-brand {
    color: var(--text);
    font-size: 1.5rem;
}

.gg-navbar .navbar-brand span {
    color: var(--accent);
}

/* Logo image next to the "GG Drama" text */
.gg-navbar .navbar-brand img,
.gg-footer-brand img {
    border-radius: 8px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.gg-navbar .nav-link {
    color: var(--text-muted);
    font-family: var(--font-head);
    font-weight: 400;
}

.gg-navbar .nav-link:hover,
.gg-navbar .nav-link.active {
    color: var(--text);
}

/* Search box in the navbar */
.gg-search {
    background: var(--bg-softer);
    border: 1px solid var(--line);
    border-radius: 50px;
    color: var(--text);
    padding: 0.4rem 1rem;
}

.gg-search:focus {
    background: var(--bg-softer);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: none;
}

.gg-search::placeholder {
    color: var(--text-muted);
}

/* ---------- 4. Hero (big banner at the top) ---------- */
.gg-hero {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
}

/* Dark fade over the image so the white text is readable */
.gg-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(11, 13, 18, 0.95) 0%, rgba(11, 13, 18, 0.4) 60%, rgba(11, 13, 18, 0.1) 100%),
        linear-gradient(to top, var(--bg) 0%, rgba(11, 13, 18, 0) 40%);
}

.gg-hero .container-xl {
    position: relative; /* stay above the dark fade */
    padding-bottom: 4rem;
}

.gg-hero h1,
.gg-hero-title {
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    line-height: 1.25;
    max-width: 760px;
}

.gg-hero p {
    color: var(--text-muted);
    max-width: 600px;
}

/* Description: max 3 lines, then "..." */
.gg-hero-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Carousel dots: thin lines at the bottom */
.gg-hero-dots {
    margin-bottom: 1.5rem;
}

.gg-hero-dots [data-bs-target] {
    width: 28px;
    height: 4px;
    border: 0;
    border-radius: 4px;
    background-color: #fff;
    opacity: 0.35;
}

.gg-hero-dots .active {
    background-color: var(--accent);
    opacity: 1;
}

/* Carousel arrows: round buttons, only on bigger screens */
.gg-hero-arrow {
    width: 56px;
    opacity: 0;
    transition: opacity 0.3s;
}

#heroCarousel:hover .gg-hero-arrow {
    opacity: 1;
}

.gg-hero-arrow i {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    font-size: 1.3rem;
}

/* Pages WITHOUT a hero: push content down below the fixed navbar */
.gg-page-top {
    padding-top: 110px;
    min-height: 60vh;
}

/* ---------- 5. Buttons ---------- */
.btn-gg {
    background: var(--accent);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-family: var(--font-head);
    padding: 0.6rem 1.6rem;
}

.btn-gg:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-gg-ghost {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-family: var(--font-head);
    padding: 0.6rem 1.6rem;
}

.btn-gg-ghost:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* Small badges like "ซีรีส์เกาหลี", "ใหม่" */
.gg-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
    padding: 0.15rem 0.6rem;
}

.gg-badge-new {
    background: var(--gold);
    color: #000;
    font-weight: 600;
}

/* ---------- 6. Section titles ---------- */
.gg-section {
    margin-top: 2.5rem;
}

.gg-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gg-section-head h2 {
    font-size: 1.4rem;
    margin: 0;
    padding-left: 0.75rem;
    border-left: 4px solid var(--accent);
}

.gg-section-head a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.gg-section-head a:hover {
    color: var(--accent-hover);
}

/* ---------- 7. Horizontal scrolling row (like Netflix rows) ---------- */
.gg-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.75rem;
}

.gg-row::-webkit-scrollbar {
    height: 6px;
}

.gg-row::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 6px;
}

.gg-row .gg-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

/* ---------- 8. Content card ---------- */
.gg-card {
    display: block;
    color: var(--text);
}

.gg-card-img {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
}

.gg-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

/* Book icon that shows on hover ("read the synopsis") */
.gg-card-img::after {
    content: "\f193"; /* bootstrap icon: book-half */
    font-family: "bootstrap-icons";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.3s;
}

.gg-card:hover .gg-card-img img {
    transform: scale(1.06);
}

.gg-card:hover .gg-card-img::after {
    opacity: 1;
}

.gg-card-img .gg-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 1;
}

.gg-card-title {
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0.6rem 0 0.2rem;
    /* show max 2 lines, then "..." */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gg-card:hover .gg-card-title {
    color: var(--accent-hover);
}

.gg-card-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---------- 9. Tag chips ---------- */
.gg-tag {
    display: inline-block;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0.4rem 0.6rem 0;
    padding: 0.3rem 0.9rem;
    transition: all 0.2s;
}

.gg-tag:hover {
    border-color: var(--accent);
    color: var(--text);
}

/* ---------- 10. Footer ---------- */
.gg-footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4rem;
    padding: 3rem 0 2rem;
}

.gg-footer h5 {
    color: var(--text);
    font-size: 1rem;
}

.gg-footer a {
    color: var(--text-muted);
}

.gg-footer a:hover {
    color: var(--text);
}

.gg-footer .gg-footer-brand {
    color: var(--text);
    font-family: var(--font-head);
    font-size: 1.4rem;
}

.gg-footer .gg-footer-brand span {
    color: var(--accent);
}

/* Link lists: small links that wrap onto several lines */
.gg-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.gg-footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-softer);
    border-radius: 50%;
    font-size: 1.1rem;
}

.gg-footer-social:hover {
    background: var(--accent);
    color: #fff !important;
}

/* ---------- 11. Content page (/page/xxx) ---------- */

/* Top header: the thumbnail as a dark, blurred background */
.gg-page-hero {
    position: relative;
    overflow: hidden;
    padding: 140px 0 3rem;
    background-size: cover;
    background-position: center;
}

/* Darken + blur the image so the title is easy to read */
.gg-page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;          /* same image as the header */
    filter: blur(6px) brightness(0.35);
    transform: scale(1.1);        /* hide blurred edges */
}

.gg-page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg) 0%, rgba(11, 13, 18, 0) 60%);
}

.gg-page-hero .container-xl {
    position: relative;
    z-index: 1;                   /* above the dark layers */
    max-width: 880px;
}

.gg-page-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    line-height: 1.3;
}

.gg-page-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1rem;
}

/* Keep the text column narrow: long lines are hard to read */
.gg-article-wrap {
    max-width: 880px;
    margin: 0 auto;
}

/* Ad box. Only top/bottom margin here: "margin: 1.5rem 0" would also set
   left/right to 0 and break Bootstrap's "margin: auto" centering of
   .container-xl (the footer banner was stuck to the left on desktop). */
.gg-ad {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Center the ad that Google puts inside <ins> (it can be narrower than the box) */
.gg-ad ins.adsbygoogle {
    text-align: center;
}

.gg-ad ins.adsbygoogle iframe {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* The content HTML from the database */
.gg-article {
    font-size: 1.08rem;
    line-height: 1.9;
    margin-top: 1.5rem;
    overflow-wrap: break-word;
}

.gg-article h2,
.gg-article h3,
.gg-article h4 {
    margin: 2rem 0 1rem;
}

.gg-article a {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Images never wider than the screen */
.gg-article img,
.gg-article iframe,
.gg-article video {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.gg-article iframe {
    aspect-ratio: 16 / 9;  /* YouTube embeds */
    width: 100%;
}

/* <div class="video"><iframe ...></iframe></div>
   Same class as the old site (Style.css), used in 137 contents.
   Max 800px wide, 16:9, no border. */
.video {
    max-width: 800px;
    margin: 1.5rem 0;
}

.video iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 10px;
}

.gg-article blockquote {
    background: var(--bg-soft);
    border-left: 4px solid var(--accent);
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.25rem;
}

/* Tables scroll sideways on phones instead of breaking the page */
.gg-article table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.gg-article pre {
    border-radius: 10px;
}

/* Share buttons */
.gg-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.gg-share span {
    margin-right: 0.5rem;
}

.gg-share a,
.gg-share button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    font-size: 1.1rem;
    transition: all 0.2s;
}

.gg-share a:hover,
.gg-share button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---------- 12. List pages (/entertain, /tag/xxx, /search) ---------- */
.gg-list-head {
    margin-bottom: 2rem;
    max-width: 880px;
}

.gg-list-head h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.gg-list-head h1 i {
    color: var(--accent);
}

.gg-list-head p {
    color: var(--text-muted);
}

.gg-list-head small {
    color: var(--text-muted);
}

/* Page numbers */
.gg-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
}

.gg-pagination a,
.gg-pagination span {
    min-width: 42px;
    height: 42px;
    padding: 0 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
}

.gg-pagination a:hover {
    border-color: var(--accent);
    color: var(--text);
}

.gg-pagination .active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* ---------- 13. Cookie banner (bottom of the screen) ---------- */
.gg-cookie {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--bg-softer);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    padding: 0.9rem 1.1rem;
}

.gg-cookie a {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ---------- 14. Hero game page (/hero/Aldric) ---------- */
.gg-hero-head {
    text-align: center;
    margin-bottom: 1rem;
}

.gg-hero-head h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.gg-hero-head p {
    color: var(--text-muted);
}

.gg-hero-pic {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.gg-hero-pic img {
    width: 100%;
    display: block;
}

.gg-hero-level {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: var(--gold);
    border-radius: 8px;
    color: #000;
    font-family: var(--font-head);
    font-weight: 500;
    padding: 0.2rem 0.7rem;
}

.gg-hero-card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.gg-hero-card h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.gg-hero-card h2 i {
    color: var(--accent);
}

.gg-stat {
    margin-bottom: 1rem;
}

/* Progress bar: grey track + colored fill */
.gg-bar {
    height: 10px;
    background: var(--bg-softer);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.gg-bar div {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #b20710, var(--accent-hover));
    border-radius: 10px;
    transition: width 0.4s;
}

.gg-bar-gold div {
    background: linear-gradient(90deg, #c99a06, var(--gold));
}

.gg-stat-box {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
}

.gg-hero-card .gg-stat-box {
    background: var(--bg);
}

.gg-stat-box small {
    display: block;
    color: var(--text-muted);
}

.gg-stat-box strong {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 500;
}

.gg-hero-table {
    --bs-table-bg: transparent;
}

.gg-hero-table th {
    color: var(--text-muted);
    font-weight: 400;
    width: 30%;
}

.gg-skill {
    height: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.gg-skill p {
    color: var(--text-muted);
    margin: 0.3rem 0 0;
}

.gg-skill-ult {
    border-left-color: var(--gold);
}

/* ---------- 15. Phone size ---------- */
@media (max-width: 576px) {
    .gg-hero {
        min-height: 65vh;
    }

    .gg-row .gg-card {
        flex: 0 0 75%;
    }

    /* On phones people swipe, so hide the arrows */
    .gg-hero-arrow {
        display: none;
    }
}
