/* =========================
   BASE
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--text-color);
    height: 100%;
}

img {
    max-width: 100%;
    display: block;
}

.badge img {
    height: 2.3rem;
    width: 2.3rem;
    object-fit: contain;
}

.btn {
    display: inline-block;
    font-weight: 700;
    color: var(--blue);
    text-align: center;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 2px solid var(--blue);
    padding: 1rem .75rem;
    font-size: 1rem;
    line-height: 1.5rem;
    border-radius: 100px;
    transition: color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out;
    text-decoration: none !important;
    min-width: 18.75rem;
    letter-spacing: 2px;
}

.btn-primary {
    display: inline-block;
    padding: 1.125rem 2rem;
    background: linear-gradient(to bottom,rgba(0,83,156,1) 0%,rgba(6,46,106,1) 100%);
    border: none;
    color: #fff;
}

.btn-outline-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: transparent;
    border-color: var(--blue);
    color: var(--blue);
}

.btn-primary:hover, .btn-outline-primary:hover {
    box-shadow: 0 0 0 .3rem rgba(0,83,156,.5);
}

/* =========================
   HEADER
   =========================
*/

.site-header {
    color: #fff;
}

.header-inner {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    align-items: center;
    justify-content: space-between;
    column-gap: clamp(.75rem, 2vw, 2rem);
    padding: 1.5rem 1rem 1rem 1rem;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left img {
    height: 5rem;
    margin-bottom: 0.5rem;
}

.header-center {
    display: block;
    min-width: 0;
    justify-self: center; /* püsib keskel, aga ei sunni suuri tühikuid */
}

.header-search {
    display: flex;
    align-items: center;
    width: clamp(240px, 32vw, 400px);
    max-width: 100%;
    background: #fff;
    border: 1px solid var(--header-search-color);
    border-radius: 999px;
    padding: 0.15rem 0.4rem;

    transition: border-color .2s ease,
    box-shadow .2s ease,
    background-color .2s ease;
}

.search-btn img {
    width: 25px;
    height: 25px;
    display: block;
}

.header-search input {
    border: none;
    outline: none;
    flex: 1;
    padding: 0.45rem 0.65rem;
    font-size: 0.95rem;
    line-height: 1.2;
    background: transparent;
}

.header-search input::placeholder {
    color: var(--header-search-color);
}

.search-btn {
    border: none;
    background: transparent;
    padding: 0.4rem;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    transition: background-color .2s ease;
}

.header-search:hover {
    border-color: var(--header-search-color-hover);
}

.header-search:focus-within {
    border-color: var(--header-search-color-hover);
    box-shadow: 0 0 0 2px rgba(0, 84, 166, 0.15);
}

.search-btn:hover {
    background: rgba(0, 84, 166, 0.08);
}

.search-btn:focus-visible {
    outline: 2px solid var(--header-search-color-hover);
    outline-offset: 2px;
}

.header-search:hover .search-btn img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(86%) saturate(2391%) hue-rotate(199deg);
}

.header-right {
    display: flex;
    justify-content: flex-end; /* oluline: ära “space-evenly” */
    gap: 2rem;                 /* kontrollitud vahed */
    align-items: center;
}

.header-navbar {
    /*max-width: 1200px;*/
}

/* =========================
   MAIN
========================= */

.site-main {
    min-height: calc(100vh - 19.73rem);
}
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    max-width: 82.5rem;
}

/* =========================
   BLOCK – ÜHINE
========================= */

.block {
    margin-bottom: 2rem;
}

a {
    text-decoration: none;
    outline: none;
}

/* =========================
   LAYOUT: NEWS + SIDEBAR
========================= */

.frontpage-layout > .block {
    margin-bottom: 0;
}

/* =========================
   LAYOUT: FEATURED
========================= */

.block--featured {
    margin-bottom: 3rem;
}

.featured-link {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
    text-decoration: none;
    color: inherit;
}

.featured-content {
    padding-left: 0.5rem;
    color: var(--text-color);
}

.featured-title {
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.featured-date {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    color: var(--gray);
}

.featured-change {
    display: inline-block;
    font-size: 0.95rem;
    color: var(--red-text-color);
}


.featured-excerpt {
    /*font-size: 0.9rem;*/
    line-height: 1.4;
}

.featured-media img {
    width: 100%;
    height: auto;
    display: block;
}

.block--featured:hover {
    background: var(--backgrount-hover);
}

.block--featured:hover .featured-title {
    color: var(--blue-hover);
}

.featured-title {
    display: -webkit-box;
   /* -webkit-line-clamp: 2;*/
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================
   LAYOUT: OLDER NEWS
========================= */
.frontpage-news {
    margin-bottom: 2rem;
}

.block--old-news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.news-card {
    display: block;
    overflow: hidden;
}

.news-card img {
    width: 100%;
    height: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.news-card h3 {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.25;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-change {
    margin-left: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--red-text-color);
}

.block--old-news-grid a {
    text-decoration: none;
    color: inherit;
}

.news-card:hover h3 {
    color: var(--blue-hover);
}

/* =========================
   LAYOUT: OLDER NEWS BUTTON
========================= */

.news-archive-link {
    display: flex;
    justify-content: center;
}

/* =========================
   SIDEBAR
========================= */

.block--sidebar h2 {
    display: block;
    justify-content: center;
    color: var(--blue);
    font-size: 1.7em;
    font-weight: 400;
    margin-top: 0;
}

/* INFO */
.no-events {
    flex: 1;
    text-align: center;
    padding: 0.7rem 0;
    color: var(--text-color);
    border-top: 1px solid var(--event-list-border-bottom);
    border-bottom: 1px solid var(--event-list-border-bottom);
}

/* EVENTS WRAPPER START */

/* WRAPPER */
.event-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

/* DATE BLOCK */
.event-date {
    width: 70px;
    background: var(--blue-soft);
    border-radius: 12px;
    text-align: center;
    padding: 8px 6px;
    border-inline: 1px solid var(--blue-soft);
}

/* MONTH */
.date-month {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray);
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* WHITE CENTER BLOCK */
.date-day-wrapper {
    background: #fff;
    padding: 8px 0;
    margin: 0 -6px; /* täidab kogu laiuse */
}

/* DAY */
.date-day {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue);
    display: block;
}

/* YEAR */
.date-year {
    font-size: 16px;
    font-weight: 500;
    color: var(--gray);
    padding-top: 8px;
}

/* INFO */
.event-info {
    flex: 1;
}

.event-title {
    /*font-size: 1rem;*/
    font-weight: 600;
    color: var(--gray);
    margin: 0 0 0.25rem;
}

.event-time {
    font-weight: 500;
    color: var(--blue);
    margin-bottom: 0.25rem;
}

.event-location {
    /*font-size: .9rem;*/
    color: var(--gray);
}

.event-change {
    font-size: .95rem;
    color: var(--red-text-color);
}


.event-item:hover .event-date {
    background: var(--blue-hover);
}

.event-item:hover .date-month, .event-item:hover .date-year {
    color: #fff;
}

.event-item:hover .event-title,
.event-item:hover .event-time,
.event-item:hover .event-location {
    color: var(--blue-hover);
}

/* Active/upcoming date badge */
.event-item.is-upcoming .event-date {
    background: var(--blue-hover);
}

.event-item.is-upcoming .date-month,
.event-item.is-upcoming .date-year {
    color: #fff;
}

/* EVENTS WRAPPER END */

.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-list li a {
    display: flex;
    padding: 0.7rem 0;
    color: var(--text-color);
    border-bottom: 1px solid var(--event-list-border-bottom);
}

.event-list li .col-date {
    color: var(--blue);
    padding-right: 1.5rem;
}

.event-list li:hover .col-content {
    color: var(--blue-hover);
}

.sidebar-section {
    margin-bottom: 2.5rem;
}

.sidebar-section--center {
    display: flex;
    justify-content: center;
}

.sidebar-section-top {
    margin-top: 2rem;
}

/* =========================
   SPONSORS
========================= */

.block--sponsors {
    padding: 0;
}

.block--sponsors h2 {
    display: block;
    color: var(--blue);
    font-size: 1.7em;
    font-weight: 400;
    margin-bottom:.5rem;
}

.sponsor-logos {
    display: block;
    padding: 0 0 20px;
    display: flex;
    justify-content: center;
}

.bx-wrapper {
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    height: auto;
}

/* =========================
   FOOTER
========================= */

.site-footer {
    background: #000;
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem 0;
    font-size: 0.9rem;
}

.block--footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    align-items: start;
}

/* Veerud */
.footer-col {
    line-height: 1.5;
}

/* Footer linkide baasseis */
.site-footer a {
    color: #6fb6ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Hover / focus */
.site-footer a:hover,
.site-footer a:focus {
    color: #3f8edc;           /* veidi tumedam sinine */
    text-decoration: underline;
}

.site-footer a:focus-visible {
    outline: 2px dashed #6fb6ff;
    outline-offset: 3px;
}

/* =========================
   SCROLL-TO-TOP
========================= */

.scroll-top {
    display: inline-flex;
    align-items: center;
    gap: .6rem;

    position: fixed;
    right: 1rem;
    bottom: 2rem;
    padding: .6rem 1rem;
    border-radius: 999px;
    border: 2px solid var(--blue);
    background: #fff;
    color: var(--blue);
    font-size: 1.5rem;
    line-height: 1.5rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: background .2s ease, color .2s ease;
}

.scroll-top__icon {
    display: block;
}

.arrow-shape {
    fill: currentColor;
    transition: fill .2s ease;
}

.arrow-shadow {
    opacity: 0.15;
}

.scroll-top:hover {
    background: var(--blue);
    color: #fff;
}

.scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

