/* ===== BASE STYLES ===== */
body {
    font-family: "Anonymous Pro";
    font-style: normal;
    font-variant: normal;
    line-height: 1.5;
    background-color: rgb(255, 251, 246);
    color: #482401;
}

/* ===== TYPOGRAPHY ===== */
h1 { 
    font-size: 2em; 
    font-weight: 700; 
} 

h3 { 
    font-size: 1.5em; 
    font-weight: 700; 
} 

p { 
    font-size: 1em; 
    font-weight: 400; 
} 

blockquote { 
    font-size: 2em; 
    font-weight: 400; 
} 

pre { 
    font-size: 1em; 
    font-weight: 400;
}

/* ===== LINKS ===== */
a, a:visited, a:hover, a:active {
    color: #2cca36;
}

.hyperlink {
    background-color: rgba(249, 255, 67, 0.7);
    transition: all 0.3s ease;
}

.hyperlink:hover, .back-nav:hover {
    transform: translateY(-1px);
}

/* ===== LAYOUT COMPONENTS ===== */
#farm {
    text-align: center;
    font-size: 1.5em;
    padding: 1rem;
}

.desc {
    text-align: left;
    margin: 0 20% 0 20%; 
    padding: 1rem;
    max-width: 100%;
}

.title {
    text-align: center;
}

.big {
    text-align: center;
    font-size: 4em;
    margin-bottom: 0.25rem;
}

.caption {
    margin: 0 5% 0 5%;
    font-size: 1.2em;
}

/* ===== NAVIGATION ===== */
nav {
    text-align: right;
    padding: 1rem 0;
}

.back-nav {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    margin: 1rem 0;
    color: #2cca36;
    text-decoration: none;
    border-radius: 2px;
    font-weight: 600;
    font-size: 1.5em;
    text-align: center;
    transition: all 0.3s ease;
}

/* ===== CONTENT AREAS ===== */
.page-content {
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.zine-content {
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem;
    line-height: 1.6;
}

.zine-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(249, 255, 67, 0.7);
    padding-bottom: 0.5rem;
}

.zine-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ===== ZINE COMPONENTS ===== */
.zine-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.zine-table th,
.zine-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.zine-table th {
    font-weight: 700;
    background-color: rgba(249, 255, 67, 0.3);
}

.zine-table tr:hover {
    background-color: rgba(249, 255, 67, 0.1);
}

.zine-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.zine-page {
    width: 100%;
    height: auto;
    border: 2px solid rgba(249, 255, 67, 0.5);
    border-radius: 4px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.zine-page:hover {
    transform: scale(1.05);
    border-color: rgba(249, 255, 67, 1);
}

.pdf-embed {
    width: 100%;
    height: 600px;
    border: 2px solid rgba(249, 255, 67, 0.5);
    border-radius: 4px;
    margin: 1rem 0;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 251, 246, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    font-size: 1.5em;
    color: #482401;
    animation: pulse 1.5s ease-in-out infinite;
}

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

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

/* Large Desktop */
@media screen and (max-width: 1020px) {
    .desc {
        margin: 0 15% 0 15%;
    }
}

/* Tablet */
@media screen and (max-width: 780px) {
    body {
        font-size: 0.7em;
    }
    
    .desc {
        margin: 0 10% 0 10%;
        padding: 1rem;
    }
    
    #farm {
        font-size: 1.1em;
        overflow-x: auto;
        white-space: pre;
    }
    
    .back-nav {
        font-size: 1.3em;
        padding: 0.5rem 1.2rem;
    }
    
    .big {
        font-size: 3em;
    }
    
    .zine-table {
        font-size: 0.9em;
    }
    
    .zine-content {
        max-width: 95%;
        padding: 1.5rem;
    }
    
    .page-content {
        max-width: 95%;
        padding: 1.5rem;
    }
    
    .zine-images {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.8rem;
    }
    
    .loading-content {
        font-size: 1.1em;
        padding: 1rem;
    }
    
    .loading-content pre {
        font-size: 0.5em;
        overflow-x: auto;
        white-space: pre;
    }
    
    /* Articles responsive - tablet */
    .articles-container {
        min-height: 700px;
    }
    
    .article-section {
        width: 28%;
        font-size: 0.8em;
        padding: 0.4rem;
    }
    
    /* Fallback positions for tablet */
    .article-section:nth-child(1) { top: 15%; left: 5%; }
    .article-section:nth-child(2) { top: 15%; left: 33%; }
    .article-section:nth-child(3) { top: 15%; left: 61%; }
    .article-section:nth-child(4) { top: 40%; left: 5%; }
    .article-section:nth-child(5) { top: 40%; left: 33%; }
}

/* Mobile */
@media screen and (max-width: 480px) {
    body {
        font-size: 0.6em;
    }
    
    .desc {
        margin: 0 5% 0 5%;
        padding: 0.8rem;
    }
    
    #farm {
        font-size: 0.8em;
        overflow-x: auto;
    }
    
    .back-nav {
        font-size: 1.1em;
        padding: 0.4rem 1rem;
    }
    
    .big {
        font-size: 2.2em;
    }
    
    .zine-table {
        font-size: 0.8em;
    }
    
    .zine-table th,
    .zine-table td {
        padding: 0.5rem;
    }
    
    .zine-content {
        max-width: 98%;
        padding: 1rem;
    }
    
    .zine-images {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .loading-content {
        font-size: 1em;
        padding: 0.8rem;
    }
    
    .loading-content pre {
        font-size: 0.4em;
    }
    
    /* Articles responsive - mobile */
    .articles-container {
        position: static;
        min-height: auto;
        margin-top: 1rem;
    }
    
    .article-section {
        position: static;
        width: 100%;
        margin-bottom: 1rem;
        font-size: 0.7em;
        cursor: default;
    }
    
    .article-section:hover {
        box-shadow: none;
        transform: none;
    }
    
    .article-section:active {
        box-shadow: none;
        transform: none;
    }
    
    .article-section:nth-child(1),
    .article-section:nth-child(2), 
    .article-section:nth-child(3),
    .article-section:nth-child(4),
    .article-section:nth-child(5) {
        top: auto;
        left: auto;
        right: auto;
    }
}

/* ===== ARTICLES ===== */
.articles-container {
    position: relative;
    min-height: 800px;
    margin-top: 2rem;
    width: 100%;
}

.article-section {
    background-color: #fcf5ed;
    padding: 0.5rem;
    position: absolute;
    width: 22%;
    font-size: 0.9em;
    border: 1px solid #e0d4c7;
    border-radius: 4px;
    box-sizing: border-box;
    line-height: 1.4;
    cursor: move;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.article-section:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.article-section:active {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.article-section a {
    word-wrap: break-word;
    display: inline-block;
    margin: 0.2rem 0;
}

/* Default fallback positions if JavaScript fails */
.article-section:nth-child(1) { top: 15%; left: 5%; }
.article-section:nth-child(2) { top: 15%; left: 27%; }
.article-section:nth-child(3) { top: 15%; left: 49%; }
.article-section:nth-child(4) { top: 40%; left: 5%; }
.article-section:nth-child(5) { top: 40%; left: 27%; }

/* Large desktop screens */
@media screen and (min-width: 1200px) {
    .articles-container {
        min-height: 900px;
    }
    
    .article-section {
        width: 18%;
        font-size: 0.9em;
    }
    
    /* More spacing for large screens */
    .article-section:nth-child(1) { top: 15%; left: 5%; }
    .article-section:nth-child(2) { top: 15%; left: 23%; }
    .article-section:nth-child(3) { top: 15%; left: 41%; }
    .article-section:nth-child(4) { top: 15%; left: 59%; }
    .article-section:nth-child(5) { top: 15%; left: 77%; }
}

/* ===== ASCII ART ===== */
.ascii-art {
    position: absolute;
    font-size: 0.7em;
    color: #bb9362;
    opacity: 0.6;
    font-family: 'Anonymous Pro', monospace;
    line-height: 1.2;
    white-space: pre;
    z-index: 1;
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.8); 
    }
    to { 
        opacity: 0.6; 
        transform: scale(1); 
    }
}

@media screen and (max-width: 780px) {
    .ascii-art {
        font-size: 0.6em;
        opacity: 0.5;
    }
}

@media screen and (max-width: 480px) {
    .ascii-art {
        display: none;
    }
}
