/* =========================================================
   IESIF TV / RESPONSIVE STANDARD
   Version 1.0
   ========================================================= */

/* ---------- BOX MODEL ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}


/* ---------- DOCUMENT ---------- */

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}


/* ---------- MEDIA ---------- */

img,
video,
svg,
canvas {
    max-width: 100%;
    height: auto;
}


/* ---------- FORM CONTROLS ---------- */

button,
input,
select,
textarea {
    max-width: 100%;
}


/* ---------- GRID / FLEX SAFETY ---------- */

main,
header,
footer,
section,
article,
aside,
.container,
.page-layout,
.main-column,
.sidebar,
.header-inner,
.brand,
.main-nav,
.header-tools {
    min-width: 0;
}


/* ---------- MAIN CONTAINER ---------- */

.container {
    width: 100%;
    max-width: var(--maxw, 1200px);
    margin-inline: auto;
}


/* ---------- GRID SAFETY ---------- */

.page-layout {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 320px);
}

.hero {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 300px);
}


/* ---------- HEADER ---------- */

.header-inner {
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);
}


/* ---------- FLEX ELEMENTS ---------- */

.main-nav,
.header-tools,
.search {
    min-width: 0;
    max-width: 100%;
}


/* ---------- TEXT OVERFLOW ---------- */

.brand-text,
.main-nav a,
.card,
.news-entry {
    overflow-wrap: anywhere;
}


/* ---------- MODALS ---------- */

.modal,
.lightbox {
    max-width: 100vw;
    max-height: 100dvh;
}

.modal-content {
    width: min(100%, 680px);
    max-width: 100%;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
}


/* ---------- LIGHTBOX ---------- */

.lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    max-height: 90dvh;
    object-fit: contain;
}


/* ---------- TABLET ---------- */

@media (max-width: 980px) {

    .page-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        grid-template-columns: 1fr;
    }

}


/* ---------- MOBILE ---------- */

@media (max-width: 600px) {

    .container {
        width: calc(100% - 16px);
    }

    .header-inner {
        grid-template-columns: 1fr;
    }

    .main-nav {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

}


/* ---------- REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

}
/* IESIF TV adjustment — ZVYAGINA */
@media (min-width: 981px) {
  .header-inner {
    grid-template-columns:
      minmax(0, 1fr)
      auto
      minmax(360px, 1fr);
    gap: 28px;
  }

  .brand {
    justify-content: center;
  }

  .header-tools {
    justify-content: flex-end;
    gap: 14px;
    padding-right: 8px;
  }

  .search {
    flex: 1 1 auto;
    min-width: 0;
  }

  .search input {
    width: 170px;
    min-width: 0;
  }

  .language-select {
    width: 130px;
    min-width: 130px;
    flex: 0 0 130px;
  }
}

/* Do not break normal words on TV */
.brand-text,
.main-nav a,
.card,
.news-entry {
  overflow-wrap: normal;
  word-break: normal;
}

@media (min-width: 981px) and (max-width: 1200px) {
  .header-inner {
    grid-template-columns:
      minmax(0, 1fr)
      auto
      minmax(330px, 1fr);
  }

  .header-tools {
    gap: 10px;
  }

  .search input {
    width: 150px;
  }

  .language-select {
    width: 120px;
    min-width: 120px;
    flex-basis: 120px;
  }
}


/* =========================================================
   IESIF TV / LARGE SCREEN — ZVYAGINA
   ========================================================= */

@media (min-width: 1201px) {

  .header-inner {
    grid-template-columns:
      minmax(300px, 1fr)
      minmax(300px, auto)
      minmax(390px, 1fr);
    gap: 24px;
  }

  .brand {
    justify-content: center;
    min-width: 0;
  }

  .brand-text {
    min-width: 0;
    overflow: visible;
  }

  .main-nav {
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
  }

  .header-tools {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    min-width: 390px;
    padding-right: 14px;
  }

  .search {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 190px;
    min-width: 160px;
  }

  .search input {
    width: 180px;
    min-width: 0;
  }

  .language-select {
    width: 130px;
    min-width: 130px;
    flex: 0 0 130px;
  }

  .container {
    width: calc(100% - 48px);
    max-width: 1200px;
    margin-inline: auto;
  }

  .page-layout {
    grid-template-columns:
      minmax(0, 1fr)
      320px;
  }

  .main-column {
    min-width: 0;
  }

  .sidebar {
    min-width: 0;
  }

  .card,
  .news-entry {
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* =========================================================
   FONT RENDERING
   ========================================================= */

body {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  -webkit-text-size-adjust: 100%;
}

