/*
Theme Name: Prompt Gallery
Theme URI: https://example.com/prompt-gallery-theme
Author: Gemini
Author URI: https://gemini.google.com/
Description: A dark, modern gallery theme for displaying AI prompts or other visual content, based on user-provided screenshots.
Version: 2.0.6
Requires at least: 5.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: prompt-gallery
Tags: custom-background, post-formats, theme-options, threaded-comments, translation-ready, dark, gallery, portfolio

This theme is licensed under the GNU GPL v2.
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Generic & Helpers
# Layout
# Header
  ## Site Branding
  ## Navigation Menus
  ## Search Form
# Content
  ## Gallery Grid (Homepage, Archives)
  ## Post Card
  ## Single Post View
  ## Page View (About, Contact, etc.)
# Footer
# Media Queries
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Generic & Helpers
--------------------------------------------------------------*/
:root {
    --background-color: #121826;
    --card-background: #1e293b;
    --text-color: #cbd5e1;
    --heading-color: #ffffff;
    --accent-color: #9333ea;
    --accent-hover: #a855f7;
    --border-color: #334155;
    --subtle-text: #94a3b8;
    --pink-accent: #ec4899;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-weight: 600;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/*--------------------------------------------------------------
# Layout
--------------------------------------------------------------*/
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}


/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
.site-header {
    text-align: center;
    padding: 40px 20px 20px;
}

/* ## Site Branding */
.site-branding {
    margin-bottom: 2rem;
}

.site-title {
    font-size: 2.8rem;
    margin: 0 0 10px;
}

.site-title a {
    text-decoration: none;
    background: linear-gradient(to right, var(--accent-hover), var(--pink-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.site-description {
    font-size: 1.1rem;
    color: var(--subtle-text);
    max-width: 500px;
    margin: 0 auto;
}

/* ## Navigation Menus */
.main-navigation {
    margin-bottom: 2rem;
}
.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1rem;
}
.primary-menu a {
    color: var(--subtle-text);
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}
.primary-menu a:hover,
.primary-menu .current-menu-item a {
    color: var(--heading-color);
}


/* ## Search Form */
.search-form {
    margin: 2rem auto;
    max-width: 700px;
    position: relative;
}

.search-field {
    width: 100%;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 16px 24px 16px 50px;
    border-radius: 50px;
    font-size: 1.1rem;
    box-sizing: border-box;
}

.search-field::placeholder {
    color: var(--subtle-text);
}

.search-submit {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--subtle-text);
    font-size: 1.2rem;
    padding: 0;
    cursor: default;
}

/*--------------------------------------------------------------
# Content
--------------------------------------------------------------*/

/* ## Gallery Grid (Homepage, Archives) */
.posts-grid {
    display: grid;
    /* EDITED: Slightly reduced min-width to allow 4 columns at 100% zoom */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ## Post Card */
.post-card {
    background-color: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.post-card__image-link {
    display: block;
    position: relative;
    overflow: hidden; /* For zoom effect */
}

.post-card__thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1.1;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-card__thumbnail {
    transform: scale(1.05);
}

.post-card__content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card__header {
    margin-bottom: 1rem;
}

.post-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.post-card__title a {
    color: var(--heading-color);
}
.post-card__title a:hover {
    color: var(--accent-color);
}

.post-card__author {
    color: var(--subtle-text);
    font-size: 0.9rem;
}

.post-card__excerpt {
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.post-card__footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-create, .btn-icon {
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-create {
    background: linear-gradient(to right, #9333ea, #d946ef);
    color: white;
    padding: 8px 16px;
    border: none;
    font-size: 0.9rem;
}

.btn-create:hover {
    opacity: 0.9;
}

.btn-icon {
    background-color: #334155;
    color: var(--text-color);
    border: none;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
}
.btn-icon:hover {
    background-color: #475569;
}
.btn-icon.liked {
    color: #f43f5e; /* Red when liked */
}

.post-card__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.like-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--subtle-text);
}


/* ## Single Post View */
.single-post-container {
    max-width: 1100px;
    margin: 2rem auto;
}

.single-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.back-to-gallery, .share-button {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--text-color);
}
.back-to-gallery:hover, .share-button:hover {
    background-color: #334155;
}

.single-post-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.single-post-media-wrapper {
    margin-bottom: 2rem;
}
.single-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-post-video-wrapper video {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.single-post-title {
    font-size: 2.8rem;
    margin: 0 0 1rem;
}
.single-post-meta-header {
    color: var(--subtle-text);
    margin-bottom: 2rem;
}

.single-post-content {
    line-height: 1.7;
    font-size: 1.1rem;
}

/* NEW: Single Post Section Boxes */
.prompt-section-box {
    background-color: #0c111c;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-top: 2.5rem;
}
.prompt-section-box.instruction-box {
    border-top: 4px solid var(--pink-accent);
}
.prompt-section-box h2 {
    font-size: 1.2rem;
    color: var(--heading-color);
    margin-top: 0;
    margin-bottom: 1rem;
}
.prompt-section-box .single-post-content {
    font-size: 1rem;
}
.prompt-section-box .single-post-content p,
.prompt-section-box .single-post-content ul {
    margin-bottom: 0; /* Remove extra space at the bottom */
}
.prompt-section-box .single-post-content ul {
    padding-left: 20px;
}
.prompt-box .single-post-prompt-wrapper {
    margin-top: 0;
}
.prompt-box .single-post-actions {
    margin-top: 1.5rem;
}

/* EDITED: Prompt Box Content Scrolling */
.prompt-box .single-post-content {
    background-color: transparent;
    padding: 0;
    max-height: 250px; /* Set a fixed height */
    overflow-y: auto;   /* Add scrollbar when content overflows */
    padding-right: 15px;/* Give space for the scrollbar */
}

/* NEW: Custom Scrollbar for Prompt Box */
.prompt-box .single-post-content::-webkit-scrollbar {
    width: 8px;
}
.prompt-box .single-post-content::-webkit-scrollbar-track {
    background: var(--card-background);
    border-radius: 10px;
}
.prompt-box .single-post-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
    border: 2px solid var(--card-background);
}
.prompt-box .single-post-content::-webkit-scrollbar-thumb:hover {
    background-color: #475569;
}


.section-title {
    color: var(--subtle-text);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.single-post-tags {
    margin-top: 2.5rem;
}
.single-post-tags ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.single-post-tags a {
    background-color: var(--card-background);
    color: var(--text-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.single-post-tags a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.single-post-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}
.single-action-btn {
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.single-action-btn.create {
    background: linear-gradient(to right, #9333ea, #d946ef);
    color: white;
}
.single-action-btn.copy {
    background-color: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.single-action-btn.create:hover { opacity: 0.9; }
.single-action-btn.copy:hover { background-color: #334155; }


/* ## Page View (About, Contact, etc.) */
.page-container {
    max-width: 800px;
    margin: 2rem auto;
    background-color: var(--card-background);
    padding: 2rem 3rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.page-header { /* Also used for video prompts page */
    margin-bottom: 2rem;
    text-align: center;
}
.page-title {
    font-size: 2.8rem;
    margin-top: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}
.page-content {
    font-size: 1.1rem;
    line-height: 1.8;
}
.page-content a {
    text-decoration: underline;
}
.page-content h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
}
.page-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.site-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--subtle-text);
}
.footer-menu {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.footer-menu a {
    color: var(--subtle-text);
}
.footer-menu a:hover {
    color: var(--heading-color);
}

/*--------------------------------------------------------------
# Media Queries
--------------------------------------------------------------*/
@media (min-width: 768px) {
    .single-post-layout {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    .single-post-media-wrapper {
        position: sticky;
        top: 2rem;
        align-self: start;
        margin-bottom: 0;
    }
}

@media (min-width: 1400px) {
    .posts-grid {
        /* Ensure 4 columns on very large screens */
        grid-template-columns: repeat(4, 1fr);
    }
}

