/* Field Notes specific styles */

.fieldnotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xl, 32px);
}

.fieldnote-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.fieldnote-card {
    padding: 0;
    background: var(--bg-secondary, var(--surface));
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    transition: all 0.2s ease;
    overflow: hidden;
    height: 100%;
}

.fieldnote-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.fieldnote-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fieldnote-card-link:hover .fieldnote-card {
    border-color: #f59e0b;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(245, 158, 11, 0.2);
}

.fieldnote-card-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--space-sm, 12px);
    letter-spacing: 0.5px;
}

.fieldnote-card-title {
    font-family: var(--font-primary, 'Lexend'), Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 var(--space-sm, 12px) 0;
    padding: var(--space-xl, 32px) var(--space-xl, 32px) 0 var(--space-xl, 32px);
    color: var(--text-primary, #1a1a1a);
}

.fieldnote-card-date {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light, #9ca3af);
    margin-bottom: var(--space-md, 16px);
    padding: 0 var(--space-xl, 32px);
}

.fieldnote-card-summary {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary, #6b7280);
    margin: 0;
    padding: 0 var(--space-xl, 32px) var(--space-xl, 32px) var(--space-xl, 32px);
}

/* Locked ribbon for unauthenticated users */
.fieldnote-card-link.locked {
    position: relative;
}

.fieldnote-card-link.locked .fieldnote-card::after {
    content: 'Subscriber Only';
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: var(--surface);
    border-bottom-left-radius: 8px;
    border-top-right-radius: 12px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    letter-spacing: 0.75px;
    text-transform: uppercase;
    z-index: 10;
}

.fieldnotes-newsletter {
    margin: 0 auto var(--space-3xl, 64px);
}

/* Single fieldnote page */
.fieldnote {
    max-width: 56rem;
    margin: calc(var(--header-height, 80px) + var(--space-2xl, 48px)) auto var(--space-3xl, 64px);
    padding: 0;
    background: var(--surface);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
}

/* Paper grain texture */
.fieldnote::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.01) 2px,
            rgba(0, 0, 0, 0.01) 4px
        );
    pointer-events: none;
    opacity: 0.5;
}

/* Pink margin line inside paper */
.fieldnote::after {
    content: '';
    position: absolute;
    top: 0;
    left: 64px;
    bottom: 0;
    width: 2px;
    background: #fecaca; /* red-200 - notebook margin line */
    z-index: 0;
}

.fieldnote-header {
    margin-bottom: var(--space-2xl, 48px);
    margin-left: 96px; /* Start after the margin line */
    margin-right: var(--space-xl, 32px);
    padding-top: var(--space-2xl, 48px);
    text-align: left;
    padding-bottom: var(--space-lg, 24px);
    border-bottom: 1px solid #e7e5e4;
    position: relative;
}

.fieldnote-header::after {
    content: 'FIELD NOTE';
    position: absolute;
    top: calc(var(--space-2xl, 48px) + 0.75rem);
    right: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #a8a29e; /* stone-400 */
    text-transform: uppercase;
    padding: 4px 8px;
    background: #fafaf9; /* stone-50 */
    border: 1px solid #e7e5e4; /* stone-200 */
    border-radius: 3px;
}

.fieldnote-badge {
    display: none; /* Hidden in favor of the ::after label */
}

.fieldnote-title {
    font-family: var(--font-primary, 'Lexend'), Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #57534e; /* stone-600 */
    margin: 0;
    position: relative;
    z-index: 1;
}

.fieldnote-date {
    display: none; /* No dates for field notes */
}

.fieldnote-featured-image {
    margin-left: 96px; /* Align with content after margin line */
    margin-right: var(--space-xl, 32px);
    margin-bottom: var(--space-2xl, 48px);
    position: relative;
    z-index: 1;
}

.fieldnote-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fieldnote-content {
    font-family: var(--font-primary, 'Lexend'), Arial, sans-serif;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #57534e; /* stone-600, same as title */
    padding: 0 var(--space-xl, 32px) var(--space-xl, 32px) 96px; /* Start after the margin line */
    position: relative;
    z-index: 1;
}

.fieldnote-content h1,
.fieldnote-content h2,
.fieldnote-content h3 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: var(--space-xl, 32px);
    margin-bottom: var(--space-md, 16px);
    color: #57534e; /* stone-600, same as title */
}

.fieldnote-content h1 { font-size: 2rem; }
.fieldnote-content h2 { font-size: 1.75rem; }
.fieldnote-content h3 { font-size: 1.5rem; }

.fieldnote-content p {
    margin-bottom: var(--space-lg, 24px);
}

.fieldnote-content ul,
.fieldnote-content ol {
    margin-bottom: var(--space-lg, 24px);
    padding-left: var(--space-xl, 32px);
}

.fieldnote-content li {
    margin-bottom: var(--space-sm, 12px);
}

.fieldnote-content blockquote {
    border-left: 4px solid #a8a29e; /* stone-400 */
    padding-left: var(--space-lg, 24px);
    margin: var(--space-xl, 32px) 0;
    font-style: italic;
    color: #78716c; /* stone-500 - slightly lighter than main text */
}

.fieldnote-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
    margin: var(--space-2xl, 48px) 0;
}

.fieldnote-content th,
.fieldnote-content td {
    padding: 20px 24px;
    text-align: left;
    border: 1px solid #e7e5e4; /* stone-200 */
    border-radius: 4px;
}

.fieldnote-content th {
    background: #fafaf9; /* stone-50 */
    font-weight: 600;
    color: #57534e; /* stone-600 */
}

.fieldnote-content td {
    background: var(--surface);
    line-height: 1.7;
}

.fieldnote-content code {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--bg-secondary, #f3f4f6);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.fieldnote-content pre {
    background-color: var(--bg-secondary, #f3f4f6);
    padding: var(--space-lg, 24px);
    border-radius: 8px;
    overflow-x: auto;
    margin: var(--space-xl, 32px) 0;
}

.fieldnote-content pre code {
    background: none;
    padding: 0;
}

.fieldnote-footer {
    margin-top: var(--space-2xl, 48px);
    margin-left: 96px; /* Align with content after margin line */
    margin-right: var(--space-xl, 32px);
    padding-top: var(--space-xl, 32px);
    padding-bottom: var(--space-2xl, 48px);
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.fieldnote-meta {
    text-align: left;
}

.back-to-fieldnotes {
    font-family: var(--font-primary, 'Lexend'), Arial, sans-serif;
    font-size: 0.9375rem;
    color: #78716c; /* stone-500 */
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-to-fieldnotes:hover {
    color: #57534e; /* stone-600 */
}

/* Responsive */
@media (max-width: 640px) {
    .fieldnote {
        padding: var(--space-xl, 32px) var(--space-md, 16px);
    }

    .fieldnote-title {
        font-size: 2rem;
    }

    .fieldnote-content {
        font-size: 1rem;
    }
}
