@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');

/* Reset any defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Make the page full-height and center everything */
html, body {
    min-height: 100%;
    font-family: 'Audiowide', 'Courier New', monospace;
    background-color: #0a0a1a;
    color: #e0e0e0;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 2rem;
}

/* Header styling: large, bold, left-aligned with nav on right */
header {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    color: #00f2ff;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

/* Navigation: very minimal, small links under the header */
nav {
    margin-top: 0.5rem;
}

nav a {
    color: #e0e0e0;
    font-size: 0.9rem;
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid #334;
    border-radius: 4px;
    transition: all 0.15s ease;
}

nav a:hover {
    background-color: rgba(0, 242, 255, 0.1);
    border-color: #00f2ff;
    color: #00f2ff;
    box-shadow: 0 0 5px rgba(0, 242, 255, 0.3);
}

/* Main content area: keep it narrow and centered */
main {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* Article styling */
article {
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

/* Global header styles that work with HTMX */
h1, article h1, #content h1 {
    color: #00f2ff; /* Accent color, consistent with main header */
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

h2, article h2, #content h2 {
    color: #e0e0e0; /* Standard text color */
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Specific overrides for header h1 */
header h1 {
    color: #00f2ff !important;
    background: transparent !important;
    border: none !important;
    font-size: 3rem !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.3) !important;
}

article p {
    margin-bottom: 1rem;
}

article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 4px;
}

article a {
    color: #00f2ff;
    text-decoration: none;
}

article a:hover {
    text-decoration: underline;
}

article blockquote {
    margin: 1rem 0;
    padding: 1rem;
    border-left: 4px solid #00f2ff;
    background-color: rgba(0, 242, 255, 0.05);
    font-style: italic;
}

article blockquote p {
    margin-bottom: 0;
}

/* List styling */
article ul, article ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

article li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Nested lists */
article ul ul, article ol ol, article ul ol, article ol ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

article li li {
    margin-bottom: 0.25rem;
}

/* Footer: tiny copyright text at bottom */
footer {
    margin-top: 3rem;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

footer a {
    color: #00f2ff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Welcome message styling */
#content > p {
    text-align: center;
    color: #e0e0e0;
    opacity: 0.8;
}

/* Post snippets styling */
.post-snippet {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #334;
}

.post-snippet:last-child {
    border-bottom: none;
}

.post-snippet h2 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.post-snippet h2 a {
    color: #00f2ff;
    text-decoration: none;
}

.post-snippet h2 a:hover {
    text-decoration: underline;
}

.post-date {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.post-image {
    margin: 1rem 0;
}

.post-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    max-height: 200px;
    object-fit: cover;
}

.post-excerpt {
    color: #e0e0e0;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    margin-top: 0.5rem;
}

.read-more a {
    color: #00f2ff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.read-more a:hover {
    text-decoration: underline;
}

/* Back link styling */
.back-link {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #334;
    text-align: center;
}

.back-link a {
    color: #00f2ff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Visit counter styling */
.visit-counter {
    display: inline;
}

.visit-count {
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.8;
}

/* Tone transformation controls */
.tone-controls {
    margin: 1rem 0 2rem 0;
    padding: 1.5rem;
    border: 1px solid #334;
    border-radius: 8px;
    background-color: rgba(0, 242, 255, 0.05);
}

.tone-controls h3 {
    color: #00f2ff;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.2rem;
}

.tone-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.tone-btn {
    background-color: #1a1a2e;
    color: #e0e0e0;
    border: 1px solid #334;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-width: 100px;
}

.tone-btn:hover {
    background-color: rgba(0, 242, 255, 0.1);
    border-color: #00f2ff;
    color: #00f2ff;
    transform: translateY(-1px);
}

.tone-btn:active {
    transform: translateY(0);
}

.restore-btn {
    background-color: #2a2a3e !important;
    border-color: #555 !important;
}

.restore-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: #777 !important;
    color: #fff !important;
}

.loading-indicator {
    text-align: center;
    margin-top: 1rem;
}

.loading-text {
    color: #00f2ff;
    font-style: italic;
    animation: pulse 2s infinite;
}

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

.transformed-content {
    background-color: rgba(0, 242, 255, 0.08);
    border-left: 4px solid #00f2ff;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.transformed-content em {
    color: #00f2ff;
    font-weight: bold;
}

/* Mobile responsiveness for tone buttons */
@media (max-width: 600px) {
    .tone-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .tone-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* General Mobile Responsiveness - Target wider range of mobile devices */
@media (max-width: 768px) {
    body {
        /* Override flex settings for a single column layout */
        display: block;
        padding-top: 1rem; /* Reduce top padding slightly for mobile */
    }

    header {
        margin-bottom: 1rem; /* Reduce bottom margin for mobile */
    }

    header h1 {
        font-size: 2.5rem !important; /* Slightly smaller main title for mobile */
        margin-bottom: 1rem !important; /* Adjust margin for mobile */
    }

    nav {
        /* If nav links appear, make them stack */
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 1rem;
    }

    nav a {
        margin: 0.5rem 0; /* Adjust margin for vertical stacking */
        display: block; /* Make links take full width available in nav */
        width: 80%;     /* Or a specific width */
        text-align: center;
    }

    main {
        /* Allow main content to use more of the screen width */
        max-width: 100%;
        padding: 0.5rem; /* Adjust padding for smaller screens */
    }

    /* Mobile image styling is handled by global article img rule */

    /* Adjust article text for readability */
    article {
        font-size: 1rem; /* Ensure a readable base font size */
    }

    .post-snippet h2 {
        font-size: 1.5rem; /* Adjust snippet titles */
    }

    /* Make tone buttons full width in their container on mobile */
    .tone-btn { /* This will override the 600px media query if screen is <=600px */
        width: 100%;
        max-width: none; /* Remove max-width constraint from previous query if needed */
    }
}
