/* KAS — public styles.
   Typography, colours and the cloud are taken verbatim from the old Berta site
   (template messy-0.4.2) so the identity survives the move. */

:root {
    --melns:  #000000;
    --zils:   #0420d1;   /* link blue, from the old stylesheet */
    --debess: #3fbdeb;   /* accent cyan — the selected menu item */
    --izvelne-teksts: #0f131f;   /* menu, normal */
    --izvelne-virs:   #3c445e;   /* menu, hover */
    --pelēks: #767676;
    --līnija: #e2e2e2;
    --mala:   35px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 0 0 80px;
    background: #fff url("../att/makonis.png") no-repeat top left;
    font: 12px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--melns);
}

a { color: var(--zils); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* --- header ------------------------------------------------------------- */

#galvene {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 50px var(--mala) 0;
}

/* The wordmark sets the width; the tagline is taken out of flow so it can be
   stretched to exactly that width and nothing else. padding-bottom keeps the
   space it would have occupied, so the menu below it never overlaps. */
#zimols-bloks {
    position: relative;
    width: fit-content;
    padding-bottom: 24px;
}

#zimols {
    display: block;
    font-size: 50px;
    font-weight: bold;
    line-height: 1;
    color: var(--melns);
    white-space: nowrap;
}
#zimols:hover { text-decoration: none; }

#devize {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    margin: 0;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--melns);
    white-space: nowrap;
}

/* The three menu states, verbatim from the old stylesheet:
   normal #0f131f · hover #3c445e underlined · selected #3fbdeb, never underlined. */
#izvelne {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    font-size: 16px;
}
#izvelne a          { color: var(--izvelne-teksts); text-decoration: none; }
#izvelne a:hover    { color: var(--izvelne-virs); text-decoration: underline; }
#izvelne a.aktivs,
#izvelne a.aktivs:hover { color: var(--debess); text-decoration: none; }

#saturs {
    max-width: 1180px;
    padding: 40px var(--mala) 90px;
}

/* --- text --------------------------------------------------------------- */

.platums-lasams { max-width: 680px; }

.teksts p { margin: 0 0 1.1em; }
.teksts p:last-child { margin-bottom: 0; }

h1, h2, h3 { font-weight: bold; }

.sadalas-virsraksts {
    margin: 0 0 26px;
    font-size: 18px;
    font-weight: bold;
}
.sadalas-virsraksts.mazs {
    margin: 54px 0 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.celins { margin: 0 0 22px; font-size: 11px; color: var(--pelēks); }
.celins a { color: var(--pelēks); }

.tuksums { color: var(--pelēks); }
.sika    { font-size: 11px; color: var(--pelēks); }

/* --- lists of teachers -------------------------------------------------- */

/* A list, not a grid: portrait on the left, course name then staff. */
.kursu-saraksts {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 680px;
    border-top: 1px solid var(--līnija);
}
.kursu-saraksts li {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--līnija);
}
.kursu-saraksts li > a { flex: 1 1 auto; min-width: 0; }

.kursu-saraksts a {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    color: var(--melns);
}
.kursu-saraksts a:hover { text-decoration: none; }
.kursu-saraksts a:hover .kursa-nosaukums { text-decoration: underline; }

.kursa-bilde {
    flex: 0 0 76px;
    display: block;
    width: 76px;
    aspect-ratio: 4 / 5;
    background: #f4f4f4;
    overflow: hidden;
}
.kursa-bilde img { width: 100%; height: 100%; object-fit: cover; }

.kursa-teksts   { display: block; min-width: 0; }
.kursa-nosaukums { display: block; font-weight: bold; }
.kursa-personals { display: block; color: var(--pelēks); }

.bez-bildes {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
    font-size: 26px;
    color: #c9c9c9;
    background: #f4f4f4;
}

.neredzams { opacity: .45; }
.birka {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 5px;
    font-size: 10px;
    background: #f0f0f0;
    color: var(--pelēks);
}

/* --- one teacher page --------------------------------------------------- */

/* Portrait left, everything else — including the course description — right. */
.kursa-galva {
    display: flex;
    gap: 34px;
    align-items: flex-start;
    margin-bottom: 30px;
}

.kursa-foto {
    position: relative;
    flex: 0 0 230px;
    aspect-ratio: 4 / 5;
    background: #f4f4f4;
    overflow: hidden;
}
.kursa-foto img { width: 100%; height: 100%; object-fit: cover; }

.kursa-info {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 640px;   /* a readable measure; the 250-word cap keeps it short */
}

/* The name sits one step below the course name: half its size, bold.
   The role stays quiet underneath it. */
.kursa-virsraksts       { margin: 0 0 8px; font-size: 26px; font-weight: bold; }
.kursa-info .personals  { margin: 0; }
.kursa-info .personals .vards { font-size: 13px; font-weight: bold; }
.kursa-info .personals .amats { color: var(--pelēks); }
.kursa-info .personals .vards + .amats::before { content: " · "; color: var(--pelēks); }
.kursa-info .epasts     { margin: 8px 0 0; }

.kursa-apraksts { margin-top: 16px; }

.vardu-skaits { margin-left: 8px; font-weight: normal; letter-spacing: 0; }
.vardu-skaits.parvaris { color: #b3261e; font-weight: bold; }

.darba-apraksts {
    margin-top: 6px;
    color: #3c3c3c;
}
.darba-apraksts p { margin: 0 0 .5em; }
.darba-apraksts p:last-child { margin-bottom: 0; }

.gk-apraksts {
    display: block;
    max-width: 620px;
    margin: 5px auto 0;
    color: #3c3c3c;
}

/* Field labels exist only while editing — the public page stays bare. */
.lauka-nosaukums {
    margin: 26px 0 8px;
    font-size: 11px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--pelēks);
}

/* --- homepage and social links ------------------------------------------ */

.saites {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin: 16px 0 0;
    padding: 0;
}
.saites li { position: relative; display: flex; align-items: center; gap: 4px; }

.saites a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--melns);
}
.saites a:hover { color: var(--debess); text-decoration: none; }
.saites a:hover .saites-teksts { text-decoration: underline; }

.saites-ikona { display: block; flex: 0 0 auto; }
.saites-teksts { white-space: nowrap; }

.saites-pievienot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    max-width: 680px;
}
.saites-pievienot input {
    flex: 1 1 300px;
    padding: 10px;
    font: inherit;
    font-size: 15px;
    border: 1px solid #bbb;
}
.saites-pievienot input:focus { outline: 2px solid var(--zils); border-color: var(--zils); }
.saites-stavoklis { flex-basis: 100%; color: #b3261e; }

.dzest.maza-saite { font-size: 13px; opacity: .5; }
.dzest.maza-saite:hover { opacity: 1; }

/* --- works grid --------------------------------------------------------- */

.darbu-rezgis {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 26px 20px;
    align-items: start;
}

.darbs { position: relative; }

.darba-bilde {
    display: block;
    position: relative;
    width: 100%;
    padding: 0;
    border: 0;
    background: #f4f4f4;
    aspect-ratio: 1;
    cursor: zoom-in;
    overflow: hidden;
}
.darba-bilde img { width: 100%; height: 100%; object-fit: cover; }
.darba-bilde:hover img { opacity: .88; }

.atskanot {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--melns);
    font-size: 14px;
    pointer-events: none;
}
.atskanot.liels { width: 66px; height: 66px; font-size: 20px; }

.darba-teksts { margin-top: 8px; }
.darba-teksts > span { display: block; }
.darba-autors     { font-weight: bold; }
.darba-gads       { color: var(--pelēks); }

/* --- diplomas ----------------------------------------------------------- */

/* One page, three across at most. The years are headings inside the grid. */
.diplomu-rezgis {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 34px 24px;
}

.gada-virsraksts {
    grid-column: 1 / -1;
    margin: 26px 0 0;
}
.gada-virsraksts:first-child { margin-top: 0; }
.gada-virsraksts h2 {
    margin: 0;
    padding-bottom: 6px;
    font-size: 30px;
    font-weight: bold;
    border-bottom: 1px solid var(--līnija);
}

#vairak {
    min-height: 60px;
    padding-top: 30px;
    color: var(--pelēks);
}
.diplomu-rezgis a { color: var(--melns); display: block; }
.diplomu-rezgis a:hover { text-decoration: none; }
.diplomu-rezgis a:hover .diploma-nosaukums { text-decoration: underline; }

.diploma-bilde {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f4f4f4;
    overflow: hidden;
    margin-bottom: 9px;
}
.diploma-bilde img { width: 100%; height: 100%; object-fit: cover; }

.diploma-autors     { display: block; font-weight: bold; }
.diploma-nosaukums  { display: block; }
.diploma-limenis    { display: block; color: var(--pelēks); }

.diplomdarbs h1 { margin: 0 0 6px; font-size: 24px; font-weight: bold; }
.diplomdarbs h1 em { font-style: normal; font-weight: normal; display: block; }
.diplomdarba-dati { margin: 0 0 24px; color: var(--pelēks); }
.diplomdarba-dati span + span::before { content: " · "; }

.video-rāmis {
    position: relative;
    max-width: 960px;
    margin: 0 0 26px;
    background: #000;
    aspect-ratio: 16 / 9;
}
.video-rāmis video,
.video-rāmis iframe { width: 100%; height: 100%; display: block; border: 0; }
.video-poga {
    width: 100%; height: 100%;
    padding: 0; border: 0;
    background: #000;
    cursor: pointer;
    position: relative;
}
.video-poga img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }

.bildu-rezgis {
    list-style: none;
    margin: 34px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.bildu-rezgis li { position: relative; }
.bildu-rezgis button {
    display: block; width: 100%; padding: 0; border: 0;
    background: #f4f4f4; cursor: zoom-in;
}
.bildu-rezgis img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* --- "Kā pieteikties" — the button out to the LMA admissions site -------- */

.pieteikties { margin: 20px 0 0; }

.poga-pieteikties {
    padding: 11px 20px;
    font-size: 14px;
    border-color: var(--melns);
}
.poga-pieteikties:hover {
    background: var(--debess);
    border-color: var(--debess);
    color: var(--melns);
}

/* --- contacts ----------------------------------------------------------- */

.kontaktu-saraksts {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 680px;
    border-top: 1px solid var(--līnija);
}
.kontaktu-saraksts li {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--līnija);
}

.kontakta-bilde {
    position: relative;
    flex: 0 0 76px;
    display: block;
    width: 76px;
    aspect-ratio: 4 / 5;
    background: #f4f4f4;
    overflow: hidden;
}
.kontakta-bilde img { width: 100%; height: 100%; object-fit: cover; }

.kontakta-teksts { display: block; min-width: 0; }
.kontakta-vards { display: block; font-weight: bold; font-size: 13px; }
.kontakta-amats { display: block; color: var(--pelēks); }
.kontakta-epasts, .kontakta-talrunis { display: block; }

/* --- login -------------------------------------------------------------- */

.pieteiksanas { max-width: 340px; }
.pieteiksanas h1 { font-size: 22px; margin: 0 0 20px; }
.pieteiksanas label { display: block; margin-bottom: 18px; font-size: 14px; }
.pieteiksanas input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 10px;
    font: inherit;
    font-size: 16px;
    border: 1px solid #bbb;
    background: #fff;
}
.pieteiksanas input:focus { outline: 2px solid var(--zils); border-color: var(--zils); }
.pieteiksanas small { display: block; margin-top: 6px; color: var(--pelēks); }
.kluda {
    padding: 10px 12px;
    background: #fdecea;
    border-left: 3px solid #c0392b;
    font-size: 14px;
}

/* --- shared buttons ----------------------------------------------------- */

.poga {
    display: inline-block;
    padding: 7px 13px;
    font: inherit;
    font-size: 13px;
    color: var(--melns);
    background: #fff;
    border: 1px solid #bbb;
    cursor: pointer;
}
.poga:hover { border-color: var(--melns); text-decoration: none; }
.poga-galvena {
    background: #17803d;
    border-color: #17803d;
    color: #fff;
    font-weight: bold;
}
.poga-galvena:disabled { background: #d8d8d8; border-color: #d8d8d8; color: #8a8a8a; cursor: default; }
.poga.liela { padding: 13px 22px; font-size: 16px; width: 100%; }

/* --- tables, trash, stats ----------------------------------------------- */

.tabula { border-collapse: collapse; width: 100%; max-width: 760px; margin-bottom: 26px; }
.tabula th, .tabula td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--līnija); }
.tabula th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--pelēks); }

.miskastes-saraksts, .parvaldes-saraksts { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.miskastes-saraksts li, .parvaldes-saraksts li {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--līnija);
}
.mk-nosaukums { flex: 1; }
.mk-dati { color: var(--pelēks); font-size: 11px; }
.parvaldes-saraksts .sika { margin-left: auto; }

.stabini { display: flex; align-items: flex-end; gap: 3px; height: 90px; max-width: 760px; }
.stabs { flex: 1; background: var(--debess); min-height: 2px; }

.palidziba h3 { margin: 30px 0 8px; font-size: 14px; }
.palidziba ul { margin: 0 0 1em; padding-left: 20px; }

/* --- mobile -------------------------------------------------------------- */

@media (max-width: 700px) {
    :root { --mala: 20px; }

    body { background-size: 380px auto; }

    #galvene { padding-top: 30px; }
    #zimols { font-size: 38px; }
    #izvelne { gap: 16px; font-size: 19px; }

    #saturs { padding-top: 34px; }

    .kursa-galva { flex-direction: column; }
    .kursa-foto { flex-basis: auto; width: 100%; max-width: 280px; }

    .darbu-rezgis   { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .diplomu-rezgis { grid-template-columns: 1fr; gap: 26px; }
    .gada-virsraksts h2 { font-size: 24px; }

    .kursu-saraksts a { gap: 14px; }
    .kursa-bilde { flex-basis: 60px; width: 60px; }
}

@media (min-width: 701px) and (max-width: 950px) {
    .diplomu-rezgis { grid-template-columns: repeat(2, 1fr); }
}

/* --- lightbox ----------------------------------------------------------- */

#gaismaskaste {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(255, 255, 255, .97);
    display: flex;
    align-items: center;
    justify-content: center;
}
#gaismaskaste[hidden] { display: none; }

.gk-saturs {
    max-width: 92vw;
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gk-saturs img,
.gk-saturs video { max-width: 92vw; max-height: 82vh; width: auto; height: auto; }
.gk-saturs iframe { width: min(92vw, 1280px); aspect-ratio: 16 / 9; height: auto; border: 0; }

.gk-paraksts {
    position: absolute;
    left: 0; right: 0; bottom: 22px;
    text-align: center;
    font-size: 11px;
    color: var(--melns);
    pointer-events: none;
}

#gaismaskaste button {
    position: absolute;
    border: 0;
    background: none;
    font-size: 30px;
    line-height: 1;
    color: var(--melns);
    cursor: pointer;
    padding: 12px 16px;
}
.gk-aizvert { top: 10px; right: 14px; }
.gk-iepr    { left: 4px;  top: 50%; transform: translateY(-50%); font-size: 42px; }
.gk-nak     { right: 4px; top: 50%; transform: translateY(-50%); font-size: 42px; }
#gaismaskaste button:hover { color: var(--zils); }

@media (max-width: 700px) {
    .gk-iepr, .gk-nak { font-size: 32px; }
}
