/*
Theme Name: Flavor
Theme URI: https://shaunandrews.com
Description: Terminal-inspired digital garden theme
Author: Shaun Andrews
Author URI: https://shaunandrews.com
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
Version: 2.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flavor
Tags: blog, portfolio, one-column, custom-colors, custom-menu, editor-style, featured-images, full-site-editing, block-patterns, block-styles, wide-blocks
*/

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   ========================================================================== */

:root {
  --bg: #0d120d;
  --text: #8fb87a;
  --bright: #9DFF20;
  --dim: #3d5a30;
  --error: #ff6b6b;
  --font: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* ==========================================================================
   BASE RESET & BODY
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  font-family: var(--font) !important;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding: 3rem 2rem;
}

/* Account for WP admin bar when logged in */
body.admin-bar {
  padding-top: calc(3rem + var(--wp-admin--admin-bar--height, 32px));
}

/* Remove default WP wrapper padding */
.wp-site-blocks {
  padding: 0 !important;
}

/* ==========================================================================
   PAGE CONTAINER
   ========================================================================== */

.page-container {
  max-width: 600px !important;
  margin: 0 auto;
  padding: 0 !important;
}

.page-container > * {
  padding: 0 !important;
}

/* ==========================================================================
   SITE HEADER
   ========================================================================== */

.site-header {
  margin-bottom: 4rem !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 !important;
}

/* Site name / title */
.site-header .wp-block-site-title,
.site-header .site-name {
  margin: 0;
}

.site-header .wp-block-site-title a,
.site-name a {
  color: var(--bright) !important;
  font-weight: 500;
  font-size: 15px;
  text-shadow: 0 0 20px rgba(157, 255, 32, 0.4), 0 0 40px rgba(157, 255, 32, 0.2);
  text-decoration: none !important;
}

/* NO cursor on header - removed */

/* Navigation */
.site-header .wp-block-navigation,
.site-nav {
  gap: 1.5rem;
}

.site-header .wp-block-navigation-item a,
.site-nav a,
.nav-link {
  color: var(--dim) !important;
  text-decoration: none !important;
  font-size: 0.85rem;
  padding: 0 !important;
  background: none !important;
}

.site-header .wp-block-navigation-item a:hover,
.site-nav a:hover {
  color: var(--bright) !important;
  text-shadow: 0 0 10px rgba(157, 255, 32, 0.4);
}

/* ==========================================================================
   WELCOME SECTION
   ========================================================================== */

.welcome-section {
  margin-bottom: 4rem !important;
  padding: 0 !important;
}

.welcome-section .headline {
  font-size: 1.5rem !important;
  line-height: 1.4 !important;
  color: var(--bright) !important;
  margin-bottom: 1.5rem !important;
  max-width: 500px;
  text-shadow: 0 0 30px rgba(157, 255, 32, 0.3);
  font-weight: 400;
}

/* Blinking cursor - ONLY on headline */
.welcome-section .headline .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--bright);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: cursor-blink 1s step-end infinite;
  box-shadow: 0 0 10px rgba(157, 255, 32, 0.5);
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.welcome-section .subtext {
  margin-bottom: 0 !important;
  max-width: 500px;
  text-shadow: 0 0 30px rgba(107, 140, 90, 0.2);
  color: var(--text);
}

.welcome-section .subtext a {
  color: var(--bright);
  text-decoration: none;
}

/* ==========================================================================
   SECTIONS (Recent, Projects)
   ========================================================================== */

.section {
  margin-bottom: 3rem !important;
  padding: 0 !important;
}

.section-title {
  color: var(--dim) !important;
  font-size: 0.8rem !important;
  margin-bottom: 1rem !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   POST LIST (Latest Posts Block) - FIXED LAYOUT
   ========================================================================== */

.post-list,
.wp-block-latest-posts {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.post-list li,
.wp-block-latest-posts li {
  padding: 0.75rem 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  border-bottom: 1px dotted var(--dim) !important;
  gap: 1rem;
}

.post-list li:last-child,
.wp-block-latest-posts li:last-child {
  border-bottom: none !important;
}

/* Post title - left side */
.post-list a,
.wp-block-latest-posts__post-title {
  color: var(--text) !important;
  text-decoration: none !important;
  text-shadow: none !important;
  font-size: 15px;
  flex: 1;
  order: 1;
}

.post-list a:hover,
.wp-block-latest-posts__post-title:hover {
  color: var(--bright) !important;
  text-shadow: 0 0 10px rgba(157, 255, 32, 0.5) !important;
}

/* Post dates - right side, short format via CSS */
.wp-block-latest-posts__post-date {
  color: var(--dim) !important;
  font-size: 0.85rem !important;
  flex-shrink: 0;
  order: 2;
  white-space: nowrap;
}

/* Hide full month/year, show only via content (handled by WP date format) */

/* Featured images - hide */
.wp-block-latest-posts__featured-image {
  display: none !important;
}

/* ==========================================================================
   FILE TREE (Projects Section)
   ========================================================================== */

.terminal-prompt {
  color: var(--dim);
  margin-bottom: 1rem !important;
}

.terminal-prompt a {
  color: var(--dim);
  text-shadow: none;
}

.terminal-prompt a:hover {
  color: var(--bright);
}

.post-count {
  color: var(--dim);
  font-size: 0.8rem;
}

/* ==========================================================================
   PROJECTS GRID
   ========================================================================== */

.projects-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 600px) {
  .projects-page-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .projects-page-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.project-grid-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--dim);
  border-radius: 4px;
  text-decoration: none !important;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.project-grid-card:hover {
  border-color: var(--bright);
  background: rgba(157, 255, 32, 0.03);
}

.project-grid-card .card-icon {
  font-size: 2rem;
  line-height: 1;
}

.project-grid-card .card-icon svg {
  width: 32px;
  height: 32px;
  fill: var(--dim);
  transition: fill 0.2s ease;
}

.project-grid-card:hover .card-icon svg {
  fill: var(--bright);
}

.project-grid-card .card-name {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.project-grid-card:hover .card-name {
  color: var(--bright);
  text-shadow: 0 0 10px rgba(157, 255, 32, 0.3);
}

.project-grid-card .card-desc {
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.5;
}

.prompt-user {
  color: var(--bright);
}

.file-tree {
  margin-left: 0;
}

.directory {
  margin-bottom: 1.5rem;
}

.dir-header {
  color: var(--bright);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dir-icon {
  color: var(--dim);
}

.file-list {
  list-style: none;
  border-left: 1px solid var(--dim);
  margin-left: 0.5rem;
  padding: 0 !important;
}

.file-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 1rem;
  text-decoration: none !important;
  color: inherit;
  border-bottom: 1px dotted rgba(61, 90, 48, 0.3);
  transition: background 0.15s ease;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item:hover {
  background: rgba(157, 255, 32, 0.05);
}

.file-item:hover .file-name {
  color: var(--bright);
  text-shadow: 0 0 10px rgba(157, 255, 32, 0.3);
}

.file-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.file-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--dim);
  transition: fill 0.15s ease;
}

.file-item:hover .file-icon svg {
  fill: var(--text);
}

.file-name {
  color: var(--text);
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.file-desc {
  color: var(--dim);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   PROJECT GRID - ENHANCED LAYOUT (Legacy)
   ========================================================================== */

.project-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 0 !important;
}

.project-card {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 1rem 0 !important;
  margin: 0 !important;
  border-bottom: 1px dotted var(--dim) !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  gap: 1rem;
}

.project-card:last-child {
  border-bottom: none !important;
}

.project-card:hover {
  padding-left: 0.5rem !important;
  border-color: var(--bright) !important;
}

.project-card:hover .project-name {
  color: var(--bright) !important;
  text-shadow: 0 0 15px rgba(157, 255, 32, 0.5) !important;
}

.project-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
  padding: 0 !important;
}

.project-name {
  color: var(--text) !important;
  font-size: 15px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  transition: all 0.2s ease !important;
}

.project-desc {
  color: var(--dim) !important;
  font-size: 0.8rem !important;
  margin: 0 !important;
}

.project-tag {
  color: var(--dim) !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.2rem 0.6rem !important;
  background: rgba(157, 255, 32, 0.05) !important;
  border: 1px solid var(--dim) !important;
  border-radius: 3px !important;
  flex-shrink: 0;
}

.project-card:hover .project-tag {
  border-color: var(--bright) !important;
  color: var(--bright) !important;
}

/* Status indicators for active projects */
.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.active {
  background: var(--bright);
  box-shadow: 0 0 8px rgba(157, 255, 32, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

.status-indicator.building {
  background: #f5a623;
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

/* Legacy project-list support */
.project-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.project-list > li {
  padding: 0.75rem 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  border-bottom: 1px dotted var(--dim) !important;
}

.project-list > li:last-child {
  border-bottom: none !important;
}

.project-list .tag {
  color: var(--dim) !important;
  font-size: 0.85rem;
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */

.site-footer {
  margin-top: 5rem !important;
  color: var(--dim);
  font-size: 0.8rem;
  padding: 0 !important;
  gap: 1rem;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 0.5rem !important;
}

.footer-status .status-text {
  margin: 0 !important;
  color: var(--dim);
  font-size: 0.8rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--bright);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(157, 255, 32, 0.6);
  animation: pulse 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.footer-links {
  display: flex;
  gap: 1.5rem !important;
}

.footer-links p {
  margin: 0 !important;
}

.footer-links a {
  color: var(--dim) !important;
  text-decoration: none !important;
  text-shadow: none !important;
}

.footer-links a:hover {
  color: var(--bright) !important;
  text-shadow: 0 0 10px rgba(157, 255, 32, 0.4);
}

/* ==========================================================================
   GLOBAL LINKS
   ========================================================================== */

a {
  color: var(--bright);
  text-decoration: none;
  text-shadow: 0 0 10px rgba(157, 255, 32, 0.3);
}

a:hover {
  text-shadow: 0 0 15px rgba(157, 255, 32, 0.6);
}

/* ==========================================================================
   TEXT SELECTION
   ========================================================================== */

::selection {
  background: var(--bright);
  color: var(--bg);
}

::-moz-selection {
  background: var(--bright);
  color: var(--bg);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 600px) {
  body {
    padding: 2rem 1rem;
  }
  
  .site-footer {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* Home container: narrow on small screens, wide on large */
.home-container {
  max-width: 600px !important;
}

/* Wide viewport: hero + blog side by side, projects side by side */
@media (min-width: 900px) {
  .home-container {
    max-width: 1000px !important;
  }

  .hero-area {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4rem !important;
    margin-bottom: 4rem !important;
  }

  .hero-area > .welcome-section,
  .hero-area > .wp-block-group.welcome-section {
    margin-bottom: 0 !important;
    align-self: center !important;
  }

  .hero-area .recent-section {
    margin-bottom: 0 !important;
  }

  /* File tree directories side by side */
  .file-tree {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .file-tree .directory {
    margin-bottom: 0;
  }
}

/* ==========================================================================
   HIDE DEFAULT WORDPRESS ELEMENTS
   ========================================================================== */

html { margin-top: 0 !important; }

/* ==========================================================================
   POST LIST ITEMS (Query Loop)
   ========================================================================== */

.post-list-item {
  padding: 0.75rem 0 !important;
  border-bottom: 1px dotted var(--dim) !important;
  gap: 1rem !important;
}

.post-list-item:last-child {
  border-bottom: none !important;
}

.post-list-item .wp-block-post-title {
  margin: 0 !important;
  font-size: 15px !important;
  font-weight: 400 !important;
}

.post-list-item .wp-block-post-title a {
  color: var(--text) !important;
  text-decoration: none !important;
  text-shadow: none !important;
}

.post-list-item .wp-block-post-title a:hover {
  color: var(--bright) !important;
  text-shadow: 0 0 10px rgba(157, 255, 32, 0.5) !important;
}

.post-list-item .wp-block-post-date {
  color: var(--dim) !important;
  font-size: 0.85rem !important;
  white-space: nowrap;
}

/* ==========================================================================
   POST HEADER & META
   ========================================================================== */

.post-header {
  margin-bottom: 2rem !important;
}

.post-title {
  margin-bottom: 0.5rem !important;
  line-height: 1.15 !important;
}

.post-meta {
  color: var(--dim) !important;
  font-size: 0.85rem !important;
  gap: 0.5rem !important;
}

.post-meta .wp-block-post-date,
.post-meta .wp-block-post-author {
  color: var(--dim) !important;
}

.post-meta p {
  margin: 0 !important;
}

/* Fix byline layout — keep "by" and author name inline */
.post-meta .wp-block-post-author {
  display: flex !important;
  align-items: baseline !important;
  gap: 0.3rem !important;
}

.post-meta .wp-block-post-author__byline {
  font-size: inherit !important;
  color: var(--dim) !important;
}

.post-meta .wp-block-post-author__name {
  color: var(--dim) !important;
}

/* ==========================================================================
   POST CONTENT
   ========================================================================== */

.post-content {
  margin-bottom: 3rem !important;
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* ==========================================================================
   POST FOOTER (Terms/Tags)
   ========================================================================== */

.post-footer {
  margin-top: 3rem !important;
  padding-top: 1.5rem !important;
  border-top: 1px solid var(--dim) !important;
  color: var(--dim) !important;
  font-size: 0.85rem !important;
}

.post-footer .wp-block-post-terms {
  color: var(--dim) !important;
}

.post-footer .wp-block-post-terms a {
  color: var(--text) !important;
  text-decoration: none !important;
}

.post-footer .wp-block-post-terms a:hover {
  color: var(--bright) !important;
}

/* ==========================================================================
   ARCHIVE & SEARCH TITLES
   ========================================================================== */

.archive-title,
.search-title {
  margin-bottom: 1rem !important;
}

.archive-description {
  color: var(--dim) !important;
  margin-bottom: 2rem !important;
}

/* ==========================================================================
   SEARCH FORM
   ========================================================================== */

.terminal-search {
  margin-bottom: 2rem !important;
}

.terminal-search .wp-block-search__inside-wrapper {
  border: 1px solid var(--dim) !important;
  border-radius: 4px !important;
  overflow: hidden;
}

.terminal-search .wp-block-search__input {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  padding: 0.75rem 1rem !important;
  font-family: var(--font) !important;
}

.terminal-search .wp-block-search__input::placeholder {
  color: var(--dim) !important;
}

.terminal-search .wp-block-search__input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.terminal-search .wp-block-search__button {
  background: var(--dim) !important;
  border: none !important;
  color: var(--bg) !important;
  padding: 0.75rem 1rem !important;
  cursor: pointer;
}

.terminal-search .wp-block-search__button:hover {
  background: var(--bright) !important;
}

/* ==========================================================================
   404 ERROR PAGE
   ========================================================================== */

.error-page {
  text-align: center;
  padding: 4rem 0 !important;
}

.error-prompt {
  text-align: left;
}

.error-code {
  font-size: 6rem !important;
  color: var(--error) !important;
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.4) !important;
  margin: 2rem 0 1rem !important;
  line-height: 1 !important;
}

.error-message {
  color: var(--text) !important;
  margin-bottom: 0.5rem !important;
}

.error-suggestion {
  color: var(--dim) !important;
  margin-bottom: 2rem !important;
}

.error-suggestion a {
  color: var(--bright) !important;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.wp-block-query-pagination {
  margin-top: 2rem !important;
  padding-top: 1.5rem !important;
  border-top: 1px dotted var(--dim) !important;
  color: var(--dim) !important;
}

.wp-block-query-pagination a {
  color: var(--text) !important;
  text-decoration: none !important;
}

.wp-block-query-pagination a:hover {
  color: var(--bright) !important;
}

.wp-block-query-pagination-numbers .page-numbers {
  padding: 0.25rem 0.5rem !important;
}

.wp-block-query-pagination-numbers .page-numbers.current {
  color: var(--bright) !important;
}

/* ==========================================================================
   COMMENTS
   ========================================================================== */

.comments-section {
  margin-top: 4rem !important;
  padding-top: 2rem !important;
  border-top: 1px solid var(--dim) !important;
}

.comments-title {
  color: var(--dim) !important;
  font-size: 0.85rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  margin-bottom: 1.5rem !important;
}

.comment {
  padding: 1rem 0 !important;
  border-bottom: 1px dotted rgba(61, 90, 48, 0.3) !important;
}

.comment:last-child {
  border-bottom: none !important;
}

.comment-meta {
  color: var(--dim) !important;
  font-size: 0.85rem !important;
  margin-bottom: 0.5rem !important;
  gap: 0.75rem !important;
}

.comment-meta .wp-block-comment-author-name {
  color: var(--text) !important;
  font-weight: 500 !important;
}

.wp-block-comment-content {
  color: var(--text) !important;
}

.wp-block-comment-reply-link {
  color: var(--dim) !important;
  font-size: 0.8rem !important;
}

.wp-block-comment-reply-link:hover {
  color: var(--bright) !important;
}

/* Comment Form */
.wp-block-post-comments-form {
  margin-top: 2rem !important;
}

.wp-block-post-comments-form textarea,
.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form input[type="url"] {
  background: transparent !important;
  border: 1px solid var(--dim) !important;
  color: var(--text) !important;
  padding: 0.75rem !important;
  font-family: var(--font) !important;
  border-radius: 4px !important;
}

.wp-block-post-comments-form textarea:focus,
.wp-block-post-comments-form input:focus {
  border-color: var(--bright) !important;
  outline: none !important;
}

.wp-block-post-comments-form label {
  color: var(--dim) !important;
  font-size: 0.85rem !important;
}

.wp-block-post-comments-form .form-submit input[type="submit"] {
  background: var(--bright) !important;
  color: var(--bg) !important;
  border: none !important;
  padding: 0.75rem 1.5rem !important;
  font-family: var(--font) !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  cursor: pointer !important;
  border-radius: 4px !important;
}

.wp-block-post-comments-form .form-submit input[type="submit"]:hover {
  box-shadow: 0 0 20px rgba(157, 255, 32, 0.5) !important;
}

/* ==========================================================================
   NO RESULTS
   ========================================================================== */

.no-results {
  color: var(--dim) !important;
  font-style: italic;
  padding: 2rem 0 !important;
}
