/* Shared styles for the iframe content pages (projects, lab, tutorials, info).
   Union of the per-page inline styles from the old static site, drawn with the
   two theme colours: --fons (background) and --tinte (boxes, text, borders). */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* These pages are the shell's 3rd column: they scroll inside the iframe, but
   the scrollbar is never drawn. komp/main.js also injects this into
   same-origin frames; doing it here too means there is no bar visible for the
   moment before that script runs. */
html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--fons, #fff);
    color: var(--tinte, #000);
    padding: 2rem;
    line-height: 1.6;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1 {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 0.85rem;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    opacity: 0.5;
}

p {
    margin-bottom: 1rem;
}

.divider {
    margin: 1rem 0;
    font-weight: bold;
}

a {
    color: var(--tinte, #000);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.more-btn,
.open-btn {
    background: var(--tinte, #000);
    color: var(--fons, #fff);
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}

.more-btn {
    margin-top: 1rem;
}

.open-btn {
    margin-bottom: 2rem;
}

.more-btn:hover,
.open-btn:hover {
    opacity: 0.8;
}

.more-content {
    display: none;
    margin-top: 1rem;
}

.more-content.active,
.more-content[data-atverts] {
    display: block;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.media-grid img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.media-grid img:hover {
    opacity: 0.8;
}

.framed-link {
    display: inline-block;
    border: 1px solid var(--tinte, #000);
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.framed-link:hover {
    background-color: var(--tinte, #000);
    color: var(--fons, #fff);
}

/* ABC videos: compact entries — title, a thumbnail that plays the video in
   the shell's 4th column, a few lines of LV/EN text, then the materials. */
.video-bloks {
    margin-bottom: 2.25rem;
    max-width: 40rem;   /* stays compact when the page is opened on its own */
}

.video-bloks > p {
    margin-bottom: 0.5rem;
}

.video-virsraksts {
    font-weight: bold;
    opacity: 1;
    margin-bottom: 0.5rem;
}

.video-sikttels {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background-color: var(--tinte, #000);
    border: 1px solid var(--tinte, #000);
}

/* YouTube's smaller thumbnails are 4:3 with bars; cover crops them away. */
.video-sikttels img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.video-sikttels:hover {
    text-decoration: none;
}

.video-sikttels:hover img {
    opacity: 0.85;
}

.video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3rem;
    height: 3rem;
    margin: -1.5rem 0 0 -1.5rem;
    background-color: var(--fons, #fff);
    transition: background-color 0.15s ease;
}

.video-play::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -0.6rem 0 0 -0.35rem;
    border-style: solid;
    border-width: 0.6rem 0 0.6rem 1rem;
    border-color: transparent transparent transparent var(--tinte, #000);
}

.video-sikttels:hover .video-play,
.video-sikttels:focus-visible .video-play {
    background-color: var(--tinte, #000);
    outline: 1px solid var(--fons, #fff);
}

.video-sikttels:hover .video-play::after,
.video-sikttels:focus-visible .video-play::after {
    border-left-color: var(--fons, #fff);
}

/* An embed with no thumbnail: its site's name on the dark placeholder. */
.video-avots {
    position: absolute;
    left: 0.75rem;
    bottom: 0.5rem;
    color: var(--fons, #fff);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.materiali {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.materiali p {
    margin: 0;
}

.materiali .framed-link {
    margin-top: 0;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.materiala-info {
    white-space: nowrap;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-left: 0.25rem;
}

/* The player page (lapas/video/<id>) in the 4th column. The video is as wide
   as fits both ways, so its controls and the title stay on screen in a short
   overlay or a landscape phone, clear of the corner buttons. */
body.atskanotajs {
    background-color: var(--tinte, #000);
    color: var(--fons, #fff);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.atskanotajs-video,
.atskanotajs-virsraksts {
    width: min(100%, calc((100vh - 11rem) * 16 / 9));
}

.atskanotajs-video {
    display: block;
    aspect-ratio: 16 / 9;
    border: 0;
}

.atskanotajs-virsraksts {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.atskanotajs-aizvert {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    font-family: inherit;
    font-size: 1.25rem;
    line-height: 1;
    background: var(--tinte, #000);
    color: var(--fons, #fff);
    border: 1px solid var(--fons, #fff);
    cursor: pointer;
}

.atskanotajs-aizvert:hover {
    background: var(--fons, #fff);
    color: var(--tinte, #000);
}

.atskanotajs-aizvert:focus-visible {
    outline: 1px solid var(--fons, #fff);
    outline-offset: 2px;
}

/* Focused by script so Escape works; no ring around the whole page. */
body.atskanotajs:focus {
    outline: none;
}

/* Below the admin bar, which sits over the top-right corner. */
body.atskanotajs.red-ielogots .atskanotajs-aizvert {
    top: 3rem;
}

body.atskanotajs .uz-sakumu {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: var(--fons, #fff);
    border-color: var(--fons, #fff);
}

body.atskanotajs .uz-sakumu:hover {
    background-color: var(--fons, #fff);
    color: var(--tinte, #000);
}

/* Info page */
.info-line {
    margin-bottom: 0.5rem;
}

.info-line.divider,
.section .divider {
    font-weight: bold;
}

.activity-item {
    margin-bottom: 1rem;
}

.activity-date {
    display: inline;
}

/* Shown only when a content page is opened on its own, outside the shell (lapa.js). */
.uz-sakumu {
    display: inline-block;
    margin-bottom: 1.5rem;
    border: 1px solid var(--tinte, #000);
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.uz-sakumu:hover {
    background-color: var(--tinte, #000);
    color: var(--fons, #fff);
    text-decoration: none;
}

/* What the shell's search bar found on this page (lapa.js), until the next click or key. */
::highlight(meklesana) {
    background-color: var(--tinte, #000);
    color: var(--fons, #fff);
}
