/* LSG site styles, shared by every portal (lsghobby, admin, vendor): the whole look.
   Colours come from the portal's colour set (--lsg-color-* in theme.<portal>.css).
   Its module files (lsg.layout.css, lsg.utility.css, lsg.forms.css, lsg.table.css) are linked before it in Views/_Layout.cshtml,
   each with its own version stamp, so a change to one reaches browsers straight away. */

/* Shared, portal-independent tokens; Bootstrap's body font through its own variables (its body, form and component text follow) */
:root {
    --bs-body-font-family: Tahoma, sans-serif;
    --bs-body-font-size: 14px;
    --bs-body-line-height: 1.42857143;
    --lsg-shadow-card: 0 4px 8px rgb(0 0 0 / 0.1);
    --lsg-shadow-thumb: 0 1px 4px rgb(0 0 0 / 0.15);
}

/* ===== Base ===== */

html,
body {
    overscroll-behavior: none;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.1;
}

h1, h2 {
    margin-top: 20px;
    margin-bottom: 10px;
}

h4, h5, h6 {
    margin-top: 10px;
    margin-bottom: 10px;
}

h1 {
    font-size: 25px;
    line-height: 40px;
}

h2 {
    font-size: 28px;
    line-height: 32px;
}

h3 {
    font-size: 24px;
    line-height: 28px;
    margin-top: 10px;
    margin-bottom: 3px;
}

h4 {
    font-size: 20px;
    line-height: 26px;
}

p {
    margin: 0 0 10px;
    line-height: 1.5em;
    color: var(--lsg-color-text-body);
}

img {
    max-width: 100%;
    max-height: 100%;
}

/* Bootstrap draws the line in the text colour at 25%: ours is the border colour, solid */
hr {
    margin: 15px 0;
    color: var(--lsg-color-border);
    opacity: 1;
}

/* Label/value blocks (an order's summary, the admin customer picker, any details): <dl class="row row-cols-…"> whose items
   are each a <div> holding a <dt> label over its <dd> value. Labels bold and top-aligned on one line, values right under;
   the page only picks the column count (Bootstrap's row-cols-*) */
:where(dl).row {
    --bs-gutter-y: 1rem;
}

:where(dl.row > *) > dt {
    margin-bottom: 0.25rem;
}

:where(dl.row > *) > dd {
    margin-bottom: 0;
}

/* Alpine: hide x-cloak elements until Alpine has started */
[x-cloak] {
    display: none !important;
}

@media (max-width: 480px) {
    h2 {
        font-size: 22px;
        line-height: 1.5em;
    }
}

/* Page width: full width on phones, then 750 / 970 / 1170px. */
/* The one page gutter: every page and the footer get their side spacing from here */
.site-container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-inline: 15px;
}

@media (min-width: 768px) {
    .site-container {
        max-width: 750px;
    }
}

@media (min-width: 992px) {
    .site-container {
        max-width: 970px;
    }
}

@media (min-width: 1200px) {
    .site-container {
        max-width: 1170px;
    }
}

/* The admin portal uses the full browser width (wide lists); the page gutter stays */
.lsg-portal-admin .site-container {
    max-width: none;
}

/* ===== Shared components ===== */

.page-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
}

.page-section {
    margin-bottom: 50px;
}

/* Cards: Bootstrap's .card without a border, lifted by a shadow (the page and card background is the portal's surface).
   Use as class="card lsg-card-panel" (a panel of content) or class="card post-card" (a blog teaser) */
.lsg-card-panel,
.post-card {
    --bs-card-border-width: 0;
    box-shadow: var(--lsg-shadow-card);
}

.lsg-card-panel {
    --bs-card-border-radius: 8px;
    margin: 20px 0;
    padding: 20px;
    font-size: 15px;
}

/* Back link as a small primary button (Bootstrap's .btn-primary in the portal colours, lsg.utility.css).
   Use as class="btn btn-primary lsg-btn-back" */
.lsg-btn-back {
    --bs-btn-padding-x: 20px;
    --bs-btn-padding-y: 5px;
    --bs-btn-font-size: 12px;
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: 5px;
}

.lsg-btn-back i {
    margin-right: 8px;
}

/* Search box: Bootstrap's input group (the input, then the search button), 40px high.
   Borders, text, placeholder and focus come from Bootstrap's variables and lsg.forms.css */
.lsg-site-search {
    height: 40px;
}

.lsg-site-search .form-control {
    font-size: 16px;
}

.lsg-site-search-button {
    --bs-btn-color: var(--lsg-color-text);
    --bs-btn-bg: var(--lsg-color-surface-muted);
    --bs-btn-border-color: var(--lsg-color-border);
    --bs-btn-hover-color: var(--lsg-color-text);
    --bs-btn-hover-bg: var(--lsg-color-border);
    --bs-btn-hover-border-color: var(--lsg-color-border);
    --bs-btn-active-color: var(--lsg-color-text);
    --bs-btn-active-bg: var(--lsg-color-border);
    --bs-btn-active-border-color: var(--lsg-color-border);
    width: 40px;
    font-size: 15px;
}

/* ===== Pages ===== */

.page {
    padding-block: 30px 40px;
}

.landing-page {
    padding-block: 40px;
}

.landing-hero {
    padding: 40px 0;
}

.landing-logo {
    max-width: 260px;
    padding: 16px;
    border-radius: 15px;
    background-color: var(--lsg-color-dark);
}

.landing-title {
    margin-top: 30px;
}

.not-found-page {
    text-align: center;
}

/* Blog list */
.post-grid {
    padding: 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* A blog teaser: a card (see Cards above) that lifts on hover */
.post-card {
    --bs-card-border-radius: 10px;
    padding: 10px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-card-image {
    display: block;
    width: 100%;
    margin: 0 auto 30px;
    border-radius: 10px;
    object-fit: cover;
}

.post-card-body {
    padding: 0 10px 10px;
}

.post-card-title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.4;
}

.post-card-meta {
    margin-bottom: 15px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    display: ruby;
    color: var(--lsg-color-text-muted);
}

.post-card-author {
    font-weight: 600;
}

.post-card-teaser {
    margin: 10px 0 15px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--lsg-color-text-muted);
}

/* Blog post */
.post-header {
    margin-bottom: 20px;
    text-align: center;
}

.post-back {
    margin-bottom: 20px;
    text-align: left;
}

.post p {
    padding: 5px 80px;
}

.post a {
    font-weight: 600;
}

/* A post's links in the accent (Bootstrap's link colours, set for the post body) */
.post-body {
    --bs-link-color-rgb: var(--lsg-color-primary-rgb);
    --bs-link-hover-color-rgb: var(--lsg-color-primary-dark-rgb);
    margin-bottom: 100px;
    padding: 10px 10px 50px;
    border-radius: 10px;
    box-shadow: var(--lsg-shadow-card);
}

.post-image {
    padding-bottom: 30px;
}

.post img {
    margin-top: 15px;
    object-fit: contain;
}

@media (max-width: 1024px) {
    .post p {
        padding: 5px 0;
    }
}
