/* ==============================================
   FINAL GLOBAL STYLESHEET - V8 (DEFINITIVE)
   - The companion to the inline CSS. Fixes all flicker and layout shift.
   ============================================== */


@font-face {
  font-family: 'Mulish';
  src: url('fonts/Mulish/static/Mulish-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Mulish';
  src: url('fonts/Mulish/static/Mulish-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}


/* ----------------------------
   1. Root Variables & Global Reset
   ---------------------------- */
:root {
/*    --font-heading: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/
/*    --font-heading: 'Lora', serif;*/
    --font-heading: 'Mulish', sans-serif;
    --font-body: 'Mulish', sans-serif;
/*    --font-body: 'Nunito Sans', sans-serif;*/

/*    --font-heading: 'Playfair Display', Georgia, serif;*/
/*    --font-body: 'Lato', 'Helvetica Neue', sans-serif;*/
    
    --accent-color: #ff9800;
    --accent-color-hover: #C0A062;
    --dark-bg: #2c3e50;
    --light-bg: #f9f9f9;
    --text-light: #fff;
    --text-dark: #333;
    --text-muted: #bbb;
    --border-color: #eee;
    --container-width: 1800px;
    --base-spacing: 1rem;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --transition-speed: 0.3s ease;
    --border-color: #C0A062;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* ADD THIS LINE to disable the tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
}

/* ----------------------------
   2. Body & Main Layout
   ---------------------------- */

/* This OVERRIDES the inherited font for headings only */
main h1, main h2, main h3, main h4, main h5, main h6 {
    font-family: var(--font-heading);
}

body {
    font-family: var(--font-body);
/*    background-color: var(--light-bg);*/
    background-color: var(--dark-bg); /* CHANGE TO --dark-bg TO MATCH THE FOOTER */
    color: var(--text-dark);
    line-height: 1.6;
    
    /* ADD THIS for the sticky footer and full-width sections */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: var(--dark-bg);
    color: var(--text-light);
    padding: var(--base-spacing) calc(var(--base-spacing) * 2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    border-bottom: 5px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensures the header stays on top of other content */
}


main {
/*    width: 95%;*/  /*disable to avoid spaces right and bottom of the page*/
    width: 100%;
    max-width:none;
/*    var(--container-width);*/
/*    margin: calc(var(--base-spacing) * 2) auto;*/ /*disable to avoid spaces left and above of the page*/
    background: var(--text-light);
    padding: calc(var(--base-spacing) * 2);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition-speed);
    
    /* ADD THIS to make it fill empty space on short pages */
    flex-grow: 1;
}

main:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* --- New Class for Inline Text Links --- */
a.text-link {
    /* Use a color that is darker and more subtle than the main accent color */
    color: #005fa3; /* A professional, deep blue */
    
    /* Underline the link to make it clear it's clickable within the text */
    text-decoration: underline;
    text-decoration-thickness: 1px; /* A thinner underline looks more refined */
    text-underline-offset: 3px;   /* Adds a little space between the text and the line */
    
    font-weight: 600; /* Make it slightly bolder than the surrounding text */
    
    transition: color 0.2s ease-in-out;
}

footer {
    text-align: center;
    padding: calc(var(--base-spacing) * 3);
    background: var(--dark-bg);
    color: var(--text-light);
/*    margin-top: calc(var(--base-spacing) * 2);*/ /*avoid spaces over footer*/
}

/*NOTE:It's Brittle to Future Changes: This is the most significant risk. Imagine six months from now, you decide you want a slightly lighter gray footer. You change the footer's color, but you forget you changed the <body> background. The "white line" at the bottom of the screen will reappear, but this time it will be a dark line, and you'll have to debug the problem all over again. The fix only works as long as the body and footer have the exact same background color.*/

/* ----------------------------
   3. Typography
   ---------------------------- */
header h1, header h2, header h3 {
    color: var(--text-light);
    font-weight: 600;
}
header h1 { font-size: 1.8rem; }
header p { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.25rem; }

main h1, main h2, main h3, main h4, main h5, main h6 {
    color: var(--text-dark);
    margin-bottom: var(--base-spacing);
    line-height: 1.3;
}
main h2 {
    font-size: 1.75rem;
/*    border-bottom: 1px solid var(--border-color);*/
    padding-bottom: calc(var(--base-spacing) * 0.5);
}
main a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
}
main a:hover {
    color: var(--accent-color-hover);
    text-decoration: underline;
}

/* ---------------------------------------------------
   4. NAVIGATION - STABLE, NO LAYOUT SHIFT
   --------------------------------------------------- */

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Base style for all navigation links */
nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    
    /* Remove the default browser outline for a custom look */
    outline: none;
    
    /* Animate color, border, AND the transform for a smooth lift effect */
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* --- HOVER & FOCUS States --- */
/* This rule applies for both mouse hover and keyboard (Tab key) focus */
nav a:hover,
nav a:focus {
    color: var(--accent-color-hover);
    transform: translateY(-2px); /* The "lift" effect you like */
    
    /* A clear outline for accessibility on keyboard navigation */
/*    outline: 2px solid var(--accent-color-hover);*/
    /*outline-offset: 5px;*/ /* Adds a little space between the link and the outline */
    /*border-radius: 2px;*/ /* Soften the corners of the focus outline */
}

/* --- ACTIVE States --- */
/* This applies when a link is being clicked OR it's the current page */
nav a:active,
nav a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* This prevents the hover/focus outline from appearing on the active link, which can look cluttered */
nav a.active:focus {
    outline: none;
}


/* ==============================================
   5. DEFINITIVE GLOBAL SCROLLBAR SETTINGS
   - This version uses high specificity to ensure it works on all pages.
   ============================================== */

/* --- For WebKit-based browsers (Chrome, Safari, Edge) --- */

/* We target the <html> element to increase specificity */
html::-webkit-scrollbar {
  width: 12px;
}

html::-webkit-scrollbar-track {
  background: var(--light-bg); /* Matches your body background */
}

html::-webkit-scrollbar-thumb {
  background-color: #c1c1c1;    /* Default subtle gray color */
  border-radius: 10px;
  border: 3px solid var(--light-bg); /* Creates the inset effect */
}

html::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-color-hover); /* Your site's accent color on hover */
}

/* --- For Firefox --- */

/* This rule is already specific enough */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color-hover) var(--light-bg); /* thumb track */
}



/* =========================================================
   6. Styles for the Back to Top button.
   ========================================================= */

#back-to-top-btn {
    /* --- Positioning --- */
    position: fixed; /* Stays in the same spot on the screen */
    bottom: 30px;    /* 30px from the bottom */
    right: 30px;     /* 30px from the right */
    z-index: 1000;   /* Stays on top of other content */
    
    /* --- Appearance --- */
    width: 60px;
    height: 60px;
    background-color: var(--accent-color-hover); /* Your site's golden accent color */
    color: #fff;
    border-radius: 50%; /* Makes it a perfect circle */
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* A nice, subtle shadow */
    
    /* --- Center the icon inside --- */
    display: flex;
    align-items: center;
    justify-content: center;
/*    font-size: 2.2rem;*/
    
    
    /* Make the ">" symbol larger */
    font-size: 1.8rem;
    /* Make it bolder */
    font-weight: bold;
    /* Rotate it -90 degrees to point upwards */
    transform: rotate(-90deg);
    
    
    
    /* --- Initial State & Animation --- */
    /* It starts out invisible and slightly lower */
    opacity: 0;
    visibility: hidden;
/*    transform: translateY(15px);*/
    
    /* Smooth transition for appearing/disappearing */
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* This is the class your JavaScript adds to make the button visible */
/*#back-to-top-btn.visible {*/
/*    opacity: 1;*/
/*    visibility: visible;*/
    /*transform: translateY(0);*/ /* Moves it up to its final position */
/*}*/

/* A subtle hover effect */
/*#back-to-top-btn:hover {*/
    /*background-color: #a78850;*/ /* A slightly darker shade of your accent color */
    /*transform: translateY(-3px);*/ /* Lifts the button slightly on hover */
/*}*/


/* In style.css */

/* The visible state no longer needs a transform */
#back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: rotate(-90deg) translateY(0);
}

/* The hover effect no longer uses a transform */
#back-to-top-btn:hover {
    background-color: #a78850;
}



/* =========================================================
   This moves the button up when the footer is visible.
   ========================================================= */
#back-to-top-btn.at-bottom {
    /* Push the button up by 80px */
    transform: translateY(-120px) rotate(-90deg);
}
/* ========================================================= */

/* ==============================================
   7. Styles for the new PDF lightbox.
   ============================================== */

/* --- PDF Lightbox Styles --- */

.pdf-lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Class added by JavaScript to show the lightbox */
.pdf-lightbox.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* The iframe that holds the PDF */
.pdf-content {
    width: 90%;
    height: 90%;
    max-width: 1000px; /* Limit the max width on very large screens */
    border: 2px solid #555;
    border-radius: 8px;
}

/* The close button */
.pdf-close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.pdf-close-btn:hover {
    color: #bbb;
}



/* ----------------------------
   8. Responsive Design
   ---------------------------- */
@media (max-width: 768px) {
    :root { --base-spacing: 0.8rem; }
    header { flex-direction: column; align-items: center; text-align: center; }
    nav { gap: var(--base-spacing); margin-top: var(--base-spacing); }
    header h1 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
    main { padding: var(--base-spacing); }
    main h2 { font-size: 1.5rem; }
    nav a { padding: 0.5rem; flex-grow: 1; text-align: center; }
}
