/* ============================================================
   WORDS TO PAGES CONVERTER
   Page-specific styles
   ============================================================ */


/* ============================================================
   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;
}


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

.conversion-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 14px;
}


.mode-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 165px;
    padding: 10px 15px;
    border: 1px solid #d5d9df;
    border-radius: 8px;
    background: #fff;
    color: #444;
    font-size: 14px;
    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"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #1a73e8;
    cursor: pointer;
}


/* ============================================================
   PRIMARY METRICS
   ============================================================ */

.primary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-bottom: 14px;
}


.metric-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center;
    border: 1px solid #d9dde3;
    border-radius: 9px;
    background: #fff;
}


.primary-metric {
    min-height: 105px;
    padding: 15px 10px;
}


.metric-label {
    display: block;
    color: #555;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
}


.metric-value {
    display: block;
    margin-top: 7px;
    color: #1a73e8;
    font-size: 31px;
    line-height: 1;
    font-weight: 700;
}


.result-metric {
    border-color: #c7d8f2;
    background: #fbfdff;
}


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

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


/* ============================================================
   MAIN NUMBER INPUT
   ============================================================ */

.converter-input-group {
    width: 100%;
    margin-bottom: 18px;
}


.converter-input-label {
    display: block;
    margin-bottom: 7px;
    color: #444;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
}


.conversion-input {
    display: block;
    width: 100%;
    max-width: 320px;
    height: 58px;
    margin: 0;
    padding: 10px 14px;
    border: 2px solid #c9ced6;
    border-radius: 9px;
    background: #fff;
    color: #222;
    outline: none;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


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


.conversion-input:focus {
    border-color: #5f6368;
    box-shadow: 0 0 0 2px rgba(95, 99, 104, 0.08);
}


.conversion-input::placeholder {
    color: #9a9fa7;
    opacity: 1;
    font-size: 15px;
    font-weight: 400;
}


/* Remove number arrows in Chrome, Safari, Edge, Opera */

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


/* Remove number arrows in Firefox */

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


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

.formatting-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    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;
}


.setting-group select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 7px 30px 7px 10px;
    border: 1px solid #c8cdd4;
    border-radius: 7px;
    background-color: #fff;
    color: #333;
    outline: none;
    font-size: 14px;
    line-height: 1.3;
    cursor: pointer;
    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);
}


/* ============================================================
   ESTIMATE NOTE
   ============================================================ */

.estimate-note {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    margin-top: 16px;
    padding: 11px 13px;
    border: 1px solid #dde1e6;
    border-radius: 8px;
    background: #fafafa;
    color: #555;
    font-size: 13px;
    line-height: 1.45;
}


/* ============================================================
   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-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}


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


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

.info-popup {
    position: absolute;
    z-index: 20;
    left: 10px;
    top: calc(100% + 7px);
    width: min(410px, 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);
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.15s ease,
        visibility 0.15s ease;
}


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


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


/* ============================================================
   TOOL RECOMMENDATION BOXES
   ============================================================ */

.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;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

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


/* ============================================================
   LARGE / MEDIUM DESKTOP
   ============================================================ */

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

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


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


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

}


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

@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;
        margin-top: 28px;
    }


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

}


/* ============================================================
   MEDIUM SCREENS
   ============================================================ */

@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;
    }


    .primary-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }


    .primary-metric {
        min-height: 94px;
        padding: 13px 7px;
    }


    .metric-label {
        font-size: 13px;
    }


    .metric-value {
        font-size: 27px;
    }


    .converter-card {
        padding: 16px;
    }


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


    .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;
    }

}


/* ============================================================
   SMALL SCREENS
   ============================================================ */

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

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


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


    .conversion-mode {
        gap: 8px;
    }


    .mode-option {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        padding: 9px 8px;
        font-size: 13px;
    }


    .primary-metrics {
        grid-template-columns: 1fr;
        gap: 8px;
    }


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


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


    .metric-value {
        margin-top: 6px;
        font-size: 27px;
    }


    .converter-card {
        padding: 14px;
    }


    .conversion-input {
        width: 100%;
        max-width: 100%;
        height: 56px;
        padding: 10px 13px;
        font-size: 21px;
    }


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


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


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


    .setting-group select {
        height: 40px;
        padding-left: 8px;
        font-size: 13px;
    }


    .estimate-note {
        align-items: flex-start;
        padding: 10px 11px;
    }


    .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;
    }

}


/* ============================================================
   EXTRA SMALL SCREENS
   ============================================================ */

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

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


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


    .conversion-mode {
        flex-direction: column;
        align-items: stretch;
    }


    .mode-option {
        width: 100%;
        flex-basis: auto;
    }


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


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


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


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

}


/* ============================================================
   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;
    }

}