/* =============================================
   MAIN.CSS
   Replaces: responsivegridsystem.css
             footer.css
             layout.css
             purecssmenu.css
             stories.css
             480.css
             768.css
             1024.css
   ============================================= */


/* =============================================
   1. CSS VARIABLES
   ============================================= */

:root {
    /* Colours */
    --color-text:         #2b2b2b;
    --color-bg:           #dadcd1;
    --color-primary:      #266c8e;
    --color-primary-dark: #1a4f68;
    --color-accent:       #b54923;
    --color-dark:         #0d0d0d;
    --color-footer-bg:    #2b2b2b;
    --color-footer-text:  #dadcd1;

    /* Fonts */
    --font-sans:      'Open Sans', sans-serif;
    --font-condensed: 'Open Sans', sans-serif; /* condensed via font-stretch */
    --font-serif:     'Georgia', serif;

    /* Layout */
    --max-width:     1100px;
    --content-width: 80%;
}


/* =============================================
   2. RESET & BASE
   ============================================= */

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

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 100%;
    color: var(--color-text);
    background: var(--color-bg);
}


/* =============================================
   3. TYPOGRAPHY — HEADINGS
   ============================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-condensed);
    font-stretch: condensed;
    margin-top: 10px;
    text-transform: uppercase;
    line-height: 1em;
}

h1 {
    color: var(--color-primary);
    margin: 0.25em 0 0.5em 0;
    font-size: 4.5rem;
}

h2 {
    color: var(--color-text);
	font-size: 2.5rem; 
    margin-bottom: 0.5em;
}

h3 {
    color: var(--color-accent);
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-size: 1.625rem; 
}

h4 {
    color: var(--color-accent);
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.375rem;
}

h5 {
    color: #555;
    margin-bottom: 1.25em;
    font-size: 0.8125rem;
}

h6 {
    color: #666;
    font-size: 0.8125rem;
}


/* =============================================
   4. TYPOGRAPHY — BODY
   ============================================= */

p {
    margin-bottom: 1em;
    font-size: 1.125rem;
    hyphens: none;
    line-height: 1.5;
}

p.center   { text-align: center; margin: 0 auto; }
p.under    { clear: both; margin-left: 50px; }
p.question { font-weight: 700; }
p.answer   { font-weight: 400; margin-bottom: 2em; }
p.syn      { font-size: 1.125rem; }
p.story    { line-height: 2; }

hr {
    display: block;
    margin: 1em 0;
    padding: 0;
    height: 1px;
    border: 0;
    border-top: 1px solid #8c8b8b;
}

form { font-size: 1.125rem; }

::selection {
    background: rgb(23, 119, 175);
    color: rgb(250, 250, 250);
    text-shadow: none;
}


/* =============================================
   5. LINKS
   ============================================= */

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    outline: 0;
}

/* Restore focus indicator for keyboard users */
a:focus-visible {
    outline: 2px solid var(--color-primary);
    border-radius: 2px;
}

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

a:hover,
a:active  { color: var(--color-primary-dark); }

a.top,
a.top:visited,
a.top:hover {
    clear: both;
    color: var(--color-text);
    font-size: 0.875rem;
}

a.quotes { font-weight: 700; }


/* =============================================
   6. IMAGES
   ============================================= */

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

img.floatleft  { float: left;  margin: 0 10px 0 0; }
img.floatright { float: right; margin: 0 0 0 10px; }

.siteimage {
    max-width: 90%;
    padding: 5%;
    margin: 0 0 1em 0;
    background: transparent;
    transition: background 0.3s ease;
}

.siteimage:hover {
    background: #bbb;
    position: relative;
    top: -2px;
}


/* =============================================
   7. LAYOUT
   ============================================= */

/* Skip link — hidden until focused for keyboard users */
#skiptomain {
    position: absolute;
    left: -9999px;
}

#skiptomain:focus {
    left: 0;
}

/* Wrapper fills available space, pushing footer down */
#wrapper {
    flex: 1 0 auto;
    width: 100%;
    position: relative;
    text-align: left;
}

#headercontainer {
    width: 100%;
    background: var(--color-dark);
}

header {
    width: var(--content-width);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
    text-align: center;
    position: relative;
}

#maincontentcontainer {
    width: 100%;
}

#maincontent,
.maincontent {
    width: var(--content-width);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1em 20px;
    color: #333;
    line-height: 1.5;
    position: relative;
}

/* Container background variants */
.darkcontainer  { background: rgba(102, 102, 102, 0.05); }
.lightcontainer { background: rgba(255, 255, 255, 0.33); }


/* =============================================
   8. GRID & COLUMNS
   ============================================= */

.section {
    clear: both;
    padding: 0;
    margin: 0;
}

.col { width: 100%; }

.twocolumns {
    column-count: 2;
    column-gap: 2em;
}

/* Modern clearfix */
.group { display: flow-root; }


/* =============================================
   8b. SPAN GRID — 4 AND 8 COLUMN
   ============================================= */

/* All columns full width by default (mobile first) */
[class*="span_"] {
    width: 100%;
    margin-left: 0;
    float: left;
    box-sizing: border-box;
}

/* 4-column grid — activates at 481px and up */
@media (min-width: 481px) {

    .span_4_of_4 { width: 100%;   margin-left: 0; }
    .span_3_of_4 { width: 74.6%;  margin-left: 0; }
    .span_2_of_4 { width: 48.4%;  margin-left: 3.2%; }
    .span_1_of_4 { width: 22.6%;  margin-left: 3.2%; }

    .span_4_of_4:first-child,
    .span_3_of_4:first-child,
    .span_2_of_4:first-child,
    .span_1_of_4:first-child { margin-left: 0; }

    /* 8-column grid */
    .span_8_of_8 { width: 100%;   margin-left: 0; }
    .span_7_of_8 { width: 87.3%;  margin-left: 1.6%; }
    .span_6_of_8 { width: 74.6%;  margin-left: 1.6%; }
    .span_5_of_8 { width: 61.9%;  margin-left: 1.6%; }
    .span_4_of_8 { width: 49.2%;  margin-left: 1.6%; }
    .span_3_of_8 { width: 36.5%;  margin-left: 1.6%; }
    .span_2_of_8 { width: 23.8%;  margin-left: 1.6%; }
    .span_1_of_8 { width: 11.1%;  margin-left: 1.6%; }

    .span_8_of_8:first-child,
    .span_7_of_8:first-child,
    .span_6_of_8:first-child,
    .span_5_of_8:first-child,
    .span_4_of_8:first-child,
    .span_3_of_8:first-child,
    .span_2_of_8:first-child,
    .span_1_of_8:first-child { margin-left: 0; }
}


/* =============================================
   9. NAVIGATION
   ============================================= */

ul.pureCssMenu ul {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 100;
}

ul.pureCssMenu ul ul {
    position: absolute;
    left: 100%;
    top: 0;
}

ul.pureCssMenu,
ul.pureCssMenu ul {
    list-style: none;
    background: transparent;
    color: var(--color-footer-text);
    margin: 0;
    padding: 0;
}

ul.pureCssMenu ul {
    width: auto;
    background: var(--color-dark);
}

ul.pureCssMenu li {
    display: block;
    float: left;
    margin: 0;
}

ul.pureCssMenu ul li {
    float: none;
    background: var(--color-dark);
    padding: 5px 0 0 10px;
}

ul.pureCssMenu li:hover > ul { display: block; }
ul.pureCssMenu li:hover      { position: relative; }

ul.pureCssMenu a,
ul.pureCssMenu li.dis a:hover,
ul.pureCssMenu li.sep a:hover {
    font-family: var(--font-condensed);
    font-size: 1.5em;
    font-weight: 700;
    display: block;
    vertical-align: middle;
    background: transparent;
    text-decoration: none;
    padding: 0 25px 3px 0;
    color: var(--color-footer-text);
    text-transform: uppercase;
}

ul.pureCssMenu ul a {
    text-align: left;
    white-space: nowrap;
}

ul.pureCssMenu a:active,
ul.pureCssMenu a:focus { outline: none; }

ul.pureCssMenu li a:hover {
    position: relative;
    color: var(--color-primary);
}

ul.pureCssMenu li.dis a { color: #666; }

/* Dropdown arrows */
ul.pureCssMenu span {
    display: block;
    overflow: hidden;
    padding-right: 12px;
    background-image: url(../images/arr_white.gif);
    background-position: right center;
    background-repeat: no-repeat;
}

ul.pureCssMenu li:hover > a > span,
ul.pureCssMenu a:hover span {
    background-image: url(../images/arrv_white.gif);
}

ul.pureCssMenu ul span {
    background-image: url(../images/arr_white.gif);
}

ul.pureCssMenu a { font-size: 1.22rem; }

/* =============================================
   10. FOOTER
   ============================================= */

#footercontainer {
    flex-shrink: 0;
    width: 100%;
    border-top: 1px solid #000;
    background: var(--color-footer-bg);
    padding: 1.5rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    gap: 2rem;
}

.footer-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-icons img {
    width: 24px;
    height: 24px;
    transition: opacity 0.3s;
}

.footer-icons a:hover img { opacity: 0.7; }

.footer-search form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.footer-search input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 200px;
}

.footer-search input[type="image"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

footer strong { font-size: 1.077em; color: #aaa; }
footer p      { font-size: 0.9em; }

footer a:link,
footer a:visited { color: #999; text-decoration: underline; }
footer a:hover   { color: #fff; text-decoration: underline; }

footer { font-size: 0.8125em; }

#smallprint {
    margin-top: 20px;
    line-height: 1.4;
    text-align: center;
    color: #999;
    font-size: 0.923em;
}

#smallprint a:link,
#smallprint a:visited { color: #999; text-decoration: none; }
#smallprint a:hover   { color: #999; text-decoration: underline; }


/* =============================================
   11. STORY-SPECIFIC STYLES
   ============================================= */

.story-content {
    max-width: 660px;
    margin: 40px auto;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.8;
    color: #222;
}

.story-content h3 {
    margin: 60px 0 30px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #900;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.3rem;
}

.story-content p {
    margin-bottom: 20px;
    text-align: justify;
    hyphens: none;
}

.story-title {
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.copyright-notice {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-style: italic;
    font-size: 0.95rem;
    text-align: center;
    color: #666;
}


/* =============================================
   12. GLIGHTBOX
   ============================================= */

.glightbox-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.95);
}

.gslide-description {
    font-size: 0.95rem;
    line-height: 1.5;
}

.glightbox-container img {
    max-width: none;
    height: auto;
}

.glightbox-container *,
.glightbox-container *::before,
.glightbox-container *::after {
    box-sizing: content-box;
}


/* =============================================
   13. UTILITIES
   ============================================= */

.breaker    { clear: both; }
.floatleft  { float: left; }
.floatright { float: right; }

#myBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 200;
    border: none;
    outline: none;
    background-color: var(--color-primary);
    color: white;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-family: var(--font-condensed);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: background 0.3s ease, opacity 0.3s ease;
    opacity: 0.85;
}

#myBtn:hover {
    background-color: var(--color-primary-dark);
    opacity: 1;
}



/* =============================================
   14. MEDIA QUERIES
   ============================================= */

/* Tablet landscape — 1024px and below */
@media (max-width: 1024px) {
    #maincontent,
    .maincontent { width: 93.75%; }
}

/* Tablet portrait — 768px and below */
@media (max-width: 768px) {
    #maincontent,
    .maincontent { width: 93.75%; }

    .footer-content {
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
    }

    .footer-icons { justify-content: center; }

    .twocolumns { column-count: 1; }
}

/* Mobile — 480px and below */
@media (max-width: 480px) {
    h1 { font-size: 2.875rem; }

    #maincontent,
    .maincontent {
        width: 93.75%;
        padding: 1em 10px;
    }

    .footer-search input[type="text"] { min-width: 150px; }

    .story-content p { text-align: left; }

    /* Collapse all span columns to full width */
    [class*="span_"] {
        width: 100%;
        margin-left: 0;
    }
}

/* =============
   Search styling
   ==========*/

.gcse-search {
    width: 350px !important;
    margin-top: 10px;
}

.question::before { content: "Q: "; font-weight: bold; }
.answer::before { content: "A: "; font-weight: bold; }

.closing {
    font-style: italic;
    border-top: 1px solid #ccc;
    margin-top: 1em;
    padding-top: 1em;
	margin-bottom: 3em;
}


