/* ==================================================
   Twinky v0.7
   Twitter風 自分専用SNS
   CSS
================================================== */


/* ---------- 全体設定 ---------- */

* {

    margin: 0;
    padding: 0;
    box-sizing: border-box;

}



body {

    background: #15202b;

    color: white;

    font-family:
        "Segoe UI",
        "Yu Gothic UI",
        sans-serif;

}




/* ==================================================
   アプリ全体
================================================== */


#app {

    display: flex;

    width: 100%;

    max-width: 900px;

    margin: auto;

    min-height: 100vh;

}




/* ==================================================
   サイドバー
================================================== */


#sidebar {

    width:260px;

    flex-shrink:0;

    border-right:1px solid #2f3336;

    padding:16px;

}



/* ==========================
   カレンダー
========================== */


#calendar {
    color:white;
}

.calendar-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-weight:bold;
    margin-bottom:12px;
}

.calendar-button{
    width:28px;
    height:28px;
    border:none;
    border-radius:50%;
    background:none;
    color:white;
    cursor:pointer;
    font-size:18px;
}

.calendar-button:hover{
    background:rgba(29,155,240,.15);
}

.calendar-week {
    display:grid;
    grid-template-columns:
    repeat(7,1fr);
    text-align:center;
    color:#71767b;
    font-size:12px;
    margin-bottom:6px;
}

.calendar-days {
    display:grid;
    grid-template-columns:
    repeat(7,1fr);
    gap:4px;
}

.calendar-day {
    aspect-ratio:1;
    display:flex;
    justify-content:center;
    align-items:center;
    border-radius:50%;
    font-size:13px;
    cursor:pointer;
    position:relative;
}

.calendar-day:hover {
    background:rgba(29,155,240,.15);
}

.calendar-day.has-post::after {
    content:"";
    width:5px;
    height:5px;
    background:#1d9bf0;
    border-radius:50%;
    position:absolute;
    bottom:4px;
}

.calendar-day.selected{
    background:#1d9bf0;
    color:white;
}

.calendar-today{
    margin-top:10px;
    width:100%;
    border:none;
    background:#1d9bf0;
    color:white;
    border-radius:999px;
    padding:6px;
    cursor:pointer;
    font-size:13px;
}

.calendar-selected{
    margin-top:10px;
    color:#71767b;
    font-size:13px;
}

.calendar-clear{
    margin-top:6px;
    border:none;
    background:none;
    color:#1d9bf0;
    cursor:pointer;
}

/* ==================================================
   メイン
================================================== */

#main {
    flex: 1;
    min-width: 0;
    max-width: 600px;
    border-right: 1px solid #2f3336;
}

/* ==================================================
   アイコン
================================================== */

.icon {
    width:40px;
    height:40px;
    border-radius:50%;
    object-fit:cover;
    flex-shrink:0;
}

/* ==================================================
   投稿作成
================================================== */

#composer {
    display:flex;
    gap:12px;
    padding:16px;
    border-bottom:1px solid #2f3336;
}

.composer-content {
    flex:1;
    min-width:0;
    padding-top:12px;
}

#post {
    width:100%;
    min-height:40px;
    max-height:300px;
    resize:none;
    overflow:hidden;
    background:none;
    border:none;
    outline:none;
    color:white;
    font-size:20px;
    font-family:inherit;
}

#post::placeholder {
    color:#71767b;
}

/* ==================================================
   投稿下部
================================================== */

.composer-footer {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:12px;
}

#count {
    color:#71767b;
    font-size:14px;
}

#submit {
    border:none;
    background:#1d9bf0;
    color:white;
    font-weight:bold;
    font-size:15px;
    border-radius:999px;
    padding:10px 22px;
    cursor:pointer;
}

#submit:hover {
    background:#1a8cd8;
}

/* ==================================================
   投稿表示
================================================== */

.post {
    display:flex;
    gap:10px;
    padding:10px 12px;
    border-bottom:1px solid #2f3336;
}

.content {
    flex:1;
    min-width:0;
}

.header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    height:22px;
}

.name {
    font-size:15px;
    font-weight:bold;
}

.text {
    margin-top:4px;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    line-height:1.45;
}

.date {
    margin-top:4px;
    color:#71767b;
    font-size:13px;
}

/* ==================================================
   削除ボタン
================================================== */

.delete {
    width:34px;
    height:34px;
    border:none;
    border-radius:50%;
    background:none;
    color:#71767b;
    cursor:pointer;
    font-size:18px;
}

.delete:hover {

    background:rgba(29,155,240,.15);

    color:#1d9bf0;

}




/* ==================================================
   画像
================================================== */


.post-image {

    margin-top:12px;

    max-width:100%;

    border-radius:16px;

    display:block;

    cursor:pointer;

}




.image-button {

    display:inline-flex;

    align-items:center;

    cursor:pointer;

}



.image-button img {

    width:24px;

    height:24px;

    opacity:.8;

}



.image-button:hover img {

    opacity:1;

}



.image-button input {

    display:none;

}





/* ==================================================
   プレビュー
================================================== */


#preview {

    margin-top:10px;

}



.preview-box {

    position:relative;

    display:inline-block;

}



.preview-box img {

    max-width:300px;

    max-height:300px;

    border-radius:16px;

}



#remove-image {

    position:absolute;

    top:8px;

    right:8px;

    width:28px;

    height:28px;

    border:none;

    border-radius:50%;

    background:rgba(0,0,0,.6);

    color:white;

    font-size:20px;

    cursor:pointer;

}




/* ==================================================
   ライトボックス
================================================== */


#lightbox {

    display:none;

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.8);

    justify-content:center;

    align-items:center;

    z-index:999;

}



#lightbox img {

    max-width:90%;

    max-height:90%;

    border-radius:12px;

}

/* ==========================
   投稿メニュー
========================== */

.post-menu{
    position:relative;
}

.menu-box{
    display:none;
    position:absolute;
    right:0;
    top:35px;
    background:#15202b;
    border:1px solid #2f3336;
    border-radius:8px;
    overflow:hidden;
    z-index:10;
}

.menu-button{

    width:34px;
    height:34px;
    border:none;
    background:transparent;
    color:#71767b;
    border-radius:50%;
    cursor:pointer;
    font-size:22px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
}

.menu-button:hover{
    background:rgba(29,155,240,.15);
    color:#1d9bf0;
}

.menu-item{
    padding:10px 20px;
    cursor:pointer;
    white-space:nowrap;
    color:white;
}

.menu-item:hover{
    background:rgba(29,155,240,.15);
}


/* ==========================
   編集
========================== */

.edit-area{
    width:100%;
    min-height:40px;
    max-height:300px;
    background:#15202b;
    color:white;
    border:1px solid #2f3336;
    border-radius:8px;
    padding:8px;
    resize:none;
    overflow:hidden;
    font-family:inherit;
    font-size:16px;
}

.edit-buttons{
    margin-top:12px;
    display:flex;
    gap:8px;
}

.edit-save,
.edit-cancel{
    padding:8px 18px;
    border-radius:999px;
    border:none;
    cursor:pointer;
    font-size:14px;
}

.edit-save{
    background:#1d9bf0;
    color:white;
}

.edit-cancel{
    background:#2f3336;
    color:white;
}


/* ==========================
   削除確認モーダル
========================== */


#delete-modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.6);
    z-index:1000;
    align-items:center;
    justify-content:center;
}

.delete-modal-box{
    width:360px;
    max-width:85%;
    background:#15202b;
    border-radius:20px;
    padding:28px;
    border:1px solid #2f3336;
}

.delete-title{
    font-size:18px;
    font-weight:bold;
    text-align:center;
    margin-bottom:20px;
}

.delete-buttons{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.delete-buttons button{
    width:100%;
    border:none;
    border-radius:999px;
    padding:12px;
    cursor:pointer;
    font-size:15px;
    font-weight:bold;
}

#delete-cancel{
    background:#2f3336;
    color:white;
}

#delete-confirm{
    background:#f4212e;
    color:white;
}

/* ==========================
   設定
========================== */

#settings{
    margin-top:30px;
    border-top:1px solid #2f3336;
    padding-top:15px;
}

.settings-title{
    color:#71767b;
    font-size:14px;
    margin-bottom:10px;
}

#settings button,
.import-button{
    display:block;
    width:100%;
    padding:8px;
    margin-bottom:8px;
    border-radius:999px;
    border:1px solid #2f3336;
    background:transparent;
    color:white;
    text-align:center;
    cursor:pointer;
    font-size:13px;
}

#settings button:hover,
.import-button:hover{
    background:rgba(29,155,240,.15);
}

.import-button input{
    display:none;
}



/* ==========================
   スマホ対応
========================== */

@media (max-width:768px){

#app{

    flex-direction:column;

}

#sidebar{

    width:100%;

    border-right:none;

    border-bottom:1px solid #2f3336;

}

#main{

    width:100%;

}

#composer{

    padding:12px;

}

.post{

    padding:12px;

}

.post-image{

    max-width:100%;

}

}

/* ==========================
   Smartphone
========================== */

@media (max-width:768px){

#app{

    display:flex;
    flex-direction:column;

}

#sidebar{

    width:100%;
    order:2;

    border-right:none;
    border-top:1px solid #2f3336;

}

#main{

    width:100%;
    order:1;

}

#composer{

    padding:16px;

}

.post{

    padding:16px;

}

.icon{

    width:42px;
    height:42px;

}

.post-image{

    width:100%;

}

textarea{

    font-size:16px;

}

}

/* ==========================
   ハンバーガーメニュー
========================== */

#menu-toggle{

    display:none;

}

@media (max-width:768px){

#menu-toggle{

    display:block;

    position:fixed;

    top:12px;

    left:12px;

    z-index:1000;

    width:44px;

    height:44px;

    border:none;

    border-radius:12px;

    background:#1d9bf0;

    color:white;

    font-size:22px;

    cursor:pointer;

}

#sidebar{

    position:fixed;

    top:0;

    left:-310px;

    width:300px;

    height:100vh;

    background:#000;

    z-index:999;

    transition:.3s;

    overflow-y:auto;

    border-right:1px solid #2f3336;

}

#sidebar.open{

    left:0;

}

#main{

    width:100%;

}

#composer{

    padding-top:64px;

}

}