/* ==========================================================
   Ashley Lodge No. 279 - shared styles
   Used by every page. Page-specific styles stay in each page.

   QUICK GUIDE - search (Ctrl+F) for these to find what to change:
     body {                  -> page font and plain background colour
     body::before            -> the background PHOTO (lodgo.jpg)
     #flash-page             -> the loading screen
     header { / nav {        -> the dark blue menu bar
     .dropbtn                -> menu buttons;  .dropdown-content = drop-down lists
     .corner-logo            -> logo in the top-left of each page
     .a4-footer              -> the black footer (4 columns)
     .social-icons           -> round Facebook / X / Instagram buttons
     @media (max-width       -> phone / tablet layout

   COLOURS USED (copy these codes to keep the look consistent):
     Navy blue     #121a33      Link blue   #0056b3
     Gold          #DAA520      Page cream  #F8F4E3
     Antique brass #9C7A3C      (picture-frame borders)
     Brass text    #3b2c0a (dark)  /  #6b4f1a (lighter)
   ========================================================== */

/* ---------- Shared layout, menu and loading screen ---------- */

body {
    margin: 0;
    padding: 0;
    font-family: Aptos, 'Segoe UI', 'Roboto', Arial, sans-serif;
    background-color: #f0f0f0;
    font-size: 18px;
}
/* Page background photo. Kept on its own fixed layer (instead of
   background-attachment: fixed) so phones do not redraw or flicker it
   when scrolling or when the address bar hides. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100lvh;
    z-index: -1;
    background: #f0f0f0 url('lodgo.jpg') center / cover no-repeat;
    pointer-events: none;
}

#flash-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, #22315a 0%, #121a33 55%, #0a0f1e 100%);
    z-index: 1000;
    transition: opacity 0.7s ease-in-out, visibility 0.7s;
    opacity: 1;
}

#flash-page.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#flash-page .content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 20px;
    animation: loadIn 0.8s ease-out both;
}

#flash-page .logo {
    width: 170px;
    max-width: 60%;
    height: auto;
    padding: 14px;
    margin-bottom: 26px;
    box-sizing: border-box;
    background-color: #F8F4E3;
    border: 6px groove #9C7A3C;
    border-radius: 16px;
    animation: logoGlow 2.4s ease-in-out infinite;
}

.loading-message {
    margin: 0 0 18px;
    padding: 0;
    color: #f1e7c6;
    font-size: 1.35em;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.flash-footer {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 10px;
    background-color: #000000;
    border-top: 1px solid #333333;
    color: #ffffff;
    font-size: 0.85em;
    text-align: center;
}

.footer-section .social-icons a i {
    transition: color 0.25s ease;
}

.footer-section .social-icons .fa-facebook-f { color: #1877F2; }
.footer-section .social-icons .fa-x-twitter { color: #000000; }
.footer-section .social-icons .fa-instagram { color: #E1306C; }

.footer-section .social-icons a:hover i {
    color: #ffffff;
}

.footer-section .social-icons a:has(.fa-facebook-f):hover { background-color: #1877F2; }
.footer-section .social-icons a:has(.fa-x-twitter):hover { background-color: #000000; }
.footer-section .social-icons a:has(.fa-instagram):hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.flash-footer p {
    margin: 0;
}

@keyframes loadIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes logoGlow {
    0%, 100% { box-shadow: 0 0 14px 2px rgba(218, 165, 32, 0.25); }
    50% { box-shadow: 0 0 30px 8px rgba(218, 165, 32, 0.55); }
}

header {
    background-color: rgba(10, 15, 30, 0.95);
    border-bottom: 3px solid #0056b3;
    padding: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: transparent;
    color: #ffffff;
    text-decoration: none;
    padding: 16px 22px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
}

.dropbtn i.fa-chevron-down {
    font-size: 11px;
    color: #cccccc;
    transition: transform 0.25s ease, color 0.25s ease;
}

.dropdown:hover .dropbtn {
    background-color: #0056b3;
    color: #ffffff;
}

.dropdown:hover .dropbtn i.fa-chevron-down {
    color: #ffffff;
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 100;
    border-top: 3px solid #0056b3;
    border-radius: 0 0 4px 4px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    overflow: hidden;
    animation: menuSlideFade 0.2s ease-in-out forwards;
}

@keyframes menuSlideFade {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.dropdown-content a {
    color: #222222;
    padding: 12px 18px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #f4f7fa;
    color: #0056b3;
    font-weight: 700;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.load-bar {
    width: 280px;
    max-width: 75%;
    height: 10px;
    margin-top: 4px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(218, 165, 32, 0.5);
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.load-bar-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #9C7A3C, #DAA520, #f1d67a, #DAA520, #9C7A3C);
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width 1.2s ease-out;
    animation: barShimmer 1.4s linear infinite;
}

@keyframes barShimmer {
    from { background-position: 200% 0; }
    to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    #flash-page .content,
    #flash-page .logo,
    .load-bar-fill {
        animation: none;
    }

    .load-bar-fill {
        transition: none;
    }
}

/* ---------- Corner logo (identical on every page) ---------- */

.a4-page {
    position: relative;
}

.corner-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: auto;
    z-index: 2;
}

@media (max-width: 900px) {
    .corner-logo {
        position: relative;
        top: 0;
        left: 0;
        display: block;
        margin: 15px auto 0;
    }
}


/* ---------- Footer (same on every page) ---------- */

.a4-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px 32px;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    padding: 28px 20mm 22px;
    background-color: #111111;
    color: #dddddd;
    border-top: 3px solid #DAA520;
    text-align: left;
}

.footer-section h4 {
    display: inline-block;
    margin: 0 0 12px;
    padding-bottom: 4px;
    color: #ffffff;
    font-size: 0.95em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 2px solid #DAA520;
}

.footer-section p,
.footer-section a {
    display: block;
    margin: 6px 0;
    color: #dddddd;
    font-size: 0.85em;
    line-height: 1.5;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: #DAA520;
    text-decoration: underline;
}

.footer-section .social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.footer-section .social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 50%;
    background-color: #ffffff;
    color: #111111;
    font-size: 0.95em;
    text-decoration: none;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.footer-section .social-icons a:hover {
    background-color: #DAA520;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
}

footer {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 10px;
    background-color: #000000;
    color: #aaaaaa;
    font-size: 0.85em;
    text-align: center;
    border-top: 1px solid #333333;
}

footer p {
    margin: 0;
}

@media (max-width: 600px) {
    .a4-footer {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        text-align: center;
    }

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


/* ---------- Pointer cursor on everything clickable ---------- */

a,
button,
summary,
label[for],
[onclick],
.dropbtn,
.dropdown,
.gallery-item,
.close,
.social-icons a {
    cursor: pointer;
}


/* ---------- Skip link (keyboard / screen reader users) ---------- */

.skip-link {
    position: absolute;
    top: -60px;
    left: 10px;
    z-index: 2000;
    padding: 10px 16px;
    background: #DAA520;
    color: #111111;
    font-weight: bold;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ---------- Loading screen safety net ----------
   If the script ever fails to run, hide the loading screen by itself after 8 seconds. */

#flash-page {
    animation: flashSafetyHide 0.4s ease 8s forwards;
}

@keyframes flashSafetyHide {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ==========================================================
   Works on phones, tablets and laptops
   ========================================================== */

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

img,
iframe,
video {
    max-width: 100%;
}

/* The menu button only appears on small screens (added by script.js) */
.nav-toggle {
    display: none;
}

/* Open a dropdown when it has been tapped or chosen with the keyboard */
.dropdown.open .dropdown-content {
    display: block;
}

/* Touch screens have no hover: dropdowns open on tap instead */
@media (hover: none) {
    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown.open .dropdown-content {
        display: block;
    }

    .dropdown:hover .dropbtn {
        background-color: transparent;
    }

    .dropdown.open .dropbtn {
        background-color: #0056b3;
    }
}

/* Tablets and phones: a menu button and a stacked menu */
@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 14px 20px;
        background: transparent;
        border: none;
        color: #ffffff;
        font-family: inherit;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 0.5px;
        cursor: pointer;
    }

    .nav-toggle:focus-visible {
        outline: 3px solid #DAA520;
        outline-offset: -3px;
    }

    header nav {
        display: none;
        flex-direction: column;
        flex-wrap: nowrap;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    header nav.open {
        display: flex;
    }

    .dropdown {
        display: block;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropbtn {
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
        padding: 16px 20px;
    }

    .dropdown:hover .dropbtn {
        background-color: transparent;
    }

    .dropdown.open .dropbtn {
        background-color: #0056b3;
    }

    .dropdown.open .dropbtn i.fa-chevron-down,
    .dropdown:hover .dropbtn i.fa-chevron-down {
        transform: none;
    }

    .dropdown.open .dropbtn i.fa-chevron-down {
        transform: rotate(180deg);
        color: #ffffff;
    }

    .dropdown-content {
        position: static;
        left: auto;
        width: 100%;
        min-width: 0;
        transform: none;
        box-shadow: none;
        border-top: none;
        border-radius: 0;
        background-color: #16203d;
        animation: none;
    }

    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown.open .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding: 14px 28px;
        color: #ffffff;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .dropdown-content a:hover {
        background-color: #0056b3;
        color: #ffffff;
    }
}

/* Phones: a little more breathing room for fingers */
@media (max-width: 600px) {
    body {
        font-size: 18px;
    }

    .footer-section a,
    .footer-section p {
        padding: 4px 0;
    }
}
