/* ==========================================================================
Sela Civil Advisory Ltd - Flat Responsive Core Styles (centralized engine)
========================================================================== */

:root {
--primary-color: #1a6c7a;
--dark-blue: #000f2b;
--text-color: #111111;
--white: #ffffff;
}

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

/* Centralized Background Engine - Locks the background photo across the entire site */
html, body {
margin: 0;
padding: 0;
min-height: 100vh;
font-family: 'Open Sans', -apple-system, sans-serif;
color: var(--text-color);
line-height: 1.6;
background: url('../img/sela_header.jpg') no-repeat center center fixed;
background-size: cover;
}

/* Master Structural Box stabilizing layout flow */
.page-container {
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100%;
}

/* --- Centralized Frosted Glass Header & Nav --- */
.site-header {
background-color: rgba(255, 255, 255, 0.75);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-bottom: 2px solid var(--primary-color);
padding: 0.4rem 1rem;
position: sticky;
top: 0;
z-index: 1000;
width: 100%;
flex-shrink: 0;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.nav-container {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}

.logo-box {
display: flex;
align-items: center;
}

.site-logo {
width: 180px;
height: 60px;
display: block;
object-fit: contain;
}

.main-nav ul {
list-style: none;
display: flex;
gap: 1.5rem;
align-items: center;
}

.main-nav a {
color: var(--text-color);
font-size: 0.95rem;
font-weight: 700;
text-decoration: none;
padding: 0.2rem 0;
transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
color: var(--primary-color);
border-bottom: 2px solid var(--primary-color);
}

/* --- Centralized Content Blocks (Glassmorphism Cards) --- */
.main-wrapper {
flex: 1 0 auto;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 2.5rem 1rem;
}

.container {
max-width: 900px;
width: 100%;
margin: 0 auto;
}

/* This targets the inner box on all pages, making them uniform white glass plates */
.main-content {
background: rgba(255, 255, 255, 0.92);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
padding: 2.5rem;
border-radius: 12px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Specific centered override for home and contact card structures */
.hero-wrapper, .contact-wrapper {
flex: 1 0 auto;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 3rem 1rem;
}

.hero-glass-card, .contact-glass-card {
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
padding: 3.5rem 2.5rem;
border-radius: 12px;
width: 100%;
max-width: 650px;
text-align: center;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
border: 1px solid rgba(255, 255, 255, 0.4);
}

/* --- Centralized Frosted Glass Footer Layout --- */
.site-footer {
margin-top: auto;
flex-shrink: 0;
text-align: center;
padding: 1.5rem 1rem 1rem 1rem;
font-size: 0.85rem;
color: #222222;
background: rgba(255, 255, 255, 0.75);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-top: 1px solid rgba(255, 255, 255, 0.3);
width: 100%;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.footer-links {
margin-top: 0.5rem;
margin-bottom: 1.5rem;
font-size: 0.85rem;
}

.footer-links a {
margin: 0 8px;
color: #222222;
text-decoration: none;
font-weight: 700;
}

.footer-links a:hover {
color: var(--primary-color);
}

/* ==========================================================================
MOBILE SCALING ENGINE
========================================================================== */
@media (max-width: 768px) {
.nav-container {
flex-direction: column;
gap: 0.8rem;
text-align: center;
}

.main-nav ul {
flex-wrap: wrap;
justify-content: center;
gap: 0.8rem;
}

.main-nav a {
font-size: 0.85rem;
}
}

/* ==========================================================================
Fact Sheets Dropdown Menu (append to the end of css/custom.css)
========================================================================== */

.main-nav ul li.has-dropdown {
position: relative;
}

/* Scoped selector (not just .dropdown-menu) so this reliably beats the
   site's existing ".main-nav ul { display: flex; }" rule, which would
   otherwise also match this nested <ul> and force it visible. */
.main-nav ul li.has-dropdown .dropdown-menu {
display: none;
position: absolute;
top: 100%;
right: 0;
margin-top: 0.6rem;
min-width: 220px;
list-style: none;
background: rgba(255, 255, 255, 0.97);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-radius: 8px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
border: 1px solid rgba(255, 255, 255, 0.4);
padding: 0.5rem 0;
z-index: 1001;
}

/* Hover-to-open only on real mouse/trackpad devices (desktop) */
@media (hover: hover) and (pointer: fine) {
.main-nav ul li.has-dropdown:hover .dropdown-menu {
display: block;
}
}

/* Tap-to-open (JS-controlled) for touch devices */
.main-nav ul li.has-dropdown.open .dropdown-menu {
display: block;
}

.main-nav ul li.has-dropdown .dropdown-menu li {
width: 100%;
}

.main-nav ul li.has-dropdown .dropdown-menu a {
display: block;
padding: 0.6rem 1.2rem;
white-space: nowrap;
font-weight: 700;
font-size: 0.9rem;
color: var(--text-color);
border-bottom: none !important;
}

.main-nav ul li.has-dropdown .dropdown-menu a:hover,
.main-nav ul li.has-dropdown .dropdown-menu a.active {
color: var(--primary-color);
background: rgba(26, 108, 122, 0.08);
}

@media (max-width: 768px) {
.main-nav ul li.has-dropdown .dropdown-menu {
position: static;
box-shadow: none;
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
border: none;
padding-left: 1rem;
margin-top: 0.3rem;
}
}
