/* ============================================================================
   Base Styles
   ============================================================================ */

:root {
    --color-primary: #cc0000;
    --color-text: #333;
    --color-text-light: #666;
    --color-text-lighter: #999;
    --color-bg: #fff;
    --color-border: #ddd;
    --color-shadow: rgba(0, 0, 0, 0.4);
    
    --max-width-content: 1200px;
    --max-width-wrapper: 1500px;
    
    --header-height: 120px;
    --header-height-reduced: 42px;
    --header-height-mobile: 60px;
    
    --transition-speed: 0.5s;
}

* {
    box-sizing: border-box;
}

body { 
    background: var(--color-bg) url(img/bodybg.png) repeat-x 0 0;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
}

/* ============================================================================
   Layout Blocks
   ============================================================================ */

.wrapper {
    box-shadow: 0 20px 40px -20px var(--color-shadow);
}

.wrapper,
#topmenubox .m_inner {
    width: 90%;
    max-width: var(--max-width-wrapper);
    margin: 0 auto;
}

.topspacer {
    padding-top: var(--header-height);
    width: 100%;
}

/* ============================================================================
   Header Styles
   ============================================================================ */

.topheader {
    position: relative;
    padding-bottom: 12%;
    width: 100%;
    background: var(--color-bg) url(img/background_01.jpg) no-repeat fixed center top;
    background-size: cover;
}

.topheader p {
    position: absolute;
    bottom: 10%;
    width: 90%;
    padding: 0 5%;
    font-size: 1.6em;
    line-height: 1.1;
    color: var(--color-bg);
    text-align: center;
    text-shadow: 0 2px 30px #000;
}

/* ============================================================================
   Frontpage Parallax
   ============================================================================ */

#topparallax {
    width: 100%;
    position: relative;
    padding-top: 60%;
    background: #479cd4 url(img/parallaxheader.jpg) no-repeat center 0;
    background-size: cover;
}

#topparallax .ptext {
    position: absolute;
    bottom: 20%;
    width: 90%;
    padding: 3% 5%;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--color-bg);
    border-bottom: 1px solid var(--color-bg);
}

#topparallax .ptext * {
    color: var(--color-bg) !important;
    text-shadow: 0 2px 30px #000;
}

#topparallax a.topdown img {
    width: 100px;
    max-width: 100%;
    height: auto;
    margin-top: 20px;
}

/* ============================================================================
   Content Area
   ============================================================================ */

.contentbox {
    background: var(--color-bg);
    padding: 20px 4%;
}

.container {
    max-width: var(--max-width-content);
    width: 100%;
    margin: 0 auto;
    padding-top: 30px;
}

/* ============================================================================
   Grid Layout
   ============================================================================ */

.content {
    width: 73%;
    float: left;
    margin-left: 0;
}

.usegrid3 .content.contentnarrow {
    width: 66%;
}

.mainbox .contentwide {
    width: 100%;
    margin: 0;
}

#rightbox {
    width: 25%;
    float: right;
    border-left: 1px solid var(--color-border);
}

.usegrid3 #rightbox {
    width: 30%;
}

#rightbox .inner {
    margin: 0 3% 3px 3%;
    font-size: 0.9em;
    line-height: 1.35;
}

#rightbox .inner img {
    max-width: 100%;
    height: auto !important;
}

.clearcontent {
    height: 60px;
    clear: both;
}

/* ============================================================================
   Footer
   ============================================================================ */

.footerbox {
    min-height: 80px;
    font-size: 13px;
    color: var(--color-text-lighter);
    width: 100%;
    background: var(--color-bg);
    padding: 10px 0;
}

.footerbox .left {
    width: 25%;
    float: left;
}

.footerbox .center {
    width: 50%;
    margin: 10px 0 0;
    float: left;
    text-align: center;
}

#gototopswitch {
    float: right;
    margin: 10px 10px 0 0;
    transition: opacity var(--transition-speed);
}

#gototopswitch:hover {
    opacity: 0.7;
}

/* ============================================================================
   Top Menu Box
   ============================================================================ */

#topmenubox {
    width: 100%;
    height: var(--header-height);
    position: fixed;
    z-index: 5000;
    top: 0;
    left: 0;
    transition: height var(--transition-speed);
}

#topmenubox .m_inner {
    position: relative;
    height: 100%;
    background: var(--color-bg);
}

#topmenubox a.logo img {
    max-height: 100%;
    max-width: 100%;
    position: absolute;
    left: 2%;
    bottom: 3px;
}

#topmenubox.reduced {
    height: var(--header-height-reduced);
}

/* Search Box */
li.search_box_li a {
    border: none !important;
}

.toggleMobileMenu {
    display: none;
}

/* ============================================================================
   Breadcrumbs
   ============================================================================ */

.breadcrumbs {
    height: 30px;
    line-height: 1;
    margin: 0;
    padding: 3px 0;
    clear: both;
}

.innerbc {
    font-size: 14px;
    margin: 10px 0 0 25%;
}

.breadcrumbs .innerbc span {
    background: transparent url(img/bclink.gif) no-repeat;
    padding: 6px 2px 0 12px;
    font-weight: normal;
}

.breadcrumbs .innerbc a {
    padding: 1px;
    border-bottom: 1px dotted #505567;
    text-decoration: none;
    transition: border var(--transition-speed);
}

.breadcrumbs .innerbc a:hover {
    border-bottom: 1px solid #505567;
}

.breadcrumbs .innerbc .menu-current a {
    color: #000;
}

.frontpage .breadcrumbs {
    display: none;
}

/* Prev/Next Navigation */
#aprevnext {
    display: block;
    width: 90px;
    height: 27px;
    float: right;
}

#aprevnext a {
    display: block;
    width: 40px;
    height: 27px;
    float: right;
    opacity: 0.5;
    border: none;
    transition: opacity var(--transition-speed);
}

#aprevnext a.aprev {
    background: url(img/prev.png) no-repeat center top;
}

#aprevnext a.anext {
    background: url(img/next.png) no-repeat center top;
}

#aprevnext a:hover {
    opacity: 0.8;
}

/* ============================================================================
   Main Navigation
   ============================================================================ */

#nav {
    position: absolute;
    right: 0;
    bottom: 0;
    border: 0;
    padding: 0;
}

#nav ul,
#nav2 ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: auto;
    position: relative;
    z-index: 800;
    background: #eee;
}

#nav ul li,
#nav2 ul li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Root Level Links */
#nav ul li {
    float: left;
    color: #aaa;
    text-align: left;
    font-weight: normal;
}

#nav ul li a {
    display: block;
    font-size: 16px;
    border-right: 1px solid var(--color-border);
    color: var(--color-text-light);
    text-decoration: none;
    background-repeat: no-repeat;
    transition: all var(--transition-speed);
}

#nav ul li a span {
    display: block;
    padding: 11px 12px 10px 12px;
}

/* Root Level Hover */
#nav ul li a:hover,
#nav li a:focus,
#nav li a:active,
#nav ul li a.active,
#nav a.menu-current,
#nav a.menu-parent {
    color: var(--color-bg);
    background: var(--color-primary);
}

/* Current Page */
#nav a.menu-current {
    font-weight: bold;
}

/* ============================================================================
   Dropdown Menu (2nd Level)
   ============================================================================ */

#nav li ul {
    position: absolute;
    right: -10000px;
    width: 200px;
    opacity: 0;
    text-transform: none;
    border-bottom: 1px solid var(--color-bg);
    border-left: 1px solid var(--color-bg);
    font-size: 13px;
    background: var(--color-border) url(img/glitzi.png) no-repeat right 0;
    box-shadow: 0 10px 10px -4px var(--color-shadow);
    transition: opacity var(--transition-speed);
}

#nav li ul li {
    text-align: left;
    font-weight: normal;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

#nav li ul li a {
    width: 200px;
    text-align: left;
    height: auto;
    text-shadow: none;
    margin: 0;
    padding: 0;
    color: var(--color-text);
    border-top: 1px solid var(--color-bg);
    border-right: none;
    font-weight: normal;
    font-size: 14px;
    background: none;
}

#nav li ul li a span {
    display: block;
    padding: 8px;
}

/* 2nd Level Hover */
#nav li ul a:hover,
#nav li ul a.menu-current {
    text-shadow: 1px 2px 4px #000;
}

#nav li ul a.menu-expand {
    background: transparent url(img/arr-right.png) no-repeat right 5px;
}

#nav li ul a.menu-parent {
    background: var(--color-primary) url(img/arr-right.png) no-repeat right 5px;
}

/* Show/Hide Logic */
#nav li:hover ul,
#nav li a:focus ul,
#nav li.tabselected ul {
    right: -20px;
    opacity: 1;
}

#nav li ul ul {
    margin-left: -10000px;
    opacity: 0;
}

#nav li:hover ul ul,
#nav li.subMenu ul ul {
    margin-left: -10000px;
    opacity: 0;
}

#nav li:hover > ul,
#nav li li:hover > ul {
    opacity: 1;
    margin-left: 0;
    z-index: 1000;
}

#nav ul li ul li:hover > ul {
    margin-left: -30%;
    opacity: 0.9;
}

/* ============================================================================
   3rd Level Dropdown
   ============================================================================ */

#nav li ul li ul {
    width: 180px;
    margin: 10px 0 0 -40%;
    z-index: 2000;
}

#nav li ul li ul li {
    width: 100%;
}

#nav li ul li ul li a {
    width: 100%;
}

#nav li {
    position: relative;
}

#nav ul ul ul {
    position: absolute;
    top: 1px;
    left: 100%;
}

#nav li:hover {
    z-index: 1000;
    white-space: normal;
}

/* ============================================================================
   Footer Menu
   ============================================================================ */

#footer_menu {
    padding-bottom: 10px;
}

#footer_menu a {
    display: inline-block;
    padding: 2px 10px;
    border-right: 1px solid var(--color-text-lighter);
    transition: opacity var(--transition-speed);
}

#footer_menu a:first-child {
    border-left: 1px solid var(--color-text-lighter);
}

#footer_menu a.menu-current {
    font-weight: bold;
}

#footer_menu a:hover {
    opacity: 0.7;
}

/* ============================================================================
   Cookie Permission Notice
   ============================================================================ */

#cookie_permission {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9950;
    width: 200px;
    padding: 10px;
    background: #555;
    text-align: center;
    font-size: 0.9em;
    line-height: 1.2;
    border-radius: 0 0 0 25px;
    box-shadow: 0 10px 50px 0 rgba(0, 0, 0, 0.2);
}

#cookie_permission p,
#cookie_permission a {
    color: var(--color-bg);
}

#cookie_permission a.cookieaccepted {
    color: #000;
    background: #eeb300;
    display: block;
    padding: 5px;
    border-radius: 15px;
    border: 1px solid var(--color-bg);
    font-weight: bold;
    transition: transform var(--transition-speed);
}

#cookie_permission a.cookieaccepted:hover {
    transform: scale(1.05);
}

/* ============================================================================
   Color Picker (Admin Feature)
   ============================================================================ */

#colorpickericon {
    display: block;
    width: 24px;
    height: 24px;
    background: url(img/colorpicker.png) no-repeat;
    z-index: 5000;
    position: absolute;
    top: 230px;
    right: 0;
    cursor: pointer;
}

#colorpicker {
    display: none;
    width: 90px;
    background: var(--color-border);
    position: absolute;
    top: 100px;
    right: 0;
    z-index: 5000;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 20px 50px 0 rgba(0, 0, 0, 0.1);
}

.pickerfield {
    width: 100%;
    height: 40px;
    float: left;
}

.pickerfield input[type="color"] {
    width: 100%;
    height: 20px;
    padding: 0;
    border: 0;
    cursor: pointer;
}

.pickerfield input[type="text"] {
    width: 90%;
    height: 20px;
    padding: 1px 3%;
    border: 1px solid var(--color-text-lighter);
    cursor: text;
}

a.colpick-button {
    display: block;
    clear: both;
    width: 80%;
    margin: 10px auto;
    padding: 3px;
    background: rgba(255, 255, 255, 0.2);
    text-align: center;
    border: 1px solid #666;
    border-radius: 15px;
    cursor: pointer;
    transition: background var(--transition-speed);
}

a.colpick-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

#colorpicker-info {
    display: none;
    position: absolute;
    width: 160px;
    padding: 10px;
    top: 0;
    left: -180px;
    background: #eee;
    box-shadow: 0 20px 50px 0 rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Login Box
   ============================================================================ */

#showlogin {
    display: block;
    float: left;
    position: relative;
    width: 30px;
    text-align: right;
    margin: 10px 6px 0 0;
}

#login-box {
    position: absolute;
    width: 250px;
    left: 10px;
    top: -10px;
    padding: 5px;
    font-size: 11px;
    z-index: 2000;
    background: #eee;
    box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.2);
}

#login-box td {
    vertical-align: top;
}

#login-box .loginsubmit {
    border: 0;
}

#login-box .inputfield {
    width: 100px;
    border: 1px solid #c9e8f9;
    padding: 1px;
    line-height: 1em;
}

/* Mobile Menu (Hidden on Desktop) */
#nav2 {
    width: 250px;
    height: auto;
    position: absolute;
    left: -300px;
}

.showonmobiles {
    display: none;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Large Screens */
@media screen and (min-width: 1200px) {
    /* Additional styles for large screens if needed */
}

/* Medium-Large Screens */
@media screen and (max-width: 1500px) {
    .wrapper,
    .mainbox,
    #topmenubox .m_inner {
        width: 100%;
        margin: 0;
    }
}

/* Tablets and Small Desktops */
@media screen and (max-width: 1024px) {
    .container {
        padding-top: 2px;
    }
    
    .mainbox .contentwide {
        width: 96%;
        margin: 0 0 0 2%;
    }
    
    #rightbox {
        width: 33%;
    }
    
    #rightbox .inner {
        margin: 0 5%;
    }
    
    /* Mobile Menu Toggle */
    #topmenubox {
        height: var(--header-height-mobile) !important;
    }
    
    #topmenubox #nav {
        display: none;
    }
    
    .toggleMobileMenu {
        display: block;
        float: right;
        width: 20px;
        height: 50px;
        background: url(img/menuswitch.png) no-repeat top right;
        margin: 10px 4% 0 0;
        cursor: pointer;
        border: none;
        transition: opacity var(--transition-speed);
    }
    
    .toggleMobileMenu:hover {
        opacity: 0.7;
    }
    
    .topspacer {
        padding-top: var(--header-height-mobile);
    }
    
    #topparallax {
        padding-top: 50%;
    }
    
    /* Mobile Navigation */
    #nav2 {
        width: 250px;
        height: auto;
        position: fixed;
        left: -300px;
        top: var(--header-height-mobile);
        z-index: 2000;
        transition: left var(--transition-speed);
        background: #eee url(img/glitzi.png) no-repeat right 0;
        box-shadow: 0 10px 10px 0 var(--color-shadow);
        max-height: calc(100vh - var(--header-height-mobile));
        overflow-y: auto;
    }
    
    #nav2 li {
        width: 250px;
        padding: 0;
    }
    
    #nav2 li a {
        display: block;
        padding: 12px 0 12px 20px;
        font-size: 18px;
        color: #000;
        text-decoration: none;
        border-bottom: 1px solid var(--color-bg);
        transition: background var(--transition-speed);
    }
    
    #nav2 li a:hover {
        background: rgba(0, 0, 0, 0.05);
    }
    
    #nav2 li li a {
        padding: 10px 0 10px 30px;
        font-size: 16px;
    }
    
    #nav2 li li li a {
        padding: 8px 0 8px 40px;
        font-size: 14px;
    }
    
    #nav2 li li li li a {
        padding: 6px 0 6px 50px;
        font-size: 13px;
    }
    
    #nav2 li ul {
        display: none;
    }
    
    #nav2 li.menu-parent > ul,
    #nav2 li.menu-current > ul,
    #nav2 li.is_opened > ul {
        display: block;
    }
    
    #nav2 li a.menu-expand {
        background: transparent url(img/arr-down.png) no-repeat left center;
    }
    
    #nav2 li a.menu-current {
        color: var(--color-bg);
        text-shadow: 1px 2px 4px #000;
    }
    
    #nav2 ul li a.menu-expand.is_opened,
    #nav2 ul li a.menu-parent {
        font-weight: bold;
        background: var(--color-border) url(img/arr-right.png) no-repeat 2px center;
    }
    
    #nav2close {
        display: none;
        z-index: 1990;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .mobilemenuopen #nav2 {
        left: 0;
    }
    
    .mobilemenuopen #nav2close {
        display: block;
    }
    
    .mobilemenuopen body {
        overflow: hidden;
    }
    
    /* Breadcrumbs for mobile */
    .breadcrumbs {
        width: 100%;
        height: auto;
    }
    
    .innerbc {
        margin: 2px 0 5px 2%;
        width: 96%;
    }
    
    .innerbc span {
        display: block;
        float: left;
        padding: 2px 2px 2px 12px;
        margin: 0 0 5px 0;
    }
    
    .innerbc b {
        display: none;
    }
    
    /* Typography adjustments */
    h1 {
        font-size: 2.2em;
    }
    
    h2 {
        font-size: 1.8em;
    }
    
    h3 {
        font-size: 1.6em;
    }
}

/* Small Tablets and Large Phones */
@media screen and (max-width: 768px) {
    .content {
        width: 96%;
        margin: 0 0 0 2%;
        float: none;
    }
    
    .mainbox,
    .content,
    .contentwide,
    .contentwidenarrow,
    #rightbox,
    .main {
        float: none;
        width: 100% !important;
        border-left: none;
        display: block;
    }
    
    #rightbox {
        border-top: 10px solid var(--color-text-lighter);
        padding-top: 20px;
        border-left: none;
    }
    
    #rightbox .inner {
        margin: 0;
    }
    
    .topheader {
        padding-bottom: 30%;
        background-size: cover;
        background-image: url(img/header-mobile.jpg);
    }
    
    #topparallax {
        padding-top: 80%;
        background-image: url(img/parallaxheader-mobile.jpg);
    }
    
    #topparallax .ptext {
        bottom: 5%;
    }
    
    #topparallax a.topdown {
        display: none;
    }
    
    /* Typography */
    h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.6em;
    }
    
    h3 {
        font-size: 1.4em;
    }
    
    #topparallax p {
        line-height: 1.2;
    }
}

/* Mobile Phones */
@media screen and (max-width: 480px) {
    #topparallax .ptext {
        bottom: 0;
    }
    
    .topheader p {
        font-size: 1.4em;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.6em;
    }
    
    h3 {
        font-size: 1.3em;
    }
    
    .footerbox .left,
    .footerbox .center {
        width: 100%;
        float: none;
        text-align: center;
        margin: 10px 0;
    }
}

/* ============================================================================
   Accessibility Improvements
   ============================================================================ */

/* Skip to content link */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus states */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@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;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    #topmenubox,
    #nav,
    #nav2,
    .toggleMobileMenu,
    #gototopswitch,
    #showlogin,
    #editthis,
    #colorpickericon,
    #colorpicker,
    .breadcrumbs {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}
