/* Mountain Creek Studios - site styles.
   Fluid, mobile-first. Brand colours/typeface unchanged (grey palette, self-hosted Saira). */

/* Saira (SIL OFL 1.1), latin subset, from @fontsource 5.3.0 - see fonts/saira/OFL.txt */
@font-face {
    font-family: "Saira";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/saira/saira-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Saira";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/saira/saira-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Saira Semi Condensed";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/saira/saira-semi-condensed-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bgPrimary: rgb(50,50,50);
    --bgSecondary: rgb(38,38,38);
    --heroDark: #323232;
    --heroLight: #7d7d7d;
    --bgFooter: rgb(25,25,25);
    --bgButtonHover: rgb(225,225,225);
    --textPrimary: rgb(200,200,200);
    --textSecondary: rgb(175,175,175);
    --textButton: rgb(60,60,60);
    --shadow: rgb(25,25,25);
    --alphaLayer01: rgba(255,255,255,.2);
    --alphaLayer02: rgba(255,255,255,.075);
    --alphaLayer03: rgba(255,255,255,.05);
    --focus: #fff;
    --gutter: clamp(1rem, 5vw, 4.5rem);
    --font: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: "Saira Semi Condensed", "Saira", system-ui, -apple-system, "Segoe UI", Roboto, "Arial Narrow", Arial, sans-serif;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    background-color: var(--bgPrimary);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: var(--font);
    font-size: 1.125rem;
    line-height: 1.5;
    color: var(--textPrimary);
    background-color: var(--bgPrimary);
}

main { flex: 1 0 auto; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* Focus: always visible for keyboard users */
:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}
h1:focus, main:focus { outline: none; } /* programmatic focus only (route change / skip link) */

.skip_link {
    position: absolute;
    left: 0.5rem;
    top: -4rem;
    z-index: 2000;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    color: var(--textButton);
    background: var(--textPrimary);
    transition: top .15s;
}
.skip_link:focus { top: 0.5rem; }

/* HEADINGS */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: 1px;
    line-height: 1.1;
    text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.2rem + 5vw, 5rem); font-weight: bold; }
h2 { font-size: clamp(2.25rem, 1.4rem + 4vw, 4.5rem); font-weight: bold; text-align: center; text-shadow: 0 0 8px var(--shadow); }
h3 { font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem); font-weight: bold; text-shadow: 0 0 8px var(--shadow); }

/* TOPBAR */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 64px;
    padding: 0 max(0.5rem, env(safe-area-inset-right)) 0 max(0.5rem, env(safe-area-inset-left));
    background-color: var(--bgSecondary);
    box-shadow: 0 2px 8px var(--shadow);
    position: relative;
    z-index: 2;
}
.topbar_brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0 0.5rem;
    border-radius: 5px;
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.topbar_logo { width: 40px; height: 40px; }
.topbar_name { display: none; font-weight: bold; }
.topbar_nav { display: flex; gap: 0.25rem; }
.topbar_nav a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 1rem;
    border-radius: 5px;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}
.topbar_nav a:hover, .topbar_brand:hover { background: var(--alphaLayer02); }
@media (min-width: 30em) { .topbar_name { display: inline; } }

/* BUTTONS */
.button_readMore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 1.125rem;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color .2s, box-shadow .2s, transform .1s;
    color: var(--textButton);
    background-color: var(--textPrimary);
}
.button_readMore:hover { box-shadow: 0 2px 8px var(--shadow); background-color: var(--bgButtonHover); }
.button_readMore:active { transform: scale(.97); }

.button_showMore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-height: 48px;
    padding: 10px 48px;
    font-family: var(--font);
    font-size: 1.125rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color .2s, box-shadow .2s, transform .1s;
    color: var(--textButton);
    background-color: var(--textPrimary);
}
.button_showMore:hover { box-shadow: 0 2px 8px var(--shadow); background-color: var(--bgButtonHover); }
.button_showMore:active { transform: scale(.97); }

/* HERO
   The background is the original home_background image (WebP, PNG fallback): a #323232 field with the light-grey
   mountain shape of the logo rising on the right (about 71% of the picture is dark). It is decoration only. The logo
   itself is a real <img> (.hero_logo) in normal flow, so no background-size/-position can crop it and the title panel
   can never cover it: the section is a grid, the logo and the panel are separate cells.
   - below 56em: one column (logo, then panel), the picture is a full-width band reserved at the bottom of the section
     (padding-bottom: 56.25% = 9/16 of the width = the height of the picture at 100% width), so nothing overlaps it.
   - from 56em: logo and panel side by side on the dark part. The section is at least 9/16 of its width high (at most
     the first screen: 100svh minus the 64px top bar), so `cover` fits the picture to the width and the diagonal stays
     at roughly 62-70% of the width at every size; the
   panel is kept (almost) left of the diagonal (max-width, never narrower than its longest word). */
.intro_section {
    --logo: clamp(7rem, 36vw, 12rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    align-content: start;
    row-gap: 1.5rem;
    padding: 2rem var(--gutter) calc(56.25% + 1.5rem);
    background-color: var(--heroDark);
    background-image: url("lib/images/home_background.png");
    background-image: image-set(url("lib/images/home_background.webp") type("image/webp"), url("lib/images/home_background.png") type("image/png"));
    background-repeat: no-repeat;
    background-size: 100% auto;
    background-position: right bottom;
}
.hero_logo {
    display: block;
    width: var(--logo);
    height: auto;
    aspect-ratio: 1;
}
/* Shrink-to-fit wrapper: the title sets its width and the tagline is exactly as wide as the title. The tagline's own
   text does not widen the wrapper (width 0 + min-width 100%), so it wraps inside it instead of overflowing. */
.banner { width: fit-content; max-width: 100%; }
/* Title and tagline sit on the same dark panel so their contrast stays >= 4.5:1 over either half of the cut. */
.banner_title, .banner_content {
    border-radius: 8px;
    background-color: rgba(25,25,25,.8);
    overflow-wrap: anywhere;
}
.banner_title { padding: 0.1em 0.2em 0.15em; overflow-wrap: break-word; }
.banner_content {
    width: 0;
    min-width: 100%;
    margin: 1rem 0 1.25rem;
    padding: 0.5rem 0.875rem;
    font-size: 1.125rem;
}
@media (min-width: 48em) {
    .banner_content { font-size: 1.25rem; }
}
@media (min-width: 56em) {
    .intro_section {
        --logo: clamp(9rem, 17vw, 16rem);
        --gap: clamp(1.5rem, 3vw, 3rem);
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        align-content: center;
        column-gap: var(--gap);
        min-height: clamp(24rem, 56.25vw, calc(100svh - 64px));
        padding: 3rem var(--gutter);
        background-size: cover;
        background-position: right top;
    }
    .banner { min-width: min-content; max-width: calc(58vw - var(--gutter) - var(--logo) - var(--gap)); }
}

/* NEWS */
.site_content { background-color: var(--bgSecondary); padding: 2rem var(--gutter) 3rem; }
.news_section { max-width: 64rem; margin: 0 auto; }
.news_title { color: var(--textPrimary); }
.news_subtitle { margin-top: 0.5rem; font-size: 1.25rem; letter-spacing: 1px; text-align: center; color: var(--textSecondary); }

.news_post {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    text-decoration: none;
    border-radius: 12px;
    transition: background-color .2s, transform .1s;
    background-color: var(--alphaLayer03);
}
.news_post:hover { background-color: var(--alphaLayer02); }
.news_post:active { transform: scale(.985); }
.news_post_image { width: 100%; max-width: 20rem; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; justify-self: center; order: -1; }
.news_post_text { padding: 0 0.5rem; }
.news_post_info { margin: 0.25rem 0 0.75rem; }
.news_post_content { max-width: 60ch; color: var(--textSecondary); }
@media (min-width: 48em) {
    .news_post { grid-template-columns: 1fr 18rem; padding: 1rem 1rem 1rem 2rem; }
    .news_post_image { order: 0; justify-self: end; }
    .news_post_text { padding: 0; }
}
.news_empty { margin-top: 2rem; text-align: center; color: var(--textSecondary); }
.news_button { display: flex; justify-content: center; margin: 1.5rem 0 2rem; }
.site_content::after { content: ""; display: block; max-width: 64rem; height: 2px; margin: 0 auto; background-color: var(--alphaLayer01); }

/* COVER FOCUS: focal point of a post cover (object-position), steps of 1 percent; the server centres the point per crop (ui/News/CoverFocus.cs Position). Classes instead of style attributes (CSP). Kept equal to ui/News/CoverFocus.cs (a test checks it). */
.cover_focus{object-position:var(--cx,50%) var(--cy,50%)}
.cx0{--cx:0%}.cy0{--cy:0%}
.cx1{--cx:1%}.cy1{--cy:1%}
.cx2{--cx:2%}.cy2{--cy:2%}
.cx3{--cx:3%}.cy3{--cy:3%}
.cx4{--cx:4%}.cy4{--cy:4%}
.cx5{--cx:5%}.cy5{--cy:5%}
.cx6{--cx:6%}.cy6{--cy:6%}
.cx7{--cx:7%}.cy7{--cy:7%}
.cx8{--cx:8%}.cy8{--cy:8%}
.cx9{--cx:9%}.cy9{--cy:9%}
.cx10{--cx:10%}.cy10{--cy:10%}
.cx11{--cx:11%}.cy11{--cy:11%}
.cx12{--cx:12%}.cy12{--cy:12%}
.cx13{--cx:13%}.cy13{--cy:13%}
.cx14{--cx:14%}.cy14{--cy:14%}
.cx15{--cx:15%}.cy15{--cy:15%}
.cx16{--cx:16%}.cy16{--cy:16%}
.cx17{--cx:17%}.cy17{--cy:17%}
.cx18{--cx:18%}.cy18{--cy:18%}
.cx19{--cx:19%}.cy19{--cy:19%}
.cx20{--cx:20%}.cy20{--cy:20%}
.cx21{--cx:21%}.cy21{--cy:21%}
.cx22{--cx:22%}.cy22{--cy:22%}
.cx23{--cx:23%}.cy23{--cy:23%}
.cx24{--cx:24%}.cy24{--cy:24%}
.cx25{--cx:25%}.cy25{--cy:25%}
.cx26{--cx:26%}.cy26{--cy:26%}
.cx27{--cx:27%}.cy27{--cy:27%}
.cx28{--cx:28%}.cy28{--cy:28%}
.cx29{--cx:29%}.cy29{--cy:29%}
.cx30{--cx:30%}.cy30{--cy:30%}
.cx31{--cx:31%}.cy31{--cy:31%}
.cx32{--cx:32%}.cy32{--cy:32%}
.cx33{--cx:33%}.cy33{--cy:33%}
.cx34{--cx:34%}.cy34{--cy:34%}
.cx35{--cx:35%}.cy35{--cy:35%}
.cx36{--cx:36%}.cy36{--cy:36%}
.cx37{--cx:37%}.cy37{--cy:37%}
.cx38{--cx:38%}.cy38{--cy:38%}
.cx39{--cx:39%}.cy39{--cy:39%}
.cx40{--cx:40%}.cy40{--cy:40%}
.cx41{--cx:41%}.cy41{--cy:41%}
.cx42{--cx:42%}.cy42{--cy:42%}
.cx43{--cx:43%}.cy43{--cy:43%}
.cx44{--cx:44%}.cy44{--cy:44%}
.cx45{--cx:45%}.cy45{--cy:45%}
.cx46{--cx:46%}.cy46{--cy:46%}
.cx47{--cx:47%}.cy47{--cy:47%}
.cx48{--cx:48%}.cy48{--cy:48%}
.cx49{--cx:49%}.cy49{--cy:49%}
.cx50{--cx:50%}.cy50{--cy:50%}
.cx51{--cx:51%}.cy51{--cy:51%}
.cx52{--cx:52%}.cy52{--cy:52%}
.cx53{--cx:53%}.cy53{--cy:53%}
.cx54{--cx:54%}.cy54{--cy:54%}
.cx55{--cx:55%}.cy55{--cy:55%}
.cx56{--cx:56%}.cy56{--cy:56%}
.cx57{--cx:57%}.cy57{--cy:57%}
.cx58{--cx:58%}.cy58{--cy:58%}
.cx59{--cx:59%}.cy59{--cy:59%}
.cx60{--cx:60%}.cy60{--cy:60%}
.cx61{--cx:61%}.cy61{--cy:61%}
.cx62{--cx:62%}.cy62{--cy:62%}
.cx63{--cx:63%}.cy63{--cy:63%}
.cx64{--cx:64%}.cy64{--cy:64%}
.cx65{--cx:65%}.cy65{--cy:65%}
.cx66{--cx:66%}.cy66{--cy:66%}
.cx67{--cx:67%}.cy67{--cy:67%}
.cx68{--cx:68%}.cy68{--cy:68%}
.cx69{--cx:69%}.cy69{--cy:69%}
.cx70{--cx:70%}.cy70{--cy:70%}
.cx71{--cx:71%}.cy71{--cy:71%}
.cx72{--cx:72%}.cy72{--cy:72%}
.cx73{--cx:73%}.cy73{--cy:73%}
.cx74{--cx:74%}.cy74{--cy:74%}
.cx75{--cx:75%}.cy75{--cy:75%}
.cx76{--cx:76%}.cy76{--cy:76%}
.cx77{--cx:77%}.cy77{--cy:77%}
.cx78{--cx:78%}.cy78{--cy:78%}
.cx79{--cx:79%}.cy79{--cy:79%}
.cx80{--cx:80%}.cy80{--cy:80%}
.cx81{--cx:81%}.cy81{--cy:81%}
.cx82{--cx:82%}.cy82{--cy:82%}
.cx83{--cx:83%}.cy83{--cy:83%}
.cx84{--cx:84%}.cy84{--cy:84%}
.cx85{--cx:85%}.cy85{--cy:85%}
.cx86{--cx:86%}.cy86{--cy:86%}
.cx87{--cx:87%}.cy87{--cy:87%}
.cx88{--cx:88%}.cy88{--cy:88%}
.cx89{--cx:89%}.cy89{--cy:89%}
.cx90{--cx:90%}.cy90{--cy:90%}
.cx91{--cx:91%}.cy91{--cy:91%}
.cx92{--cx:92%}.cy92{--cy:92%}
.cx93{--cx:93%}.cy93{--cy:93%}
.cx94{--cx:94%}.cy94{--cy:94%}
.cx95{--cx:95%}.cy95{--cy:95%}
.cx96{--cx:96%}.cy96{--cy:96%}
.cx97{--cx:97%}.cy97{--cy:97%}
.cx98{--cx:98%}.cy98{--cy:98%}
.cx99{--cx:99%}.cy99{--cy:99%}
.cx100{--cx:100%}.cy100{--cy:100%}
/* END COVER FOCUS */

/* CONTENT PAGES (about, posts) */
.prose { width: 100%; max-width: 44rem; margin: 0 auto; padding: 3rem var(--gutter) 4rem; }
.prose h1 { margin-bottom: 1rem; text-shadow: 0 0 8px var(--shadow); overflow-wrap: anywhere; }
.prose p { margin-bottom: 1.25rem; max-width: 65ch; }

/* FOOTER */
.site_footer { padding: 1.5rem var(--gutter); font-size: 1rem; text-align: center; color: var(--textSecondary); background-color: var(--bgFooter); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

.sr_only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
