/* ========================================
   TWITTER-STYLE LAYOUT CSS
   For Neocities & Personal Websites
   ======================================== */

::selection {
  color: #d36c44;
  background: #a9be6b;
}

/* ========== 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 */
    --psz: 600px; /* Post width */
    --sbw: 350px; /* Sidebar width */
    --brds: 16px; /* Border radius */
    
    /* ACCENT COLOR - Change this to match your brand! */
    --act: #ad241b; /* Used for links, verified badge, etc. */
    
    /* ICON HOVER COLOR - This is the color icons turn on hover! */
    --icon-hover: #ad241b;
    
    /* BODY COLORS (Light Theme) */
    --bg: #ffffff;
    --bdr: #e8eced;
    --txt: #0f1419;
    --gray: #71767b;
    
    /* NAV COLORS */
    --navh: rgba(83,100,113,.13);
    
    /* SIDEBAR COLORS */
    --sbg: #f7f9f9;
    --sbgh: rgba(0,0,0,0.03);
    --sbdr: #e6ecf2;
    
    /* POST COLORS */
    --pbg: #ffffff;
    --pbg2: #f2f6f7;
    --pbdr: #e8eced;
    --ptxt: #0f1419;
    --pgray: #71767b;
}

/* ========== 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;
    gap: 30px;
    padding: 0 15px;
}

/* ========== NAVIGATION (LEFT SIDEBAR) ========== */

nav {
    width: var(--nw);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

nav::-webkit-scrollbar {
    display: none;
}

nav a {
    display: block;
    padding: 12px 20px;
    margin: 5px 0;
    border-radius: 9999px;
    color: var(--txt);
    font-size: 19px;
    font-weight: 700;
    transition: background 0.2s ease;
}

nav a:hover {
    background: var(--navh);
    text-decoration: none;
}

nav a:hover i {
    color: var(--icon-hover);
}

nav a i {
    margin-right: 15px;
    font-size: 24px;
    width: 24px;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    transition: color 0.2s ease;
}

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;
    position: relative;
}

/* Header Banner Image */

.header-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #cfd9de; /* Fallback if no image loads */
    position: relative;
}

.header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Header Content Container */

.header-content {
    padding: 0 16px 16px;
    position: relative;
}

/* Avatar - Overlaps banner image */

.header-avatar {
    width: 134px;
    height: 134px;
    border-radius: 50%;
    border: 4px solid var(--pbg);
    background: var(--gray);
    overflow: hidden;
    position: absolute;
    top: -67px;
    left: 16px;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Action Buttons - Below banner, right side, separate from avatar */

.header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    min-height: 67px;
}

.header-actions a {
    width: 40px;
    height: 40px;
    border: 1px solid var(--bdr);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--txt);
    transition: all 0.2s ease;
    background: var(--pbg);
    font-size: 17px;
    flex-shrink: 0;
}

.header-actions a:hover {
    background: var(--pbg2);
    color: var(--icon-hover);
    border-color: var(--icon-hover);
    text-decoration: none;
}

.follow-button {
    background: #EB765F;
    color: #EB765F;
    padding: 0 28px !important;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    width: auto !important;
    height: 40px !important;
    font-size: 15px !important;
    border: 1px solid var(--txt) !important;
    min-width: 90px !important;
    letter-spacing: 0.3px !important;
}

.follow-button:hover {
    background: var(--icon-hover) !important;
    border-color: var(--icon-hover) !important;
    color: var(--pbg) !important;
}

/* Bio Section - Below avatar */

.bio-info {
    margin-top: 8px;
}

.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: 20px;
}

.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: 15px;
}

.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: 15px;
}

.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(--icon-hover);
    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 i {
    font-size: 16px;
    transition: color 0.2s ease;
}

.footer-left a:hover {
    color: var(--icon-hover);
    text-decoration: none;
}

.footer-left a:hover i {
    color: var(--icon-hover);
}

.footer-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-right a {
    color: var(--gray);
    transition: color 0.2s ease;
    font-size: 18px;
}

.footer-right a:hover {
    color: var(--icon-hover);
    text-decoration: none;
}

/* ========== SIDEBAR (RIGHT) ========== */

aside {
    width: var(--sbw);
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow: visible;
    padding: 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

aside::-webkit-scrollbar {
    display: none;
}

/* 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;
    color: var(--icon-hover);
}

/* ========== 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(--icon-hover);
    text-decoration: none;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Large Desktop - Full Layout */
@media (min-width: 1288px) {
    main {
        max-width: calc(var(--nw) + var(--psz) + var(--sbw) + 62px);
    }
}

/* Medium Desktop - Compact Navigation */
@media (max-width: 1287px) and (min-width: 963px) {
    :root {
        --nw: 90px;
    }
    
    nav a {
        padding: 12px;
        text-align: center;
        justify-content: center;
    }
    
    nav a span {
        display: none;
    }
    
    nav a i {
        margin-right: 0;
    }
}

/* Tablet - Hide Right Sidebar */
@media (max-width: 962px) and (min-width: 653px) {
    :root {
        --nw: 90px;
    }
    
    aside {
        display: none;
    }
    
    #posts {
        border-right: none;
    }
    
    nav a {
        padding: 12px;
        text-align: center;
        justify-content: center;
    }
    
    nav a span {
        display: none;
    }
    
    nav a i {
        margin-right: 0;
    }
    
    main {
        max-width: calc(var(--nw) + var(--psz) + 30px);
    }
}

/* Small Tablet - Minimal Navigation */
@media (max-width: 652px) and (min-width: 541px) {
    :root {
        --nw: 60px;
        --psz: calc(100vw - 70px);
    }
    
    aside {
        display: none;
    }
    
    main {
        padding-left: 0;
        max-width: 100%;
    }
    
    nav {
        padding: 20px 5px;
    }
    
    nav a {
        padding: 10px;
        margin: 3px 0;
        font-size: 16px;
    }
    
    nav a span {
        display: none;
    }
    
    nav a i {
        margin-right: 0;
        font-size: 20px;
    }
    
    #posts {
        width: 100%;
        border-right: none;
    }
    
    .post {
        border-radius: 0;
    }
    
    header {
        border-radius: 0;
    }
}

/* Mobile - Full Width, Top Navigation */
@media (max-width: 540px) {
    :root {
        --fsz: 14px;
    }
    
    nav {
        display: none;
    }
    
    aside {
        display: none;
    }
    
    main {
        padding: 0;
        max-width: 100%;
    }
    
    #posts {
        width: 100%;
        border-left: none;
        border-right: none;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .header-image {
        height: 150px;
    }
    
    .header-avatar {
        width: 84px;
        height: 84px;
        top: -42px;
        left: 12px;
        border-width: 3px;
    }
    
    .header-content {
        padding: 0 12px 12px;
    }
    
    .header-actions {
        min-height: 42px;
        padding: 8px 0;
    }
    
    .post {
        padding: 12px 15px;
        border-radius: 0;
    }
    
    header {
        border-radius: 0;
    }
    
    .bio-name {
        font-size: 18px;
    }
    
    .post-title {
        font-size: 17px;
    }
    
    .quote {
        font-size: 20px;
        padding: 15px;
    }
}

/* Small Mobile - Minimal UI */
@media (max-width: 400px) {
    :root {
        --fsz: 14px;
    }
    
    .header-actions a:not(.follow-button) {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    .follow-button {
        font-size: 14px !important;
        padding: 0 22px !important;
        height: 36px !important;
        min-width: 80px !important;
    }
    
    .header-image {
        height: 120px;
    }
    
    .header-avatar {
        width: 72px;
        height: 72px;
        top: -36px;
    }
    
    .header-content {
        padding: 0 12px 12px;
    }
    
    .bio-name {
        font-size: 16px;
    }
    
    .bio-url {
        font-size: 14px;
    }
    
    .bio-description {
        font-size: 14px;
    }
    
    .bio-meta {
        font-size: 13px;
        gap: 10px;
    }
    
    .post {
        padding: 10px 12px;
    }
    
    .post-title {
        font-size: 16px;
    }
    
    .post-caption {
        font-size: 14px;
    }
    
    .quote {
        font-size: 18px;
        padding: 12px;
    }
    
    .footer-right a:last-child {
        display: none;
    }
    
    .mobile-nav {
        padding: 8px 5px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .mobile-nav a {
        font-size: 13px;
        padding: 6px 10px;
        white-space: nowrap;
    }
}

/* Very Small Mobile - Ultra Compact */
@media (max-width: 360px) {
    .header-image {
        height: 100px;
    }
    
    .header-avatar {
        width: 64px;
        height: 64px;
        top: -32px;
    }
    
    .bio-name {
        font-size: 15px;
    }
    
    .bio-meta span {
        font-size: 12px;
    }
    
    .post-title {
        font-size: 15px;
    }
    
    .quote {
        font-size: 16px;
    }
    
    .mobile-nav a {
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    nav {
        height: auto;
        position: relative;
    }
    
    aside {
        height: auto;
        position: relative;
    }
    
    .header-image {
        height: 120px;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    nav a {
        padding: 14px 20px;
        min-height: 48px;
    }
    
    .mobile-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .header-actions a:not(.follow-button) {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }
    
    .follow-button {
        min-height: 44px !important;
        height: 44px !important;
        padding: 0 28px !important;
    }
    
    .post {
        padding: 15px;
    }
    
    /* Remove hover effects on touch */
    .post:hover {
        background: var(--pbg);
    }
    
    .post:active {
        background: var(--pbg2);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .header-avatar img,
    .account img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== 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;
}

/* ========== HIDE SCROLLBARS (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 ========== */