/*
Theme Name: Dharma Project
Template: twentytwentyfour
*/

/*
  Zen/Tech Aesthetic:
  - This root setup establishes our design system in CSS.
  - The color variables are pulled from our theme.json, ensuring consistency.
  - The --hud variables are specifically for our glassmorphism effect,
    which embodies the "NW Tech" precision and data-centric feel.
    The blur and transparency create a sense of depth and focus,
    like looking through a high-tech lens, while keeping the UI clean and unobtrusive (Zen).
*/

:root {
  /*
    Zen/Tech Aesthetic:
    - Glassmorphism effect for the HUD.
    - Evokes a futuristic, data-driven feel.
  */
  --hud-backdrop-blur: 10px;
  --hud-background-color: rgba(46, 46, 46, 0.65); /* Dark Slate, more transparent */
  --hud-border-color: rgba(46, 134, 222, 0.5); /* Azure/Cerulean with transparency */
  --hud-border-radius: 8px;
  --hud-padding: 0.8rem; /* Tighter padding */
  --hud-box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  --hud-text-color: var(--wp--preset--color--text);
  --hud-font-family: var(--wp--preset--font-family--primary);
  --hud-font-size: 0.75rem; /* Smaller font for HUD */
}

/* Gallery Styles */
.dharma-gallery {
  display: grid;
  /* Force exactly 3 columns on large screens */
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; /* Consistent spacing */
  padding: 1rem 0;
}

.dharma-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--hud-border-radius);
}

.dharma-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.dharma-gallery-item:hover img {
  transform: scale(1.05);
}

/* HUD Styles */
.astro-hud {
  position: fixed;
  z-index: 1000;
  padding: var(--hud-padding);
  background: var(--hud-background-color);
  border: 1px solid var(--hud-border-color);
  border-radius: var(--hud-border-radius);
  box-shadow: var(--hud-box-shadow);
  backdrop-filter: blur(var(--hud-backdrop-blur));
  -webkit-backdrop-filter: blur(var(--hud-backdrop-blur));
  color: var(--hud-text-color);
  font-family: var(--hud-font-family);
  font-size: var(--hud-font-size);
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  max-width: 250px; /* Prevent the box from getting too wide */
  word-wrap: break-word; /* Wrap long text */
}

.astro-hud.visible {
  opacity: 1;
}

.astro-hud h3, .astro-hud h4 {
  margin: 0 0 0.4rem 0;
  color: var(--wp--preset--color--primary);
  font-weight: 600;
  font-size: 0.9em; /* Relative to the HUD's font size */
}

.astro-hud p {
  margin: 0.2rem 0;
  font-size: 0.85em; /* Make spec text even smaller */
}

.astro-hud span {
  color: var(--wp--preset--color--text);
  margin-left: 0.5rem;
}

/* --- Global Typography --- */
p {
    margin-bottom: 1.8rem;
    line-height: 1.8;
    font-size: 1.05rem;
    color: #E0E0E0;
}

h1, h2, h3, h4 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* --- Reading Widths --- */
.entry-content,
.about-bio,
.single-tech-post {
    max-width: 75ch;
    width: 100%;
    margin-left: 0;
}

/* --- Gallery Control Bar --- */
.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
}

#gallery-search {
    width: 100%;
    max-width: 400px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #2E8DDE;
    color: white;
    padding: 10px;
}

#gallery-search:focus {
    outline: none;
    border-bottom-color: var(--wp--preset--color--text);
}

.sort-buttons button {
    background: none;
    border: none;
    color: var(--wp--preset--color--primary);
    cursor: pointer;
    margin-left: 1rem;
    font-family: var(--wp--preset--font-family--primary);
    font-size: 0.9rem;
}

.sort-buttons button:hover {
    color: var(--wp--preset--color--text);
}


/* --- Single Image (image.php) --- */
.single-image-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.main-astro-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.astro-metadata-list dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.metadata-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 4px;
}

.metadata-item dt {
    font-weight: bold;
    color: var(--wp--preset--color--primary);
    margin-bottom: 0.5rem;
}

.metadata-item dd {
    margin: 0;
    font-family: var(--wp--preset--font-family--monospace);
}

/* --- Global Layout & Container --- */
body {
    background: radial-gradient(circle at 50% 0%, #2E2E2E, #3a3a3a 80%);
    background-attachment: fixed; /* Keeps the spotlight at the top when scrolling */
    color: var(--wp--preset--color--text, #F7F5F2);
    font-family: var(--wp--preset--font-family--primary, sans-serif);
}

.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hide Twenty Twenty-Four parent header and aggressive block-title/logo hiding */
.wp-site-blocks > header {
    display: none !important;
}

/* Aggressively hide Block Theme title/logo template parts */
.wp-block-site-title,
.wp-block-site-logo,
header.wp-block-template-part,
.site-title {
    display: none !important;
}

/* --- 2. GLASS HEADER LAYOUT --- */
.site-header {
    width: 100%;
    z-index: 1000;
    position: sticky; /* Keeps it stuck to top */
    top: 1rem; /* Add a little space at the top of the page */
    background: rgba(46, 46, 46, 0.85); /* Dark Slate semi-transparent */
    backdrop-filter: blur(12px); /* Stronger blur */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0; /* Reduced top/bottom padding */
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

/* Logo Sizing */
.site-logo {
    max-height: 50px; /* Adjust this to make logo bigger/smaller */
    width: auto;
    display: block;
}

/* --- 3. GLASS BUTTON MENU --- */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 12px; /* Space between buttons */
}

.nav-menu li a {
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    
    /* The Glass Button Look */
    color: #F7F5F2;
    background: rgba(255, 255, 255, 0.03); /* Very faint fill */
    border: 1px solid rgba(255, 255, 255, 0.15); /* Thin border */
    padding: 8px 16px; /* Button sizing */
    border-radius: 6px; /* Rounded corners */
    transition: all 0.3s ease;
}

/* Hover State: Glows Cyan */
.nav-menu li a:hover {
    background: rgba(46, 134, 222, 0.15); /* Azure/Cerulean tint */
    border-color: #2E86DE;
    color: #2E86DE;
    box-shadow: 0 0 10px rgba(46, 134, 222, 0.2); /* Subtle glow */
}

/* --- Homepage: Content Grid & Cards --- */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Make the whole card clickable */
    margin-bottom: 1.5rem; /* Reduced bottom margin */
}


/* --- Homepage Layout --- */
.home-main-container {
    padding-top: 2rem; /* Add space below header */
    display: flex;
    gap: 2rem;
    max-width: 1200px; /* Match header max-width */
    margin: 0 auto; /* Center the content */
    padding-left: 2rem; /* Match .header-container padding for edge alignment */
    padding-right: 2rem; /* Match .header-container padding for edge alignment */
}

.generic-page-container,
.about-container,
.single-post-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.main-content-area {
    flex: 7; /* 70% */
}

.sidebar-area {
    flex: 3; /* 30% */
}

/* Responsive Layout */
@media (max-width: 900px) {

    /* 1. Stack the Main Layout & ADD BREATHING ROOM */
    .home-main-container,
    .generic-page-container,
    .about-container,
    .header-inner, /* Use inner to avoid full-width background issues */
    .footer-container {
        flex-direction: column;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        gap: 2rem;
    }

    /* Original padding reset */
    .header-container {
        padding: 0 1rem;
    }

    /* 2. Give Columns Full Width */
    .main-content-area,
    .sidebar-area {
        width: 100%;
        flex: none; /* Disable the 70/30 split logic */
    }

    /* 3. Fix the Sidebar */
    .sidebar-area {
        order: 2; /* Force sidebar to visually sit BELOW content */
        margin-top: 2rem;
    }

    /* 4. Fix the Menu (Wrap Buttons) */
    .main-navigation {
        width: 100%;
        margin-top: 1rem;
    }
    .nav-menu {
        flex-wrap: wrap; /* Allow buttons to drop to next line */
        justify-content: center; /* Center them */
        gap: 10px;
    }
    .nav-menu li a {
        font-size: 0.85rem; /* Slightly smaller text */
        padding: 8px 12px;
    }

    /* 5. Adjust Logo */
    .site-branding {
        margin-bottom: 0.5rem;
    }
    
    /* 6. Fix Generic Pages (Gallery/About) */
    .generic-page-container {
        padding: 1rem; /* Less padding on mobile */
    }
    .entry-title {
        font-size: 2rem; /* Smaller title so it doesn't wrap weirdly */
        text-align: center;
    }
    
    /* 7. Gallery Grid Adjustment */
    .dharma-gallery {
        grid-template-columns: repeat(2, 1fr); /* Step down to 2 columns */
        gap: 1rem;
    }

    /* Single Post Padding Adjustment */
    .single-post-container {
        padding: 1.5rem;
    }

    /* --- About Me Page Fix --- */
    .about-container {
        flex-direction: column;
    }
    .profile-section {
        flex-direction: column;
        align-items: center;
    }
    .about-portrait {
        width: 100%;
        text-align: center;
        margin-bottom: 2rem;
    }
    .about-portrait img {
        max-width: 250px;
        height: auto;
        margin: 0 auto;
    }
    .about-bio {
        width: 100%;
        text-align: center; /* Center bio text on mobile for consistency */
    }
    .about-bio .bio-title, .about-bio .bio-subtitle {
        text-align: center;
    }

    /* --- Base of Operations Fix --- */
    .base-operations {
        height: auto;
        min-height: 500px;
    }
    .dark-sky-advocacy {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 2rem;
        width: 100%;
    }
}

/* --- Gallery Page --- */
.gallery-page-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.gallery-page-container .entry-content {
    max-width: 100% !important;
}

.dharma-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Mobile Phones Only (Screens smaller than 600px) */
@media (max-width: 600px) {
    .dharma-gallery {
        grid-template-columns: 1fr; /* Single column stack */
        gap: 1rem;
    }

    .content-card {
        border-radius: 0; /* Square off corners to maximize space */
        border-left: none;
        border-right: none;
    }
    
    .card-title {
        font-size: 1.3rem;
    }

    /* Hide the sidebar completely on very small phones? (Optional) 
       Uncomment line below if you want to hide it: */
    /* .sidebar-area { display: none; } */
}

/* --- Comments Section --- */
.comments-area {
    max-width: 800px;
    margin: 4rem auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

/* Toned Down 'Transmissions' Header */
.comments-area h3 {
    font-size: 1.3rem;       /* Much smaller than the main title */
    font-weight: 400;        /* Regular weight, not bold */
    color: #888;             /* Muted grey */
    text-transform: uppercase;
    letter-spacing: 2px;     /* Wide spacing for a 'Tech Label' look */
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
    display: inline-block;   /* Only underline the text, not the whole width */
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-body {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 2px solid #2E86DE;
}

.comment-meta,
.comment-meta .fn,
.comment-meta .fn a {
    color: #2E86DE;
    font-weight: bold;
}

.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    background: transparent;
    border: 1px solid #444;
    color: white;
    padding: 10px;
    width: 100%;
    border-radius: 4px;
}

.comment-form input[type="submit"] {
    background: transparent;
    border: 1px solid #2E86DE;
    color: #2E86DE;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form input[type="submit"]:hover {
    background: rgba(46, 134, 222, 0.15);
    color: #fff;
}

/* --- Single Post Content Card --- */
.single-content-card {
    background: rgba(40, 40, 40, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 2rem auto; /* Add top/bottom margin */
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- User Controls --- */
.user-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.glass-btn {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ccc;
    border: 1px solid #444;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    text-decoration: none;
}

.glass-btn:hover {
    border-color: #2E86DE;
    color: #2E86DE;
    box-shadow: 0 0 10px rgba(46, 134, 222, 0.2);
}

.glass-btn.highlight {
    background: rgba(46, 134, 222, 0.1);
    border-color: #2E86DE;
}

/* --- RESTORED VISUAL STYLES --- */

/* 1. The Tech Card (Homepage & Archives) */
.content-card {
    background: rgba(40, 40, 40, 0.6); /* Glass Dark */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid #2E86DE; /* Logo Blue */
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-top-color 0.3s ease;
    margin-bottom: 2rem; /* Ensure space between cards */
}

.content-card:hover {
    transform: translateY(-5px); /* Lift Effect */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-top-color: #00BFFF; /* Glows Cyan */
}

/* 2. Card Internals */
.card-content-padding {
    padding: 2rem;
}

.card-title {
    margin-top: 0.5rem;
    font-size: 1.6rem;
    line-height: 1.2;
}

.card-meta {
    color: #2E86DE;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.card-read-more {
    display: inline-block;
    margin-top: 1.5rem;
    color: #2E86DE;
    font-weight: 600;
    text-decoration: none;
}

/* 3. Sidebar Widgets (Glass Look) */
.sidebar-widget {
    background: rgba(40, 40, 40, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.widget-title {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #F7F5F2;
}

/* 4. Fix Search Bar */
.sidebar-search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #2E86DE;
    color: #FFF;
    padding: 0.5rem;
    font-family: inherit;
}
.sidebar-search-input:focus {
    outline: none;
    border-bottom-color: #00BFFF;
}

/* --- Sidebar: Recent Posts --- */
.sidebar-recent-posts ul {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.sidebar-recent-posts li {
    margin-bottom: 0;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Faint tech separator */
}

.sidebar-recent-posts li:last-child {
    border-bottom: none;
}

.sidebar-recent-posts a {
    text-decoration: none;
    color: #B0B0B0; /* Muted tech grey */
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    display: block; /* Makes the whole row clickable-ish */
    transition: all 0.2s ease;
}

.sidebar-recent-posts a:hover {
    color: #2E86DE; /* Logo Blue */
    padding-left: 8px; /* "Nudge" effect to the right */
    text-shadow: 0 0 8px rgba(46, 134, 222, 0.4); /* Slight glow */
}

/* --- Footer --- */
.site-footer {
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-tagline {
    color: #2E86DE;
    font-weight: 500;
    margin: 0;
    font-size: 0.9rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
}

/* --- About Page: Mission Profile --- */
.about-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem; /* Desktop Padding */
}

/* Profile Section (Desktop: Row, Mobile: Column) */
.about-profile-section {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 4rem;
}

/* Portrait Styling */
.about-portrait img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%; /* Circular */
    border: 3px solid #2E86DE; /* Logo Blue */
    box-shadow: 0 0 20px rgba(46, 134, 222, 0.3);
}

.about-bio h2 {
    margin-bottom: 0.75rem; /* Reduced from default */
}

.bio-subtitle {
    color: #2E86DE; /* Logo Blue */
    font-family: "Source Code Pro", monospace; /* Tech font */
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Base of Operations (The Map/HUD) */
.base-operations {
    position: relative;
    min-height: 500px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 3rem;
    border-radius: 8px;
    overflow: hidden;
    background: radial-gradient(circle at center, #2a2a2a, #1a1a1a); /* Placeholder BG */
}

.ops-hud {
    position: absolute;
    top: 2rem;
    left: 2rem;
    font-family: "Source Code Pro", monospace;
    color: #2E86DE;
}

.dark-sky-advocacy {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    max-width: 500px;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(8px);
    padding: 2rem;
    border-left: 3px solid #2E86DE;
}

.ops-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6; /* Optional: Dims the image so text pops */
}

/* RESPONSIVE MEDIA QUERY (Max-Width 900px) */
@media (max-width: 900px) {
    /* Fix Reading Margins */
    .about-container {
        padding: 1.5rem;
    }

    /* Stack Profile Vertically */
    .about-profile-section {
        flex-direction: column;
        text-align: center;
    }
   
    /* Stack Base of Operations */
    .base-operations {
        display: flex;
        flex-direction: column;
        padding: 2rem;
    }
    .ops-hud, .dark-sky-advocacy {
        position: relative;
        top: auto; left: auto; bottom: auto; right: auto;
        width: 100%;
        margin-bottom: 2rem;
    }
}
