/*
Theme Name: HexGrinder Theme
Theme URI: https://example.com/hexgrinder-theme
Author: Your Name
Author URI: https://example.com
Description: A dark fantasy theme designed specifically for the HexGrinder hex exploration plugin. Features a full-width layout optimized for the map interface.
Version: 1.0.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hexgrinder-theme
Tags: dark, gaming, full-width, custom-menu, custom-logo

HexGrinder Theme - A dark fantasy theme for tabletop RPG hex exploration
*/

/* =====================
   CSS VARIABLES
   ===================== */
:root {
    --bg-deep: #0a0a0f;
    --bg-card: #12121a;
    --bg-elevated: #1a1a25;
    --bg-header: #0d0d14;
    --border-subtle: #2a2a3a;
    --border-glow: #4a3a6a;
    --text-primary: #e8e4f0;
    --text-secondary: #9a94a8;
    --text-muted: #6a6478;
    --accent-mystic: #7c5cbf;
    --accent-gold: #c9a84c;
    --accent-ember: #bf5c5c;
    --accent-jade: #5cbf7c;
    --accent-frost: #5c9fbf;
    --glow-mystic: rgba(124, 92, 191, 0.3);
    --glow-gold: rgba(201, 168, 76, 0.3);
    --header-height: 60px;
    --footer-height: 50px;
}

/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(124, 92, 191, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(201, 168, 76, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Full height layout for app pages */
body.hexgrinder-app-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.hexgrinder-app-page .site-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* =====================
   TYPOGRAPHY
   ===================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1rem;
}

a {
    color: var(--accent-mystic);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* =====================
   SITE HEADER
   ===================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    height: var(--header-height);
}

.header-inner {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-logo {
    font-size: 1.5rem;
    line-height: 1;
}

.site-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.1em;
}

.site-title a {
    color: var(--accent-gold);
    text-decoration: none;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 50%, var(--text-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-description {
    display: none;
}

/* Main Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
}

.main-navigation li {
    margin: 0;
}

.main-navigation a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a,
.main-navigation .current_page_item a {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.main-navigation .current-menu-item a,
.main-navigation .current_page_item a {
    color: var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    padding: 0.4rem 1rem;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.header-btn:hover {
    border-color: var(--accent-mystic);
    color: var(--text-primary);
}

.header-btn.primary {
    background: var(--accent-mystic);
    border-color: var(--accent-mystic);
    color: white;
}

.header-btn.primary:hover {
    background: #9370db;
    border-color: #9370db;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* =====================
   MAIN CONTENT
   ===================== */
.site-content {
    width: 100%;
}

/* Full-width page template for HexGrinder */
.page-template-template-hexgrinder .site-content,
.hexgrinder-app-page .site-content {
    max-width: none;
    padding: 0;
}

/* Regular content pages */
.content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Full-width content area for app */
.full-width .content-area {
    max-width: none;
    padding: 0;
}

/* =====================
   HEXGRINDER SPECIFIC
   ===================== */
/* Remove extra padding/margins from plugin container */
.hexgrinder-container {
    width: 100%;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.hexgrinder-container .container {
    max-width: 1800px;
    padding: 1rem 1.5rem;
}

/* Dashboard full-width */
.hexgrinder-dashboard {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* Hide the plugin's built-in header when using theme */
.hexgrinder-container > header {
    display: none;
}

/* Adjust account bar to match theme */
.hexgrinder-account-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.5rem 1.5rem;
}

/* =====================
   SITE FOOTER
   ===================== */
.site-footer {
    background: var(--bg-header);
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
    text-align: center;
    min-height: var(--footer-height);
}

.footer-inner {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--accent-gold);
}

/* =====================
   POSTS & PAGES
   ===================== */
.entry-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.entry-title {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.entry-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.entry-content h2 {
    color: var(--accent-gold);
    margin-top: 2rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.5rem 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-card);
    border-left: 4px solid var(--accent-mystic);
    font-style: italic;
    color: var(--text-secondary);
}

.entry-content pre,
.entry-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--bg-elevated);
    border-radius: 4px;
}

.entry-content code {
    padding: 0.2rem 0.4rem;
    font-size: 0.9em;
    color: var(--accent-frost);
}

.entry-content pre {
    padding: 1rem;
    overflow-x: auto;
}

.entry-content pre code {
    padding: 0;
    background: none;
}

/* =====================
   BUTTONS
   ===================== */
.btn,
button,
input[type="submit"],
input[type="button"] {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    border-color: var(--accent-mystic);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--accent-mystic);
    border-color: var(--accent-mystic);
    color: white;
}

.btn-primary:hover {
    background: #9370db;
    border-color: #9370db;
    color: white;
}

/* =====================
   FORMS
   ===================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-mystic);
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =====================
   WIDGETS
   ===================== */
.widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
}

.widget-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.widget li:last-child {
    border-bottom: none;
}

/* =====================
   COMMENTS
   ===================== */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.comments-title {
    color: var(--accent-gold);
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
}

.comment-author {
    font-weight: 600;
    color: var(--accent-mystic);
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* =====================
   404 PAGE
   ===================== */
.error-404 {
    text-align: center;
    padding: 4rem 2rem;
}

.error-404 h1 {
    font-size: 6rem;
    color: var(--accent-gold);
    margin-bottom: 0;
}

.error-404 p {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* =====================
   UTILITIES
   ===================== */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* =====================
   RESPONSIVE DESIGN
   ===================== */
@media (max-width: 1200px) {
    :root {
        --header-height: 55px;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .main-navigation a {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .main-navigation {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-header);
        border-bottom: 1px solid var(--border-subtle);
        padding: 1rem;
    }
    
    .main-navigation.toggled {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-navigation a {
        padding: 0.75rem 1rem;
        border-radius: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .header-actions {
        margin-left: auto;
        margin-right: 1rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 50px;
        --footer-height: auto;
    }
    
    html {
        font-size: 15px;
    }
    
    .header-inner {
        padding: 0 1rem;
    }
    
    .site-title {
        font-size: 1.1rem;
        letter-spacing: 0.05em;
    }
    
    .site-logo {
        font-size: 1.25rem;
    }
    
    .header-actions .header-btn span {
        display: none;
    }
    
    .content-area {
        padding: 1.5rem 1rem;
    }
    
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .entry-title {
        font-size: 1.75rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .site-branding .site-title {
        display: none;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* =====================
   WORDPRESS CORE OVERRIDES
   ===================== */
/* Remove default WordPress admin bar padding */
html.wp-toolbar {
    padding-top: 0 !important;
}

body.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

/* WordPress block editor styles */
.wp-block-button__link {
    background: var(--accent-mystic);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
}

.wp-block-quote {
    border-left-color: var(--accent-mystic);
    background: var(--bg-card);
    padding: 1rem 1.5rem;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}
