/* =========================
   Layout / Sticky footer
   ========================= */
html,
/* =========================
   Design tokens
   ========================= */
:root {
    --accent: #ff5722;
    --line: #e9edf3;
    --good: #2e7d32;
    --warn: #ff8f00;
    --ink: #1f2937;
    --muted: #667085;
    --head-bg: #fff3e9;
    --head-bdr: #ffd8c7;
    --row-bdr: #eaeaea;
    --row-hover: #fff9f5;
    --row-alt: #fafafa;
    --curr-bdr: #ffb893;
    --curr-bar: #ff8a50;
}

/* When the main grid is reversed, make it stack on small screens */
@media (max-width:600px) {
    .w3-row-reverse {
        display: flex;
        flex-direction: column-reverse;
    }
}

/* =========================
   TOPBAR
   ========================= */
.topbar.three-cols {
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    background: #fff;
}

.tb-left,
.tb-center,
.tb-right {
    min-width: 0;
}

.school-logo {
    max-height: 110px;
    height: auto;
    width: auto;
}

.search-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.search-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
}

.search-btn {
    padding: 8px 14px;
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
}

.search-btn:hover {
    filter: brightness(.95);
}

.tb-right {
    text-align: left;
    font-size: 12px;
    line-height: 1.35;
    color: #666;
}

.tb-right a {
    color: #0645AD;
}

@media (max-width:900px) {
    .topbar.three-cols {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tb-left {
        justify-self: center;
    }

    .tb-center {
        justify-self: stretch;
    }

    .tb-right {
        justify-self: stretch;
        text-align: left;
    }

    .school-logo {
        max-height: 96px;
    }
}

/* =========================
   Navigation (single source of truth)
   ========================= */

/* Desktop bar typography */
.w3-bar.w3-deep-orange.w3-card.w3-medium {
    font-size: 15px;
}

/* Default: desktop visible, mobile hidden */
.nav-desktop {
    display: block;
}

.mnav-wrap {
    display: none;
    padding: 6px;
}

/* Switch on small screens */
@media (max-width:900px) {
    .nav-desktop {
        display: none !important;
    }

    .mnav-wrap {
        display: block !important;
    }
}

/* Mobile nav look */
.mnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mnav-list>li {
    margin-bottom: 6px;
}

.mnav-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: #ff5722;
    color: #fff;
    border: 1px solid #cc4520;
    font-weight: 500;
    text-decoration: none;
}

.mnav-item:hover {
    background: #e64a19;
    color: #fff;
}

.has-children .mnav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.caret {
    transition: transform .2s ease;
}

.mnav-sub {
    background: #ff7043;
    border-left: 4px solid #cc4520;
    margin-top: 4px;
}

.mnav-sub-item {
    display: block;
    padding: 10px 16px;
    color: #fff;
    border-bottom: 1px solid #d95c34;
    text-decoration: none;
}

.mnav-sub-item:hover {
    background: #f4511e;
}

/* =========================
   HOMEPAGE SLIDESHOW
   ========================= */
.home-ss-wrap {
    position: relative;
    width: 100%;
    background: #000;
    border: 1px solid #009688;
    border-radius: 4px;
    overflow: hidden;
}

.home-ss-slide {
    display: none;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #000;
}

.home-ss-slide.active {
    display: block;
}

.home-ss-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 14px;
    padding: 6px 10px;
}

/* Remove black bg / aspect lock on mobile */
.home-ss-wrap,
.home-ss-slide {
    background: transparent !important;
}

.home-ss-wrap img.home-ss-slide {
    display: block;
}

@media (max-width:900px) {
    .home-ss-wrap {
        aspect-ratio: auto !important;
    }
}

/* =========================
   Content spacing helpers
   ========================= */
.responsive-margin-right {
    margin-left: 0;
    margin-right: 0;
    padding-left: 16px;
    padding-right: 16px;
}

@media (max-width:900px) {
    .responsive-margin-right {
        padding-left: 12px;
        padding-right: 12px;
    }

    .w3-quarter {
        padding-left: 12px;
        padding-right: 12px;
        box-sizing: border-box;
    }
}

/* =========================
   Panels / Lists
   ========================= */
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
}

.panel h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.list-item {
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
}

.list-item:last-child {
    border-bottom: none;
}

.plan-list {
    background: #fafafa;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
}

.plan-item {
    padding: 8px;
    border-bottom: 1px solid var(--line);
}

.plan-item:last-child {
    border-bottom: none;
}

.plan-time {
    color: #5b6470;
    font-size: 13px;
}

/* =========================
   Timetable styles
   ========================= */
.tt .head,
.tt .r {
    display: grid;
    grid-template-columns: 1.1fr .9fr .9fr .9fr 1.4fr;
    gap: 8px;
}

.tt .head {
    font-weight: 800;
    font-size: 13px;
    background: var(--head-bg);
    border: 1px solid var(--head-bdr);
    color: #5a3b2d;
    border-radius: 0;
    padding: 8px 10px;
}

#ttBody {
    display: grid;
    gap: 6px;
    padding-top: 6px;
}

.tt .r {
    align-items: center;
    border: 1px solid var(--row-bdr);
    padding: 8px 10px;
    font-size: 13px;
    background: #fff;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#ttBody .r:nth-child(even) {
    background: var(--row-alt);
}

#ttBody .r:hover {
    background: var(--row-hover);
    border-color: #f2d1bf;
    box-shadow: 0 1px 6px rgba(16, 24, 40, .06);
}

.row-current-lesson {
    border-color: var(--curr-bdr) !important;
    background: linear-gradient(90deg, rgba(255, 138, 80, .09), rgba(255, 138, 80, .02)) !important;
    box-shadow: inset 3px 0 0 var(--curr-bar);
}

.row-past {
    opacity: .72;
}

.tt .head.w3-deep-orange {
    color: #fff !important;
    border: 1px solid #ffb08f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}

.tt .r {
    border-radius: 0;
}

.tt .head>div,
.tt .r>div {
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
}

@media (max-width:520px) {

    .tt .head,
    .tt .r {
        grid-template-columns: 1.05fr .8fr .8fr 1.05fr 1.65fr;
    }
}

/* Badges */
.badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    display: inline-block;
}

.badge-green {
    background: #e6f4ea;
    color: var(--good);
    border: 1px solid #cfead4;
}

.badge-amber {
    background: #fff5e5;
    color: var(--warn);
    border: 1px solid #ffd8a8;
}

/* =========================
   “Skolēniem” list buttons
   ========================= */
.students-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.students-list a {
    display: block;
    padding: 10px 14px;
    margin: 2px 0;
    border: 1px solid var(--accent);
    color: var(--accent) !important;
    font-weight: 600;
    border-radius: 0;
    text-decoration: none;
    background: #fff;
    transition: background-color .2s ease, color .2s ease;
}

.students-list a:hover,
.students-list a:focus {
    background: #f1f1f1;
    color: #000 !important;
}

/* =========================
   Custom table for logos
   ========================= */
.custom-table {
    width: 100%;
}

.custom-table td {
    padding: 8px;
}

.custom-table img {
    object-fit: fill;
    width: 100%;
    height: 100%;
}

/* =========================
   Notifications
   ========================= */
.notif-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-title {
    flex: 1 1 auto;
    min-width: 0;
}

.notif-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-ghost {
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #333;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-ghost:hover {
    background: #f1f1f1;
}

.btn-link {
    border: 1px solid var(--accent);
    background: #fff;
    color: var(--accent);
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 3px;
    text-decoration: none;
}

.btn-link:hover {
    background: #f1f1f1;
    color: #000;
}

.notif-body {
    display: none;
    position: relative;
    padding: 10px 12px;
    background: #fff;
}

.notif-body.open {
    display: block;
}

.header-overlay {
    position: relative;
}

.header-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .08), rgba(0, 0, 0, .08));
    pointer-events: none;
}

/* Make header text white on colored headers */
.w3-container[class*="w3-"] .notif-title h3,
.w3-container[class*="w3-"] .notif-title div,
.custom-colored-header .notif-title h3,
.custom-colored-header .notif-title div {
    color: #fff !important;
}

.custom-colored-header {
    color: #fff;
}

.notif-panel {
    padding-bottom: 14px;
}

.notif-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.notif-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.notif-btn:hover,
.notif-btn:focus {
    color: #000 !important;
}

.pub-label {
    font-size: 11px;
    color: #555;
    margin-left: auto;
}

@media (max-width:640px) {
    .notif-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .notif-bar .notif-btn,
    .notif-bar a.notif-btn {
        width: auto;
        text-align: left;
    }

    .pub-label {
        margin-left: 0;
        align-self: flex-start;
    }
}

.w3-pale-red .pub-label,
.w3-pale-yellow .pub-label,
.w3-pale-green .pub-label,
.w3-white .pub-label,
.custom-colored-header[style*="background: #fff"] .pub-label,
.custom-colored-header[style*="background: white"] .pub-label {
    color: #555;
}

/* Footer line at the very bottom of the panel */
.notif-pub {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--line, #e9edf3);
    font-size: 11px;
    color: #555;
}

.notif-footer {

    padding-bottom: 0px;

    font-size: 11px;
    color: #555;
    text-align: right;
    /* or left if you prefer */
}



/* simple card grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

.news-card {
    border: 1px solid teal;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.news-thumb {
    aspect-ratio: 16/9;
    width: 100%;
    object-fit: cover;
    background: #f6f6f6;
    display: block;
}

/* no-image icon style */
.news-thumb--noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    color: #9aa3af;
    font-size: 48px;
}

.news-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.news-title {
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
}

.news-meta {
    font-size: 12px;
    color: #5f6b7a;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-card a:hover .news-title {
    text-decoration: underline;
}

.news-pager {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

.news-pager a,
.news-pager span {
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background: #fff;
}

.news-pager .active {
    border-color: #ff5722;
    color: #ff5722;
    font-weight: 700;
}

.news-pager a:hover {
    background: #f1f1f1;
}