/*
 Theme Name:   Hoarding Potions Theme
 Description:  Custom Child Theme for HoardingPotions.com
 Author:       You
 Template:     generatepress
 Version:      1.0.1
*/

/* 1. IMPORT FONTS */
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;700&display=swap');

/* 2. VARIABLES */
:root {
    --bg-color: #1a1a1d;       
    --card-bg: #2d2d30;        
    --text-main: #e6e6e6;      
    --text-muted: #a0a0a0;
    --potion-red: #ff4d4d;     
    --potion-blue: #4d94ff;    
    --loot-gold: #ffcc00;
    --potion-gold: #d4af37;      
    --font-pixel: 'Pixelify Sans', sans-serif;
}

/* 3. GLOBAL STYLES */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-pixel);
    letter-spacing: 1px;
    color: var(--text-main);
}

/* 4. NAVIGATION (THE MENU FIX) */
.main-navigation,
.main-navigation ul ul {
    background-color: var(--bg-color) !important; /* Dark background for menu bar */
}

/* Make sure the header itself is also dark */
.site-header {
    background-color: var(--bg-color) !important;
}

/* Menu link styling - more specific selectors */
.main-navigation a,
.main-navigation .main-nav ul li a,
.menu-toggle,
nav.main-navigation a {
    font-family: var(--font-pixel);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1rem;
    color: var(--text-main) !important; /* Forces text to be WHITE/GREY */
}

.main-navigation a:hover,
.main-navigation .main-nav ul li a:hover {
    color: var(--potion-blue) !important; /* Hover becomes Blue */
    background-color: transparent !important;
}

/* 5. DARK MODE CONTENT BOXES (THE WHITE BOX FIX) */
/* We use !important here to override GeneratePress defaults */
.inside-article,
.sidebar .widget,
.comments-area {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
}

/* Footer Styling - Force dark background */
.site-footer,
.site-footer .footer-widgets,
.site-footer .footer-bar,
footer.site-footer {
    background-color: var(--bg-color) !important;
    color: var(--text-main) !important;
}

/* Footer links */
.site-footer a {
    color: var(--text-main) !important;
}

.site-footer a:hover {
    color: var(--potion-blue) !important;
}

/* Footer info bar */
.site-footer .footer-bar,
.footer-bar,
.site-info,
.inside-site-info,
.footer-bar .inside-footer-bar {
    background-color: var(--bg-color) !important;
    color: var(--text-muted) !important;
    border: none !important;
}

.footer-bar a,
.site-info a {
    color: var(--potion-blue) !important;
}

.footer-bar a:hover,
.site-info a:hover {
    color: var(--loot-gold) !important;
}

/* Fix the bright white container wrapper */
.site-content, .container {
    background-color: transparent !important;
}

/* Link Colors inside posts */
.entry-content a {
    color: var(--potion-blue);
    text-decoration: none;
    border-bottom: 1px dashed var(--potion-blue);
}

.entry-content a:hover {
    color: var(--potion-red);
}

/* Post Titles */
h2.entry-title a {
    color: var(--loot-gold) !important;
}
/* =========================================
   7. HEADER LAYOUT (The "Title Screen" Center)
   ========================================= */

/* 1. Stack the Logo and Menu vertically */
.inside-header {
    display: flex !important;
    flex-direction: column; 
    align-items: center;    
    justify-content: center;
    gap: 0px !important; /* Removed the 20px gap */
    padding-bottom: 10px; /* Reduced bottom padding */
}

/* 2. Container for Logo + Text */
.site-branding {
    display: flex !important;
    align-items: center;
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 10px; /* Small buffer before the menu starts */
}
/* 3. Style the Site Title */
.main-title {
    margin: 0 !important;
    line-height: 1;
}

.main-title a {
    font-family: var(--font-pixel);
    color: var(--loot-gold) !important;
    font-size: 2.5rem;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: 3px 3px 0px #000;
}

.main-title a:hover {
    color: #fff !important;
}

/* 4. Center the Tagline */
.site-description {
    font-family: var(--font-pixel);
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
    text-align: center; /* Center the text */
}

/* 5. Force the Menu to Center */
.main-navigation {
    float: none !important; /* Stop it from floating right */
    width: 100%;
    display: flex;
    justify-content: center; /* Center the links */
}

.main-navigation .main-nav > ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 20px; /* Space between menu items */
}
/* =========================================
   8. HOMEPAGE GRID LAYOUT
   ========================================= */

/* Only apply this grid to the blog index/homepage */
.blog .site-main, 
.archive .site-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); /* Auto columns */
    gap: 30px; /* Space between cards */
}

/* Make the cards same height */
.blog .inside-article, 
.archive .inside-article {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #333; /* Subtle border */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover Effect: Lift the card up */
.blog .inside-article:hover, 
.archive .inside-article:hover {
    transform: translateY(-5px);
    box-shadow: 0px 10px 20px rgba(0,0,0,0.5);
    border-color: var(--potion-blue); /* Blue glow on hover */
}

/* Fix the Read More button to stick to bottom */
.entry-summary {
    flex-grow: 1; /* Pushes button down */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
/* Ensure the grid container stretches the items */
.blog .site-main, 
.archive .site-main {
    /* (Keep your existing grid-template-columns line here) */
    align-items: stretch; /* This forces columns to be same height */
}

/* Ensure the card fills that stretched space */
.inside-article {
    /* (Keep your existing grid-area code here) */
    height: 100%; 
    display: grid !important; 
    /* This ensures the footer (meta) pushes to the bottom */
}
/* =========================================
   9. SAFE HOMEPAGE GRID (Does not break Single Posts)
   ========================================= */

/* 1. Define Card Layout ONLY for Homepage/Archives */
.blog .inside-article,
.archive .inside-article {
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto; 
    grid-template-areas: 
        "image"
        "header"
        "content"
        "meta";
    padding: 0 !important;
    border: 1px solid #333;
    height: 100%;
}

/* 2. Image Styles (Homepage Only) */
.blog .post-image, 
.archive .post-image {
    grid-area: image;
    width: 100%;
    margin: 0 !important;
}

.blog .post-image img, 
.archive .post-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* 3. Text Areas (Homepage Only) */
.blog .entry-header, .archive .entry-header {
    grid-area: header;
    padding: 20px 20px 10px 20px;
}

.blog .entry-summary, .archive .entry-summary {
    grid-area: content;
    padding: 0 20px 20px 20px;
}

.blog .entry-meta, .archive .entry-meta {
    grid-area: meta;
    padding: 0 20px 20px 20px;
    margin-top: auto;
}

/* =========================================
   10. METADATA CLEANUP (Global)
   ========================================= */
/* Keep the email hidden everywhere */
.entry-meta .byline {
    display: none !important;
}

.entry-meta .posted-on {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
/* =========================================
   11. SINGLE POST POLISH (The Cinematic Fix)
   ========================================= */

/* 1. Remove padding from the Main Card so image touches edges */
.single .inside-article {
    padding: 0 !important;
    overflow: hidden; /* Keeps sharp corners contained */
    border: 1px solid #333;
}

/* 2. Force the Image to be Massive */
.single .featured-image,
.single .post-image, 
.page-header-image-single {
    margin: 0 !important;
    width: 100% !important;
}

.single .featured-image img,
.single .post-image img, 
.page-header-image-single img {
    width: 100% !important;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-bottom: 2px solid var(--loot-gold); /* A gold border under the image */
}

/* 3. Add Padding back to the Title & Text (So they aren't squished) */
.single .entry-header,
.single .entry-content,
.single .entry-meta,
.single .comments-area {
    padding-left: 40px;
    padding-right: 40px;
}

.single .entry-header {
    padding-top: 30px; /* Space above title */
}

.single .entry-content {
    padding-bottom: 30px;
}

/* 4. Super-Size the Title */
.single .entry-title {
    font-size: 2.5rem;
    color: var(--loot-gold) !important;
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 3px 3px 0px #000;
    line-height: 1.2;
}

/* 5. Center the Date/Meta info */
.single .entry-meta {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

/* 6. Comment Section Styling */
.comments-area {
    background-color: var(--card-bg); /* Ensure it matches */
    padding-top: 20px;
    padding-bottom: 20px;
}

.comment-form input,
.comment-form textarea {
    background-color: #1a1a1d !important;
    color: #fff !important;
    border: 1px solid #555 !important;
    padding: 15px;
    width: 100%;
    font-family: var(--font-pixel);
    box-sizing: border-box; 
}

.form-submit input[type="submit"] {
    background-color: var(--potion-red);
    color: white;
    font-family: var(--font-pixel);
    border: none;
    padding: 10px 30px;
    cursor: pointer;
    text-transform: uppercase;
}
/* =========================================
   12. COMMENT FORM CHECKBOX FIX
   ========================================= */

/* 1. Make the container a flexible row so they sit next to each other */
.comment-form-cookies-consent {
    display: flex;
    align-items: center; /* Vertically center them */
    justify-content: center; /* Center the whole group (optional, remove if you want left align) */
    gap: 10px; /* Space between checkbox and text */
    margin-bottom: 20px;
}

/* 2. Fix the checkbox itself so it doesn't stretch */
.comment-form-cookies-consent input[type="checkbox"] {
    width: auto !important; /* Stop it from being 100% wide */
    margin: 0 !important;
    transform: scale(1.2); /* Make it slightly easier to click */
    cursor: pointer;
}

/* 3. Fix the label text */
.comment-form-cookies-consent label {
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.2;
    text-align: left;
}
/* =========================================
   13. FORCE EQUAL HEIGHT CARDS
   ========================================= */

/* 1. Force the outer wrapper (the invisible column) to stand tall */
.blog .type-post,
.archive .type-post {
    height: 100%;
}

/* 2. Force the inner card (the grey box) to fill that height */
.blog .inside-article,
.archive .inside-article {
    height: 100% !important;
    box-sizing: border-box; /* Ensures padding doesn't add extra height */
    
    /* Ensure the internal layout pushes footer to bottom */
    display: flex;
    flex-direction: column;
}

/* 3. Make the content (text) grow to fill empty space */
/* This pushes the "Leave a Comment" / Tags section to the bottom */
.blog .entry-summary,
.archive .entry-summary {
    flex-grow: 1; 
}
/* =========================================
   14. MOVE DATE ABOVE TITLE (Perfect Alignment Fix)
   ========================================= */

/* 1. Turn the header into a Flex Column and FLIP it */
.blog .entry-header,
.archive .entry-header {
    display: flex;
    flex-direction: column-reverse; /* Date on top */
    gap: 0px !important;            /* Kill gap between them */
    align-items: flex-start;        /* Force everything to the hard left */
}

/* 2. Style the Date (Zeroed Out) */
.blog .entry-header .entry-meta,
.archive .entry-header .entry-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--potion-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    
    /* THE FIXES: */
    margin-left: 0 !important;   /* Force it to the edge */
    padding-left: 0 !important;  /* Remove any hidden padding */
    margin-bottom: 2px !important; /* Tiny space below date, tight to title */
    line-height: 1;              /* Stop it from being tall */
}

/* 3. Style the Title (Zeroed Out) */
.blog .entry-title,
.archive .entry-title {
    margin: 0 !important;        /* Remove all margins */
    padding: 0 !important;       /* Remove all padding */
    line-height: 1.1;            /* Tighten the title lines */
    text-align: left;            /* Ensure it doesn't try to center */
}
/* =========================================
   15. BBPRESS FORUM DARK MODE
   ========================================= */

/* 1. Fix the "Yellow Alert" boxes */
div.bbp-template-notice,
div.indicator-hint {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--loot-gold) !important;
    color: var(--text-main) !important;
    border-radius: 0 !important;
    padding: 15px !important;
}

/* 2. Fix the Search Bar */
#bbpress-forums #bbp-search-form #bbp_search {
    background-color: #1a1a1d !important;
    color: #fff !important;
    border: 1px solid #555 !important;
    padding: 10px;
    font-family: var(--font-pixel);
}

/* 3. Style the Forum List Container */
#bbpress-forums li.bbp-header {
    background-color: var(--card-bg) !important; /* Header of the list */
    border: 1px solid #333 !important;
    color: var(--loot-gold) !important;
    font-family: var(--font-pixel);
    text-transform: uppercase;
}

#bbpress-forums li.bbp-body ul.forum,
#bbpress-forums li.bbp-body ul.topic {
    background-color: transparent !important; /* Remove white stripes */
    border-bottom: 1px solid #333 !important;
}

/* 4. Fix Link Colors in the Forum */
#bbpress-forums a.bbp-forum-title,
#bbpress-forums a.bbp-topic-permalink {
    color: var(--potion-blue) !important;
    font-weight: 700;
    text-decoration: none;
}

#bbpress-forums a.bbp-forum-title:hover {
    color: var(--potion-red) !important;
}

/* 5. Fix Breadcrumbs (Home > Forums) */
.bbp-breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.bbp-breadcrumb a {
    color: var(--potion-blue);
    text-decoration: none;
}
/* =========================================
   16. FORUM STRIPE FIX (The Nuclear Option)
   ========================================= */

/* 1. Target Header AND Footer (The Bars) */
#bbpress-forums .bbp-header,
#bbpress-forums .bbp-footer {
    background-color: transparent !important; /* Kill the white/grey bg */
    border: 1px solid #333 !important;        /* Dark border only */
    color: var(--text-muted) !important;
    padding: 10px !important;
}

/* 2. Target the Body Rows (The Content) */
#bbpress-forums .bbp-body ul.forum, 
#bbpress-forums .bbp-body ul.topic {
    background-color: transparent !important;
    border-left: 1px solid #333; /* Borders to keep structure */
    border-right: 1px solid #333;
}

/* 3. Target Odd/Even Rows (Just in case) */
.bbp-row-odd, 
.bbp-row-even {
    background-color: transparent !important;
}

/* 4. Style the "Search" Button (Keep this, it worked!) */
#bbpress-forums #bbp-search-form #bbp_search_submit {
    background-color: var(--potion-red);
    color: white;
    font-family: var(--font-pixel);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    text-transform: uppercase;
    margin-left: 5px;
}

#bbpress-forums #bbp-search-form #bbp_search_submit:hover {
    transform: scale(1.05);
}
/* ==================================================
   17. BLOG POST TYPOGRAPHY (Readability Fix)
   ================================================== */

/* Target headings inside blog posts only, not the main site title */
.entry-content h2, 
.entry-content h3, 
.entry-content h4 {
    /* Switch to a clean, readable font stack */
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    
    /* Use the Gold color (Replace var if you didn't define it) */
    color: var(--potion-gold, #d4af37) !important; 
    
    font-weight: 700;
    letter-spacing: normal; /* Removes the wide pixel spacing */
    margin-top: 40px;       /* Adds breathing room before new sections */
    margin-bottom: 20px;
}

/* Add a subtle divider under H2s to separate sections */
.entry-content h2 {
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}
/* ==================================================
   18. VERDICT BOX & MOBILE OPTIMIZATION
   ================================================== */

/* 1. The Verdict Box (Desktop Default) */
.hp-verdict-box {
    background: #1a1a1a;
    border: 2px solid var(--potion-gold, #d4af37);
    padding: 30px;
    border-radius: 10px;
    color: #ffffff;
    margin-top: 60px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); /* Adds a nice "pop" */
}

.hp-verdict-title {
    color: var(--potion-gold, #d4af37);
    margin-top: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 2. Mobile Rules (Triggered on screens narrower than 768px) */
@media screen and (max-width: 768px) {
    
    /* Make the box tighter on phones */
    .hp-verdict-box {
        padding: 15px !important;
        margin-top: 30px !important;
        border-width: 1px !important; /* Thinner border looks better on mobile */
    }

    /* Shrink the huge Gold Headers */
    .entry-content h2 {
        font-size: 1.4rem !important; /* Smaller than desktop */
        margin-top: 25px !important;
    }

    /* Ensure images don't overflow */
    .entry-content img {
        max-width: 100%;
        height: auto;
    }
}
/* ==================================================
   19. HOME PAGE CLEANUP
   ================================================== */

/* Make Home Page Post Titles Gold & Readable */
h2.entry-title a, 
h2.post-title a {
    color: var(--potion-gold, #d4af37) !important;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    text-decoration: none;
    font-weight: 700;
}

/* Add a hover effect so users know they are clickable */
h2.entry-title a:hover,
h2.post-title a:hover {
    color: #ffffff !important; /* Turns white on hover */
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6); /* Gold Glow */
}
/* ==================================================
   21. MOBILE HEADER FINAL (Vertical Stack)
   ================================================== */

@media screen and (max-width: 768px) {

    /* --- 1. KILL THE TOP GHOST MENU --- */
    /* This removes the top box with the plain lines */
    #mobile-header,
    .mobile-header-navigation {
        display: none !important;
    }

    /* --- 2. THE STACKING CONTAINER --- */
    /* Forces Chest, Title, and Tagline to sit on top of each other */
    .site-branding,
    .inside-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding-top: 15px !important;
    }

    /* --- 3. FIX THE CHEST LOGO --- */
    .site-logo, 
    .header-image,
    .custom-logo {
        float: none !important;
        display: block !important;
        margin: 0 auto 10px auto !important; /* Space below chest */
        max-width: 80px !important; 
        height: auto !important;
    }

    /* --- 4. FIX THE TITLE (Hoarding Potions) --- */
    .site-title, 
    .main-title,
    .main-title a {
        font-size: 22px !important; /* Small enough to fit, big enough to read */
        line-height: 1.2 !important;
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        margin: 0 0 5px 0 !important; /* Space below title */
        white-space: normal !important; /* Lets it wrap if needed */
    }

    /* --- 5. FIX THE TAGLINE --- */
    /* Moves it to the bottom of the stack */
    .site-description {
        display: block !important;
        float: none !important;
        clear: both !important;
        margin: 0 0 20px 0 !important;
        font-size: 11px !important;
        opacity: 0.8;
        width: 100% !important;
        text-align: center !important;
        position: static !important;
    }

    /* --- 6. CLEAN THE BOTTOM MENU --- */
    #site-navigation, 
    .main-navigation {
        margin-top: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    /* Style the Gold Button */
    button.menu-toggle {
        display: block !important;
        margin: 0 auto 20px auto !important;
        width: auto !important;
        border: 2px solid var(--potion-gold, #d4af37) !important;
        background: transparent !important;
        color: var(--potion-gold, #d4af37) !important;
        text-transform: uppercase;
        font-weight: bold;
        padding: 10px 30px !important;
    }
}
/* =======================
   CATEGORY HEADERS FIX
   ======================= */

.page-header,
.archive-header {
    background: none !important;
    padding: 0 0 15px 0 !important;
    margin-bottom: 30px !important;
    border: none !important;
    border-bottom: 0px solid #ffcc00 !important;
}

.page-title,
.archive-title {
    color: #ffcc00 !important;
    font-family: 'Pixelify Sans', sans-serif !important;
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    background: none !important;
}