/* Visual clean-up layer for wordparts.ru and crossword24.ru.
   Loaded last from inc/header2.php (tools/patch_sites.py). Only overrides: markup, ad slots,
   texts and URLs stay as they are. Most original styles are inline, hence the !important. */

:root {
    --tidy-text: #24292f;
    --tidy-muted: #6a737d;
    --tidy-row: #f6f7f9;
    --tidy-row-hover: #eef2fb;
    --tidy-accent: #2f6fde;
    --tidy-border: #e3e6ea;
}

/* body text: ragged-right instead of justified (justify leaves wide gaps in Russian text) */
.bottext:not([style*="center"]),
.simlist,
[style*="text-align:justify"],
[style*="text-align: justify"] {
    text-align: left !important;
}
body {
    color: var(--tidy-text);
    -webkit-text-size-adjust: 100%;
}

/* answer lists (/vopros/, /question/, city/animal/... lists) */
.simlist {
    padding: 0 10px 10px !important;
    margin: 0;
}
.simlist li {
    min-height: 0 !important;           /* was 72px for every row, to fit the AI icon */
    padding: 10px 12px !important;
    margin-bottom: 6px !important;
    border-radius: 6px;
    background-color: var(--tidy-row) !important;
    line-height: 1.45;
    overflow: hidden;                   /* contains the floated AI icon */
}
.simlist li:hover {
    background-color: var(--tidy-row-hover) !important;
}
.simlist li > strong:first-child,
.simlist li > span > strong:first-child {
    color: #111;
}
/* AI rows: a small badge instead of a 64px picture */
.simlist li img[src*="ai1.png"] {
    width: 28px !important;
    height: 28px !important;
    margin: 0 10px 0 0 !important;
}
/* cross-promo row inside the answers ("Разгадывать кроссворды") */
.simlist li:has(> a[href*="/wordgame/"]) {
    background: none !important;
    border: 1px dashed var(--tidy-border);
    padding: 8px 12px !important;
}

/* AI notice: a quiet note instead of dotted top/bottom borders and a 110px picture */
.ad336[style*="border-top: dotted"] {
    border: 0 !important;
    border-left: 3px solid var(--tidy-accent) !important;
    background: #f7f9fe;
    font-style: normal !important;
    color: var(--tidy-muted);
    padding: 10px 14px !important;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ad336[style*="border-top: dotted"] img[src*="ai1.png"] {
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    flex: none;
}

/* answer card on /scanword/ and /answer/: same AI badge size */
img[src*="ai1.png"][style*="96px"] {
    width: 56px !important;
    height: 56px !important;
}


/* image strip on lists (cities, animals...): visible, snapping horizontal scroll */
.ad336[style*="overflow-x: scroll"] {
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.ad336[style*="overflow-x: scroll"] .illu {
    scroll-snap-align: start;
    border-radius: 6px;
}

/* anagram result headings were right-aligned above left-aligned lists */
h3:has(+ .anaglist) {
    text-align: left !important;
}

/* anagram "popular" words are letters with spaces: never break inside one */
a[href^="/anagramma/?word="] {
    white-space: nowrap;
}

/* footer: the ipinf link and the logo as one small centred block */
#container a[href="https://ipinf.ru"] {
    font-size: 13px;
    color: var(--tidy-muted);
    letter-spacing: .05em;
}
.bottext[itemprop],
.bottext {
    color: var(--tidy-muted);
}
.bottext img[src*="apple-touch-icon"],
.bottext img[src*="logo"] {
    width: 40px !important;
    height: 40px !important;
}

/* inputs: one height and radius across the search forms */
.form-field {
    border-radius: 6px !important;
}

@media (max-width: 600px) {
    /* letter / length filters: on phones a grid of tap targets */
    .ad336 a[href*="/start/"][href$="/letter/"],
    .ad336 a[href*="/vopros/"][href$="/"],
    .ad336 a[href*="/question/"][href$="/"] {
        display: inline-block;
        min-width: 1.6em;
        text-align: center;
    }
    .simlist li {
        font-size: 16px !important;
        padding: 9px 10px !important;
    }
    .ad336[style*="border-top: dotted"] {
        font-size: 14px;
    }
}

.ai-note {
    color: var(--tidy-muted);
    font-size: 13px !important;
    white-space: nowrap;
}

/* ad columns are gone: when no side column is left next to the content, use the full width
   (the content kept "width: calc(100% - 346px)" reserved for the old 336px ad column) */
.features-head:not(:has(> .aleft)):not(:has(> .aright)) > .cent,
.container:not(:has(> .aleft)):not(:has(> .aright)) > .cent {
    width: 100% !important;
}
