/* Spatial Media styles */

/* General page */
body {
    font-size: 18px;
    line-height: 1.75;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Headings */
h1 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e9ecef;
}

h3 {
    margin-top: 2rem;
}

/* Paragraphs */
p {
    margin-bottom: 1.2rem;
}

/* Code blocks */
pre {
    border-radius: 12px;
}

/* Tables */
table {
    border-radius: 8px;
    overflow: hidden;
}

/* Automatic format links (PDF / EPUB) */
.other-formats {
    margin: 1.5rem 0;
}

.other-formats h2 {
    display: none;
}

.other-formats ul {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.other-formats li {
    margin: 0;
}

.other-formats a {
    display: inline-block;
    padding: 0.55rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    color: inherit;
    transition: all 0.2s ease;
}

.other-formats a:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

/* Navigation */
.navbar {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

/* Homepage */
.home-hero {
    background:
        radial-gradient(circle at 90% 10%, rgba(13, 110, 253, 0.16), transparent 34%),
        linear-gradient(135deg, #f6f9ff 0%, #eef4ff 52%, #f8fafc 100%);
    border: 1px solid #dce7f8;
    border-radius: 24px;
    margin: 2rem auto 4rem;
    max-width: 1180px;
    overflow: hidden;
    padding: clamp(3rem, 8vw, 7rem) clamp(1.5rem, 7vw, 6rem);
}

.home-hero[style] {
    background:
        linear-gradient(
            90deg,
            rgba(246, 249, 255, 0.99) 0%,
            rgba(246, 249, 255, 0.96) 38%,
            rgba(246, 249, 255, 0.7) 58%,
            rgba(246, 249, 255, 0.08) 88%
        ),
        var(--home-hero-image);
    background-position: center, 76% center;
    background-repeat: no-repeat;
    background-size: cover, cover;
}

.home-hero[style] h1 {
    max-width: 590px;
}

.home-hero[style] > p {
    max-width: 560px;
}

.home-hero h1 {
    font-size: clamp(2.7rem, 6vw, 5.2rem);
    letter-spacing: -0.045em;
    line-height: 0.98;
    margin: 0 0 1.5rem;
    max-width: 850px;
}

.home-hero > p {
    color: #495057;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.6;
    max-width: 760px;
}

.home-kicker {
    color: #0d6efd;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    margin-bottom: 1.25rem;
}

.home-button {
    border: 1px solid #0d6efd;
    border-radius: 999px;
    display: inline-block;
    font-size: 0.92rem;
    font-weight: 650;
    margin: 0.5rem 0.5rem 0 0;
    padding: 0.65rem 1.1rem;
    text-decoration: none;
}

.home-button-primary {
    background: #0d6efd;
    color: white;
}

.home-button-primary:hover {
    background: #0b5ed7;
    color: white;
}

.home-section {
    margin: 0 auto 4rem;
    max-width: 1180px;
    padding: 0 1rem;
}

.home-section > h2 {
    border: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
}

.home-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-card {
    border: 1px solid #e1e6ed;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 1.5rem 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease,
        transform 0.2s ease;
}

.home-card:hover {
    border-color: #cbd8e8;
    box-shadow: 0 14px 34px rgba(28, 55, 90, 0.1);
    transform: translateY(-3px);
}

.home-card .home-card-image {
    aspect-ratio: 16 / 8;
    border-radius: 0;
    box-shadow: none;
    display: block;
    margin: 0 -1.5rem 1.35rem;
    max-width: calc(100% + 3rem);
    object-fit: cover;
    width: calc(100% + 3rem);
}

.home-card h3 {
    font-size: 1.2rem;
    margin: 0 0 0.75rem;
}

.home-card p {
    color: #5b6470;
    font-size: 0.92rem;
    line-height: 1.6;
}

.home-card p:last-child {
    margin-top: auto;
    margin-bottom: 0;
}

.home-card a,
.home-text-link {
    font-weight: 650;
    text-decoration: none;
}

.home-knowledge {
    background: #f8f9fa;
    border-radius: 18px;
    padding: 2rem;
}

.home-knowledge p {
    max-width: 850px;
}

.home-text-link + .home-text-link {
    margin-left: 1.25rem;
}

@media (max-width: 850px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .home-hero {
        border-radius: 0;
        margin-top: 0;
    }
}

/* Category landing pages */
body:has(.spatialwiki-category-hero) #title-block-header {
    display: none;
}

.spatialwiki-category-hero {
    align-content: center;
    background:
        radial-gradient(circle at 88% 15%, rgba(13, 110, 253, 0.15), transparent 32%),
        linear-gradient(135deg, #f6f9ff 0%, #eef4ff 55%, #f8fafc 100%);
    background-position: center;
    background-size: cover;
    border: 1px solid #dce7f8;
    border-radius: 22px;
    box-sizing: border-box;
    justify-self: center;
    margin: 2rem auto 3rem;
    max-width: 1180px;
    min-height: clamp(10rem, 20vh, 14rem);
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 6vw, 5rem);
    width: calc(100% - 2rem);
}

.spatialwiki-category-hero[style] {
    background:
        linear-gradient(90deg, rgba(11, 24, 44, 0.9), rgba(11, 35, 66, 0.62)),
        var(--spatialwiki-category-image);
    box-shadow: 0 16px 44px rgba(18, 38, 63, 0.18);
}

.spatialwiki-category-hero[style] .spatialwiki-category-kicker {
    color: #9dccff;
}

.spatialwiki-category-hero[style] .spatialwiki-category-name,
.spatialwiki-category-hero[style] > :last-child {
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.spatialwiki-category-kicker {
    color: #0d6efd;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    margin-bottom: 0.5rem;
}

.spatialwiki-category-name {
    color: #2f343b;
    font-size: clamp(2.1rem, 5vw, 4rem);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 0.75rem;
}

.spatialwiki-category-hero > :last-child {
    color: #5b6470;
    font-size: 0.95rem;
    margin: 0;
}

.spatialwiki-category-content {
    margin-bottom: 4rem;
}

.spatialwiki-category-content h2 {
    margin-top: 0;
}

.spatialwiki-article-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.spatialwiki-article-card {
    border: 1px solid #e1e6ed;
    border-radius: 16px;
    overflow: hidden;
}

.spatialwiki-article-card p {
    margin: 0;
}

.spatialwiki-article-card p:last-child a {
    color: inherit;
    display: block;
    font-weight: 650;
    line-height: 1.4;
    padding: 1rem 1.1rem 1.15rem;
    text-decoration: none;
}

.spatialwiki-article-card img {
    aspect-ratio: 16 / 9;
    border-radius: 0;
    box-shadow: none;
    display: block;
    object-fit: cover;
    transition: transform 0.25s ease;
    width: 100%;
}

.spatialwiki-article-card:hover img {
    transform: scale(1.025);
}

.spatialwiki-article-hero {
    margin: 0 0 2.5rem;
    overflow: hidden;
}

.spatialwiki-article-hero p {
    margin: 0;
}

.spatialwiki-article-hero img {
    aspect-ratio: 16 / 7;
    border-radius: 18px;
    display: block;
    object-fit: cover;
    width: 100%;
}

/* Technical diagrams must remain fully visible when used as article heroes. */
.stereobase-calculation-page .spatialwiki-article-hero img {
    aspect-ratio: 1600 / 860;
    background: #f5f7fa;
    object-fit: contain;
}

@media (max-width: 850px) {
    .spatialwiki-category-hero {
        border-radius: 0;
        width: 100%;
    }
}

/* Wiki links */

a.wikilink {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.18em;
}

a.wikilink::before {
  content: "◈";
  display: inline-block;
  margin-right: 0.2em;
  font-size: 0.72em;
  opacity: 0.55;
}

a.wikilink-missing {
  color: #a33;
  text-decoration-style: dashed;
}

a.wikilink-missing::after {
  content: "?";
  margin-left: 0.12em;
  font-size: 0.72em;
  vertical-align: super;
}
