/* ========================================
   TWITTER-STYLE LAYOUT CSS
   For Neocities & Personal Websites
   ======================================== */

/* ========== CUSTOMIZATION VARIABLES ========== */
/* Change these values to customize your site! */

:root {
    /* FONTS */
    --ft: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --fsz: 15px; /* Options: 14px, 15px, 16px, 18px */
    
    /* LAYOUT DIMENSIONS */
    --nw: 275px;  /* Navigation width - Options: 200px, 225px, 250px, 275px, 300px, 325px, 350px, 90px (icon-only) */
    --psz: 600px; /* Post width - Options: 400px, 450px, 500px, 540px, 600px, 650px, 700px */
    --sbw: 350px; /* Sidebar width - Options: 250px, 275px, 300px, 325px, 350px, 375px, 400px */
    --brds: 16px; /* Border radius - Options: 4px, 8px, 10px, 16px */ 
    
    /* BODY COLORS (Light Theme) */
    --bg: #ffffff;     /* Page background */
    --bdr: #e8eced;    /* Border color */
    --txt: #0f1419;    /* Main text color */
    --gray: #71767b;   /* Gray/muted text */
    
    /* NAVIGATION COLORS */
    --navh: rgba(83,100,113,.13); /* Nav hover background */
    
    /* SIDEBAR COLORS */
    --sbg: #f7f9f9;              /* Sidebar background */
    --sbgh: rgba(0,0,0,0.03);    /* Sidebar hover */
    --sbdr: #e6ecf2;             /* Sidebar borders */
    
    /* POST COLORS */
    --pbg: #ffffff;    /* Post background */
    --pbg2: #f2f6f7;   /* Alternate post background (hover/secondary) */
    --pbdr: #e8eced;   /* Post borders */
    --ptxt: #0f1419;   /* Post text */
    --pgray: #71767b;  /* Post gray text */
}

/* ========== DARK THEME (Optional) ========== */
/* Uncomment this section to enable dark mode */
/*
body.dark-theme {
    --bg: #000000;
    --bdr: #2f3336;
    --txt: #e7e9ea;
    --gray: #71767b;
    
    --navh: rgba(239,243,244,.1);
    
    --sbg: #16181c;
    --sbgh: rgba(255,255,255,0.03);
    --sbdr: #2f3336;
    
    --pbg: #000000;
    --pbg2: #16181c;
    --pbdr: #2f3336;
    --ptxt: #e7e9ea;
    --pgray: #71767b;
}
*/

/* ========== RESET & BASE STYLES ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--ft);
    font-size: var(--fsz);
    color: var(--txt);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--act);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== MAIN LAYOUT STRUCTURE ========== */

main {
    max-width: calc(var(--nw) + var(--psz) + var(--sbw) + 62px);
    margin: 0 auto;
    display: flex;
    padding: 0 15px;
}

/* ========== NAVIGATION (LEFT SIDEBAR) ========== */

nav {
    width: var(--nw);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 10px;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

nav a {
    display: block;
    padding: 12px 20px;
    margin: 5px 0;
    border-radius: 9999px; /* Fully rounded */
    color: var(--txt);
    font-size: 19px;
    font-weight: 700;
    transition: background 0.2s ease;
}

nav a:hover {
    background: #CCDE7D;
    text-decoration: none;
}

nav a i {
    margin-right: 15px;
    font-size: 26px;
    width: 26px;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
}

nav a.current-page {
    font-weight: 900;
}

/* ========== POSTS SECTION (CENTER) ========== */

#posts {
    width: var(--psz);
    min-height: 100vh;
    border-left: 1px solid var(--bdr);
    border-right: 1px solid var(--bdr);
}

/* ========== HEADER / PROFILE ========== */

header {
    background: var(--pbg);
    border-bottom: 1px solid var(--bdr);
    margin: 0;
    padding: 0;
}

.header-image {
    width: 100%;
    height: 200px;
    /* Default gradient - replace with your image */
    background: linear-gradient(135deg, var(--act) 0%, #00d4ff 100%);
    background-size: cover;
    background-position: center;
    /* To use an image instead, uncomment below and add your image URL */
    /* background-image: url('your-banner-image.jpg'); */
}

.header-content {
    padding: 0 20px 20px;
    position: relative;
}

.header-avatar {
    width: 134px;
    height: 134px;
    border-radius: 50%;
    border: 4px solid var(--pbg);
    background: var(--gray); /* Fallback color */
    margin-top: -67px; /* Half of height to overlap banner */
    overflow: hidden;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.header-actions a {
    width: 36px;
    height: 36px;
    border: 1px solid var(--bdr);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--txt);
    transition: background 0.2s ease;
}

.header-actions a:hover {
    background: var(--pbg2);
    text-decoration: none;
}

.follow-button {
    background: var(--txt) !important;
    color: var(--pbg) !important;
    padding: 8px 20px !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    width: auto !important;
    height: auto !important;
    font-size: 15px !important;
}

.follow-button:hover {
    background: var(--gray) !important;
}

/* Profile Bio Styles */

.bio-name {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    line-height: 1.2;
}

.verified-badge {
    color: var(--act);
    font-size: 18px;
}

.bio-url {
    color: var(--gray);
    font-size: 15px;
    margin-bottom: 15px;
}

.bio-description {
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--txt);
}

.bio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--gray);
    font-size: 15px;
}

.bio-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bio-meta i {
    font-size: 16px;
}

.bio-meta a {
    color: var(--act);
}

.bio-meta a:hover {
    text-decoration: underline;
}

/* ========== POST STYLES ========== */

.post {
    background: var(--pbg);
    border-bottom: 1px solid var(--bdr);
    padding: 15px 20px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.post:hover {
    background: var(--pbg2);
}

/* Post Header (for reposts, pinned posts, etc.) */

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--gray);
    font-size: 13px;
}

.post-header i {
    font-size: 16px;
}

.post-header a {
    color: var(--txt);
    font-weight: 700;
}

.post-header a:hover {
    text-decoration: underline;
}

/* Post Title */

.post-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--ptxt);
    line-height: 1.3;
}

.post-title a {
    color: var(--ptxt);
}

/* Post Content */

.post-caption {
    line-height: 1.5;
    margin-bottom: 15px;
    word-wrap: break-word;
    color: var(--ptxt);
}

.post-caption p {
    margin-bottom: 10px;
}

.post-caption p:last-child {
    margin-bottom: 0;
}

.post-caption a {
    color: var(--act);
    text-decoration: none;
}

.post-caption a:hover {
    text-decoration: underline;
}

/* Image Posts */

.image-container {
    margin: 10px 0;
    border-radius: var(--brds);
    overflow: hidden;
    border: 1px solid var(--pbdr);
    background: var(--pbg2);
}

.image-container img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.image-container img:hover {
    opacity: 0.95;
}

/* Quote Posts */

.quote {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    padding: 20px;
    background: var(--pbg2);
    border-left: 4px solid var(--act);
    border-radius: var(--brds);
    color: var(--ptxt);
}

.quote-source {
    color: var(--gray);
    padding-left: 20px;
    font-size: 15px;
    font-style: italic;
}

/* Post Tags */

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.post-tag {
    color: var(--act);
    font-size: 14px;
    transition: color 0.2s ease;
}

.post-tag:hover {
    color: var(--txt);
    text-decoration: underline;
}

/* Post Footer (timestamps and actions) */

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray);
    font-size: 13px;
    margin-top: 10px;
}

.footer-left a {
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-left a:hover {
    color: var(--act);
    text-decoration: none;
}

.footer-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-right a {
    color: #ADFF99;
    transition: color 0.2s ease;
    font-size: 16px;
}

.footer-right a:hover {
    color: #ADFF99;
    text-decoration: none;
}

/* ========== SIDEBAR (RIGHT) ========== */

aside {
    width: var(--sbw);
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow: visible;
    padding: 20px 0;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

aside::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Sidebar Boxes/Widgets */

.sidebar-box {
    background: var(--sbg);
    border-radius: var(--brds);
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--sbdr);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--txt);
}

/* Account/Link Items in Sidebar */

.account {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
    margin-bottom: 6px;
    align-items: center;
}

.account:hover {
    background: var(--sbgh);
    text-decoration: none;
}

.account:last-child {
    margin-bottom: 0;
}

.account img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray);
    object-fit: cover;
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-info h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--txt);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.account-info h4 {
    font-size: 13px;
    color: var(--gray);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* Sidebar Footer */

.sidebar-footer {
    padding: 12px 15px;
    font-size: 12px;
    color: var(--gray);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.4;
}

.sidebar-footer a {
    color: var(--gray);
}

.sidebar-footer a:hover {
    text-decoration: underline;
}

/* ========== MOBILE NAVIGATION ========== */

.mobile-nav {
    display: none;
    background: var(--pbg);
    border-bottom: 1px solid var(--bdr);
    padding: 10px;
    justify-content: space-around;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-nav a {
    color: var(--txt);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
}

.mobile-nav a:hover {
    color: var(--act);
    text-decoration: none;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablet/Small Desktop - Compact Navigation */
@media (max-width: calc(350px + 600px + 275px + 62px)) {
    :root {
        --nw: 90px;
    }
    
    nav a {
        padding: 12px;
        text-align: center;
    }
    
    nav a span {
        display: none;
    }
    
    nav a i {
        margin-right: 0;
    }
}

/* Tablet - Hide Right Sidebar */
@media (max-width: calc(350px + 600px + 152px)) {
    aside {
        display: none;
    }
    
    #posts {
        border-right: none;
    }
}

/* Mobile - Minimal Navigation */
@media (max-width: calc(600px + 112px)) {
    :root {
        --nw: 60px;
    }
    
    main {
        padding-left: 0;
    }
    
    #posts {
        width: 100%;
    }
    
    .post {
        border-radius: 0;
    }
    
    header {
        border-radius: 0;
    }
}

/* Mobile - Full Width, Top Navigation */
@media (max-width: 540px) {
    nav {
        display: none;
    }
    
    main {
        padding: 0;
    }
    
    #posts {
        border-left: none;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .header-image {
        height: 150px;
    }
    
    .header-avatar {
        width: 84px;
        height: 84px;
        margin-top: -42px;
    }
}

/* Small Mobile - Hide Extra Elements */
@media (max-width: 400px) {
    .header-actions a:not(.follow-button) {
        display: none;
    }
    
    .footer-right a:last-child {
        display: none;
    }
    
    .bio-meta {
        font-size: 14px;
    }
}

/* ========== UTILITY CLASSES ========== */

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray);
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

/* ========== CUSTOM SCROLLBAR (ALL BROWSERS) ========== */

* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* ========== SMOOTH SCROLLING ========== */

html {
    scroll-behavior: smooth;
}

/* ========== PRINT STYLES ========== */

@media print {
    nav, aside, .mobile-nav, .header-actions, .post-footer {
        display: none !important;
    }
    
    main {
        display: block;
    }
    
    #posts {
        border: none;
        width: 100%;
    }
    
    .post {
        page-break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 20px;
    }
}

/* ========== END OF STYLES ========== */