/* =====================================================
   SAGANEST — LIFE & WISDOM
   Wisdom listing page + Wisdom Studio
   ===================================================== */

/* ================= WISDOM PAGE ================= */
.wisdom-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 6% 100px;
}

/* ---------- HERO ---------- */
.wisdom-hero {
    position: relative;
    text-align: center;
    padding: 40px 0 50px;
    max-width: 780px;
    margin: 0 auto;
}

.wisdom-hero .section-label { margin-bottom: 14px; }

.wisdom-hero h1 {
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 22px;
}

.wisdom-hero h1 span { color: var(--accent-light); }

.wisdom-hero p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- CATEGORY FILTERS ---------- */
.wisdom-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 10px 0 45px;
    max-width: 980px;
    margin: 0 auto;
}

.wisdom-filter {
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    background: #20202a;
    border: 1px solid #30303a;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.wisdom-filter:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    background: rgba(155, 92, 255, 0.08);
}

.wisdom-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 6px 20px rgba(155, 92, 255, 0.3);
}

.wisdom-filter.active:hover { transform: translateY(-3px); }

/* ---------- POSTS GRID ---------- */
.wisdom-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 25px;
}

.wisdom-post {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 26px 26px 24px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    transition: all 0.35s ease;
    overflow: hidden;
}

.wisdom-post:hover {
    transform: translateY(-8px);
    border-color: #2a1f3a;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.post-category {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-light);
    background: rgba(155, 92, 255, 0.12);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
}

.wisdom-post h2 {
    font-size: 20px;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.wisdom-post p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-post {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-light);
    transition: all var(--transition);
    padding: 6px 0;
}

.read-post:hover {
    gap: 10px;
    color: #c39aff;
    transform: translateX(4px);
}

/* ---------- EMPTY STATE ---------- */
.wisdom-empty {
    display: none;
    text-align: center;
    padding: 80px 20px;
    max-width: 440px;
    margin: 0 auto;
}

.wisdom-empty h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.wisdom-empty p {
    color: var(--text-muted);
    font-size: 15px;
}

/* =====================================================
   WISDOM POST PAGE
   ===================================================== */

.post-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 50px 6% 90px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 40px;
    transition: all var(--transition);
    padding: 6px 12px;
    border-radius: 8px;
    margin-left: -12px;
}

.back-link:hover {
    color: var(--accent-light);
    background: rgba(155, 92, 255, 0.08);
    gap: 10px;
}

.post-header {
    text-align: center;
    padding-bottom: 35px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-subtle);
}

.post-header .post-category { margin-bottom: 22px; }

.post-header h1 {
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.post-date {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.post-body {
    font-size: 17px;
    line-height: 1.85;
    color: var(--text-secondary);
}

.post-body p { margin-bottom: 24px; }

.post-body p:first-of-type::first-letter {
    float: left;
    font-size: 3.4rem;
    line-height: 0.9;
    font-weight: 800;
    color: var(--accent-light);
    padding: 6px 14px 0 0;
}

.post-body .highlight {
    position: relative;
    margin: 40px 0;
    padding: 28px 32px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.7;
    color: #c39aff;
    background: linear-gradient(135deg, rgba(155, 92, 255, 0.14), rgba(109, 40, 217, 0.08));
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.post-body .highlight::before {
    content: "\201C";
    position: absolute;
    top: -14px;
    left: 16px;
    font-family: Georgia, serif;
    font-size: 4.5rem;
    line-height: 1;
    color: var(--accent);
    opacity: 0.3;
}

.share-section {
    margin-top: 60px;
    padding: 40px 30px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.share-section h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.share-section > p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 26px;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.share-btn {
    padding: 12px 26px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.facebook-btn { background: #1877f2; border-color: #1877f2; }
.facebook-btn:hover { background: #0e63d6; }

.whatsapp-btn { background: #25d366; border-color: #25d366; }
.whatsapp-btn:hover { background: #1eb355; }

.copy-btn {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(155, 92, 255, 0.3);
}

.copy-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 10px 28px rgba(155, 92, 255, 0.5);
}

.more-wisdom {
    margin-top: 50px;
    padding-top: 40px;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

.more-wisdom h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.more-wisdom p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.more-wisdom a {
    display: inline-block;
    padding: 13px 30px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    box-shadow: 0 6px 20px rgba(155, 92, 255, 0.3);
}

.more-wisdom a:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(155, 92, 255, 0.45);
}

.not-found {
    text-align: center;
    padding: 80px 30px;
    max-width: 480px;
    margin: 0 auto;
}

.not-found h1 {
    font-size: 34px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.not-found p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 26px;
    line-height: 1.7;
}

.not-found a {
    display: inline-block;
    padding: 13px 28px;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    box-shadow: 0 6px 20px rgba(155, 92, 255, 0.3);
}

.not-found a:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(155, 92, 255, 0.45);
}

/* =====================================================
   WISDOM STUDIO
   ===================================================== */

.studio-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 6% 100px;
}

.studio-header {
    position: relative;
    margin-bottom: 45px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-subtle);
}

.studio-header h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.studio-header p {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 620px;
    line-height: 1.7;
}

.studio-header .logout-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid #553333;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.studio-header .logout-btn:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: #e74c3c;
    transform: translateY(-2px);
}

.studio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    margin-bottom: 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    transition: border-color var(--transition);
}

.studio-card:hover { border-color: #2a1f3a; }

.studio-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
    letter-spacing: -0.01em;
}

.studio-card .form-group { margin-bottom: 22px; }

.studio-card .form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #d0d0d8;
    margin-bottom: 9px;
    letter-spacing: 0.2px;
}

.studio-card .form-group input,
.studio-card .form-group select,
.studio-card .form-group textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: #f0f0f5;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.studio-card .form-group input::placeholder,
.studio-card .form-group textarea::placeholder { color: var(--text-faint); }

.studio-card .form-group input:focus,
.studio-card .form-group select:focus,
.studio-card .form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(155, 92, 255, 0.15);
}

.studio-card .form-group textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.7;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
}

.studio-card .form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 42px;
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
    margin-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.studio-btn {
    padding: 13px 26px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    font-family: inherit;
}

.publish-btn {
    background: linear-gradient(135deg, #9b5cff, #7c3aed);
    color: #fff;
    box-shadow: 0 6px 20px rgba(155, 92, 255, 0.3);
}

.publish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(155, 92, 255, 0.45);
}

.publish-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.draft-btn,
.cancel-btn {
    background: transparent;
    border-color: #444;
    color: #fff;
}

.draft-btn:hover,
.cancel-btn:hover {
    border-color: var(--accent);
    color: #c39aff;
    background: rgba(155, 92, 255, 0.06);
    transform: translateY(-2px);
}

.message {
    display: none;
    margin-top: 22px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}

.message.success {
    display: block;
    background: rgba(39, 174, 96, 0.12);
    border: 1px solid rgba(39, 174, 96, 0.35);
    color: #7bd89b;
}

.message.error {
    display: block;
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #ff8a80;
}

.post-list {
    display: grid;
    gap: 14px;
}

.post-list > .post-empty,
.post-list:empty::before,
.post-list > p {
    display: block;
    padding: 50px 20px;
    text-align: center;
    border: 1px dashed #333;
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 14px;
}

.post-item {
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.post-item:hover {
    border-color: #493263;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.post-item h3 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    word-break: break-word;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.status {
    display: inline-block;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.5;
}

.status-published {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
}

.status-draft {
    background: rgba(231, 173, 79, 0.15);
    color: var(--warning);
}

.post-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.post-actions button {
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.view-btn {
    background: rgba(155, 92, 255, 0.12);
    color: #c39aff;
    border-color: rgba(155, 92, 255, 0.3);
}

.view-btn:hover {
    background: rgba(155, 92, 255, 0.22);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.edit-btn {
    background: transparent;
    border-color: #444;
    color: #fff;
}

.edit-btn:hover {
    border-color: var(--accent);
    color: #c39aff;
    background: rgba(155, 92, 255, 0.06);
    transform: translateY(-2px);
}

.delete-btn {
    background: transparent;
    border-color: #553333;
    color: var(--danger);
}

.delete-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
    transform: translateY(-2px);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
    .wisdom-posts { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 800px) {
    .wisdom-page { padding: 40px 5% 80px; }
    .wisdom-hero { padding: 20px 0 35px; }
    .wisdom-hero h1 { font-size: 38px; margin-bottom: 18px; }
    .wisdom-hero p { font-size: 15px; }
    .wisdom-categories { gap: 8px; padding-bottom: 30px; }
    .wisdom-filter { padding: 9px 16px; font-size: 13px; }
    .wisdom-posts { grid-template-columns: 1fr; gap: 18px; }
    .wisdom-post { padding: 22px 22px 20px; }
    .wisdom-post h2 { font-size: 18px; }

    .post-page { padding: 30px 5% 70px; }
    .back-link { margin-bottom: 30px; }
    .post-header { padding-bottom: 28px; margin-bottom: 32px; }
    .post-header h1 { font-size: 28px; }
    .post-body { font-size: 16px; line-height: 1.8; }
    .post-body .highlight { padding: 22px 24px; font-size: 16px; margin: 30px 0; }
    .share-section { padding: 30px 22px; margin-top: 45px; }
    .share-btn { flex: 1; min-width: 120px; }

    .studio-container { padding: 40px 5% 80px; }
    .studio-header { padding-bottom: 24px; margin-bottom: 32px; }
    .studio-header h1 { font-size: 30px; }
    .studio-header .logout-btn { position: static; margin-top: 18px; display: inline-flex; }
    .studio-card { padding: 26px 22px; border-radius: var(--radius-lg); margin-bottom: 20px; }
    .studio-card h2 { font-size: 19px; margin-bottom: 22px; }
    .button-row { flex-direction: column; }
    .studio-btn { width: 100%; }
    .post-item { padding: 18px 20px; }
    .post-actions button { flex: 1; min-width: 90px; text-align: center; }
}

@media (max-width: 480px) {
    .wisdom-hero h1 { font-size: 32px; }
    .wisdom-hero p { font-size: 14px; }
    .wisdom-filter { padding: 8px 14px; font-size: 12px; }
    .wisdom-post { padding: 20px 18px 18px; }
    .wisdom-post h2 { font-size: 17px; }
    .post-header h1 { font-size: 24px; }
    .post-body { font-size: 15.5px; }
    .post-body p:first-of-type::first-letter { font-size: 3rem; }
    .post-body .highlight { padding: 20px 20px; font-size: 15px; }
    .share-buttons { flex-direction: column; }
    .share-btn { width: 100%; }
    .more-wisdom h2 { font-size: 20px; }

    .studio-header h1 { font-size: 26px; }
    .studio-header p { font-size: 14px; }
    .studio-card { padding: 22px 18px; }
    .studio-card h2 { font-size: 17px; }
    .studio-card .form-group input,
    .studio-card .form-group select,
    .studio-card .form-group textarea { font-size: 14px; padding: 12px 14px; }
    .post-item h3 { font-size: 16px; }
    .post-meta { font-size: 12px; }
    .post-actions { flex-direction: column; }
    .post-actions button { width: 100%; }
}