/* 
 * Doolin Digital Theme for BSSG
 * Inspired by early 90s TSR styles
 * Largely from BECMI sources, Rules Cyclopedia
 * IMPROVED: Better accessibility, performance, and text browser support
 */

@import url(https://db.onlinewebfonts.com/c/f7719afca15e0f072044d2fa642090c8?family=ITC+Quorum+Std+Black);

@import url('https://fonts.googleapis.com/css2?&family=EB+Garamond:ital,wght@0,400..800;1,400..800');

@import url('https://fonts.googleapis.com/css2?&family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700');

/* Reduced motion support - CRITICAL for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Simplify decorative elements for reduced motion */
    body, header {
        background-image: none !important;
        background-attachment: scroll !important;
    }
}

:root {
    --ddblue: #2e3853;
    --ddyellow: #f9d60b;
    --reseda-green: #71816D;
    --af-white: #EAEBED;
    --lavender: #D6E3F8;
    /* Art Deco color scheme */
    --gold: #D4AF37;
    --black: #000000;
    --silver: #C0C0C0;
    --emerald: #50C878;
    --ruby: #E0115F;
    --sapphire: #0F52BA;
    --cream: #FFFDD0;
    --charcoal: #36454F;
    
    /* Semantic color assignments */
    --bg-color: var(--lavender);
    --text-color: var(--charcoal);
    --accent-color: var(--ddyellow);
    --secondary-accent: var(--reseda-green);
    --tertiary-accent: var(--lavender);
    --link-color: var(--reseda-green);
    --link-hover: var(--ddyellow);
    --link-visited: var(--reseda-green);
    --header-bg: var(--ddblue);
    --header-text: var(--ddyellow);
    --nav-bg: var(--ddblue);
    --nav-text: var(--ddyellow);
    --nav-hover-bg: var(--ddyellow);
    --nav-hover-text: var(--ddblue);
    --footer-bg: var(--ddblue);
    --footer-text: var(--silver);
    --border-color: var(--ddyellow);
    
    /* Typography - IMPROVED fallbacks for text browsers */
    --font-main: 'Crimson Text', Georgia, 'Times New Roman', Times, serif;
    --font-headings: 'ITC Quorum Std Black', 'Copperplate Gothic Light', 'Copperplate', Garamond, Georgia, 'Times New Roman', serif;
    --font-mono: 'Courier New', Courier, monospace;
    
    /* Sizing */
    --content-width: 900px;
    --content-padding: 2rem;
}

/* Base elements - OPTIMIZED performance */
html {
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.2;
    /* OPTIMIZED: Simplified pattern for better performance */
    background-image: 
        linear-gradient(45deg, var(--lavender) 25%, transparent 25%), 
        linear-gradient(-45deg, var(--lavender) 25%, transparent 25%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    /* REMOVED: background-attachment: fixed for better mobile performance */
    background-repeat: repeat;
    background-color: var(--af-white);
    /* OPTIMIZED: Reduced blend mode complexity */
    background-blend-mode: multiply;
    opacity: 0.95;
}

.container {
    max-width: var(--content-width);
    margin: 2rem auto;
    padding: 0;
    background-color: var(--bg-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid var(--ddblue);
    border-top: 0px;
    border-bottom: 0px;
}

/* Art Deco border pattern - OPTIMIZED */
.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold),
        var(--gold) 15px,
        var(--black) 15px,
        var(--black) 30px
    );
}

.container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: repeating-linear-gradient(
        90deg,
        var(--ddyellow),
        var(--ddyellow) 15px,
        var(--ddblue) 15px,
        var(--ddblue) 30px
    );
}

/* Header - OPTIMIZED performance */
header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 2rem var(--content-padding) 1rem;
    position: relative;
    text-align: center;
    background: url('/images/HollySquare.png') no-repeat 3% 15%, url('../images/HollySquare.png') no-repeat 97% 15%;
    background-size: 15%;
    background-color: var(--ddblue);
    /* OPTIMIZED: Reduced blend mode complexity */
/*    background-blend-mode: overlay;
    opacity: 0.95;*/
}

/* Decorative header element - IMPROVED text browser support */
header::before {
    /*    content: "★ ★ ★"; */
    content "";
    display: block;
    text-align: center;
    color: var(--ddyellow);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: 2rem;
    padding-left: 2rem;
}

/* FALLBACK: Text browser support for decorative elements */
@supports not (content: "★") {
    header::before {
        content: "* * *";
    }
}

header::after {
    content: "";
    display: block;
    width: 50%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 1rem auto 0;
}

/* Site title - IMPROVED accessibility */
.site-title {
    font-family: var(--font-headings);
    font-weight: normal;
    font-size: 2.5rem;
    letter-spacing: 4px;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
}

.site-title a {
    color: var(--header-text);
    text-decoration: none;
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

.site-title a::before, 
.site-title a::after {
    content: "◆";
    position: relative;
    color: var(--ddyellow);
    margin: 0 1rem;
    font-size: 1rem;
    vertical-align: middle;
}

/* FALLBACK: Text browser support for decorative elements */
@supports not (content: "◆") {
    .site-title a::before, 
    .site-title a::after {
        content: "*";
    }
}

.site-title a:hover {
    transform: translateY(-2px);
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.site-title a:focus {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    transform: translateY(-2px);
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

/* Site description */
header p {
    margin: 0.5rem 0 1.25rem 0;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--silver);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation - IMPROVED accessibility */
nav {
    background-color: var(--nav-bg);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    position: relative;
}

nav::before,
nav::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--gold);
}

nav::before {
    top: 0;
}

nav::after {
    bottom: 0;
}

nav a {
    color: var(--ddyellow);
    text-decoration: none;
    padding: 1rem 1.5rem;
    font-family: var(--font-headings);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    transition: all 0.2s ease; /* Reduced transition time for better performance */
}

header a:visited {
    color: var(--ddyellow);
}

nav a:hover, 
nav a.active {
    background-color: var(--nav-hover-bg);
    color: var(--nav-hover-text);
    transform: translateY(-1px);
}

nav a:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    background-color: var(--nav-hover-bg);
    color: var(--nav-hover-text);
    transform: translateY(-1px);
}

/* Content area */
main {
    padding: 3rem var(--content-padding);
    position: relative;
    background-color: var(--bg-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    color: var(--text-color);
    margin: 2rem 0 1rem;
    line-height: 1.2;
    font-weight: normal;
    letter-spacing: 2px;
    text-transform: uppercase;
}

h1 {
    font-size: 2.2rem;
    margin-top: 0;
    color: var(--charcoal);
    text-align: center;
    position: relative;
}

h1::before, 
h1::after {
    content: "";
    display: inline-block;
    height: 1px;
    background-color: var(--reseda-green);
    width: 50px;
    vertical-align: middle;
    margin: 0 1rem;
}

h2 {
    font-size: 1.8rem;
    color: var(--charcoal);
    position: relative;
    display: inline-block;
}

h2::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--reseda-green), transparent);
}

h3 {
    font-size: 1.5rem;
    color: var(--charcoal);
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

ul,ol {
    font-size: 1.25rem;
    line-height: 1.3
}

blockquote {
    font-style: italic;
}

/* First paragraph special styling */
article > p:first-of-type::first-letter {
    font-size: 3.5rem;
    float: left;
    line-height: 1;
    margin-right: 0.5rem;
    color: var(--reseda-green);
    font-family: var(--font-headings);
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--link-color);
    transition: all 0.2s ease;
}

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

a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

a:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

/* Articles */
article {
    margin-bottom: 4rem;
    position: relative;
    padding: 2rem;
    border: 1px solid var(--reseda-green);
    background-color: var(--af-white);
}

article::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--reseda-green);
    pointer-events: none;
}

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

article h1 {
    font-size: 2rem;
    margin-top: 0;
}

article p img {
    display: block;
    margin: auto;
    width: 60%;
    max-width: 100%;
}

article p img + p {
    width: 50%;
    margin: auto;
    font-style: italic;
}

article .meta {
    font-size: 0.9rem;
    margin: 1rem 0 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    font-style: italic;
    color: var(--charcoal);
    border-bottom: 1px solid var(--reseda-green);
    padding-bottom: 1rem;
}

/* Reading time */
.reading-time {
    position: relative;
    padding-left: 1.5rem;
}

.reading-time::before {
    content: "⏱";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tags a {
    background-color: var(--ddblue);
    color: var(--ddyellow);
    padding: 0.2rem 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-headings);
    border: none;
    border-radius: 0;
    position: relative;
}

.tags a::before,
.tags a::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: var(--reseda-green);
    top: 50%;
    transform: translateY(-50%);
}

.tags a::before {
    left: 5px;
}

.tags a::after {
    right: 5px;
}

.tags a:hover {
    background-color: var(--ddyellow);
    color: var(--reseda-green);
    border: none;
}

.tags a:focus {
    outline: 2px solid var(--ddyellow);
    outline-offset: 2px;
    background-color: var(--ddblue);
    color: var(--ddyellow);
    border: none;
}

/* Tags list page */
.tags-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.tags-list li {
    margin: 0;
}

.tags-list a {
    display: block;
    background-color: var(--ddblue);
    color: var(--ddyellow);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: var(--font-headings);
    text-decoration: none;
    border: none;
    position: relative;
    transition: all 0.2s ease;
}

.tags-list a:hover {
    background-color: var(--ddyellow);
    color: var(--ddblue);
    border: none;
}

.tags-list a:focus {
    outline: 2px solid var(--ddyellow);
    outline-offset: 2px;
    background-color: var(--ddblue);
    color: var(--ddyellow);
    border: none;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem var(--content-padding);
    text-align: center;
    position: relative;
/*    background-blend-mode: overlay; */
}

footer::before {
    content: "";
    display: block;
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--ddyellow), transparent);
    margin: 0 auto 1.5rem;
}

footer p {
    margin: 0.5rem 0;
    font-style: italic;
}

footer a {
    color: var(--ddyellow);
    text-decoration: none;
    border-bottom: none;
}

footer a:hover {
    color: var(--silver);
    text-decoration: underline;
}

footer a:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    color: var(--silver);
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0 1rem;
}

.pagination a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--gold);
    color: var(--black);
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    font-family: var(--font-headings);
    border: none;
    position: relative;
}

.pagination a:hover {
    background-color: var(--black);
    color: var(--gold);
    border: none;
}

.pagination a:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    background-color: var(--black);
    color: var(--gold);
    border: none;
}

/* Featured images */
.featured-image, 
.index-image, 
.tag-image, 
.archive-image {
    margin-bottom: 2rem;
    position: relative;
    padding: 10px;
    background-color: var(--black);
    color: var(--af-white);
    text-align: center;
}

.featured-image::before,
.index-image::before,
.tag-image::before,
.archive-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid var(--gold);
    margin: 5px;
    pointer-events: none;
    z-index: 1;
}

.featured-image img, 
.index-image img, 
.tag-image img, 
.archive-image img {
    display: block;
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 0;
    margin: 0 auto;
}

figure {
    width: 70%;
    margin: auto;
}

figure img {
    display: block;
    max-width: 100%;
    max-height: 480px;
    width: auto;
    margin: auto;
}

/* Image caption styling for better contrast */
figcaption {
    color: var(--black);
    background-color: var(--lavender);
    padding: 0.5rem;
    font-style: italic;
    margin-top: 0.5rem;
    text-align: center;
    border: 1px solid var(--reseda-green);
    font-weight: bold;
}

figure ul {
    list-style-type: none;
}

/* Post list on index/tag/archive pages */
.posts-list article {
    margin-bottom: 3rem;
}

.posts-list h3 {
    margin-top: 0;
    font-size: 1.8rem;
    text-align: center;
}

/* IMPROVED: Responsive styles with mobile optimizations */
@media (max-width: 768px) {
    body {
        /* OPTIMIZED: Remove complex background patterns on mobile */
        background-image: none;
        background-color: var(--lavender);
    }
    
    header {
        /* OPTIMIZED: Simplified header background on mobile */
        background-image: none;
        background-color: var(--ddblue);
    }
    
    .container {
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    header, 
    main, 
    footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    header::before {
        letter-spacing: 1rem;
        padding-left: 1rem;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .site-title a::before, 
    .site-title a::after {
        margin: 0 0.5rem;
    }
    
    h1::before, 
    h1::after {
        width: 30px;
        margin: 0 0.5rem;
    }
    
    nav {
        justify-content: center;
    }
    
    nav a {
        padding: 0.8rem 1rem;
        font-size: 0.8rem;
        text-align: center;
        /* OPTIMIZED: Simplified transitions on mobile */
        transition: background-color 0.2s ease;
    }
    
    article {
        padding: 1rem;
    }
    
    article .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .featured-image, 
    .index-image,
    .tag-image,
    .archive-image {
        margin: 1.5rem 0;
        /* OPTIMIZED: Simplified decorative elements on mobile */
        padding: 5px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .site-title {
        font-size: 1.7rem;
        letter-spacing: 2px; /* Reduced letter spacing for small screens */
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    header::before {
        letter-spacing: 0.5rem;
        padding-left: 0.5rem;
    }
    
    .site-title a::before, 
    .site-title a::after {
        margin: 0 0.3rem;
    }
    
    nav {
        flex-direction: column;
    }
    
    nav a {
        width: 100%;
        box-sizing: border-box;
        border-bottom: 1px solid var(--gold);
        /* OPTIMIZED: Remove transforms on small mobile */
        transform: none !important;
    }
    
    nav a:last-child {
        border-bottom: none;
    }
    
    .tags {
        justify-content: center;
    }
    
    .featured-image::before,
    .index-image::before,
    .tag-image::before,
    .archive-image::before {
        font-size: 0.9rem;
    }
    
    /* OPTIMIZED: Simplified decorative elements on very small screens */
    .featured-image, 
    .index-image,
    .tag-image,
    .archive-image {
        padding: 2px;
    }
    
    footer {
        text-align: center;
    }
} 
