/* Shared component rules for the 75 public pages that link this file.
   Load after layout.css and before print.css.
   Duplicate selectors keep the length-converter.html source order.
   invoice-generator.html does not link this file. */

/* Source: length-converter.html lines 270-345, buttons. */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: #2d6a9f;
    color: #fff;
}
.btn-primary:hover {
    background: #245883;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
[data-theme="dark"] .btn-primary {
    background: #7fb8e8;
    color: #1a1a2e;
}
[data-theme="dark"] .btn-primary:hover {
    background: #a8d4f5;
    color: #1a1a2e;
}
.btn-secondary {
    background: transparent;
    color: #2d6a9f;
    border: 2px solid #2d6a9f;
}
.btn-secondary:hover {
    background: #245883;
    color: #fff;
    border-color: #245883;
    transform: translateY(-2px);
}
.btn-sm { padding: 6px 16px; font-size: 14px; }
/* Dark mode: secondary / unfilled buttons */
[data-theme="dark"] .btn-secondary {
    color: #7fb8e8;
    border-color: #7fb8e8;
    background: transparent;
}
[data-theme="dark"] .btn-secondary:hover {
    background: #a8d4f5;
    color: #1a1a2e;
    border-color: #a8d4f5;
}
[data-theme="dark"] .btn.btn-sm:not(.btn-primary):not(.btn-success) {
    color: var(--text);
    border: 2px solid var(--text-light);
    background: transparent;
}
[data-theme="dark"] .btn.btn-sm:not(.btn-primary):not(.btn-success):hover {
    background: var(--text-light);
    color: var(--bg);
    border-color: var(--text-light);
}
[data-theme="dark"] .blog-card a.btn.btn-sm:not(.btn-primary):not(.btn-success),
[data-theme="dark"] .related-post-card a.btn.btn-sm:not(.btn-primary):not(.btn-success) {
    background: #7fb8e8;
    color: #1a1a2e;
    border: 2px solid #7fb8e8;
}
[data-theme="dark"] .blog-card a.btn.btn-sm:not(.btn-primary):not(.btn-success):hover,
[data-theme="dark"] .related-post-card a.btn.btn-sm:not(.btn-primary):not(.btn-success):hover {
    background: #a8d4f5;
    color: #1a1a2e;
    border-color: #a8d4f5;
}

/* Source: length-converter.html lines 350-425, tool widget, result, copy status. */
.tool-widget {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 32px;
    margin: 24px 0;
    border: 1px solid var(--border);
}
.tool-widget .input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.tool-widget .input-group > div {
    flex: 1;
    min-width: 140px;
}
.tool-widget label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--text-light);
}
.tool-widget input,
.tool-widget select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    transition: border var(--transition);
}
.tool-widget input:focus,
.tool-widget select:focus,
.tool-widget textarea:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 1px;
    border-color: var(--primary-light);
}
[data-theme="dark"] .tool-widget input:focus,
[data-theme="dark"] .tool-widget select:focus,
[data-theme="dark"] .tool-widget textarea:focus {
    outline-color: #7fb8e8;
    border-color: #7fb8e8;
}
.tool-result {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-light);
}
[data-theme="dark"] .tool-result {
    border-left-color: #7fb8e8;
}
.tool-result .result-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}
[data-theme="dark"] .tool-result .result-value {
    color: #60a5fa;
}
.tool-result .result-category {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}
.tool-widget .conv-swap-cell {
    flex: 0 0 auto;
    min-width: auto;
}
.tool-widget .conv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}
.conv-copy-status {
    margin-top: 8px;
    min-height: 1.4em;
}
.copy-success {
    color: #27ae60;
}

/* Source: length-converter.html lines 454-468, selector .content-section table.
   First table block. The overflow continuation is later in this file, source line 663. */
.content-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.content-section table th,
.content-section table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.content-section table th {
    background: var(--bg-alt);
    font-weight: 600;
}

/* Source: length-converter.html lines 473-491, FAQ accordion. */
.faq-accordion details {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    padding: 8px 16px;
}
.faq-accordion details summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px 0;
}
.faq-accordion details summary::-webkit-details-marker {
    color: var(--primary-light);
}
[data-theme="dark"] .faq-accordion details summary::-webkit-details-marker {
    color: #7fb8e8;
}
.faq-accordion details p {
    padding: 8px 0 16px;
    margin: 0;
    color: var(--text-light);
}

/* Source: length-converter.html lines 496-516, selector .related-tools. */
.related-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}
.related-tools a {
    background: var(--bg-alt);
    padding: 4px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.related-tools a:hover {
    background: #245883;
    color: #fff;
    border-color: #245883;
}
.related-tools a:has(.related-tool-name) {
    display: flex;
    flex: 1 1 220px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    line-height: 1.45;
}
.related-tools a .related-tool-name,
.related-tools a .related-tool-desc {
    display: block;
}
.related-tools a .related-tool-name {
    font-weight: 600;
}
.related-tools a .related-tool-desc {
    font-size: 13px;
    font-weight: 400;
}

/* Source: length-converter.html lines 601-602, @media (max-width: 768px).
   Navigation rules from this media block are in layout.css.
   First responsive continuation of .tool-widget .input-group > div (source line 363). */
@media (max-width: 768px) {
    .tool-widget .input-group > div { min-width: 100%; }
    .tool-result .result-value { font-size: 22px; }
}

/* Source: length-converter.html lines 608-626, Adsterra slot styling only.
   Script URLs and IDs are not in this file. */
.adsterra-tool-slot {
    max-width: 100%;
    margin: 24px auto;
    text-align: center;
    overflow: hidden;
}
.adsterra-tool-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 8px;
}
.adsterra-tool-unit {
    max-width: 100%;
    overflow: hidden;
    margin: 0 auto;
}

/* Source: length-converter.html lines 658-662, selector [data-theme="dark"] .related-tools a:hover.
   Same specificity as the grouped hover rule in base.css (source lines 652-657).
   This single rule stays after that grouped rule. */
[data-theme="dark"] .related-tools a:hover {
    background: #a8d4f5;
    color: #1a1a2e;
    border-color: #a8d4f5;
}

/* Source: length-converter.html line 663, selector .content-section table.
   Second block. Keeps source order after the first .content-section table above. */
.content-section table { display: block; overflow-x: auto; max-width: 100%; }

/* Source: length-converter.html line 665, selector a.tool-card. */
a.tool-card { color: inherit; text-decoration: none; }

/* Source: length-converter.html lines 667 and 672-673, @media (max-width: 480px).
   Search and header rules from this media block are in layout.css.
   Second responsive continuation of .tool-widget .input-group > div. */
@media (max-width: 480px) {
    .tool-widget .input-group > div { min-width: 100%; flex: 1 1 100%; }
    input, select, textarea { max-width: 100%; }
    .btn { justify-content: center; }
}

/* Source: length-converter.html line 702, selector .search-close.
   Second block. Adds to layout.css .search-close (source lines 242-251) and must load after it. */
.search-close { min-width: 44px; min-height: 44px; }

/* Length converter reference tables only.
   The exact factors are unchanged. Long factors may wrap inside a data cell.
   Header text keeps normal wrapping so words such as Abbreviation stay intact. */
@media (max-width: 480px) {
    table.length-unit-table td { overflow-wrap: anywhere; }
    table.length-unit-table th { overflow-wrap: normal; }
}

/* Blog article layout. First used by the blog-bmi-guide.html centralization test.
   Selectors and declarations match the article pages. The disc list rule stays
   before the decimal list rule so ordered lists keep numeric markers. */
[data-theme="dark"] .article-body a { color: #7fb8e8; }
[data-theme="dark"] .article-body a:hover { color: #a8d4f5; }
[data-theme="dark"] .cta-box a.btn-cta { color: #1a3a5c; }
[data-theme="dark"] .cta-box a.btn-cta:hover { color: #0f2a44; }
[data-theme="dark"] .cta-box { background: linear-gradient(135deg, #1a3a5c, #2d6a9f); }
[data-theme="dark"] .highlight-box { background: #1e2a44; border-left-color: #7fb8e8; }
[data-theme="dark"] .highlight-box strong { color: #a8d4f5; }
[data-theme="dark"] .highlight-box p { color: #e8edf5; }
.article-header {
    max-width: 850px;
    margin: 32px auto 24px;
    text-align: left;
}
.article-header h1 {
    font-size: 40px;
    line-height: 1.2;
    color: #2d6a9f;
    margin-bottom: 16px;
    font-weight: 800;
}
.article-meta {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 24px;
}
.article-meta span { margin-right: 16px; }
.article-body {
    max-width: 850px;
    margin: 0 auto 40px;
    font-size: 17px;
    color: var(--text);
    line-height: 1.8;
}
.article-body h2 {
    font-size: 26px;
    margin: 32px 0 16px;
    color: #2d6a9f;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.article-body h3 {
    font-size: 20px;
    margin: 24px 0 12px;
    color: var(--text);
}
.article-body p { margin-bottom: 16px; }
.article-body ul,
.article-body ol {
    padding-left: 24px;
    margin: 8px 0 20px;
}
.article-body ul li,
.article-body ol li {
    margin-bottom: 8px;
    list-style: disc;
}
.article-body ol li { list-style: decimal; }
.article-body strong { color: var(--text); }
.article-body a { color: #2d6a9f; text-decoration: underline; }
.article-body a:hover { color: #245883; }
.highlight-box {
    background: var(--bg-alt);
    border-left: 4px solid var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin: 20px 0;
}
.highlight-box p:last-child { margin-bottom: 0; }
.highlight-box strong { color: var(--primary); }
.cta-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: var(--radius);
    padding: 28px 32px;
    margin: 32px 0;
    text-align: center;
}
.cta-box h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 22px;
    border: none;
    padding: 0;
}
.cta-box p {
    color: rgba(255,255,255,0.92);
    margin-bottom: 16px;
    font-size: 16px;
}
.cta-box .btn-cta {
    background: #fff;
    color: var(--primary);
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
    transition: transform var(--transition);
    text-decoration: none;
}
.cta-box .btn-cta:hover {
    transform: translateY(-2px);
    color: var(--primary-dark);
}
.table-wrap { overflow-x: auto; margin: 20px 0; }
.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.article-body table th,
.article-body table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.article-body table th {
    background: var(--bg-alt);
    font-weight: 600;
}
.related-posts {
    max-width: 850px;
    margin: 0 auto 40px;
}
.related-posts h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #2d6a9f;
}
[data-theme="dark"] .article-header h1,
[data-theme="dark"] .article-body h2,
[data-theme="dark"] .related-posts h2 { color: #a8d4f5; }
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.related-post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.related-post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.related-post-card .related-category {
    display: inline-block;
    background: var(--bg-alt);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    align-self: flex-start;
}
.related-post-card h3 {
    margin: 8px 0;
    color: var(--text);
    font-size: 17px;
    line-height: 1.4;
}
.related-post-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
    flex-grow: 1;
}
.adsterra-test-slot {
    max-width: 100%;
    margin: 24px auto;
    text-align: center;
    overflow: hidden;
}
.adsterra-skyscraper-slot {
    display: none;
    width: 160px;
    min-height: 600px;
    overflow: hidden;
    text-align: center;
}
@media (max-width: 768px) {
    .article-header h1 { font-size: 28px; }
    .article-body { font-size: 16px; }
    .article-body h2 { font-size: 22px; }
}
@media (max-width: 480px) {
    .article-header h1 { font-size: 24px; }
}
@media (min-width: 1280px) {
    .adsterra-test-slot { display: none; }
    .article-with-rail {
        display: grid;
        grid-template-columns: minmax(0, 850px) 160px;
        column-gap: 24px;
        justify-content: center;
        align-items: start;
        max-width: 100%;
    }
    .article-with-rail .article-header,
    .article-with-rail .article-body,
    .article-with-rail .related-posts {
        max-width: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .adsterra-skyscraper-slot { display: block; }
}
