/* ==========================================================================
   uzlidep-fixes.css
   Loaded last, after style.css / main.css / responsive.css, so these rules win.

   Contains:
   1. Portrait photo proportions (fraksiya, rahbariyat, hududiy kengashlar,
      loyiha ishtirokchilari) — the source rules sized images with
      width:100% + height:100% and no object-fit, which stretches or squeezes
      every photo that is not exactly the container ratio.
   2. Shared building blocks used by the standardised profile / project /
      region templates.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Portrait proportions
   -------------------------------------------------------------------------- */

/* Fraksiya (deputies) list — the source rules pinned a fixed pixel height
   (380px desktop / 240px tablet / 380px on a full-width mobile card) onto a
   fluid-width column, so the crop ratio changed at every breakpoint and the
   same portrait looked stretched on one screen and narrow on another.
   A fixed aspect-ratio keeps one proportion everywhere. */
.recall-row .featured-item {
    height: auto;
    aspect-ratio: 3 / 4;
}

/* Fraksiya member detail photo — same reason (was a fixed 360px). */
.dekan_img.image {
    height: auto;
    aspect-ratio: 3 / 4;
}

@media (max-width: 480px) {
    /* Beats `.recall-row_col .featured-item { height: 380px }` in responsive.css */
    .recall-row_col .featured-item,
    .recall-row .featured-item {
        height: auto;
        aspect-ratio: 3 / 4;
    }
}

/* Deputies / leadership list */
.leadership__item__image {
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
}

.leadership__item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Faces sit in the upper part of a portrait, so crop from the bottom. */
    object-position: top center;
    border-radius: 10px;
    display: block;
}

/* Deputy / leadership detail page */
.manage_v-body .manage_img {
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
}

.manage_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Regional council head photo */
.region_manage_img {
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
}

.region_manage_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Project participants */
.participants_card .participants_card_img {
    overflow: hidden;
    border-radius: 12px;
    background: #f1f5f9;
}

.participants_card .participants_card_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 12px;
    display: block;
}

/* Tablet: the list switches to a stacked card, so the photo needs its own
   size instead of inheriting the flex row width. */
@media (max-width: 991px) {
    .leadership__item__image {
        width: 220px;
        max-width: 100%;
        flex: 0 0 auto;
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .manage_v-body .manage_img {
        width: 260px;
        max-width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .region_manage_img {
        aspect-ratio: 4 / 5;
        height: auto;
    }
}

@media (max-width: 575px) {
    .leadership__item__image {
        width: 180px;
    }

    .manage_v-body .manage_img {
        width: 100%;
        max-width: 320px;
        float: none;
        margin: 0 auto 16px auto;
    }

    .participants_card .participants_card_img {
        aspect-ratio: 4 / 5;
        height: auto;
    }
}

/* --------------------------------------------------------------------------
   2. Shared blocks for the standardised templates
   -------------------------------------------------------------------------- */

/* Single, reusable portrait frame — used by the deputy and youth-parliament
   cards so every photo on the site has the same ratio regardless of upload. */
.uz-portrait {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 12px;
    background: #eef2f7;
}

.uz-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Key/value list used on profile, region and project pages */
.uz-facts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.uz-facts li {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 16px;
    line-height: 1.5;
}

.uz-facts li:last-child {
    border-bottom: 0;
}

.uz-facts__label {
    flex: 0 0 40%;
    max-width: 40%;
    color: #64748b;
}

.uz-facts__value {
    flex: 1;
    color: #0f172a;
    font-weight: 500;
}

@media (max-width: 575px) {
    .uz-facts li {
        flex-direction: column;
        gap: 2px;
    }

    .uz-facts__label,
    .uz-facts__value {
        flex: 1 1 auto;
        max-width: 100%;
    }
}

/* Numbers / results block ("3 500 ishtirokchi", "48 tadbir", …) */
.uz-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.uz-stat {
    background: #ffffff;
    border: 1px solid #e6ecf5;
    border-radius: 14px;
    padding: 20px 18px;
    text-align: center;
}

.uz-stat__value {
    display: block;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: #253a60;
}

.uz-stat__label {
    display: block;
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.4;
    color: #64748b;
}

/* Section heading inside a content page */
.uz-section {
    margin-top: 32px;
}

.uz-section__title {
    font-size: 24px;
    line-height: 1.3;
    color: #253a60;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e6ecf5;
}

/* Media gallery grid (project pages, region pages) */
.uz-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.uz-gallery a {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: #eef2f7;
}

.uz-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.uz-gallery a:hover img {
    transform: scale(1.05);
}

/* Social links row (regional councils without their own website) */
.uz-social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.uz-social a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e6ecf5;
    border-radius: 999px;
    font-size: 15px;
    color: #253a60;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.uz-social a:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Card grid used by the youth parliament / member listings */
.uz-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.uz-person {
    background: #ffffff;
    border: 1px solid #e6ecf5;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.uz-person:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 26px rgba(37, 58, 96, 0.12);
}

.uz-person .uz-portrait {
    border-radius: 0;
}

.uz-person__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.uz-person__name {
    font-size: 17px;
    line-height: 1.35;
    font-weight: 600;
    color: #253a60;
    margin: 0;
}

.uz-person__role {
    font-size: 15px;
    line-height: 1.4;
    color: #64748b;
    margin: 0;
}

/* Upcoming / past state for announcements */
.uz-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
}

.uz-badge--upcoming {
    background: #dcfce7;
    color: #166534;
}

.uz-badge--past {
    background: #f1f5f9;
    color: #64748b;
}

/* Year filter pills (reports archive) */
.uz-years {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.uz-years a {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
}

.uz-years a:hover {
    border-color: #0754c8;
    color: #0754c8;
}

.uz-years a.is-active {
    background: #253a60;
    border-color: #253a60;
    color: #ffffff;
}
