/* ============================================================
   WORDS TO PAGES CONVERTER
   words-to-pages.css
   ============================================================ */


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

html {
    margin: 0;
    padding: 0;
    border: none;
    font-family: Arial, sans-serif;
}


.words-pages-page {
    width: 100%;
    padding: 105px 15px 30px;
    color: #333;
    font-family: Arial, sans-serif;
}


.words-pages-page *,
.words-pages-page *::before,
.words-pages-page *::after {
    box-sizing: border-box;
}


.words-pages-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}


.words-pages-main {
    min-width: 0;
}


.words-pages-tool-section {
    width: 100%;
}


.words-pages-page button,
.words-pages-page select,
.words-pages-page input {
    font-family: Arial, sans-serif;
}


.words-pages-page a {
    color: #1155cc;
    text-decoration: none;
}


.words-pages-page a:hover {
    text-decoration: underline;
}


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

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


.words-pages-heading h1 {
    margin: 0 0 10px;
    padding: 0;
    color: #333;
    font-size: 32px;
    line-height: 1.25;
    font-weight: 700;
}


.words-pages-intro {
    max-width: 760px;
    margin: 0 auto;
    color: #555;
    font-size: 17px;
    line-height: 1.55;
}


/* ============================================================
   CONVERTER CARD
   ============================================================ */

.converter-card {
    width: 100%;
    padding: 20px;
    border: 1px solid #d9dde3;
    border-radius: 10px;
    background: #fff;
}


/* ============================================================
   MAIN CONVERTER ROW

   Word Count → Estimated Pages
   ============================================================ */

.converter-main-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        34px
        minmax(0, 1fr);

    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-bottom: 18px;
}


/* ============================================================
   WORD COUNT CARD
   ============================================================ */

.converter-input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 158px;
    margin: 0;
    overflow: hidden;
    border: 1px solid #cfd7e3;
    border-radius: 10px;
    background: #fff;
}


/* ============================================================
   WORD COUNT TITLE
   ============================================================ */

.converter-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 50px;
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid #cfd7e3;
    background: #eef5ff;
    color: #333;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
}


/* ============================================================
   WORD COUNT INPUT
   ============================================================ */

.conversion-input {
    display: block;
    flex: 1;
    width: calc(100% - 30px);
    min-height: 68px;
    height: 68px;
    margin: 19px 15px;
    padding: 10px 15px;
    border: 2px solid #aeb4bd;
    border-radius: 8px;
    background: #fff;
    color: #222;
    outline: none;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 700;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.conversion-input:hover {
    border-color: #8f969f;
}


.conversion-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}


.conversion-input::placeholder {
    color: #8d949e;
    opacity: 1;
    font-size: 20px;
    font-weight: 400;
}


.conversion-input::-webkit-outer-spin-button,
.conversion-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}


.conversion-input[type="number"] {
    -moz-appearance: textfield;
}


/* ============================================================
   CONVERSION ARROW
   ============================================================ */

.converter-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: #7a828c;
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    user-select: none;
}


/* ============================================================
   ESTIMATED RESULT CARD
   ============================================================ */

.metric-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 158px;
    padding: 0;
    overflow: visible;
    border: 1px solid #cfd7e3;
    border-radius: 10px;
    background: #fff;
    text-align: center;
}


.primary-metric {
    min-height: 158px;
}


.top-result-card {
    width: 100%;
    min-width: 0;
    height: 100%;
}


.result-metric {
    border-color: #cfd7e3;
    background: #fff;
}


/* ============================================================
   ESTIMATED PAGES TITLE
   ============================================================ */

.metric-label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid #cfd7e3;
    border-radius: 9px 9px 0 0;
    background: #eef5ff;
    color: #333;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
}


/* ============================================================
   RESULT NUMBER
   ============================================================ */

.metric-value {
    display: block;
    max-width: 100%;
    margin: 17px 15px 0;
    color: #1a73e8;
    font-size: 39px;
    line-height: 1;
    font-weight: 700;
    overflow-wrap: anywhere;
}


/* ============================================================
   RESULT BASIS
   ============================================================ */

.result-basis {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    width: calc(100% - 28px);
    margin: 8px 14px 14px;
    color: #6a6f76;
    font-size: 12px;
    line-height: 1.4;
}


.result-basis > span {
    display: inline;
}


.result-basis strong {
    color: #555;
    font-weight: 700;
}


/* ============================================================
   INFO BUTTON
   ============================================================ */

.info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
    border: 1px solid #9da4ae;
    border-radius: 50%;
    background: #fff;
    color: #60656d;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}


.info-button:hover,
.info-button:focus {
    border-color: #666;
    color: #333;
    outline: none;
}


.result-info-button {
    width: 18px;
    height: 18px;
    font-size: 11px;
}


/* ============================================================
   RESULT INFO POPUP
   ============================================================ */

.info-popup {
    position: absolute;
    z-index: 30;
    width: min(330px, calc(100vw - 50px));
    padding: 11px 13px;
    border: 1px solid #cfd4db;
    border-radius: 7px;
    background: #fff;
    color: #444;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
    text-align: left;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.15s ease,
        visibility 0.15s ease;
}


.result-info-popup {
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
}


.result-basis:has(.result-info-button:hover) .result-info-popup,
.result-basis:has(.result-info-button:focus) .result-info-popup,
.result-basis:has(.result-info-button:focus-visible) .result-info-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


.info-popup.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


.info-popup-title {
    display: block;
    margin: 0 0 6px;
    color: #333;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
}


.info-popup p {
    margin: 0 0 7px;
    color: #444;
    font-size: 13px;
    line-height: 1.45;
}


.info-popup p:last-child {
    margin-bottom: 0;
}


.info-popup-note {
    color: #666 !important;
}


/* ============================================================
   CONVERSION MODE
   ============================================================ */

.conversion-mode-group {
    width: 100%;
    margin: 0 0 20px;
}


.conversion-mode-label {
    display: block;
    margin-bottom: 8px;
    color: #444;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 700;
}


.conversion-mode {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin: 0;
}


.mode-option {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    flex: 0 1 175px;
    min-width: 0;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #d5d9df;
    border-radius: 7px;
    background: #fff;
    color: #444;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}


.mode-option:hover {
    border-color: #aeb4bd;
    background: #fafafa;
}


.mode-option:has(input:checked) {
    border-color: #1a73e8;
    background: #f5f9ff;
    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.08);
}


.mode-option input[type="radio"] {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #1a73e8;
    cursor: pointer;
}


/* ============================================================
   FORMATTING SECTION
   ============================================================ */

.formatting-section {
    width: 100%;
    padding-top: 17px;
    border-top: 1px solid #e2e5e9;
}


.formatting-title {
    margin: 0 0 12px;
    padding: 0;
    color: #444;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
}


/* ============================================================
   FORMATTING CONTROLS

   Paper Size gets more width because its labels are longer.
   ============================================================ */

.formatting-grid {
    display: grid;

    grid-template-columns:
        1.25fr
        0.8fr
        0.9fr
        1.15fr
        1.9fr;

    gap: 12px;
    width: 100%;
}


.setting-group {
    min-width: 0;
}


.setting-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
}


/* ============================================================
   CUSTOM SELECTS

   Using our own arrow prevents the browser from reserving a
   large invisible area inside the right side of the select.
   ============================================================ */

.setting-group select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 42px;

    margin: 0;

    padding:
        7px
        27px
        7px
        10px;

    border: 1px solid #c8cdd4;
    border-radius: 7px;

    background-color: #fff;

    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            #666 50%
        ),
        linear-gradient(
            135deg,
            #666 50%,
            transparent 50%
        );

    background-position:
        calc(100% - 13px) 17px,
        calc(100% - 9px) 17px;

    background-size:
        4px 4px,
        4px 4px;

    background-repeat: no-repeat;

    color: #333;

    outline: none;

    font-size: 14px;
    line-height: 1.3;

    white-space: nowrap;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.setting-group select:hover {
    border-color: #aeb4bd;
}


.setting-group select:focus {
    border-color: #666;
    box-shadow: 0 0 0 2px rgba(95, 99, 104, 0.06);
}


/* ============================================================
   FORMATTING HELP
   ============================================================ */

.formatting-help {
    margin: 10px 0 0;
    color: #6b7078;
    font-size: 13px;
    line-height: 1.4;
}


/* ============================================================
   TOOL RECOMMENDATION BOX
   ============================================================ */

.tool-recommendation {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid #d6dde7;
    border-radius: 8px;
    background: #f7faff;
}


.tool-recommendation p {
    margin: 0;
    color: #444;
    font-size: 15px;
    line-height: 1.55;
}


.secondary-recommendation {
    margin-top: 10px;
}


/* ============================================================
   QUICK REFERENCE SECTION
   ============================================================ */

.reference-section {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #d9dde3;
    border-radius: 10px;
    background: #fff;
}


.reference-header {
    margin-bottom: 16px;
}


.reference-header h2 {
    margin: 0 0 5px;
    padding: 0;
    color: #333;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
}


.reference-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}


/* ============================================================
   QUICK REFERENCE TABLE
   ============================================================ */

.reference-table-wrapper {
    width: 100%;
    overflow-x: auto;
}


.reference-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #333;
    font-size: 14px;
}


.reference-table th,
.reference-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #e2e5e9;
    text-align: center;
    vertical-align: middle;
}


.reference-table th {
    background: #f4f5f7;
    color: #444;
    font-weight: 700;
    white-space: nowrap;
}


.reference-table th:first-child,
.reference-table td:first-child {
    text-align: left;
    font-weight: 600;
}


.reference-table tbody tr:last-child td {
    border-bottom: none;
}


.reference-table tbody tr:hover {
    background: #fafafa;
}


/* ============================================================
   INFORMATIONAL CONTENT
   ============================================================ */

.words-pages-content {
    width: 100%;
    margin-top: 34px;
    color: #333;
    font-size: 17px;
    line-height: 1.7;
}


.words-pages-content h2 {
    margin: 34px 0 12px;
    padding: 0;
    color: #292929;
    font-size: 25px;
    line-height: 1.3;
    font-weight: 700;
}


.words-pages-content h2:first-child {
    margin-top: 0;
}


.words-pages-content h3 {
    margin: 26px 0 9px;
    padding: 0;
    color: #333;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
}


.words-pages-content p {
    margin: 0 0 17px;
    padding: 0;
    color: #444;
    font-size: 17px;
    line-height: 1.7;
}


.words-pages-content strong {
    color: #333;
}


.words-pages-content a strong {
    color: inherit;
}


.words-pages-content ol,
.words-pages-content ul {
    margin: 8px 0 20px 28px;
    padding: 0;
    color: #444;
    list-style-position: outside;
}


.words-pages-content ol {
    list-style-type: decimal;
}


.words-pages-content ul {
    list-style-type: disc;
}


.words-pages-content li {
    margin-bottom: 8px;
    padding-left: 3px;
    color: #444;
    font-size: 17px;
    line-height: 1.65;
}


.words-pages-content ol li {
    list-style: decimal;
}


.words-pages-content ul li {
    list-style: disc;
}


/* ============================================================
   FAQ
   ============================================================ */

.faq-section {
    margin-top: 38px;
}


.faq-section > h2 {
    margin-bottom: 16px;
}


.faq-item {
    padding: 17px 0;
    border-bottom: 1px solid #e1e4e8;
}


.faq-item:first-of-type {
    border-top: 1px solid #e1e4e8;
}


.faq-item h3 {
    margin: 0 0 7px;
    padding: 0;
    color: #333;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
}


.faq-item p {
    margin: 0;
    color: #444;
    font-size: 16px;
    line-height: 1.65;
}


/* ============================================================
   RAPTIVE SIDEBAR
   KEEP THIS ID UNCHANGED
   ============================================================ */

#sidebar {
    width: 300px;
    min-width: 300px;
    min-height: 600px;
    position: relative;
    align-self: stretch;
}


/* ============================================================
   1280PX
   ============================================================ */

@media screen and (max-width: 1280px) {

    .words-pages-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 22px;
    }


    #sidebar {
        width: 280px;
        min-width: 280px;
    }


    .converter-main-row {
        grid-template-columns:
            minmax(0, 1fr)
            30px
            minmax(0, 1fr);

        gap: 9px;
    }


    .converter-arrow {
        font-size: 26px;
    }


    .formatting-grid {
        grid-template-columns:
            1.2fr
            0.8fr
            0.9fr
            1.1fr
            1.75fr;

        gap: 10px;
    }

}


/* ============================================================
   1100PX
   GIVE FORMATTING CONTROLS MORE ROOM
   ============================================================ */

@media screen and (max-width: 1100px) {

    .formatting-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


/* ============================================================
   992PX
   SIDEBAR MOVES BELOW
   ============================================================ */

@media screen and (max-width: 992px) {

    .words-pages-page {
        padding-top: 95px;
    }


    .words-pages-layout {
        display: block;
        max-width: 820px;
    }


    .words-pages-main {
        width: 100%;
    }


    #sidebar {
        width: 100%;
        min-width: 0;
        min-height: 0;
        margin-top: 28px;
    }


    .converter-main-row {
        grid-template-columns:
            minmax(0, 1fr)
            34px
            minmax(0, 1fr);

        gap: 10px;
    }


    .formatting-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 11px;
    }

}


/* ============================================================
   760PX
   ============================================================ */

@media screen and (max-width: 760px) {

    .words-pages-page {
        padding: 88px 12px 26px;
    }


    .words-pages-heading {
        margin-bottom: 18px;
    }


    .words-pages-heading h1 {
        font-size: 28px;
    }


    .words-pages-intro {
        font-size: 16px;
    }


    .converter-card {
        padding: 16px;
    }


    .converter-main-row {
        grid-template-columns:
            minmax(0, 1fr)
            26px
            minmax(0, 1fr);

        gap: 7px;
        margin-bottom: 16px;
    }


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


    .converter-input-group,
    .metric-card,
    .primary-metric {
        min-height: 150px;
    }


    .converter-input-label,
    .metric-label {
        min-height: 47px;
        padding: 9px 10px;
        font-size: 18px;
    }


    .conversion-input {
        width: calc(100% - 24px);
        height: 64px;
        min-height: 64px;
        margin: 19px 12px;
        padding: 9px 12px;
        font-size: 23px;
    }


    .conversion-input::placeholder {
        font-size: 18px;
    }


    .metric-value {
        margin-top: 17px;
        font-size: 34px;
    }


    .result-basis {
        width: calc(100% - 20px);
        margin: 7px 10px 12px;
        font-size: 11px;
    }


    .conversion-mode-label {
        font-size: 16px;
    }


    .conversion-mode-group {
        margin-bottom: 18px;
    }


    .mode-option {
        flex-basis: 165px;
        min-height: 35px;
        font-size: 12px;
    }


    .formatting-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 11px;
    }


    .formatting-help {
        font-size: 12px;
    }


    .reference-section {
        padding: 16px;
    }


    .words-pages-content {
        margin-top: 30px;
        font-size: 16px;
    }


    .words-pages-content h2 {
        font-size: 23px;
    }


    .words-pages-content p,
    .words-pages-content li {
        font-size: 16px;
    }

}


/* ============================================================
   560PX
   STACK WORD COUNT + RESULT
   ============================================================ */

@media screen and (max-width: 560px) {

    .words-pages-page {
        padding-right: 10px;
        padding-left: 10px;
    }


    .words-pages-heading h1 {
        font-size: 26px;
    }


    .converter-main-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }


    .converter-arrow {
        min-height: 25px;
        font-size: 25px;
        transform: rotate(90deg);
    }


    .converter-input-group,
    .metric-card,
    .primary-metric {
        min-height: 145px;
    }


    .converter-input-label,
    .metric-label {
        min-height: 47px;
        font-size: 19px;
    }


    .conversion-input {
        width: calc(100% - 28px);
        height: 62px;
        min-height: 62px;
        margin: 18px 14px;
        font-size: 24px;
    }


    .conversion-input::placeholder {
        font-size: 19px;
    }


    .metric-value {
        margin-top: 16px;
        font-size: 35px;
    }


    .result-basis {
        margin-top: 8px;
        font-size: 12px;
    }


    .result-info-popup {
        width: min(320px, calc(100vw - 32px));
    }


    .conversion-mode {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }


    .mode-option {
        width: 100%;
        min-width: 0;
        min-height: 36px;
        padding: 7px 8px;
        font-size: 12px;
    }


    .formatting-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
    }


    .setting-group label {
        font-size: 12px;
    }


    .setting-group select {
        height: 40px;
        padding:
            7px
            26px
            7px
            8px;

        font-size: 13px;

        background-position:
            calc(100% - 13px) 16px,
            calc(100% - 9px) 16px;
    }


    .tool-recommendation {
        padding: 12px 13px;
    }


    .tool-recommendation p {
        font-size: 14px;
    }


    .reference-section {
        margin-top: 16px;
        padding: 14px;
    }


    .reference-header h2 {
        font-size: 20px;
    }


    .reference-header p {
        font-size: 13px;
    }


    .reference-table {
        min-width: 440px;
        font-size: 13px;
    }


    .reference-table th,
    .reference-table td {
        padding: 10px 8px;
    }


    .words-pages-content h2 {
        margin-top: 30px;
        font-size: 22px;
    }


    .words-pages-content h3 {
        font-size: 19px;
    }


    .words-pages-content p,
    .words-pages-content li {
        font-size: 16px;
        line-height: 1.65;
    }


    .words-pages-content ol,
    .words-pages-content ul {
        margin-left: 24px;
    }


    .faq-item h3 {
        font-size: 17px;
    }


    .faq-item p {
        font-size: 15px;
    }

}


/* ============================================================
   420PX
   ============================================================ */

@media screen and (max-width: 420px) {

    .words-pages-heading h1 {
        font-size: 24px;
    }


    .words-pages-intro {
        font-size: 15px;
    }


    .converter-input-label,
    .metric-label {
        font-size: 18px;
    }


    .conversion-input {
        width: calc(100% - 24px);
        margin-right: 12px;
        margin-left: 12px;
    }


    .conversion-input::placeholder {
        font-size: 18px;
    }


    .conversion-mode {
        grid-template-columns: 1fr;
    }


    .formatting-grid {
        grid-template-columns: 1fr;
    }


    .setting-group label {
        font-size: 13px;
    }


    .setting-group select {
        font-size: 14px;
    }


    .reference-table {
        min-width: 410px;
    }


    .result-info-popup {
        width: calc(100vw - 28px);
    }

}


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

.mode-option:focus-within {
    outline: 2px solid rgba(26, 115, 232, 0.35);
    outline-offset: 2px;
}


.conversion-input:focus-visible,
.setting-group select:focus-visible,
.info-button:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}


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

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

    .mode-option,
    .conversion-input,
    .setting-group select,
    .info-popup {
        transition: none;
    }

}