/* ============================================
   GROWY COMMUNITY – Übersicht + Diary-Ansicht
   Erbt Variablen aus base.css
   ============================================ */

:root {
    --community-radius: 16px;
    --community-radius-sm: 10px;
    --community-border: 1px solid rgba(255,255,255,0.08);
    --community-card-bg: #141414;
    --community-card-hover: #1a1a1a;
}

/* --- Community Hero --- */
.community-hero {
    padding-top: 80px;
    padding-bottom: 24px;
}
.community-hero .hero-kicker {
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.community-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 16px; }
.community-hero p { font-size: 1.05rem; max-width: 640px; }

/* --- Privacy Banner --- */
.privacy-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(95,211,95,0.06);
    border: 1px solid rgba(95,211,95,0.25);
    border-radius: var(--community-radius);
    padding: 14px 18px;
    margin: 8px 0 32px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.privacy-banner svg { width: 22px; height: 22px; fill: var(--accent-green); flex-shrink: 0; }
.privacy-banner strong { color: var(--text-main); }

/* --- Community Section / Toolbar --- */
.community-section { padding-bottom: 80px; }
.community-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

/* --- Diary Grid (Übersicht) --- */
.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.diary-card {
    background: var(--community-card-bg);
    border: var(--community-border);
    border-radius: var(--community-radius);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.diary-card:hover { border-color: rgba(95,211,95,0.25); transform: translateY(-2px); }
.diary-card-cover {
    position: relative;
    aspect-ratio: 4/3;
    background: #1a1a1a;
    overflow: hidden;
}
.diary-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.diary-card:hover .diary-card-cover img { transform: scale(1.04); }
.diary-card-phase {
    position: absolute;
    top: 10px; left: 10px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    color: var(--accent-green);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(95,211,95,0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.diary-card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.diary-card-title { font-size: 1.05rem; font-weight: 600; color: var(--text-main); }
.diary-card-strain { font-size: 0.82rem; color: var(--text-muted); }
.diary-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.diary-card-foot .dc-stats { display: flex; gap: 14px; }
.diary-card-foot .dc-stats span { display: inline-flex; align-items: center; gap: 4px; }
.diary-card-foot .dc-stats svg { width: 14px; height: 14px; fill: currentColor; }
.diary-card-foot .dc-grower { display: inline-flex; align-items: center; gap: 6px; }
.diary-card-foot .dc-grower img { width: 20px; height: 20px; border-radius: 50%; }

.diary-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* --- Diary Hero (Detailseite) --- */
.diary-hero {
    padding-top: 100px;
    padding-bottom: 40px;
}

.diary-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.diary-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.diary-breadcrumb a:hover { color: var(--accent-green); }

.diary-hero-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

.diary-cover {
    position: relative;
    border-radius: var(--community-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #1a1a1a;
}
.diary-cover img { width: 100%; height: 100%; object-fit: cover; }
.diary-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    color: var(--accent-green);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(95,211,95,0.3);
}

.diary-hero-meta h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin-bottom: 8px;
    line-height: 1.2;
}
.diary-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 20px;
}

.diary-grower-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.grower-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
    background: #1a1a1a;
}
.grower-name {
    display: block;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}
.grower-name:hover { color: var(--accent-green); }
.diary-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.diary-stats-row {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}
.diary-stat { display: flex; flex-direction: column; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-main); }
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Sticky Tabs --- */
.diary-tabs {
    display: flex;
    gap: 4px;
    margin-top: 40px;
    padding: 4px;
    background: var(--community-card-bg);
    border-radius: var(--community-radius-sm);
    border: var(--community-border);
    position: sticky;
    top: 80px;
    z-index: 50;
    backdrop-filter: blur(12px);
}
.diary-tabs a {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.diary-tabs a:hover { color: var(--text-main); background: rgba(255,255,255,0.05); }
.diary-tabs a.active { background: var(--accent-green); color: #0f0f0f; font-weight: 600; }

/* --- Sections --- */
.diary-section { padding-top: 48px; padding-bottom: 48px; }
.section-title { font-size: 1.4rem; margin-bottom: 24px; font-weight: 600; }
.section-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

/* --- Grow Details Grid --- */
.grow-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.grow-detail-card {
    background: var(--community-card-bg);
    border: var(--community-border);
    border-radius: var(--community-radius);
    padding: 20px;
}
.grow-detail-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-green);
    margin-bottom: 14px;
    font-weight: 600;
}
.grow-detail-card dl { margin: 0; }
.grow-detail-card dt { font-size: 0.75rem; color: var(--text-muted); margin-top: 10px; }
.grow-detail-card dt:first-child { margin-top: 0; }
.grow-detail-card dd { font-size: 0.95rem; color: var(--text-main); margin: 2px 0 0 0; font-weight: 500; }

/* --- Week Cards --- */
.week-card {
    background: var(--community-card-bg);
    border: var(--community-border);
    border-radius: var(--community-radius);
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.week-card:hover { border-color: rgba(95,211,95,0.2); }

.week-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}
.week-number { font-weight: 700; font-size: 1.05rem; color: var(--text-main); }
.week-phase {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.week-phase.vegetation { background: rgba(95,211,95,0.12); color: var(--accent-green); }
.week-phase.flowering { background: rgba(255,180,0,0.15); color: #ffb400; }
.week-phase.harvest { background: rgba(255,80,80,0.15); color: #ff5050; }
.week-date { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

/* Stats-Leiste */
.week-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 12px 20px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.week-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-right: 1px solid rgba(255,255,255,0.06);
    font-size: 0.8rem;
}
.week-stat:last-child { border-right: none; }
.week-stat svg { width: 14px; height: 14px; fill: var(--text-muted); flex-shrink: 0; }
.week-stat .ws-value { color: var(--text-main); font-weight: 600; }
.week-stat .ws-label { color: var(--text-muted); }

/* Wochen-Bilder */
.week-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 4px;
    padding: 4px;
}
.week-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    background: #1a1a1a;
}
.week-gallery img:hover { transform: scale(1.02); opacity: 0.9; }

.week-more-photos {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px dashed rgba(255,255,255,0.1);
}
.week-more-photos:hover { border-color: var(--accent-green); color: var(--accent-green); }

/* Wochen-Kommentar */
.week-comment { padding: 16px 20px; }
.week-comment-author { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.week-comment-author img { width: 28px; height: 28px; border-radius: 50%; background: #1a1a1a; }
.week-comment-author .author-name { font-weight: 600; font-size: 0.85rem; color: var(--text-main); }
.week-comment p { font-size: 0.92rem; line-height: 1.6; color: var(--text-muted); white-space: pre-line; }

/* Wochen-Actions */
.week-actions {
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.week-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
    font-family: inherit;
}
.week-action:hover { color: var(--accent-green); }
.week-action svg { width: 16px; height: 16px; fill: currentColor; }
.week-action.liked { color: var(--accent-green); }

/* --- Kommentare --- */
.comment-form { display: flex; gap: 12px; margin-bottom: 28px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: #1a1a1a; }
.comment-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.comment-input-wrap textarea {
    width: 100%;
    background: var(--community-card-bg);
    border: var(--community-border);
    border-radius: var(--community-radius-sm);
    padding: 12px 14px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 70px;
}
.comment-input-wrap textarea:focus { outline: none; border-color: var(--accent-green); }

.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.comment:last-child { border-bottom: none; }
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-header .author-name { font-weight: 600; font-size: 0.88rem; color: var(--text-main); }
.comment-header .comment-time { font-size: 0.75rem; color: var(--text-muted); }
.comment-body p { font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); }

/* --- Galerie --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--community-radius-sm);
    cursor: pointer;
    transition: transform 0.2s;
    background: #1a1a1a;
}
.gallery-grid img:hover { transform: scale(1.03); }

/* --- Filter Buttons --- */
.week-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    background: var(--community-card-bg);
    border: var(--community-border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.filter-btn:hover { color: var(--text-main); border-color: rgba(255,255,255,0.15); }
.filter-btn.active { background: var(--accent-green); color: #0f0f0f; border-color: var(--accent-green); font-weight: 600; }

/* --- Loading / Empty --- */
.diary-loading { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Lightbox --- */
#growy-lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 12px; object-fit: contain; }
#growy-lightbox .lb-close {
    position: absolute; top: 20px; right: 24px; background: none; border: none;
    color: #fff; font-size: 2rem; cursor: pointer; line-height: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .diary-hero-content { grid-template-columns: 1fr; }
    .diary-cover { max-width: 100%; aspect-ratio: 16/9; }
    .diary-tabs { top: 60px; overflow-x: auto; flex-wrap: nowrap; }
    .diary-tabs a { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; font-size: 0.82rem; }
    .diary-stats-row { gap: 16px; }
    .stat-value { font-size: 1.1rem; }
    .week-stats { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .week-stat { flex: 0 0 auto; }
    .week-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}