/* style/nh.css */

/* Custom color variables from palette */
:root {
    --nh-bg-color: #08160F; /* Background */
    --nh-card-bg: #11271B; /* Card BG */
    --nh-text-main: #F2FFF6; /* Text Main */
    --nh-text-secondary: #A7D9B8; /* Text Secondary */
    --nh-border-color: #2E7A4E; /* Border */
    --nh-glow-color: #57E38D; /* Glow */
    --nh-gold-color: #F2C14E; /* Gold */
    --nh-divider-color: #1E3A2A; /* Divider */
    --nh-deep-green: #0A4B2C; /* Deep Green */

    /* Button gradient */
    --nh-btn-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
}

/* Base styles for the page content */
.page-nh {
    background-color: var(--nh-bg-color); /* Dark background */
    color: var(--nh-text-main); /* Light text for contrast */
    font-family: 'Arial', sans-serif; /* Example font */
    line-height: 1.6;
    padding-top: 0; /* body already handles padding-top from shared.css */
}

/* Ensure all links inherit text color or use a distinct, contrasting color */
.page-nh a {
    color: var(--nh-gold-color); /* Gold links for visibility */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-nh a:hover {
    color: var(--nh-glow-color);
    text-decoration: underline;
}

/* Section general styles */
.page-nh__hero-section,
.page-nh__intro-section,
.page-nh__features-section,
.page-nh__how-to-play-section,
.page-nh__popular-games-section,
.page-nh__faq-section,
.page-nh__cta-section {
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden; /* Ensure content doesn't overflow */
}

/* Specific section background/text colors based on palette and contrast */
.page-nh__dark-section {
    background-color: var(--nh-bg-color);
    color: var(--nh-text-main);
}

.page-nh__light-bg {
    background-color: var(--nh-card-bg); /* Using card bg for lighter sections */
    color: var(--nh-text-main); /* Still light text as card bg is dark */
}

/* Container for content width limitation */
.page-nh__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Inner padding for containers */
    box-sizing: border-box;
}

/* Hero Section */
.page-nh__hero-section {
    padding: 0; /* Remove default padding as image and content have their own */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align content to start */
    min-height: 500px; /* Minimum height for hero */
    position: relative;
    padding-top: 10px; /* Small top padding, body handles header offset */
    background-color: var(--nh-bg-color); /* Ensure background for the whole section */
}

.page-nh__hero-image-wrapper {
    width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.page-nh__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 500px; /* Limit image height to prevent it from being too large */
    min-height: 300px; /* Minimum height for hero image */
}

.page-nh__hero-content {
    position: relative;
    z-index: 2;
    padding: 40px 20px;
    max-width: 800px;
    margin-top: 40px; /* Add positive margin for spacing below image */
    background: var(--nh-card-bg); /* Use card background for consistency and contrast */
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: var(--nh-text-main);
    box-sizing: border-box;
    width: 100%;
    border: 1px solid var(--nh-border-color); /* Add border for definition */
}

.page-nh__main-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem); /* Responsive font size for H1 */
    font-weight: 700;
    color: var(--nh-gold-color); /* Gold color for main title */
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(87, 227, 141, 0.5); /* Subtle glow */
}

.page-nh__description {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: var(--nh-text-secondary);
}

.page-nh__cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

/* Buttons */
.page-nh__btn-primary,
.page-nh__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box; /* Ensure padding doesn't cause overflow */
    max-width: 100%; /* Ensure buttons adapt to width */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Allow text to break words */
}

.page-nh__btn-primary {
    background: var(--nh-btn-gradient);
    color: var(--nh-text-main); /* Light text on dark/gradient button */
    border: none;
    box-shadow: 0 4px 15px rgba(34, 199, 104, 0.4);
}

.page-nh__btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(34, 199, 104, 0.6);
}

.page-nh__btn-secondary {
    background-color: transparent;
    color: var(--nh-glow-color); /* Glow color for secondary button text */
    border: 2px solid var(--nh-glow-color);
    box-shadow: 0 0 10px rgba(87, 227, 141, 0.3);
}

.page-nh__btn-secondary:hover {
    background-color: var(--nh-glow-color);
    color: var(--nh-bg-color); /* Dark text on glow background */
    box-shadow: 0 0 15px rgba(87, 227, 141, 0.6);
}

/* Section Titles */
.page-nh__section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: var(--nh-gold-color);
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
    display: inline-block; /* To apply border-bottom correctly */
}

.page-nh__section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--nh-glow-color);
    border-radius: 2px;
}

/* Text blocks */
.page-nh__text-block {
    font-size: 1.05rem;
    margin-bottom: 20px;
    color: var(--nh-text-secondary);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Features Grid */
.page-nh__features-grid,
.page-nh__steps-grid,
.page-nh__games-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-nh__feature-card,
.page-nh__step-card,
.page-nh__game-card {
    background-color: var(--nh-card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border: 1px solid var(--nh-border-color);
    color: var(--nh-text-main);
}

.page-nh__feature-card:hover,
.page-nh__step-card:hover,
.page-nh__game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.page-nh__card-image {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 25px;
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

.page-nh__card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--nh-gold-color);
    margin-bottom: 15px;
}

.page-nh__card-text {
    font-size: 1rem;
    color: var(--nh-text-secondary);
    flex-grow: 1; /* Allow text to take up available space */
}

/* How-to-play steps */
.page-nh__step-icon {
    width: 60px;
    height: 60px;
    background: var(--nh-btn-gradient);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--nh-text-main);
    margin-bottom: 25px;
    box-shadow: 0 0 15px rgba(34, 199, 104, 0.5);
}

/* FAQ Section */
.page-nh__faq-list {
    margin-top: 40px;
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-nh__faq-item {
    background-color: var(--nh-card-bg);
    border: 1px solid var(--nh-divider-color);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    color: var(--nh-text-main);
}

.page-nh__faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--nh-gold-color);
    list-style: none; /* Remove default marker */
    position: relative;
    outline: none;
}

.page-nh__faq-item summary::-webkit-details-marker {
    display: none; /* Hide default marker for webkit browsers */
}

.page-nh__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.page-nh__faq-toggle {
    font-size: 1.8rem;
    line-height: 1;
    margin-left: 15px;
    color: var(--nh-glow-color);
    transition: transform 0.3s ease;
}

.page-nh__faq-item[open] .page-nh__faq-toggle {
    transform: rotate(45deg); /* Rotate plus to become cross */
}

.page-nh__faq-answer {
    padding: 0 25px 20px;
    font-size: 1.05rem;
    color: var(--nh-text-secondary);
}

.page-nh__faq-answer p {
    margin: 0;
}

/* CTA Center */
.page-nh__cta-center {
    margin-top: 40px;
}


/* --- Responsive Design --- */

/* Mobile specific styles */
@media (max-width: 768px) {
    .page-nh {
        font-size: 16px;
        line-height: 1.6;
    }

    /* Ensure body padding-top is only from shared, not duplicated here */
    .page-nh__hero-section {
        padding-top: 10px !important; /* Small top padding, body handles header offset */
        min-height: unset;
    }

    .page-nh__hero-image {
        min-height: 200px;
    }

    .page-nh__hero-content {
        padding: 30px 15px;
        margin-top: 30px; /* Adjust positive margin for mobile */
        transform: none; /* Remove transform for mobile */
        width: calc(100% - 30px) !important;
    }

    .page-nh__main-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem); /* Smaller H1 for mobile */
        margin-bottom: 15px;
    }

    .page-nh__description {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .page-nh__cta-buttons {
        flex-direction: column; /* Stack buttons vertically on mobile */
        gap: 15px;
        width: 100%; /* Ensure button container takes full width */
        padding: 0 15px; /* Add padding to button container */
        box-sizing: border-box;
    }

    .page-nh__btn-primary,
    .page-nh__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 20px;
        font-size: 1rem;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-nh__section-title {
        font-size: clamp(1.5rem, 6vw, 2.2rem); /* Smaller section titles */
        margin-bottom: 30px;
    }

    .page-nh__text-block {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .page-nh__features-grid,
    .page-nh__steps-grid,
    .page-nh__games-list {
        grid-template-columns: 1fr; /* Single column layout for cards */
        gap: 20px;
        margin-top: 30px;
    }

    .page-nh__feature-card,
    .page-nh__step-card,
    .page-nh__game-card {
        padding: 20px;
    }

    .page-nh__card-image {
        height: 180px; /* Adjust card image height for mobile */
        min-width: 200px; /* Enforce min size */
        min-height: 200px; /* Enforce min size */
    }

    .page-nh__card-title {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .page-nh__card-text {
        font-size: 0.9rem;
    }

    .page-nh__step-icon {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .page-nh__faq-item summary {
        font-size: 1.1rem;
        padding: 15px 20px;
    }

    .page-nh__faq-answer {
        padding: 0 20px 15px;
        font-size: 0.95rem;
    }

    /* Mobile image responsive adaptation */
    .page-nh img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-nh__section,
    .page-nh__card,
    .page-nh__container,
    .page-nh__hero-section,
    .page-nh__intro-section,
    .page-nh__features-section,
    .page-nh__how-to-play-section,
    .page-nh__popular-games-section,
    .page-nh__faq-section,
    .page-nh__cta-section,
    .page-nh__hero-content,
    .page-nh__hero-image-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        /* Padding for content sections to prevent edge-to-edge content */
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Specific override for sections that might have 0 horizontal padding by default */
    .page-nh__hero-section {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Override padding for .page-nh__container within sections */
    .page-nh__container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Ensure video container also adapts */
    .page-nh video,
    .page-nh__video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-nh__video-section,
    .page-nh__video-container,
    .page-nh__video-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }

    .page-nh__video-section {
        padding-top: 10px !important; /* Small top padding for video section */
    }
}

/* Desktop specific adjustments */
@media (min-width: 769px) {
    .page-nh__hero-content {
        margin-top: 40px;
    }
}