/* ==========================================================================
   La Liste de Pierre - Bauhaus-inspired Design
   Palette from strommeninc.com
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=DM+Serif+Display&display=swap');

/* --- Variables --- */
:root {
    --red: #E63329;
    --blue: #1B4FB2;
    --yellow: #F5C518;
    --black: #1a1a1a;
    --white: #FAFAF8;
    --gray-50: #f7f7f5;
    --gray-100: #ededeb;
    --gray-200: #d9d9d6;
    --gray-300: #c4c4c0;
    --gray-400: #a3a39f;
    --gray-500: #8a8a86;
    --gray-600: #6b6b67;
    --gray-800: #3d3d3a;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --nav-height: 64px;
    --container-max: 1120px;
    --container-narrow: 640px;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(26,26,26,0.06);
    --shadow-md: 0 4px 12px rgba(26,26,26,0.08);
    --shadow-lg: 0 8px 24px rgba(26,26,26,0.12);
    --transition: 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--black);
    background-color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
    padding-top: var(--nav-height);
}

a {
    color: var(--black);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--blue);
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

/* --- Container --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: var(--container-narrow);
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(250, 250, 248, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-100);
    z-index: 1000;
}

.nav-inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 1.5rem;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--black);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-logo:hover {
    color: var(--red);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-links a {
    color: var(--gray-600);
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--black);
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--gray-200);
}

.nav-user {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-600) !important;
    letter-spacing: 0.02em;
}

.lang-toggle:hover {
    border-color: var(--black);
    color: var(--black) !important;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--black);
    border-radius: 1px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--black);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover {
    border-color: var(--black);
    color: var(--black);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.btn-primary:hover {
    background: var(--gray-800);
    color: var(--white);
    border-color: var(--gray-800);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* --- Flash Messages --- */
.flash-message {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--black);
    color: var(--white);
    padding: 0.875rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 999;
    animation: slideDown 0.3s ease;
}

.flash-message .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flash-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    opacity: 0.7;
}

.flash-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Hero --- */
.hero {
    padding: 5rem 0 3rem;
    text-align: center;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--gray-600);
    font-weight: 400;
}

/* --- Sections --- */
.section {
    padding: 3rem 0;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* --- Accent Colors --- */
.accent-red { background-color: var(--red); }
.accent-blue { background-color: var(--blue); }
.accent-yellow { background-color: var(--yellow); }
.accent-black { background-color: var(--black); }

.accent-red-border { border-color: var(--red); }
.accent-blue-border { border-color: var(--blue); }
.accent-yellow-border { border-color: var(--yellow); }
.accent-black-border { border-color: var(--black); }

/* --- Category Cards --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.category-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    text-decoration: none;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--black);
}

.category-card-accent {
    height: 4px;
    width: 100%;
}

.category-card-body {
    padding: 1.5rem;
}

.category-card-body h3 {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.category-card-body p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* --- CTA Banner --- */
.cta-banner {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    padding: 1.25rem 0;
}

.cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cta-text {
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.cta-text strong {
    font-weight: 700;
}

/* --- Post List --- */
.post-list {
    display: flex;
    flex-direction: column;
}

.post-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    transition: background var(--transition);
}

.post-row:first-child {
    border-top: 1px solid var(--gray-100);
}

.post-row:hover {
    background: var(--gray-50);
    color: var(--black);
}

.post-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.post-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.post-row-title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-row-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.post-row-category {
    font-weight: 500;
    color: var(--gray-600);
}

.post-row-location::before {
    content: "\2022";
    margin-right: 0.75rem;
}

.post-row-user::before {
    content: "\2022";
    margin-right: 0.75rem;
}

.post-row-time {
    font-size: 0.8125rem;
    color: var(--gray-400);
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Category Header --- */
.category-header {
    padding: 4rem 0 2rem;
    border-bottom: 3px solid var(--gray-200);
}

.category-header-accent {
    width: 48px;
    height: 4px;
    border-radius: 2px;
    margin-bottom: 1.25rem;
}

.category-header-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.category-header-desc {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.category-header-count {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.category-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

/* --- Post Detail --- */
.back-link {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.back-link:hover {
    color: var(--black);
}

.post-detail {
    padding-bottom: 3rem;
}

.post-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.post-detail-time {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.post-detail-title {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.post-detail-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-800);
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-100);
}

.post-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-detail-meta-item {
    display: flex;
    gap: 1rem;
    font-size: 0.9375rem;
}

.meta-label {
    color: var(--gray-400);
    font-weight: 500;
    min-width: 140px;
}

.meta-value {
    color: var(--black);
    font-weight: 500;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-600);
}

.empty-state p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.empty-state .btn {
    margin-top: 1.5rem;
}

/* --- Forms --- */
.form-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 2rem;
    padding-top: 3rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.form-group input,
.form-group select,
.form-group textarea {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--black);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(27, 79, 178, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 160px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6b67' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-align: right;
}

.form-footer {
    text-align: center;
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin-top: 1.5rem;
    padding-bottom: 3rem;
}

.form-footer a {
    color: var(--blue);
    font-weight: 600;
}

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

/* --- Verify --- */
.verify-icon {
    font-size: 4rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.verify-success {
    background: #22c55e;
}

.verify-fail {
    background: var(--red);
}

/* --- Footer --- */
.footer {
    background: var(--black);
    color: var(--gray-200);
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-col p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-400);
}

.footer-free {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--yellow) !important;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-col ul a {
    color: var(--gray-400);
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-col ul a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.footer-bottom a {
    color: var(--gray-400);
    font-weight: 600;
}

.footer-bottom a:hover {
    color: var(--white);
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
        gap: 1.25rem;
        font-size: 1rem;
        overflow-y: auto;
        border-top: 1px solid var(--gray-100);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-divider {
        width: 100%;
        height: 1px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .cta-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .category-header-title {
        font-size: 1.75rem;
    }

    .post-detail-title {
        font-size: 1.75rem;
    }

    .post-detail-meta-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .meta-label {
        min-width: auto;
    }

    .category-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
}

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

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

    .post-row-meta {
        flex-direction: column;
        gap: 0.125rem;
    }

    .post-row-location::before,
    .post-row-user::before {
        display: none;
    }
}

/* Pierre's List branding */
.nav-logo {
    font-family: 'Domine', serif !important;
    font-weight: 700 !important;
    color: var(--blue) !important;
    font-size: 1.3rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

/* Post images */
.post-image {
    margin-bottom: 2rem;
    border: 1px solid var(--gray-100);
    overflow: hidden;
}
.post-image img {
    width: 100%;
    height: auto;
    display: block;
}
.post-row-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid var(--gray-100);
    flex-shrink: 0;
    margin-right: 1rem;
}

/* File input styling */
input[type="file"] {
    border: 1.5px dashed var(--gray-300);
    padding: 1rem;
    width: 100%;
    cursor: pointer;
    background: var(--gray-50);
}
input[type="file"]:hover {
    border-color: var(--blue);
}
.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* --- Messaging --- */
.message-list { border-top: 1px solid var(--gray-100); }
.message-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.message-row:hover { background: var(--gray-50); }
.message-row.unread { background: rgba(27, 79, 178, 0.03); font-weight: 600; }
.message-row.unread .message-subject { font-weight: 700; }
.message-row-main { flex: 1; min-width: 0; }
.message-from { font-size: 0.85rem; color: var(--black); display: block; margin-bottom: 0.15rem; }
.message-subject { font-size: 0.95rem; color: var(--black); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-ref { font-size: 0.75rem; color: var(--gray-500); display: block; margin-top: 0.15rem; }
.message-time { font-size: 0.75rem; color: var(--gray-500); flex-shrink: 0; margin-left: 1rem; }

.message-detail { max-width: 700px; }
.message-detail-subject { font-family: 'DM Serif Display', serif; font-size: 1.5rem; margin-bottom: 1rem; }
.message-detail-meta {
    display: flex; flex-wrap: wrap; gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 1.5rem;
    font-size: 0.85rem; color: var(--gray-700);
}
.message-detail-meta a { color: var(--blue); }
.message-detail-body { font-size: 1rem; line-height: 1.8; color: var(--gray-700); margin-bottom: 2rem; }

.message-quote {
    background: var(--gray-50);
    border-left: 3px solid var(--gray-300);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.tab-nav { display: flex; gap: 0; margin-bottom: 2rem; border-bottom: 1.5px solid var(--gray-100); }
.tab {
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -1.5px;
    transition: all 0.2s;
}
.tab:hover { color: var(--black); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 4px;
}

.nav-inbox { position: relative; }

.post-contact-action {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.btn-outline {
    background: none;
    color: var(--black);
    border: 1.5px solid var(--gray-300);
}
.btn-outline:hover {
    border-color: var(--black);
    background: var(--gray-50);
}

.form-subtitle {
    color: var(--gray-700);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.page-header { margin-bottom: 1rem; }
