/*
 * Social Anxiety UK - main stylesheet
 * Mobile first: the base rules are for phones, with wider layouts added in media queries.
 */

:root {
    --sky: #9fe0ff;          /* the original SAUK sky blue */
    --sky-pale: #e8f6fd;
    --sky-cloudy: #bfebff;
    --sky-dark: #79c7ed;
    --header: var(--sky-dark);
    --blue: #34669b;         /* links */
    --blue-dark: #24496f;    /* headings */
    --bright: #fff;
    --logo: #fff;            /* logo background */
    --border: #6599cc;
    --soft: #99b7d7;         /* "SA" in the logo colours */
    --uk: #5d9fe0;           /* "UK", darkened from #92c5f8 so it's readable on white */
    --help: #a3262a;
    --text: #1f2d3d;
    --text-light: #fff;
    --muted: #55606b;
    --card: #f3fafe;
    --page: var(--sky-cloudy);
    --radius: 10px;
    --measure: 50rem;        /* maximum width of the content column */
}

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

html {
    scroll-behavior: smooth;
    /* leave room for the sticky navigation when jumping to a section */
    scroll-padding-top: 4rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
}

a {
    color: var(--blue);
}

a:hover {
    color: var(--blue-dark);
}

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--blue-dark);
    line-height: 1.25;
    margin: 1.4em 0 0.5em;
}

h1 {
    font-size: 1.8rem;
    text-align: center;
    margin-top: 0.5rem;
}

h2 {
    font-size: 1.6rem;
    margin-top: 0;
    padding-bottom: 0.3em;
    border-bottom: 3px solid var(--sky);
}

h3 { font-size: 1.3rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 1rem; color: var(--text); }

p {
    margin: 0 0 1em;
}

ul, ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

li {
    margin-bottom: 0.3em;
}

/* ---------- Skip link ---------- */

.skip-link {
    /* fixed, so it shows at the top of the window however far down the page you are */
    position: fixed;
    left: 1rem;
    top: -3rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: var(--card);
    border-radius: var(--radius);
}

.skip-link:focus {
    top: 1rem;
}

/* hidden on screen but read out by screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Header and navigation ---------- */

.site-header {
    /* the original mosaic tiles */
    background: var(--header); /* url(background.png) repeat-x top center; */
}

.site-header-inner {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.site-logo {
    display: inline-block;
    background: var(--logo);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    line-height: 0;
}

.site-logo img {
    width: 221px;
}

.help-now {
    background: var(--card);
    color: var(--help);
    font-weight: bold;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 2px solid var(--help);
}

.help-now:hover {
    background: var(--help);
    color: var(--text-light);
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bright);
    border-bottom: 1px solid var(--soft);
    box-shadow: 0 2px 6px rgba(36, 73, 111, 0.08);
}

.site-nav ul {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0.4rem 0.5rem;
    list-style: none;
    display: flex;
    /* one row; on narrow phones it can be swiped sideways rather than wrapping */
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: safe center;
    gap: 0.1rem;
    scrollbar-width: none;
}

.site-nav ul::-webkit-scrollbar {
    display: none;
}

.site-nav li {
    margin: 0;
}

.site-nav a {
    display: block;
    white-space: nowrap;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.site-nav a:hover {
    background: var(--sky-pale);
}

/* house icon for Home */
.site-nav .nav-home-icon a {
    display: flex;
    align-items: center;
    height: 100%;
}

/* small phones: tighter spacing */
@media (max-width: 26rem) {
    .site-nav a {
        font-size: 0.95rem;
        padding: 0.4rem 0.45rem;
    }
}


/* the smallest phones (320px) */
@media (max-width: 21rem) {
    .site-nav ul {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .site-nav a {
        font-size: 0.9rem;
        padding: 0.4rem 0.35rem;
    }
}

/* ---------- Sections ---------- */

main {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 1rem;
}

.panel {
    background: var(--card);
    border: 1px solid var(--soft);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(36, 73, 111, 0.06);
}

.social { color: var(--soft); }
.uk { color: var(--uk); }

h1 .social, h2 .social { color: #7ea5cf; }

.intro {
    border-left: 4px solid var(--sky);
    padding-left: 1rem;
    margin: 1rem 0 1.5rem;
}

.light-border {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem 1rem 0;
    margin-top: 1rem;
}

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

.button {
    display: inline-block;
    background: var(--blue);
    color: var(--text-light);
    text-decoration: none;
    font-weight: bold;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    overflow-wrap: anywhere;
}

.button:hover {
    background: var(--blue-dark);
    color: var(--text-light);
}

.button-large {
    font-size: 1.15rem;
    padding: 0.75rem 1.5rem;
}

/* ---------- Tabs (sauk.js) ----------
 * Each .js-div-content has a .js-div-links list of tabs and a set of .more-content panels.
 * Without JavaScript every panel shows, one after another.
 */

.js-div-links {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.js-div-links li {
    margin: 0;
}

.js-div-links a {
    display: block;
    padding: 0.35rem 0.85rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    text-decoration: none;
    font-weight: bold;
}

.js-div-links a:hover {
    background: var(--sky-pale);
}

.js-div-links a[aria-selected="true"] {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--text-light);
}

.js-div-links-mini a {
    font-size: 0.9rem;
    padding: 0.2rem 0.65rem;
}

.js .more-content[hidden] {
    display: none;
}

.more-content > :first-child {
    margin-top: 0;
}

/* ---------- Small utility classes kept from the original markup ---------- */

.bold { font-weight: bold; }
.italics { font-style: italic; }
.small, .smaller { font-size: 0.9rem; }
.center { text-align: center; }
.color { color: var(--blue-dark); }
.space-top { margin-top: 1.5rem; }
.space-bottom { margin-bottom: 1.5rem; }
.space { margin: 1rem 0; }

.make-list, .simple-list {
    padding-left: 1.5em;
}

.make-list > li {
    list-style-type: square;
}

.make-sub-list {
    list-style: none;
}

.make-sub-list ul {
    padding-left: 1.25em;
}

.simple-list {
    list-style: none;
}

.simple-list-dots li {
    list-style-type: disc;
}

/* ---------- Books (Links > Books) ---------- */

#sa-books table,
#sa-books tbody,
#sa-books tr,
#sa-books td {
    display: block;
}

#sa-books tr {
    padding: 1rem 0;
    border-bottom: 1px solid var(--sky);
}

#sa-books tr:last-child {
    border-bottom: 0;
}

#sa-books .image {
    text-align: center;
    margin-bottom: 0.75rem;
}

#sa-books .image img {
    max-height: 200px;
    width: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

@media (min-width: 40rem) {
    #sa-books tr {
        display: grid;
        grid-template-columns: 8rem 1fr;
        gap: 1.25rem;
        align-items: start;
    }

    #sa-books .image {
        margin: 0;
    }
}

/* ---------- Footer ---------- */

.site-footer {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 1rem 2rem;
    text-align: center;
    color: var(--muted);
}

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
    .site-logo img {
        width: 221px;
    }

    .panel {
        padding: 2rem 2.25rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.9rem;
    }
}

@media (prefers-color-scheme:dark) {
:root { 
  --sky-pale: #24496f;
  --sky-cloudy: #2b435c;
  --sky-dark: #49739f;
  --header: var(--sky-cloudy);
  --blue: #b7dbed;         /* links */
  --blue-dark: #b7dbed;    /* headings */
  --bright: #101922;
  --logo: #182532;
  --card: #182532;
  --help: #f93f45;
  --text: #e8f6fd;
  --text-light: #1f2d3d;
  --muted: #c9ccd0;
}     