/*
Theme Name: Vicky Midson
Description: Custom accessible theme for drawntopixels.co.uk
Version: 1.1
Author: Vicky Midson
*/

/* =============================================
   CSS VARIABLES
   ============================================= */

:root {
    --colour-cream:       #F5F4EF ;
    --colour-navy:        #0A284B;
    --colour-royal-blue:  #235FA4;
    --colour-purple:      #811e86;
    --colour-focus:       #58ffbc;
    --colour-white:       #ffffff;

    --font-heading:       'Poppins', sans-serif;
    --font-body:          Helvetica, Arial, sans-serif;
    --font-mono:          'Share Tech Mono', monospace;

    --bg:                 var(--colour-cream);
    --text:               var(--colour-navy);
    --link:               var(--colour-royal-blue);
    --link-visited:       var(--colour-purple);
    --link-hover:         var(--colour-navy);
    --header-bg:          var(--colour-cream);
    --footer-bg:          var(--colour-cream);
    --footer-text:        var(--colour-navy);
    --button-bg:          var(--colour-navy);
    --button-text:        var(--colour-white);
    --button-border:      var(--colour-navy);
    --nav-text:           var(--colour-navy);
    --nav-hover-bg:       var(--colour-navy);
    --nav-hover-text:     var(--colour-white);
    --wordmark-colour:    var(--colour-navy);
    --back-to-top-bg:   #0A284B;
    --back-to-top-text: #ffffff;
    --colour-hero:      #008059;
}

/* Dark mode — respects OS preference automatically, no plugin needed */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:               #1a1a2e;
        --text:             #e8e4d9;
        --link:             #7aaee8;
        --link-visited:     #7aaee8;
        --link-hover:       #e8e4d9;
        --header-bg:        #1a1a2e;
        --footer-bg:        #1a1a2e;
        --footer-text:      #7aaee8;
        --button-bg:        #e8e4d9;
        --button-text:      #1a1a2e;
        --button-border:    #e8e4d9;
        --nav-text:         #e8e4d9;
        --nav-hover-bg:     #e8e4d9;
        --nav-hover-text:   #1a1a2e;
        --wordmark-colour:  #e8e4d9;
        --back-to-top-bg:   #7aaee8;
        --back-to-top-text: #0A284B;
        --colour-hero:      #34D399;
    }

    /* Force navy text on focus states in dark mode */
    a:focus-visible,
    a:focus {
        color: #0A284B !important;
    }

    .footer-col a:focus-visible,
    .footer-col a:focus {
        color: #0A284B !important;
    }

    /* Footer link hover */
    .footer-col a:hover {
        color: #e8e4d9 !important;
        text-decoration-thickness: 2px;
    }

    /* Back to top button */
    .back-to-top .fa {
        color: #0A284B;
    }

    .back-to-top:hover {
        background-color: #1a1a2e;
        box-shadow: inset 0 0 0 3px #7aaee8;
        color: #0A284B;
    }

    .back-to-top:hover .fa {
        color: #0A284B;
    }
}
/* =============================================
   RESET AND BASE
   ============================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.7;
}

/* =============================================
   SELECTION
   ============================================= */

::-moz-selection {
    color: var(--colour-navy);
    background: var(--colour-focus);
}

::selection {
    color: var(--colour-navy);
    background: var(--colour-focus);
}

/* =============================================
   SKIP LINK
   ============================================= */

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--colour-navy);
    color: var(--colour-white);
    padding: 0.75em 1.25em;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 1rem;
    z-index: 9999;
    border-radius: 2px;
}

.skip-link:focus {
    top: 1rem;
    background-color: var(--colour-focus);
    color: var(--colour-navy);
    box-shadow: 0 -2px var(--colour-focus), 0 4px var(--colour-navy);
    outline: 3px solid transparent;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    line-height: 1.2;
}

h1 {
    font-size: clamp(4rem, 8vw + 1rem, 8rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h2 {
    font-size: clamp(2rem, 3vw + 0.5rem, 3rem);
    letter-spacing: -0.02em;
    margin-top: 2em;
    margin-bottom: 0.5em;
}

h3 {
    font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1.5em;
    hyphens: none;
}

p:last-child {
    margin-bottom: 0;
}

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

li {
    margin-bottom: 1.25em;
    line-height: 1.7;
}

strong {
    font-weight: 700;
}

/* =============================================
   LINKS
   ============================================= */

a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    color: var(--link-hover);
    text-decoration-thickness: 2px;
}

/* =============================================
   FOCUS STATES — GDS yellow highlight pattern
   ============================================= */

:focus-visible {
    outline: 3px solid transparent;
    background-color: var(--colour-focus);
    color: var(--colour-navy);
    box-shadow: 0 -2px var(--colour-focus), 0 4px var(--colour-navy);
    text-decoration: none;
    border-radius: 0;
}

:focus:not(:focus-visible) {
    outline: none;
    background-color: transparent;
    box-shadow: none;
}

:focus {
    outline: 3px solid transparent;
    background-color: var(--colour-focus);
    color: var(--colour-navy);
    box-shadow: 0 -2px var(--colour-focus), 0 4px var(--colour-navy);
    text-decoration: none;
    border-radius: 0;
}

/* =============================================
   LAYOUT
   ============================================= */

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* =============================================
   HEADER AND NAV
   ============================================= */

.site-header {
    background-color: var(--header-bg);
    padding: 1.5rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Wordmark */
.site-wordmark {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.site-wordmark a {
    color: var(--wordmark-colour);
    text-decoration: none;
}

.site-wordmark a:visited {
    color: var(--wordmark-colour);
}

.site-wordmark a:hover {
    color: var(--wordmark-colour);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-wordmark a:focus-visible {
    color: var(--colour-navy);
}

/* Primary nav */
.primary-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0;
}

.primary-nav li {
    margin: 0;
}

.primary-nav a {
    display: block;
    padding: 0.25em 0.75em;
    color: var(--nav-text);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.primary-nav a:visited {
    color: var(--nav-text);
}

.primary-nav a:hover {
    color: var(--nav-hover-text);
    background-color: var(--nav-hover-bg);
    text-decoration: none;
}

/* Current page indicator */
.primary-nav a[aria-current="page"] {
    border-bottom: 2px solid var(--nav-text);
}

.primary-nav a[aria-current="page"]:hover {
    border-bottom-color: var(--nav-hover-text);
}

/* Nav focus */
.primary-nav a:focus-visible {
    background-color: var(--colour-focus);
    color: var(--colour-navy);
    box-shadow: 0 -2px var(--colour-focus), 0 4px var(--colour-navy);
    outline: 3px solid transparent;
    border-bottom-color: transparent;
}

/* =============================================
   HERO — homepage
   ============================================= */

.hero {
    padding: 3rem 0 2rem;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: clamp(5rem, 10vw + 2rem, 14rem);
    font-weight: 700;
    letter-spacing: -0.08em;
    line-height: 0.9;
    color: var(--colour-hero);
    margin: 0;
}

/* =============================================
   INTRO — homepage
   ============================================= */

.intro {
    padding: 0rem 0 4rem;
    max-width: 800px;
}

.intro-tagline {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 2vw + 0.5rem, 2.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
    line-height: 1.2;
}

.intro-actions {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.intro-actions .or {
    color: var(--text);
}

/* =============================================
   BUTTONS
   ============================================= */

.button,
button,
input[type=submit],
input[type=reset],
input[type=button] {
    display: inline-block;
    padding: 0.75em 1.5em;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 2px solid var(--button-border);
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    cursor: pointer;
    border-radius: 1px;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.button:visited {
    color: var(--button-text);
}

.button:hover,
button:hover,
input[type=submit]:hover,
input[type=reset]:hover,
input[type=button]:hover {
    background-color: var(--colour-white);
    color: var(--colour-navy);
    border-color: var(--colour-navy);
    box-shadow: inset 0 0 0 2px var(--colour-navy);
    text-decoration: none;
}

.button:focus-visible,
button:focus-visible,
input[type=submit]:focus-visible,
input[type=reset]:focus-visible,
input[type=button]:focus-visible {
    background-color: var(--colour-focus);
    color: var(--colour-navy);
    border-color: var(--colour-navy);
    box-shadow: inset 0 0 0 3px var(--colour-navy);
    outline: 3px solid transparent;
}

/* =============================================
   PAGE CONTENT — about and inner pages
   ============================================= */

.page-header {
    padding: 3rem 0 1rem;
}

.page-title {
    font-size: clamp(4rem, 8vw + 1rem, 8rem);
    letter-spacing: -0.03em;
    color: var(--text);
}

.page-content {
    padding: 1rem 0 4rem;
    max-width: 700px;
}

.page-content h2 {
    font-size: clamp(2rem, 3vw + 0.5rem, 3rem);
}

.page-content h3 {
    font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
}

/* =============================================
   FOOTER
   ============================================= */

.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--text);
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-col h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin: 0 0 1rem;
    color: var(--footer-text);
}

.footer-col a {
    color: var(--footer-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-col a:visited {
    color: var(--footer-text);
}

.footer-col a:hover {
    color: var(--footer-text);
    text-decoration-thickness: 2px;
}

.footer-col a:focus-visible {
    color: var(--colour-navy);
    text-decoration: none;
}

/* Social links */
.social-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
}

.social-links li {
    margin: 0;
}

/* Back to top */
.back-to-top-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--back-to-top-bg);
    color: var(--back-to-top-text);
    text-decoration: none;
    font-size: 1.25rem;
    border: none;
    flex-shrink: 0;
}

.back-to-top:visited {
    color: var(--back-to-top-text);
}

.back-to-top:hover {
    background-color: var(--colour-white);
    box-shadow: inset 0 0 0 3px var(--colour-navy);
    color: var(--colour-navy);
    text-decoration: none;
}

.back-to-top:focus-visible {
    background-color: var(--colour-focus);
    color: var(--colour-navy);
    box-shadow: 0 0 0 4px var(--colour-navy);
    outline: 3px solid var(--colour-focus);
    outline-offset: 2px;
    text-decoration: none;
    border-radius: 50%;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 600px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-name {
        font-size: 24vw;
    }

    .footer-inner {
        flex-direction: column;
    }

    .back-to-top-col {
        justify-content: flex-start;
    }
}

@media (max-width: 440px) {
    h1 {
        font-size: clamp(2.5rem, 14vw, 4rem);
    }
}