/* public/css/style.css */

body, html {
    height: 100%;
    margin: 0;
    background-color: #121212;
    color: #ffffff;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure body takes full viewport height */
}
.main-content-area {
    flex-grow: 1;
    padding: 1rem;
    max-width: 940px; /* Adjusted from 1000px/992px to 940px for FHD split screen support */
    margin: 0 auto; /* Always center content */
    width: 100%;
}
.brand-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4.5rem 1rem 2rem 1rem; /* Increase top padding to align with button bottom */
    transition: opacity 0.3s ease-out;
    max-width: 940px;
    margin: 0 auto;
    width: 100%;
}
.brand-title {
    font-size: 4.5rem; /* Increase from 4rem */
    font-weight: bold;
    margin-bottom: 1rem;
}
.brand-subtitle {
    font-size: 1.1rem;
    color: #a0a0a0;
}
.hamburger-button {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1030;
    background-color: rgba(33, 37, 41, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border */
    padding: 0.5rem; /* Add some padding */
    border-radius: 0.5rem; /* Rounded corners */
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.8em;
    height: 1.8em;
}
.offcanvas {
    background-color: #212529;
    max-width: 300px; /* Fixed max-width for sidebar on all screens */
}
.offcanvas-body .nav-item {
    border-bottom: 1px solid #444; /* Add divider */
}

.offcanvas-body .nav-item:first-child {
    border-top: 1px solid #444; /* Add a top border for the first item */
}

.offcanvas-body .nav-link {
    color: #f8f9fa;
    font-size: 1.2rem;
    padding: 1rem 0.5rem; /* Increase vertical padding */
    transition: background-color 0.2s ease-in-out; /* Add a hover transition */
}

.offcanvas-body .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05); /* Subtle background on hover */
}
.pb-menu-extra {
    padding-bottom: 100px !important; /* Approximately 2 menu items height */
}
.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}
.game-card {
    background-color: #282828;
    border: none;
    color: #ffffff;
    margin-bottom: 1rem;
}
.game-card img {
    height: 150px;
    object-fit: cover;
}
.article-card {
    background-color: #282828;
    border: none;
    color: #ffffff;
    margin-bottom: 1rem;
}
.footer {
    background-color: #121212;
    color: #a0a0a0;
    padding: 0.4rem 1rem; /* Slightly further reduced vertical padding */
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.3; /* Even tighter line height */
    margin-top: auto; 
    width: 100%; 
    max-width: 940px;
    margin: 0 auto;
}

.footer p {
    margin-bottom: 0.1rem; /* Minimum spacing */
}

.footer-links {
    margin-bottom: 0.2rem !important;
}

/* Sticky Footer State (Triggered via body class) */
body.footer-visible .footer {
    position: fixed;
    bottom: 0 !important;
    left: 0;
    right: 0;
    margin: 0 auto; /* Center horizontally */
    z-index: 1050 !important; /* Above content */
    background-color: rgba(18, 18, 18, 0.95); /* Slightly transparent */
    backdrop-filter: blur(5px);
    border-top: 1px solid #333;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    border-radius: 10px 10px 0 0; /* Rounded top corners */
    width: 940px; /* Match layout width */
    max-width: 100%; /* For mobile safety */
    animation: slideUpFooter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; /* Smooth ease-out */
}

@keyframes slideUpFooter {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
    .brand-title {
        font-size: 5rem;
    }
    .brand-subtitle {
        font-size: 1.25rem;
    }
    .section-title {
        font-size: 2rem;
    }
    .game-card img {
        height: 200px;
    }
    .row-cols-md-2 > * {
        flex: 0 0 auto;
        width: 50%;
    }
}

@media (min-width: 992px) {
    .row-cols-lg-3 > * {
        flex: 0 0 auto;
        width: 33.33333333%;
    }
}

/* Styles for the small fixed header */
.small-fixed-header {
    position: fixed;
    top: -100px; /* Start off-screen */
    left: 0;
    width: 100%;
    background-color: rgba(18, 18, 18, 0.9); /* Semi-transparent dark background */
    backdrop-filter: blur(5px); /* Frosted glass effect */
    padding: 0.2rem 1rem;
    z-index: 1020; /* Below the sidebar hamburger, above content */
    border-bottom: 1px solid #333;
    transition: top 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.small-brand-title {
    font-size: 3rem;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
}

/* --- Scroll Behavior --- */

/* When scrolled, show the small header by moving it into view */
body.scrolled .small-fixed-header {
    top: 0;
}

/* When scrolled, hide the large header by reducing its height and fading it out */
body.scrolled .brand-section {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* Custom Tab Styles */
.nav-tabs {
    border-bottom: 1px solid #444;
}

.nav-tabs .nav-link {
    background-color: transparent;
    border: 1px solid transparent;
    color: #a0a0a0;
}

.nav-tabs .nav-link.active {
    background-color: #282828;
    border-color: #444 #444 #282828;
    color: #ffffff;
    font-weight: bold;
}

.nav-tabs .nav-link:hover {
    border-color: #444;
    color: #ffffff;
}

.tab-content {
    background-color: #282828;
    padding: 1rem;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
}

.list-group-item {
    background-color: #333;
    color: #fff;
    border-color: #444;
}

.list-group-item-action:hover, .list-group-item-action:focus {
    background-color: #444;
    color: #fff;
}

/* Strategy Page Article List */
.strategy-article-item {
  margin-bottom: 1.5rem; /* Add space between articles */
  border-radius: 0.5rem !important; /* Softer corners, !important to override bootstrap */
  border: 1px solid #444; /* A subtle border */
  padding: 1.5rem; /* More padding */
}

.strategy-article-item:last-child {
    margin-bottom: 0;
}

.strategy-article-item p {
  line-height: 1.6; /* Increase line height for the paragraph */
  color: #ccc; /* Slightly lighter text color for the snippet */
  font-size: 0.95rem;
}

.strategy-article-item h5 {
    color: #fff;
    font-weight: bold;
}

.strategy-article-item small {
    color: #aaa;
}

/* Footer Links */
.footer-links a {
    color: #adb5bd; /* A lighter gray color */
    text-decoration: none;
    font-size: 0.9em;
    margin: 0 10px;
}

.footer-links a:hover {
    color: #ffffff; /* White on hover */
    text-decoration: underline;
}

div.cpad-mt {
    margin-top: 1.5rem;
}

div.cpad-mb {
    margin-bottom: 1.5rem;
}

div.cpad-h140 {
    height: 140px;
}

div.cpad-h70 {
    height: 70px;
}

/* Custom background for article details */
.bg-article-detail {
    background-color: #e8e9ea !important;
    color: #212529 !important;
}

.border-article-detail {
    border-color: #bcbcbc !important;
}

.bg-taboola-below {
    background-color: #e8e9ea !important;
    border-radius: 0 0 12px 12px; /* 하단 모서리 둥글게 */
}

/* Right Rail Ad Sidebar (Default Hidden) */
#right-rail-wrapper {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 250px;
    padding: 1rem;
    padding-top: 20rem; /* Increased to align with content */
    z-index: 900;
    overflow: hidden; /* Removed scrollbar */
    border-left: 1px solid #333;
    background-color: #121212;
}

#right-rail-wrapper .bg-taboola-below {
    border-radius: 0 !important; /* Remove radius in sidebar */
}

/* 
   WIDE SCREEN LAYOUT (Min-width: 1440px)
   - Layout Width: 250px (Menu) + 940px (Content) + 250px (Ad) = 1440px
   - All elements are centered together via layout-wrapper
*/
@media (min-width: 1440px) {
    /* Hide Hamburger */
    .hamburger-button {
        display: none; 
    }

    /* Hide Close Button in Sidebar */
    #sidebarMenu .btn-close {
        display: none; 
    }

    /* Layout Wrapper */
    .layout-wrapper {
        display: flex;
        justify-content: flex-start; /* Align start to respect the grid columns */
        align-items: flex-start; 
        width: 1440px; /* Fixed width to ensure perfect grid alignment */
        margin: 0 auto;
        position: relative;
    }

    /* Sidebar (Sticky) */
    #sidebarMenu.offcanvas-start {
        position: sticky;
        top: 0; /* Default sticky position (respects margin-top) */
        bottom: auto;
        left: auto;
        width: 250px;
        min-width: 250px; /* Prevent shrink */
        margin-top: 3rem; /* Visual offset from top */
        transform: none !important;
        visibility: visible !important;
        border-right: 1px solid #333;
        z-index: 1000;
        height: auto;
        align-self: flex-start; /* Ensure natural height for sticky */
        background-color: #212529; /* Restore background color */
    }
    
    /* Ensure content doesn't have auto margin interfering with flex */
    .main-content-area {
        margin: 0;
        width: 940px;
        /* Flex item behavior */
        flex-shrink: 0; 
    }

    /* Show Right Rail (Fixed, Centered Right) */
    /* Note: Right Rail is currently outside the layout-wrapper in HTML usually, or absolute. 
       If it is absolute/fixed, it stays as is. */
    #right-rail-wrapper {
        display: block;
        right: calc(50% - 720px); /* Center - (1440 / 2) */
        border-left: 1px solid #333;
        padding-top: 7rem; /* Reduced from 20rem */
    }
    
    /* Adjust Small Header to fit exactly over content */
    .small-fixed-header {
        left: calc(50% - 470px); /* Center - (940 / 2) */
        width: 940px;
        margin-left: 0;
    }
}
/* Dynamic Ad Style */
.ad-wrapper {
    transition: opacity 0.3s ease, padding 0.3s ease;
    background-color: transparent;
}

.ad-wrapper.visible {
    background-color: #e8e9ea !important;
    padding: 0.5rem; /* p-2 equivalent */
    border-radius: 12px;
}
