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

body {
    font-family: 'Courier New', monospace;
    background-color: #c0c0c0;
    color: #000000;
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header and nav items */
header {
    border-bottom: 2px solid #808080;
    padding: 0.5em;
}

header h1 {
    font-size: 1.2em;
    font-weight: normal;
    text-align: center;
    padding: 0.25em;
}


nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25em;
    margin-top: 0.5em;
}

nav li {
    background-color: #ffffff;
    border: 2px outset #808080;
    min-width: 80px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

nav a {
    display: block;
    padding: 0.4em 0.8em;
    text-decoration: none;
    color: #000000;
    font-size: 0.9em;
    text-align: center;
    font-weight: bold;
}

nav a:hover {
    background-color: #0000ff;
    color: #ffffff;
    transform: translateY(1px);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

nav a[aria-current="page"] {
    border: 2px inset #808080;
    background-color: #e0e0e0;
    color: #000080;
}

.logo {
   display: block;
   margin: 0 auto;
   cursor: pointer;
}

/* Main */

main {
    flex: 1;
    padding: 1em;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

section {
    background-color: #ffffff;
    border: 2px inset #c0c0c0;
    padding: 1em;
    margin-bottom: 1em;
}

/* Hero (404) */
.hero .hero-content {
    text-align: center;
}

.hero .hero-content img {
    display: block;
    margin: 0 auto 0.8em auto;
    max-width: 320px;
    width: 100%;
    height: auto;
}

/* Typo */
h1 {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 0.8em;
    border-bottom: 1px solid #808080;
    padding-bottom: 0.4em;
}

h2 {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 0.6em;
}

h3 {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 0.4em;
}

p {
    margin-bottom: 0.8em;
}

/* Gallery */

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1em;
    margin-top: 1em;
}

/* helper: force 2 columns on wider screens for homepage picks */
.grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.image-card {
    background-color: #ffffff;
    border: 2px outset #c0c0c0;
    padding: 0.8em;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.image-card:hover {
    border: 2px inset #c0c0c0;
    background-color: #dfdfdf;
}

.image-card img {
    width: 200px;
    height: 150px;
    display: block;
    margin: 0 auto 0.8em auto;
    border: 1px solid #808080;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    flex: 1;
    text-align: center;
}

.card-info .title {
    font-size: 0.9em;
    font-weight: bold;
    color: #000080;
}

.meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #595959;
}

.time {
    color: #595959;
}

.likes {
    color: #595959;
}

/* Image page */

.image-detail {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.image-detail img {
    max-width: 100%;
    height: auto;
    border: 2px inset #c0c0c0;
    margin-bottom: 1em;
}

.image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    text-align: left;
}

.image-title-large {
    font-size: 1.2em;
    font-weight: bold;
    color: #000080;
}

.engagement-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f8f8;
    border: 1px solid #c0c0c0;
    padding: 0.8em;
    margin: 1em 0;
}

.stats-table {
    font-size: 0.9em;
}

.stats-table td {
    padding: 0.2em 0.5em;
}

.engagement-actions {
    display: flex;
    gap: 0.5em;
}

.btn-action {
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    padding: 0.4em 0.8em;
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    color: #000000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3em;
}

.btn-action:hover {
    background-color: #dfdfdf;
}

.btn-action:active {
    border: 2px inset #c0c0c0;
}

.btn-liked {
    background-color: #ffccdd;
    color: #cc0066;
    border: 1px inset #cc0066;
}

.image-metadata {
    background-color: #dfdfdf;
    border: 1px solid #808080;
    padding: 0.8em;
    text-align: left;
    margin-top: 1em;
}

.metadata-table td {
    padding: 0.2em 0.5em;
}

/* Forms */

form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

fieldset {
    border: 2px inset #c0c0c0;
    padding: 1em;
    margin-bottom: 1em;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

legend {
    font-weight: bold;
    padding: 0 0.5em;
    background-color: #c0c0c0;
    border: 1px outset #c0c0c0;
}

label {
    font-weight: bold;
    margin-bottom: 0.3em;
    font-size: 0.9em;
    display: block;
}

input, textarea, select {
    font-family: 'Courier New', monospace;
    padding: 0.4em;
    border: 2px inset #c0c0c0;
    background-color: #ffffff;
    font-size: 0.9em;
    width: 100%;
    margin-bottom: 0.5em;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.form-buttons {
    display: flex;
    gap: 0.5em;
    margin-top: 0.5em;
}

button {
    font-family: 'Courier New', monospace;
    padding: 0.5em 1em;
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    font-size: 0.9em;
}

button:hover {
    background-color: #dfdfdf;
}

button:active {
    border: 2px inset #c0c0c0;
}

.form-row {
    margin-bottom: 0.8em;
    display: flex;
    flex-direction: column;
}

/* Login form */

.login-form {
    max-width: 400px;
    margin: 0 auto;
}
.btn-link {
    display: inline-block;
    padding: 0.5em 1em;
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    color: #000000;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    text-align: center;
}

.btn-link:hover {
    background-color: #dfdfdf;
}

.btn-link:active {
    border: 2px inset #c0c0c0;
}

/* CMS Page */

.cms-nav {
    display: flex;
    gap: 0.5em;
    margin-bottom: 1em;
    flex-wrap: wrap;
}

.cms-tab {
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 0.5em 1em;
    text-decoration: none;
    color: #000000;
    font-size: 0.9em;
}

.cms-tab:hover {
    background-color: #0000ff;
    color: #ffffff;
}

.cms-tab.active {
    border: 2px inset #c0c0c0;
    background-color: #dfdfdf;
}

.cms-section {
    background-color: #ffffff;
    border: 2px inset #c0c0c0;
    padding: 1em;
    margin-bottom: 1em;
}

.upload-options {
    display: flex;
    gap: 0.5em;
    margin-bottom: 1em;
}

.upload-mode {
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 0.4em 0.8em;
    font-size: 0.9em;
    cursor: pointer;
}

.upload-mode:hover {
    background-color: #0000ff;
    color: #ffffff;
}

.upload-mode.active {
    border: 2px inset #c0c0c0;
    background-color: #dfdfdf;
}

.upload-form {
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 1em;
    margin-top: 1em;
}

.upload-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.preview-container {
    border: 2px inset #c0c0c0;
    padding: 1em;
    text-align: center;
    background-color: #f0f0f0;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    color: #4a4a4a;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 0.5em;
    margin-top: 1em;
    flex-wrap: wrap;
}

.preview-btn {
    background-color: #008080;
    color: #ffffff;
}

.preview-btn:hover {
    background-color: #006666;
}

/* CMS Archive */

.archive-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1em;
    margin-bottom: 2em;
}

.tool-group {
    background-color: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 1em;
}

.tool-group h3 {
    margin-bottom: 0.8em;
    border-bottom: 1px solid #808080;
    padding-bottom: 0.4em;
}

.tool-btn {
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 0.4em 0.8em;
    margin: 0.2em 0.2em 0.2em 0;
    font-size: 0.9em;
    cursor: pointer;
}

.tool-btn:hover {
    background-color: #0000ff;
    color: #ffffff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5em;
    margin-top: 0.5em;
}

.stat-box {
    text-align: center;
    background-color: #ffffff;
    border: 1px solid #c0c0c0;
    padding: 0.5em;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #000080;
    display: block;
}

.stat-label {
    font-size: 0.8em;
    color: #595959;
}

.image-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1em;
    margin-bottom: 1em;
}

.manage-item {
    display: flex;
    background-color: #f0f0f0;
    border: 2px outset #c0c0c0;
    padding: 0.8em;
    gap: 1em;
}

.manage-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border: 1px solid #808080;
    flex-shrink: 0;
}

.manage-info {
    flex: 1;
}

.manage-info h4 {
    margin-bottom: 0.4em;
    font-size: 0.9em;
}

.manage-info p {
    margin-bottom: 0.3em;
    font-size: 0.8em;
    color: #4a4a4a;
}

.manage-actions {
    display: flex;
    gap: 0.3em;
    margin-top: 0.5em;
}

.btn-small {
    font-family: 'Courier New', monospace;
    font-size: 0.7em;
    padding: 0.3em 0.5em;
    background-color: #c0c0c0;
    border: 1px outset #c0c0c0;
    cursor: pointer;
    color: #000000;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    text-align: center;
}

.btn-small:hover {
    background-color: #dfdfdf;
}

.btn-small:active {
    border: 1px inset #c0c0c0;
}

.load-more {
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 0.5em 1em;
    font-size: 0.9em;
    cursor: pointer;
    width: 100%;
}

.load-more:hover {
    background-color: #0000ff;
    color: #ffffff;
}

/* CMS Analytics */

.analytics-overview {
    margin-bottom: 2em;
}

.analytics-overview h3 {
    margin-bottom: 1em;
}

.top-performing {
    margin-bottom: 2em;
}

.performance-list {
    background-color: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 1em;
}

.performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em 0;
    border-bottom: 1px solid #c0c0c0;
}

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

.performance-item .rank {
    font-weight: bold;
    color: #000080;
    width: 2em;
}

.performance-item .title {
    flex: 1;
    margin-left: 0.5em;
}

.performance-item .stats {
    font-size: 0.8em;
    color: #4a4a4a;
}

.category-performance {
    margin-top: 2em;
}

.category-stats {
    background-color: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 1em;
}

.category-item {
    padding: 0.5em 0;
    border-bottom: 1px solid #c0c0c0;
}

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

/* Landing ascii tree */

.ascii-tree {
    font-family: 'Courier New', monospace;
    background-color: #ffffff;
    border: 2px inset #c0c0c0;
    padding: 1em;
    white-space: pre;
    font-size: 0.8em;
    line-height: 1.2;
}

.ascii-tree a {
    color: #0035e2;
    text-decoration: none;
}

.ascii-tree a:hover {
    cursor: pointer;
    text-decoration: underline;
}

/* Category showcase grid */

.category-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1em;
    margin-top: 1em;
}

.category-tile {
    background-color: #ffffff;
    border: 2px outset #c0c0c0;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.category-tile:hover {
    border: 2px inset #c0c0c0;
    transform: translateY(1px);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.category-tile img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.tile-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #ffffff;
    padding: 1em;
    text-align: center;
}

.tile-info h3 {
    margin: 0 0 0.3em 0;
    font-size: 1.1em;
    font-weight: bold;
}

.tile-info .count {
    font-size: 0.8em;
    opacity: 0.9;
}

/* Gallery filtering */

.category-info {
    background-color: #f0f0f0;
    border: 2px inset #c0c0c0;
    padding: 1em;
    margin-bottom: 1em;
}

.back-link {
    color: #0035e2;
    text-decoration: none;
    font-size: 0.9em;
    margin-top: 0.5em;
    display: inline-block;
}

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

/* Filter navigation */

.filter-nav {
    margin-top: 1em;
}

.filter-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-top: 0.5em;
}

.filter-link {
    background-color: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 0.3em 0.6em;
    text-decoration: none;
    color: #000000;
    font-size: 0.9em;
    display: inline-block;
}

.filter-link:hover {
    background-color: #0000ff;
    color: #ffffff;
}

.filter-link.active {
    border: 2px inset #c0c0c0;
    background-color: #dfdfdf;
    color: #000080;
}

/* Footer */

footer {
    background: linear-gradient(90deg, #c0c0c0 0%, #dfdfdf 50%, #c0c0c0 100%);
    border-top: 2px solid #808080;
    padding: 0.5em;
    text-align: center;
    font-size: 0.8em;
    color: #000080;
}

.footer-sitemap {
    color: #000080;
    text-decoration: none;
    cursor: pointer;
}

/* Media queries */

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav li {
        width: 100%;
        max-width: 200px;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
        gap: 0.8em;
    }
    .grid-2col {
        grid-template-columns: 1fr;
    }
    
    .image-card {
        padding: 0.6em;
    }
    

    
    main {
        padding: 0.5em;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .metadata-table td {
        display: block;
        padding: 0.1em 0;
    }
    
    .engagement-section {
        flex-direction: column;
        gap: 0.5em;
        align-items: stretch;
    }
    
    .engagement-actions {
        justify-content: center;
    }
    
    .image-header {
        flex-direction: column;
        gap: 0.5em;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1em;
    }
    
    nav a {
        padding: 0.3em 0.5em;
        font-size: 0.8em;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
        gap: 0.6em;
    }
    
    .image-card {
        padding: 0.5em;
    }
    

    
    .card-info .title {
        font-size: 0.8em;
    }
    
    .meta {
        font-size: 0.75em;
    }
    
    .btn-small {
        min-width: 30px;
        padding: 0.2em 0.3em;
        font-size: 0.65em;
    }
    
    section {
        padding: 0.5em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
} 