/* Post page styles - Ready for new design */

/* Desktop-only: 1560px centered container for 1920px screens */
@media (min-width: 992px) {

    /* Reset body margins/padding */
    body#post-main,
    body#post-register {
        margin: 0;
        padding: 0;
    }

    /* 72px gap below navbar - override main.css */
    body#post-main main,
    body#post-register main {
        margin-top: 72px !important;
        margin-bottom: 154px;
        /* Gap before footer */
    }

    /* Remove space below footer - only for post pages */
    body#post-main #footer-container,
    body#post-register #footer-container {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    body#post-main .footer,
    body#post-register .footer {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    body#post-main .container,
    body#post-register .container {
        max-width: 1560px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
        padding-right: 0;
    }

    /* For screens < 1920px: Make container flexible */
    @media (min-width: 992px) and (max-width: 1919px) {
        body#post-main .container,
        body#post-register .container {
            max-width: calc(100% - 360px);
            margin-left: 180px;
            margin-right: 180px;
        }
    }

    /* Two-column layout */
    .post-layout {
        display: flex;
        align-items: flex-start;
        /* Align all items to top */
        gap: 0;
        /* Remove gap, use margin on divider */
    }

    .post-left {
        flex: 0 0 auto;
    }

    /* Divider between left and right */
    .divider {
        flex-shrink: 0;
        /* Prevent collapse */
        width: 1px;
        height: 350px;
        margin-left: 166px;
        /* Gap from left box */
        margin-right: 166px;
        /* Gap to right box */
        /* Align with Name label: title(81px) + gap(68px) = 149px */
        margin-top: 260px;
        background-image: linear-gradient(to bottom, #767676 50%, transparent 50%);
        background-size: 1px 12px;
        /* Dash length: 12px */
        background-repeat: repeat-y;
    }

    .post-right {
        flex: 1;
        width: 897px;
        max-width: 897px;
    }

    /* Right box top section */
    .right-top {
        /* Align "Title" label with "Name" label */
        /* Left: title(81px) + margin-bottom(68px) = 149px offset */
        margin-top: 233px;
    }

    .right-label {
        display: block;
        width: 44px;
        height: 26px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 600;
        font-size: 22px;
        line-height: 26px;
        color: #1F1F1F;
        margin-bottom: 12px;
    }

    /* Hide mobile Title label, input, Content label, textarea, Name label/input, Password label/input, helper text, divider and mobile date-time on desktop */
    .post-title-label-mobile,
    .title-input-mobile-wrapper,
    .content-label-mobile,
    .content-textarea-mobile-wrapper,
    .name-label-mobile,
    .name-input-mobile-wrapper,
    .password-label-mobile,
    .password-input-mobile-wrapper,
    .password-helper-mobile,
    .divider-mobile,
    .post-date-time {
        display: none;
    }

    /* Desktop date-time - above title input with 15px gap */
    .post-date-time-desktop {
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 400;
        font-size: 14px;
        color: #767676;
        margin-bottom: -25px;
        margin-left: 41%;
    }

    .title-row {
        display: flex;
        align-items: center;
        gap: 26px;
        /* Gap between title input and Save button */
    }

    .title-input {
        width: 540px;
        height: 56px;
        padding: 16px 18px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-size: 16px;
        color: #111111;
        background-color: #FFFFFF;
        border: 1px solid #D3D3D3;
        border-radius: 10px;
        outline: none;
        box-sizing: border-box;
    }

    .title-input:focus {
        border-color: #111111;
    }

    .title-input::placeholder {
        color: #8A8A8A;
    }

    .btn-save,
    .btn-delete {
        height: 56px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 500;
        font-size: 16px;
        background-color: #FFFFFF;
        border: 1px solid #D3D3D3;
        border-radius: 14px;
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .btn-save:hover,
    .btn-delete:hover {
        opacity: 0.8;
    }

    .btn-save {
        width: 200px;
        color: #111111;
    }

    .btn-delete {
        width: 120px;
        margin-left: 12px;
        /* Gap between Save and Delete */
        color: #111111;
    }

    /* Post-register page only: Black Save button, Red Delete button */
    body#post-register .btn-save {
        background-color: #000000;
        color: #FFFFFF;
        border: 1px solid transparent;
    }

    body#post-register .btn-delete {
        background-color: #FFFFFF;
        color: #FF0000;
        border: 1px solid #D3D3D3;
    }

    .right-bottom {
        margin-top: 38px;
        /* Gap below title row */
    }

    /* Content textarea */
    .content-textarea {
        width: 897px;
        height: 240px;
        padding: 16px 18px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-size: 16px;
        color: #111111;
        background-color: #FFFFFF;
        border: 1px solid #D3D3D3;
        border-radius: 10px;
        outline: none;
        box-sizing: border-box;
        resize: none;
        /* Prevent resizing */
    }

    .content-textarea:focus {
        border-color: #111111;
    }

    .content-textarea::placeholder {
        color: #8A8A8A;
    }

    /* Title styling - exact Figma specs */
    .post-title {
        width: 324px;
        height: 81px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 600;
        font-size: 58px;
        line-height: 81px;
        margin: 0;
        color: #111111;
        margin-bottom: 68px;
        margin-top: 72px;
        /* Gap below title */
    }

    /* Form fields */
    .form-field {
        margin-bottom: 40px;
        /* Gap between fields */
    }

    .form-field:last-child {
        margin-bottom: 0;
    }

    .field-label {
        display: block;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 600;
        font-size: 16px;
        color: #1F1F1F;
        margin-bottom: 12px;
    }

    .field-input {
        width: 331px;
        height: 56px;
        padding: 16px 18px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-size: 16px;
        color: #111111;
        background-color: #FFFFFF;
        border: 1px solid #D3D3D3;
        border-radius: 10px;
        outline: none;
        box-sizing: border-box;
    }

    .field-input:focus {
        border-color: #111111;
    }

    .field-input::placeholder {
        color: #8A8A8A;
    }

    .field-helper {
        margin-top: 10px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-size: 14px;
        color: #8A8A8A;
        margin-bottom: 0;
        margin-left: 5px;
    }

    /* Button group */
    .button-group {
        margin-top: 134px;
        /* Gap below helper text */
        display: flex;
        gap: 20px;
        /* Gap between buttons */
    }

    /* Base button styles */
    .btn-post,
    .btn-cancel {
        width: 156px;
        height: 48px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 500;
        font-size: 16px;
        border-radius: 14px;
        border: 1px solid transparent;
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .btn-post:hover,
    .btn-cancel:hover {
        opacity: 0.8;
    }

    /* Post button - black background */
    .btn-post {
        background-color: #000000;
        color: #FFFFFF;
    }

    /* Cancel button - white background with border */
    .btn-cancel {
        background-color: #FFFFFF;
        color: #111111;
        border-color: #D3D3D3;
    }
}

/* Flexbox sticky footer solution - only for post pages, 1920px+ screens */
@media (min-width: 1920px) {
    /* Make body a flex container to push footer to bottom */
    body#post-main,
    body#post-register {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    /* Make main content expand to fill available space */
    body#post-main main,
    body#post-register main {
        flex-grow: 1;
        /* margin-bottom: 154px already set above - gap before footer */
    }
}

/* Mobile-only adjustments: align with shared navbar/header on mobile */
@media (max-width: 837px) {
    /* Account for fixed mobile navbar height + gap */
    body#post-main main,
    body#post-register main {
        padding-top: 60px !important;
        margin-top: 0 !important;
    }

    /* Stack layout vertically */
    body#post-main .post-layout,
    body#post-register .post-layout {
        flex-direction: column;
        gap: 32px;
    }

    /* Hide divider on mobile */
    body#post-main .divider,
    body#post-register .divider {
        display: none;
    }

    /* Full-width containers on mobile */
    body#post-main .container,
    body#post-register .container {
        max-width: 100%;
        padding-left: 24px;
        padding-right: 24px;
        margin: 0 auto;
    }

    /* Left column: full width and tighter title spacing */
    .post-left {
        width: 100%;
    }

    .post-title {
        width: 210px;
        height: 50px;
        font-size: 36px;
        line-height: 50px;
        font-weight: 700;
        text-align: left;
        margin-top: 110px;
        margin-bottom: 0;
    }

    .post-date-time {
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 400;
        font-size: 14px;
        color: #767676;
        margin-top: 10px;
        margin-bottom: 48px;
    }

    /* Hide desktop date-time on mobile */
    .post-date-time-desktop {
        display: none !important;
    }

    .post-title-label-mobile {
        display: block;
        width: 44px;
        height: 26px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 600;
        font-size: 22px;
        line-height: 26px;
        text-align: left;
        color: #1F1F1F;
        margin-bottom: 12px;
        margin-left: 3px;
    }

    /* Title input right below Title label on mobile */
    .title-input-mobile-wrapper {
        margin-bottom: 38px;
    }

    /* Content label - same style as Title */
    .content-label-mobile {
        display: block;
        width: 44px;
        height: 26px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 600;
        font-size: 22px;
        line-height: 26px;
        text-align: left;
        color: #1F1F1F;
        margin-bottom: 12px;
    }

    /* Content textarea - full width like title input */
    .content-textarea-mobile-wrapper {
        margin-bottom: 60px;
    }

    /* Horizontal divider - same style as desktop but in row */
    .divider-mobile {
        width: 100%;
        height: 1px;
        background-image: linear-gradient(to right, #767676 50%, transparent 50%);
        background-size: 12px 1px;
        background-repeat: repeat-x;
        margin-top: 0 !important;
        margin-bottom: 60px !important;
    }

    /* Name label - exact specs: 42px width, 22px height, 16px font, 600 weight, left-aligned */
    .name-label-mobile {
        display: block;
        width: 42px;
        height: 22px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 600;
        font-size: 16px;
        line-height: 22px;
        text-align: left;
        color: #1F1F1F;
        margin-bottom: 8px;
    }

    /* Name input wrapper - 24px gap below */
    .name-input-mobile-wrapper {
        margin-bottom: 24px;
    }

    /* Name input - same as title input: 100% width, 56px height, 10px radius, #A1A1A1 border */
    .name-input-mobile {
        width: 100% !important;
        height: 56px !important;
        border-radius: 10px !important;
        border: 1px solid #A1A1A1 !important;
        padding: 16px 18px !important;
        font-family: 'Pretendard Variable', Pretendard, sans-serif !important;
        font-size: 16px !important;
        color: #111111 !important;
        background-color: #FFFFFF !important;
        outline: none !important;
        box-sizing: border-box !important;
    }

    .name-input-mobile:focus {
        border-color: #111111 !important;
    }

    .name-input-mobile::placeholder {
        color: #8A8A8A !important;
    }

    /* Password label - same style as Name label */
    .password-label-mobile {
        display: block;
        width: 42px;
        height: 22px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 600;
        font-size: 16px;
        line-height: 22px;
        text-align: left;
        color: #1F1F1F;
        margin-bottom: 8px;
    }

    /* Password input wrapper - 12px gap below */
    .password-input-mobile-wrapper {
        margin-bottom: 12px;
    }

    /* Password input - same as Name input */
    .password-input-mobile {
        width: 100% !important;
        height: 56px !important;
        border-radius: 10px !important;
        border: 1px solid #A1A1A1 !important;
        padding: 16px 18px !important;
        font-family: 'Pretendard Variable', Pretendard, sans-serif !important;
        font-size: 16px !important;
        color: #111111 !important;
        background-color: #FFFFFF !important;
        outline: none !important;
        box-sizing: border-box !important;
    }

    .password-input-mobile:focus {
        border-color: #111111 !important;
    }

    .password-input-mobile::placeholder {
        color: #8A8A8A !important;
    }

    /* Password helper text - 60px gap below */
    .password-helper-mobile {
        width: 230px;
        height: 20px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-weight: 200;
        font-size: 14px;
        line-height: 20px;
        color: #1F1F1F;
        margin: 0 0 60px 5px;
        padding: 0;
    }

    /* Hide ALL desktop form fields on mobile (we use mobile versions) */
    .form-field {
        display: none !important;
    }

    .content-textarea-mobile {
        width: 100% !important;
        height: 240px !important;
        border-radius: 10px !important;
        border: 1px solid #A1A1A1 !important;
        padding: 16px 18px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-size: 16px;
        color: #111111;
        background-color: #FFFFFF;
        outline: none;
        box-sizing: border-box;
        resize: none;
    }

    .content-textarea-mobile:focus {
        border-color: #111111;
    }

    .content-textarea-mobile::placeholder {
        color: #8A8A8A;
    }

    .title-input-mobile {
        width: 100% !important;
        height: 56px !important;
        border-radius: 10px !important;
        border: 1px solid #A1A1A1 !important;
        padding: 16px 18px;
        font-family: 'Pretendard Variable', Pretendard, sans-serif;
        font-size: 16px;
        color: #111111;
        background-color: #FFFFFF;
        outline: none;
        box-sizing: border-box;
    }

    .title-input-mobile:focus {
        border-color: #111111;
    }

    .title-input-mobile::placeholder {
        color: #8A8A8A;
    }

    /* Hide desktop Title label and input on mobile (we use mobile versions) */
    .right-label {
        display: none;
    }

    .title-input {
        display: none; /* Hide desktop title input on mobile */
    }

    /* Hide desktop title-row (title input + Save/Delete buttons) on mobile */
    .title-row {
        display: none !important;
    }

    /* Hide desktop Content label and textarea on mobile */
    .right-bottom .right-label,
    .content-textarea {
        display: none;
    }

    .form-field {
        margin-bottom: 28px;
    }

    .field-input {
        width: 100%;
    }

    /* Button group - column layout, 18px gap between buttons, 80px gap to footer */
    .button-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
        margin-top: 0 !important;
        margin-bottom: 80px !important;
    }

    /* Post button - 100% width (same as name input), 68px height, 14px radius, 1px border */
    .btn-post {
        width: 100% !important;
        height: 68px !important;
        border-radius: 14px !important;
        border: 1px solid transparent !important;
        background-color: #000000 !important;
        color: #FFFFFF !important;
        font-family: 'Pretendard Variable', Pretendard, sans-serif !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Cancel button - same dimensions */
    .btn-cancel {
        width: 100% !important;
        height: 68px !important;
        border-radius: 14px !important;
        border: 1px solid #D3D3D3 !important;
        background-color: #FFFFFF !important;
        color: #111111 !important;
        font-family: 'Pretendard Variable', Pretendard, sans-serif !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Post-register mobile: Save Changes button (black) */
    body#post-register .btn-post {
        background-color: #000000 !important;
        color: #FFFFFF !important;
        border: 1px solid transparent !important;
    }

    /* Post-register mobile: Delete button (white with red text) */
    body#post-register .btn-cancel {
        background-color: #FFFFFF !important;
        color: #FF0000 !important;
        border: 1px solid #D3D3D3 !important;
    }

    /* Right column: full width */
    .post-right {
        width: 100%;
        max-width: 100%;
    }

    .right-top {
        margin-top: 0;
    }

    /* Hide desktop Title label on mobile (we use mobile version) */
    .right-top .right-label {
        display: none;
    }

    .title-row {
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 12px; /* 12px gap below Title label */
    }

    .title-input {
        width: 100% !important;
        height: 56px !important;
        border-radius: 10px !important;
        border: 1px solid #A1A1A1 !important;
    }

    .btn-save,
    .btn-delete {
        width: 100%;
    }

    .right-bottom {
        margin-top: 24px;
    }

    .content-textarea {
        width: 100%;
        height: 220px;
    }
}