/* ==========================================================================
   Imiona Browser — /imiona-meskie, /imiona-zenskie
   Prefix: ib-
   ========================================================================== */

.ib-page { max-width: 100%; }
.ib-intro { margin-bottom: 1.5em; font-size: 1.05em; line-height: 1.7; }

/* Cross-link navigation */
.ib-gender-nav {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5em;
    margin: 1.5em 0; padding: 1em 1.2em;
    background: var(--blockquote-bg, #f5f5f5);
    border: 1px solid var(--border-lighter, #e3e3e3);
    border-radius: 6px;
}
.ib-gender-nav a { color: var(--link-color, #6E3A0E); text-decoration: none; font-weight: 600; font-size: .95em; }
.ib-gender-nav a:hover { text-decoration: underline; }

/* Alphabet strip */
.ib-alpha-strip-wrapper {
    margin: 1.5em 0; padding: .8em 1em;
    background: var(--blockquote-bg, #f5f5f5);
    border: 1px solid var(--border-lighter, #e3e3e3);
    border-radius: 8px;
}
.ib-alpha-strip__heading {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1em; font-weight: 700;
    color: var(--text-heading, #740);
    margin: 0 0 .4em 0; text-align: center;
}
.ib-alpha-strip {
    display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
}
.ib-alpha-strip a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 6px;
    font-weight: 700; font-size: .95em; color: var(--link-color, #6E3A0E);
    text-decoration: none; border-radius: 4px;
    transition: background .15s;
}
.ib-alpha-strip a:hover { background: var(--border-lighter, #e3e3e3); }
.ib-alpha-strip .ib-alpha-strip__count {
    font-size: .7em; font-weight: 400; color: var(--text-muted, #777);
    margin-left: 1px;
}

/* ==========================================================================
   Category sections
   ========================================================================== */

.ib-categories { margin: 2em 0; }
.ib-categories > h2 { margin-bottom: .3em; }
.ib-categories > p { color: var(--text-muted, #777); margin-bottom: 1.5em; }

.ib-cat {
    background: var(--blockquote-bg, #f5f5f5);
    border: 1px solid var(--border-lighter, #e3e3e3);
    border-radius: 10px; padding: 1.2em 1.5em;
    margin-bottom: 1.2em;
}
.ib-cat__heading {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2em; font-weight: 700;
    color: var(--text-heading, #740);
    margin: 0 0 .2em 0;
}
.ib-cat__count { font-weight: 400; font-size: .85em; color: var(--text-muted, #777); }
.ib-cat__desc { color: var(--text-muted, #777); font-size: .95em; margin: 0 0 .8em 0; line-height: 1.5; }

.ib-cat__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .6em;
}
.ib-cat__card {
    display: flex; flex-direction: column; padding: .7em .9em;
    background: var(--bg-body, #fff);
    border: 1px solid var(--border-lighter, #e3e3e3);
    border-radius: 6px; text-decoration: none;
    transition: border-color .2s, box-shadow .2s;
}
.ib-cat__card:hover {
    border-color: var(--link-color, #6E3A0E);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.ib-cat__card--hidden { display: none; }
.ib-cat--expanded .ib-cat__card--hidden { display: flex; }

.ib-cat__name {
    display: block; font-weight: 600; font-size: 1.05em;
    color: var(--link-color, #6E3A0E);
}
.ib-cat__card:hover .ib-cat__name { text-decoration: underline; }

.ib-cat__meta {
    display: flex; align-items: center; gap: .4em;
    margin-top: .2em; font-size: .8em;
}
.ib-cat__tier {
    display: inline-block; padding: 1px 6px;
    border-radius: 3px; font-size: .85em; font-weight: 600;
    color: #fff; white-space: nowrap;
}
.ib-cat__trend { font-size: 1.1em; }

.ib-cat__pesel {
    display: block; font-size: .8em; color: var(--text-muted, #777);
    margin-top: .15em;
}

.ib-cat__toggle {
    display: block; width: 100%; margin-top: .8em; padding: 8px;
    background: transparent; border: 1px solid var(--border-subtle, #ddd);
    border-radius: 4px; font-size: 13px; color: var(--text-muted, #777);
    cursor: pointer; text-align: center; transition: background .2s;
}
.ib-cat__toggle:hover { background: var(--border-lighter, #e3e3e3); color: var(--text-primary, #464646); }

/* ==========================================================================
   Alphabet section (full list)
   ========================================================================== */

.ib-alpha { margin: 2em 0; }

.ib-alpha__letter {
    margin-bottom: 1.5em;
    padding-bottom: 1em;
    border-bottom: 1px solid var(--border-lighter, #e3e3e3);
}
.ib-alpha__letter:last-child { border-bottom: none; }

.ib-alpha__letter h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.3em; font-weight: 700;
    color: var(--text-heading, #740);
    margin: 0 0 .6em 0;
}
.ib-alpha__letter h3 span { font-weight: 400; font-size: .75em; color: var(--text-muted, #777); }

.ib-alpha__list {
    columns: 3;
    column-gap: 1.5em;
    list-style: none;
    margin: 0; padding: 0;
}
.ib-alpha__item {
    break-inside: avoid;
    padding: 3px 0;
    font-size: .95em;
    line-height: 1.5;
}
.ib-alpha__item a {
    color: var(--link-color, #6E3A0E);
    text-decoration: none; font-weight: 600;
}
.ib-alpha__item a:hover { text-decoration: underline; }
.ib-alpha__item-pesel {
    color: var(--text-muted, #777);
    font-size: .85em;
}
.ib-alpha__item-trend {
    font-size: .85em;
}
.ib-alpha__item-nameday {
    color: var(--text-muted, #999);
    font-size: .8em;
}

/* Trend colors */
.trend--up2 { color: #1a7f37; }
.trend--stable { color: #768390; }
.trend--down { color: #cf222e; }
.trend--down2 { color: #82071e; }
.trend--none { color: #aaa; }

/* ==========================================================================
   Attribution & links
   ========================================================================== */

.ib-links { margin-top: 2em; padding-top: 1.5em; border-top: 1px solid var(--border-lighter, #e3e3e3); }
.ib-links h3 { font-family: Georgia, "Times New Roman", serif; font-size: 1.3em; color: var(--text-heading, #740); margin: 0 0 1em 0; font-weight: 700; }
.ib-links .related-cards { display: flex; flex-wrap: wrap; gap: 1em; }
.ib-links .related-card {
    flex: 1 1 200px; max-width: 280px; display: block;
    background: var(--blockquote-bg, #f5f5f5); border: 1px solid var(--border-lighter, #e3e3e3);
    border-radius: 6px; padding: 1em 1.2em; text-decoration: none; transition: border-color .2s, box-shadow .2s;
}
.ib-links .related-card:hover { border-color: var(--link-color, #6E3A0E); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ib-links .related-card-title { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.1em; font-weight: 600; color: var(--link-color, #6E3A0E); margin-bottom: .3em; }
.ib-links .related-card:hover .related-card-title { text-decoration: underline; }
.ib-links .related-card-desc { display: block; font-size: .9em; color: var(--text-muted, #777); line-height: 1.4; }

.ib-attribution { margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--border-lighter, #e3e3e3); color: var(--text-muted, #777); font-size: .85em; }
.ib-attribution a { color: var(--link-color, #6E3A0E); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
    .ib-alpha__list { columns: 2; }
}

@media screen and (max-width: 500px) {
    .ib-cat__grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .ib-cat { padding: .8em 1em; }
    .ib-alpha__list { columns: 1; }
    .ib-alpha-strip a { min-width: 28px; height: 28px; font-size: .85em; }
}
