/* Filename: instagram-line-break-generator.css */


/* =========================================================
   PAGE
========================================================= */

.instagram-line-break-page {
    box-sizing: border-box;
    width: 100%;
    padding: 106px 16px 64px;
}


/* =========================================================
   PAGE GRID
========================================================= */

.instagram-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    width: min(100%, 1200px);
    margin: 0 auto;
    align-items: start;
}


.instagram-main-column {
    min-width: 0;
}


.instagram-sidebar {
    width: 300px;
    min-width: 300px;
}


.sidebar-ad {
    width: 300px;
    min-height: 600px;
}


/* =========================================================
   MAIN CONTENT WIDTH
========================================================= */

.line-break-tool,
.instagram-content {
    width: 100%;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}


.line-break-tool {
    color: #17212b;
}


/* =========================================================
   TOOL HEADING
========================================================= */

.tool-heading {
    margin-bottom: 22px;
    text-align: center;
}


.tool-heading h1 {
    margin: 0;
    color: #031f30;
    font-size: clamp(30px, 4vw, 40px);
    line-height: 1.15;
    letter-spacing: -0.02em;
}


.tool-subheading {
    max-width: 700px;
    margin: 10px auto 0;
    color: #5d6f7a;
    font-size: 16px;
    line-height: 1.55;
}


/* =========================================================
   WORKSPACE

   Desktop:
   Input | Arrow | Output

   Tablet / Mobile:
   Input
   Output
========================================================= */

.line-break-workspace {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        34px
        minmax(0, 1fr);

    gap: 12px;

    align-items: start;
}


/* =========================================================
   WORKSPACE PANELS
========================================================= */

.workspace-panel {
    min-width: 0;
    width: 100%;
}


/* =========================================================
   PANEL HEADING
========================================================= */

.panel-heading {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 12px;

    min-height: 66px;

    margin-bottom: 9px;
}


.panel-title-group {
    min-width: 0;
}


/* =========================================================
   STEP LABEL
========================================================= */

.step-label {
    display: inline-block;

    margin-bottom: 5px;

    color: #405de6;

    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;

    letter-spacing: 0.045em;

    text-transform: uppercase;
}


.panel-heading h2 {
    margin: 0;

    color: #17384d;

    font-size: 21px;
    line-height: 1.2;
}


/* =========================================================
   INPUT CHARACTER COUNT
========================================================= */

.character-count {
    flex: 0 0 auto;

    padding-bottom: 2px;

    color: #647681;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;

    text-align: right;

    font-variant-numeric: tabular-nums;

    white-space: nowrap;
}


.character-count strong {
    color: #183647;

    font-size: 18px;
    font-weight: 800;
}


.character-count.is-over,
.character-count.is-over strong {
    color: #bd2525;
}


/* =========================================================
   FORMATTED STATUS
========================================================= */

.formatted-status {
    flex: 0 0 auto;

    padding-bottom: 3px;

    color: #71808a;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;

    text-align: right;

    white-space: nowrap;
}


.formatted-status.is-ready {
    color: #2f7a4b;
}


.formatted-status.is-over {
    color: #bd2525;
}


/* =========================================================
   CENTER ARROW
========================================================= */

.workspace-arrow {
    display: flex;

    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    min-height: 410px;

    color: #8b9aa4;

    font-size: 26px;
}


.workspace-arrow i {
    display: block;
}


/* =========================================================
   SYNCHRONIZED CARDS

   IMPORTANT:
   The card has no fixed height.

   Its height is determined by:
   textarea height + footer height.

   This means shrinking a textarea also immediately pulls
   its footer upward.
========================================================= */

.synchronized-card,
.editor-card,
.output-card {
    position: relative;

    display: flex;

    flex-direction: column;

    box-sizing: border-box;

    width: 100%;
    height: auto;

    min-width: 0;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #cbd8e1;

    border-radius: 14px;

    box-shadow:
        0 7px 24px
        rgba(3, 31, 48, 0.08);

    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}


.editor-card:focus-within,
.output-card:focus-within {
    border-color: #405de6;

    box-shadow:
        0 0 0 3px
        rgba(64, 93, 230, 0.11),
        0 7px 24px
        rgba(3, 31, 48, 0.08);
}


/* =========================================================
   TEXTAREA CONTAINERS

   No fixed or minimum height here.

   The wrapper follows the exact textarea height so the
   footer never gets left behind when the textarea shrinks.
========================================================= */

.textarea-container {
    display: block;

    flex: 0 0 auto;

    box-sizing: border-box;

    width: 100%;
    height: auto;
    min-height: 0;

    margin: 0;
    padding: 0;

    overflow: visible;
}


/* =========================================================
   SYNCHRONIZED TEXTAREAS
========================================================= */

.synchronized-textarea,
#captionInput,
#formattedOutput {
    display: block;

    box-sizing: border-box;

    width: 100%;

    height: 330px;
    min-height: 160px;
    max-height: 750px;

    margin: 0;

    padding: 17px 18px;

    resize: vertical;

    overflow: auto;

    border: 0;
    outline: 0;

    border-radius: 0;

    color: #15222c;

    font-family: Arial, sans-serif;

    font-size: 17px;
    line-height: 1.55;
}


/* =========================================================
   INPUT TEXTAREA
========================================================= */

#captionInput {
    background: #ffffff;
}


#captionInput::placeholder {
    color: #8b98a2;
    opacity: 1;
}


/* =========================================================
   OUTPUT TEXTAREA
========================================================= */

#formattedOutput {
    background: #fdfefe;
}


#formattedOutput::placeholder {
    color: #9aa6ad;
    opacity: 1;
}


/* =========================================================
   TEXTAREA RESIZE HANDLE

   Both textareas remain vertically resizable on desktop.

   JavaScript will synchronize the opposite textarea
   whenever either one is manually resized.
========================================================= */

#captionInput,
#formattedOutput {
    resize: vertical;
}


/* =========================================================
   INPUT FOOTER
========================================================= */

.editor-footer {
    display: flex;

    flex: 0 0 auto;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    box-sizing: border-box;

    width: 100%;

    min-height: 58px;

    padding: 9px 11px;

    margin: 0;

    border-top: 1px solid #e5ebef;

    background: #fbfcfd;
}


/* =========================================================
   INPUT FOOTER INFO
========================================================= */

.input-footer-info {
    min-width: 0;

    color: #6a7c87;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}


/* =========================================================
   OUTPUT FOOTER
========================================================= */

.output-footer {
    display: flex;

    flex: 0 0 auto;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    box-sizing: border-box;

    width: 100%;

    min-height: 58px;

    padding: 9px 11px;

    margin: 0;

    border-top: 1px solid #e5ebef;

    background: #fbfcfd;
}


/* =========================================================
   OUTPUT INFO
========================================================= */

.output-info {
    display: flex;

    align-items: center;

    gap: 8px;

    min-width: 0;

    color: #637681;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;

    white-space: nowrap;
}


.output-stat {
    display: inline-flex;

    align-items: baseline;

    gap: 4px;
}


.output-stat strong {
    color: #183647;

    font-size: 18px;
    font-weight: 800;

    font-variant-numeric: tabular-nums;
}


.output-stat span {
    font-size: 14px;
}


.output-stat-divider {
    color: #a1adb4;

    font-size: 15px;
}


/* =========================================================
   ACTIONS
========================================================= */

.tool-actions {
    display: flex;

    flex: 0 0 auto;

    align-items: center;
    justify-content: flex-end;

    gap: 8px;
}


/* =========================================================
   BUTTONS
========================================================= */

.tool-button {
    min-height: 40px;

    padding: 9px 15px;

    border: 1px solid transparent;

    border-radius: 9px;

    font: inherit;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        transform 140ms ease,
        opacity 140ms ease;
}


.tool-button:hover:not(:disabled) {
    transform: translateY(-1px);
}


.tool-button:focus-visible {
    outline:
        3px solid
        rgba(64, 93, 230, 0.22);

    outline-offset: 2px;
}


.tool-button:disabled {
    opacity: 0.46;

    cursor: default;

    transform: none;
}


/* =========================================================
   PRIMARY BUTTON
========================================================= */

.tool-button-primary {
    color: #ffffff;

    background: #405de6;

    border-color: #405de6;
}


.tool-button-primary:hover:not(:disabled) {
    background: #334cc4;

    border-color: #334cc4;
}


/* =========================================================
   SECONDARY BUTTON
========================================================= */

.tool-button-secondary {
    color: #36505f;

    background: #ffffff;

    border-color: #cbd8e1;
}


.tool-button-secondary:hover:not(:disabled) {
    background: #f1f6f9;

    border-color: #aebfca;
}


/* =========================================================
   OUTPUT READY STATE
========================================================= */

.output-card.is-ready {
    border-color: #aecfba;
}


.output-card.is-ready #formattedOutput {
    background: #fcfffd;
}


/* =========================================================
   OUTPUT OVER LIMIT
========================================================= */

.output-card.is-over {
    border-color: #e7aaaa;
}


.output-card.is-over #formattedOutput {
    background: #fffafa;
}


/* =========================================================
   TOOL EXPLANATION

   This element sits directly after the entire workspace.

   Once JS keeps both textarea heights synchronized,
   shrinking either textarea shrinks the workspace and this
   content moves upward immediately.
========================================================= */

.tool-description {
    margin-top: 24px;

    color: #4c5e69;

    font-size: 15px;
    line-height: 1.6;
}


.tool-description p {
    box-sizing: border-box;

    margin: 0;

    padding: 14px 17px;

    background: #f7f9ff;

    border: 1px solid #dce2f3;

    border-left: 3px solid #405de6;

    border-radius: 9px;

    color: #435864;

    line-height: 1.65;
}


/* =========================================================
   RELATED TOOL
========================================================= */

.related-tool-box {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 16px;

    box-sizing: border-box;

    margin-top: 14px;

    padding: 13px 16px;

    background: #ffffff;

    border: 1px solid #d8e3e9;

    border-radius: 9px;
}


.related-tool-label {
    color: #586d79;

    font-size: 14px;
    font-weight: 600;
}


.related-tool-link {
    flex: 0 0 auto;

    color: #405de6;

    font-size: 14px;
    font-weight: 700;

    text-decoration: none;
}


.related-tool-link:hover {
    text-decoration: underline;

    text-underline-offset: 2px;
}


/* =========================================================
   ARTICLE
========================================================= */

.instagram-content {
    margin-top: 44px;

    color: #263640;

    font-size: 18px;
    line-height: 1.68;
}


.instagram-content p {
    margin: 1em 0;
}


/* =========================================================
   ARTICLE HEADINGS
========================================================= */

.instagram-content h2,
.instagram-content h3 {
    color: #102f42;

    line-height: 1.25;
}


.instagram-content h2 {
    margin: 1.9em 0 0.6em;

    font-size:
        clamp(
            23px,
            3vw,
            29px
        );
}


.instagram-content h3 {
    margin: 1.6em 0 0.5em;

    font-size:
        clamp(
            19px,
            2.4vw,
            23px
        );
}


/* =========================================================
   ARTICLE LINKS
========================================================= */

.instagram-content a {
    color: #405de6;

    text-decoration: underline;

    text-decoration-thickness: 1px;

    text-underline-offset: 2px;
}


.instagram-content a:hover {
    text-decoration-thickness: 2px;
}


/* =========================================================
   ARTICLE ORDERED LIST
========================================================= */

.instagram-content ol {
    margin: 0.9em 0 1.2em;

    padding-left: 1.6em;
}


.instagram-content li {
    margin: 0.45em 0;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;

    margin: -1px !important;

    overflow: hidden !important;

    clip:
        rect(
            0,
            0,
            0,
            0
        ) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


/* =========================================================
   SMALL DESKTOP

   Remove sidebar before workspace gets cramped.
========================================================= */

@media (max-width: 1180px) {

    .instagram-page-grid {
        display: block;

        width: 100%;

        max-width: 920px;
    }


    .instagram-sidebar {
        display: none;
    }

}


/* =========================================================
   MEDIUM / NARROW DESKTOP
========================================================= */

@media (max-width: 900px) {

    .line-break-workspace {
        grid-template-columns:
            minmax(0, 1fr)
            28px
            minmax(0, 1fr);

        gap: 9px;
    }


    .workspace-arrow {
        font-size: 23px;
    }


    .panel-heading {
        min-height: 72px;
    }


    .panel-heading h2 {
        font-size: 19px;
    }


    .step-label {
        font-size: 14px;
    }


    .character-count {
        font-size: 13px;
    }


    .character-count strong {
        font-size: 17px;
    }


    .synchronized-textarea,
    #captionInput,
    #formattedOutput {
        height: 300px;

        padding: 16px;

        font-size: 16px;
    }


    .editor-footer,
    .output-footer {
        min-height: 62px;
    }


    .input-footer-info {
        font-size: 12px;
    }


    .output-info {
        gap: 6px;

        font-size: 13px;
    }


    .output-stat strong {
        font-size: 17px;
    }


    .output-stat span {
        font-size: 13px;
    }


    .tool-button {
        padding-left: 12px;
        padding-right: 12px;

        font-size: 13px;
    }

}


/* =========================================================
   TABLET

   Panels become stacked.

   Both remain independently resizable here; JS can stop
   synchronizing once the panels are no longer side-by-side.
========================================================= */

@media (max-width: 760px) {

    .instagram-line-break-page {
        padding:
            94px
            12px
            48px;
    }


    .tool-heading {
        margin-bottom: 20px;
    }


    .tool-heading h1 {
        font-size: 34px;
    }


    .tool-subheading {
        font-size: 15px;
    }


    .line-break-workspace {
        display: flex;

        flex-direction: column;

        gap: 18px;
    }


    .workspace-panel {
        width: 100%;
    }


    .workspace-arrow {
        display: none;
    }


    .panel-heading {
        min-height: 0;

        margin-bottom: 8px;
    }


    .step-label {
        margin-bottom: 4px;

        font-size: 15px;
    }


    .panel-heading h2 {
        font-size: 20px;
    }


    .character-count {
        font-size: 14px;
    }


    .character-count strong {
        font-size: 18px;
    }


    .formatted-status {
        font-size: 14px;
    }


    .synchronized-textarea,
    #captionInput,
    #formattedOutput {
        height: 240px;

        min-height: 120px;
        max-height: 700px;

        padding: 16px 17px;

        font-size: 16px;
    }


    .editor-footer,
    .output-footer {
        min-height: 58px;
    }


    .input-footer-info {
        font-size: 13px;
    }


    .output-info {
        font-size: 14px;
    }


    .output-stat strong {
        font-size: 18px;
    }


    .output-stat span {
        font-size: 14px;
    }


    .instagram-content {
        margin-top: 38px;

        font-size: 17px;

        line-height: 1.62;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 550px) {

    .instagram-line-break-page {
        padding:
            92px
            10px
            44px;
    }


    .tool-heading {
        margin-bottom: 18px;
    }


    .tool-heading h1 {
        font-size: 30px;
    }


    .tool-subheading {
        margin-top: 8px;

        font-size: 14px;
        line-height: 1.5;
    }


    .line-break-workspace {
        gap: 16px;
    }


    .panel-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 7px;
    }


    .step-label {
        font-size: 15px;
    }


    .panel-heading h2 {
        font-size: 19px;
    }


    .character-count,
    .formatted-status {
        padding-bottom: 0;

        text-align: left;
    }


    .synchronized-card,
    .editor-card,
    .output-card {
        border-radius: 12px;
    }


    .synchronized-textarea,
    #captionInput,
    #formattedOutput {
        height: 215px;

        min-height: 110px;

        padding: 15px;

        font-size: 16px;
    }


    .editor-footer {
        flex-direction: column;

        align-items: stretch;

        gap: 8px;

        padding: 9px 10px;
    }


    .input-footer-info {
        width: 100%;

        font-size: 13px;
    }


    .editor-footer .tool-actions {
        width: 100%;
    }


    .editor-footer .tool-button {
        width: 100%;
    }


    .output-footer {
        flex-direction: column;

        align-items: stretch;

        gap: 9px;

        padding: 9px 10px;
    }


    .output-info {
        justify-content: flex-start;

        width: 100%;

        gap: 7px;

        font-size: 14px;
    }


    .output-stat strong {
        font-size: 18px;
    }


    .output-stat span {
        font-size: 14px;
    }


    .output-footer .tool-actions {
        width: 100%;
    }


    #copyButton {
        width: 100%;
    }


    .tool-button {
        width: 100%;

        min-width: 0;
        min-height: 40px;

        padding: 9px 10px;

        font-size: 13px;
    }


    .tool-description {
        margin-top: 20px;

        font-size: 14px;
        line-height: 1.55;
    }


    .tool-description p {
        padding: 12px 13px;

        line-height: 1.6;
    }


    .related-tool-box {
        align-items: flex-start;

        flex-direction: column;

        gap: 5px;

        padding: 12px 13px;
    }


    .related-tool-label,
    .related-tool-link {
        font-size: 13px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .instagram-line-break-page {
        padding-left: 9px;
        padding-right: 9px;
    }


    .tool-heading h1 {
        font-size: 29px;
    }


    .synchronized-textarea,
    #captionInput,
    #formattedOutput {
        height: 195px;

        min-height: 100px;

        padding: 14px;
    }


    .step-label {
        font-size: 14px;
    }


    .panel-heading h2 {
        font-size: 18px;
    }


    .character-count {
        font-size: 13px;
    }


    .character-count strong {
        font-size: 17px;
    }


    .formatted-status {
        font-size: 13px;
    }


    .output-info {
        font-size: 13px;
    }


    .output-stat strong {
        font-size: 17px;
    }


    .output-stat span {
        font-size: 13px;
    }


    .tool-button {
        font-size: 12.5px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 360px) {

    .tool-heading h1 {
        font-size: 27px;
    }


    .output-info {
        flex-wrap: wrap;
    }


    .output-stat-divider {
        display: none;
    }


    .output-stat {
        width: 100%;
    }


    .tool-button {
        min-height: 40px;

        font-size: 13px;
    }


    .related-tool-box {
        padding: 11px 12px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .synchronized-card,
    .editor-card,
    .output-card,
    .tool-button {
        transition: none;
    }


    .tool-button:hover:not(:disabled) {
        transform: none;
    }

}