/* FreshPress — Wikipedia/Early Internet Aesthetic + Video Grid */
/* No rounded corners. No shadows. No gradients. No animations. Content first. */

:root {
    --font-body: Georgia, 'Times New Roman', serif;
    --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --color-link: #1B7A4E;
    --color-link-visited: #145C3B;
    --color-bg: #FFFFFF;
    --color-bg-alt: #F4F9F6;
    --color-border: #A8D5BA;
    --color-text: #1A2E23;
    --color-text-muted: #4A6B56;
    --color-accent: #1B7A4E;
    --color-error: #D33;
    --color-success: #1B7A4E;
    --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    margin: 0;
    padding: 0;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-accent);
    color: #fff;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ===== Header ===== */
header {
    border-bottom: 2px solid var(--color-accent);
    background: var(--color-bg);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.site-title:visited { color: var(--color-accent); }
.site-title:hover { text-decoration: none; opacity: 0.85; }
.site-title img { width: 32px; height: 32px; }

.site-tagline {
    font-size: 12px;
    color: var(--color-text-muted);
    font-style: italic;
    display: none;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
}

header nav ul a,
header nav ul button {
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    font-family: var(--font-heading);
    padding: 6px 12px;
    border: 1px solid transparent;
    display: inline-block;
}
header nav ul a:visited { color: var(--color-text); }
header nav ul a:hover,
header nav ul button:hover {
    background: var(--color-bg-alt);
    border-color: var(--color-border);
}
header nav ul .active-nav a {
    border-bottom: 2px solid var(--color-accent);
    font-weight: 600;
}

/* Search form in header */
.search-form {
    margin-left: auto;
    display: flex;
    gap: 0;
}
.search-form input[type="search"] {
    font-family: var(--font-heading);
    font-size: 14px;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    width: 280px;
}
.search-form input[type="search"]:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}
.search-form button {
    font-family: var(--font-heading);
    font-size: 13px;
    padding: 6px 16px;
    border: 1px solid var(--color-accent);
    border-left: none;
    background: var(--color-accent);
    color: #fff;
    cursor: pointer;
}
.search-form button:hover { background: #145C3B; }

/* ===== Main content ===== */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 20px;
}

/* ===== Footer ===== */
footer {
    border-top: 2px solid var(--color-accent);
    background: var(--color-bg);
    padding: 24px 20px;
    margin-top: 48px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
}
footer a { color: var(--color-accent); }

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.3;
    padding-bottom: 4px;
    margin-top: 24px;
}
h1 { font-size: 28px; border-bottom: 1px solid var(--color-border); }
h2 { font-size: 22px; border-bottom: 1px solid var(--color-border); }
h3 { font-size: 18px; border-bottom: none; }

a { color: var(--color-link); }
a:visited { color: var(--color-link-visited); }

/* ===== Section headers ===== */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 4px;
    margin-bottom: 16px;
    margin-top: 32px;
}
.section-header:first-child { margin-top: 0; }
.section-header h2 {
    border-bottom: none;
    margin: 0;
    padding: 0;
}
.section-header a {
    font-family: var(--font-heading);
    font-size: 14px;
}

/* ===== Video Grid ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.video-card {
    display: flex;
    flex-direction: column;
}

.video-card a.video-thumb {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #0A1F14;
    overflow: hidden;
}
.video-card a.video-thumb video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-card a.video-thumb .thumb-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0A1F14 0%, #1B7A4E 100%);
    color: rgba(255,255,255,0.3);
    font-size: 48px;
}

.video-card .video-card-info {
    padding: 10px 0;
}

.video-card .video-card-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-card .video-card-title a {
    color: var(--color-text);
    text-decoration: none;
}
.video-card .video-card-title a:visited { color: var(--color-text); }
.video-card .video-card-title a:hover { text-decoration: underline; }

.video-card .video-card-meta {
    font-family: var(--font-heading);
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.video-card .video-card-meta a {
    color: var(--color-text-muted);
    text-decoration: none;
}
.video-card .video-card-meta a:hover { text-decoration: underline; }

.video-card .video-card-source {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--color-accent);
    border: 1px solid var(--color-border);
    padding: 1px 6px;
    margin-top: 4px;
    text-decoration: none;
}

/* ===== Video list (compact) ===== */
.video-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.video-list li {
    border-bottom: 1px solid #eaecf0;
    padding: 12px 0;
}
.video-list li:last-child { border-bottom: none; }

.video-list .video-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}
.video-list .video-meta {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* ===== Video Player Page ===== */
.video-page-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.video-player-container {
    width: 100%;
}

.video-player {
    background: #000;
    width: 100%;
    max-height: 540px;
    display: block;
}

.video-page-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    margin: 16px 0 8px;
    border-bottom: none;
    line-height: 1.3;
}

.video-page-meta {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--color-text-muted);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.video-page-meta .separator { color: var(--color-border); }

.video-info-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-heading);
    font-size: 13px;
}
.video-info-bar .source-badge {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 4px 12px;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
}
.video-info-bar .source-badge:hover { background: #eaf5ef; }

.follow-btn {
    background: var(--color-accent);
    color: #fff;
    border: 1px solid var(--color-accent);
    padding: 4px 14px;
    font-family: var(--font-heading);
    font-size: 12px;
    cursor: pointer;
}
.follow-btn:hover { background: #145C3B; }
.follow-btn.following {
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    border-color: var(--color-border);
}
.follow-btn.following:hover { background: #eaecf0; }

.video-description {
    margin: 16px 0;
    padding: 16px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    font-size: 15px;
}
.video-description h3 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

/* Sidebar related videos */
.sidebar-section h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-video-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-video-item {
    display: flex;
    gap: 10px;
}
.sidebar-video-item a.sidebar-thumb {
    flex-shrink: 0;
    width: 140px;
    height: 79px;
    background: #0A1F14;
    display: block;
    overflow: hidden;
}
.sidebar-video-item a.sidebar-thumb .thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0A1F14 0%, #1B7A4E 100%);
    color: rgba(255,255,255,0.2);
    font-size: 24px;
}
.sidebar-video-item .sidebar-video-info {
    flex: 1;
    min-width: 0;
}
.sidebar-video-item .sidebar-video-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sidebar-video-item .sidebar-video-title a {
    color: var(--color-text);
    text-decoration: none;
}
.sidebar-video-item .sidebar-video-title a:hover { text-decoration: underline; }
.sidebar-video-item .sidebar-video-meta {
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* ===== Video Metadata (definition list) ===== */
.video-metadata {
    margin: 24px 0;
}
.video-metadata dt {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--color-text-muted);
    float: left;
    clear: left;
    width: 120px;
    margin: 0;
    padding: 4px 0;
}
.video-metadata dd {
    margin-left: 130px;
    padding: 4px 0;
}

/* ===== Mission box ===== */
.mission-box {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 20px 24px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.mission-box .mission-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}
.mission-box .mission-text { flex: 1; }
.mission-box h2 {
    border-bottom: none;
    margin-top: 0;
    font-size: 16px;
    font-weight: 700;
}
.mission-box p { margin: 6px 0; font-size: 14px; }
.mission-box a {
    font-family: var(--font-heading);
    font-size: 13px;
}

/* ===== Category pills ===== */
.category-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}
.category-pill {
    font-family: var(--font-heading);
    font-size: 13px;
    padding: 4px 14px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
}
.category-pill:visited { color: var(--color-text); }
.category-pill:hover { background: var(--color-bg-alt); }
.category-pill.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.category-pill.active:visited { color: #fff; }

/* ===== Status notices ===== */
.notice {
    background: #FEF6E7;
    border: 1px solid #FC3;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}
.notice-removed {
    background: #FEE7E6;
    border-color: var(--color-error);
}

/* ===== Flash messages ===== */
.flash-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}
.flash-messages li {
    background: #D5FDF4;
    border: 1px solid var(--color-success);
    padding: 10px 16px;
    font-size: 14px;
    font-family: var(--font-heading);
    margin-bottom: 8px;
}

/* ===== Forms ===== */
form fieldset {
    border: 1px solid var(--color-border);
    padding: 16px 20px;
    margin: 16px 0;
}
form legend {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    padding: 0 8px;
}

label {
    display: block;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 4px;
}
label .required { color: var(--color-error); }
label .hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--color-text-muted);
    display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
textarea,
select {
    font-family: var(--font-body);
    font-size: 14px;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    width: 100%;
    max-width: 600px;
    background: var(--color-bg);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}
textarea { min-height: 120px; resize: vertical; }
select { max-width: 400px; }

input[type="file"] {
    font-family: var(--font-heading);
    font-size: 14px;
    margin: 4px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    font-size: 14px;
    margin-top: 16px;
    max-width: 600px;
}
.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

button[type="submit"], .btn {
    font-family: var(--font-heading);
    font-size: 14px;
    padding: 8px 20px;
    border: 1px solid var(--color-accent);
    background: var(--color-accent);
    color: #fff;
    cursor: pointer;
    margin-top: 16px;
    display: inline-block;
    text-decoration: none;
}
button[type="submit"]:hover, .btn:hover { background: #145C3B; }

.btn-secondary {
    background: var(--color-bg-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover { background: #eaecf0; }

.errors {
    background: #FEE7E6;
    border: 1px solid var(--color-error);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.errors ul { margin: 4px 0; padding-left: 20px; }
.errors li { font-size: 14px; color: var(--color-error); }

/* ===== Browse page ===== */
.browse-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
}
.browse-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.browse-sidebar li {
    padding: 6px 8px;
    font-size: 14px;
    font-family: var(--font-heading);
}
.browse-sidebar li:hover { background: var(--color-bg-alt); }
.browse-sidebar .active {
    font-weight: 700;
    border-left: 3px solid var(--color-accent);
    background: var(--color-bg-alt);
}
.browse-sidebar .active a { color: var(--color-accent); }

.sort-controls {
    font-family: var(--font-heading);
    font-size: 13px;
    margin-bottom: 16px;
    color: var(--color-text-muted);
}
.sort-controls a { margin: 0 4px; }

/* ===== Flag form ===== */
details {
    margin-top: 24px;
    border: 1px solid var(--color-border);
    padding: 12px 16px;
}
details summary {
    font-family: var(--font-heading);
    font-size: 14px;
    cursor: pointer;
    color: var(--color-text-muted);
}
details[open] summary { margin-bottom: 12px; }

.flag-form label { margin-top: 8px; }
.flag-form select { max-width: 300px; }

/* ===== Admin flags table ===== */
.flags-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.flags-table th, .flags-table td {
    border: 1px solid var(--color-border);
    padding: 8px 12px;
    text-align: left;
}
.flags-table th {
    background: var(--color-bg-alt);
    font-family: var(--font-heading);
    font-weight: 600;
}

/* ===== Contributor page ===== */
.contributor-header {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.contributor-header h1 { border-bottom: none; margin: 0; }
.contributor-header p { margin: 8px 0 0 0; color: var(--color-text-muted); font-size: 14px; }

/* ===== Content sections (about, guidelines) ===== */
.content-section { margin-bottom: 32px; }
.content-section h2 { margin-top: 32px; }
.content-section ul { padding-left: 24px; }
.content-section li { margin: 6px 0; }

/* ===== Error page ===== */
.error-page { text-align: center; padding: 48px 0; }
.error-page h1 { border-bottom: none; font-size: 48px; color: var(--color-text-muted); }

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-muted);
}
.empty-state p { font-size: 18px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .video-page-layout {
        grid-template-columns: 1fr;
    }
    .sidebar-video-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    .sidebar-video-item { flex-direction: column; }
    .sidebar-video-item a.sidebar-thumb { width: 100%; height: 0; padding-top: 56.25%; position: relative; }
    .sidebar-video-item a.sidebar-thumb .thumb-placeholder { position: absolute; top: 0; left: 0; }
}

@media (max-width: 700px) {
    .video-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .browse-layout { grid-template-columns: 1fr; }
    .browse-sidebar { border-bottom: 1px solid var(--color-border); padding-bottom: 16px; }
    header nav { flex-direction: column; align-items: flex-start; }
    .search-form { margin-left: 0; width: 100%; }
    .search-form input[type="search"] { flex: 1; width: auto; }
    .mission-box { flex-direction: column; text-align: center; }
    .category-bar { overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 480px) {
    .video-grid { grid-template-columns: 1fr; }
}
