/*
 * Legowebben additions on top of lamnea.css (the shared Lämneå theme copied from customer-web).
 * Only what this site needs beyond the theme: the site name in the header, the language switch,
 * the drawing list tabs and cards, the operation grid and the freight goods table.
 */

/* ------------------------------------------------------------ Header additions */

.navbar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.navbar-brand .brand-site {
    color: #fff;
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: .02em;
    border-left: 1px solid rgba(255, 255, 255, .35);
    padding-left: .75rem;
}

/* On a phone the site name would push the menu button down under the logo: the logo alone is the brand,
   and the pages get a wider side margin than Bootstrap's 12px. */
@media (max-width: 767.98px) {
    .container {
        --bs-gutter-x: 2.5rem;
    }

    .site-header .navbar-brand {
        margin-right: 0;
    }

    .navbar-brand .brand-site {
        display: none;
    }

    .item-card {
        padding: 1rem;
    }
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: rgba(255, 255, 255, .7);
    font-size: .85rem;
    font-weight: 600;
}

.language-switch button {
    background: none;
    border: 0;
    padding: .1rem .2rem;
    color: rgba(255, 255, 255, .7);
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
}

.language-switch button:hover,
.language-switch button.active {
    color: var(--lamnea-yellow);
}

.auth-page .language-switch,
.auth-page .language-switch button {
    color: rgba(255, 255, 255, .85);
}

@media (max-width: 991.98px) {
    .site-nav .language-switch {
        padding: .5rem 0;
    }
}

/* ----------------------------------------------------------------- Buttons */

/* An icon in a button keeps the space that separates it from the text, plus as much again. */
.btn .bi:first-child:not(:last-child) {
    margin-right: .25em;
}

.btn .bi:last-child:not(:first-child) {
    margin-left: .25em;
}

/* ------------------------------------------------------------- Drawing lists */

.list-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.list-tab {
    display: inline-block;
    padding: .4rem 1rem;
    border-radius: 100px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--slate);
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
}

.list-tab:hover {
    border-color: var(--lamnea-blue);
    color: var(--lamnea-blue);
    text-decoration: none;
}

.list-tab.active {
    background: var(--lamnea-blue);
    border-color: var(--lamnea-blue);
    color: #fff;
}

/* A drawing card: the picture, then the details below it; on a desktop the details to the right. */
.drawing-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drawing-card .item-image-link {
    display: block;
    flex: 0 0 auto;
}

.drawing-card .item-image {
    width: 100%;
}

.drawing-card .item-body {
    flex: 1 1 auto;
    min-width: 0;
}

/* The checkbox sits in front of the title; the details stack below, left-aligned with it. */
.drawing-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .6rem;
}

.drawing-title .form-check-input {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
}

.drawing-card .item-meta {
    margin: .5rem 0 0;
}

/* The answer button: last in the card on a phone, at the right edge of the card on a desktop. */
.drawing-actions {
    flex: 0 0 auto;
}

.drawing-actions .btn {
    white-space: nowrap;
}

@media (min-width: 768px) {
    .drawing-card {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .drawing-card .item-image-link {
        flex-basis: 260px;
        width: 260px;
    }

    .drawing-actions {
        margin-left: auto;
    }
}

.item-meta-wide {
    flex-basis: 100%;
}

.drawing-preview {
    display: block;
}

.drawing-preview .item-image {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 1.414;
    object-fit: contain;
    background: var(--soft-bg);
}

.material-optional {
    background-color: var(--soft-bg);
}

.cutting-image {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: none;
}

/* --------------------------------------------------------------- Start page */

/* The three page links share one panel: a row each with the theme's icon and arrow. */
.nav-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    overflow: hidden;
}

.nav-panel-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: background-color .2s;
}

.nav-panel-item + .nav-panel-item {
    border-top: 1px solid var(--card-border);
}

.nav-panel-item:hover,
.nav-panel-item:focus {
    background: var(--soft-bg);
    color: inherit;
    text-decoration: none;
}

.nav-panel-item .nav-card-icon {
    flex: 0 0 auto;
    margin: 0;
}

.nav-panel-text {
    flex: 1 1 auto;
    min-width: 0;
}

.nav-panel-text h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--lamnea-blue);
    margin: 0 0 .15rem;
}

.nav-panel-text p {
    color: var(--slate);
    font-size: .95rem;
    margin: 0;
}

.nav-panel-item .nav-card-arrow {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.nav-panel-item:hover .nav-card-arrow .bi {
    transform: translateX(4px);
}

.list-help dt {
    font-weight: 600;
    margin-top: .75rem;
}

.list-help dd {
    color: var(--slate);
    margin-bottom: 0;
}

/* ----------------------------------------------------------- My operations */

.operation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .35rem 1.5rem;
}

.operation-item .operation-number {
    display: inline-block;
    min-width: 3ch;
    color: var(--slate);
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ Freight */

.goods-table th {
    white-space: nowrap;
}

.goods-table td {
    min-width: 6rem;
}

.goods-table td:last-child {
    min-width: 0;
    width: 2.5rem;
}

.goods-row-errors td {
    padding-top: 0;
    border-top: 0;
}

.delivery-choice .form-check {
    margin-bottom: .1rem;
}

/* --------------------------------------------------------- Contact & forms */

.coordinates dt {
    font-weight: 600;
    margin-top: .5rem;
}

.coordinates dd {
    color: var(--slate);
    margin-bottom: 0;
}

.form-label.required::after {
    content: " *";
    color: #c0392b;
}

/* ---------------------------------------------------------- Instructions */

.instruction-page h2 {
    margin-top: 1.5rem;
}

.instruction-page h2:first-child {
    margin-top: 0;
}

.instruction-table {
    width: auto;
    max-width: 100%;
}

.instruction-table th,
.instruction-table td {
    white-space: nowrap;
}

.instruction-page img {
    margin: 1rem 0;
    border: 1px solid var(--card-border);
    border-radius: .5rem;
}
