:root {
    /** --theme-background-color: #e1dfcd; **/
    --theme-background-color: white;
    --theme-font-family: open-sans-regular, arial, sans-serif;
    --theme-font-size: 18px;
    --theme-font-color: #444;
    --theme-form-element-border: 1px solid #666;
}

html {
    width: 100%;
    padding: 0;
    margin: 0;
/*    overflow-x: hidden; */
}

body {
    background-color: var(--theme-background-color);
    font-family: var(--theme-font-family);
    color: var(--theme-font-color);
    font-size: var(--theme-font-size);
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

#master-container {
    margin: 0;
    padding-left: 5%;
    padding-right: 5%;
}

select, input, textarea, input[type="submit"], button {
    -webkit-appearance:none;
    -moz-appearance: none;
    background-color: var(--theme-background-color);
    border: var(--theme-form-element-border);
    border-radius: 0.3em;
    padding-top: 0.25em;
    padding-bottom: 0.25em;
    padding-left: 0.7em;
    padding-right: 0.7em;
    margin: 0.25em;
    font-family: var(--theme-font-family);
    color: var(--theme-font-color);
    font-size: var(--theme-font-size);
}

.center {
    text-align: center;
}

label {
    margin: 0.25em;
}

textarea {
    height: 100%;
    line-height: 1.3em;
}

input[type="submit"] {
    box-shadow: 1px 1px black;
}

select, button, input[type="submit"] {
    /* box-shadow: 1px 1px black; */
}

:is(input, select, textarea):focus {
    outline: 2px solid #ddd;
    outline-offset: 0px;
}

input:focus::placeholder {
  color: transparent;
}

:is(button, select, input[type="submit"]):hover {
    box-shadow: 1px 1px black;
    /*  background-color: #eee; */
}

select {
  background-repeat: no-repeat;
  background-position-x: 100%;
  background-position-y: 50%;
  background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  white-space: nowrap;
  padding-right: 2em;
}

.noscroll {
    overflow: hidden;
    height: 100%;
    /*filter: blur(4px);*/
}

#mobile-nav-container {
    position: fixed;
    height: 100%;
    left: 0;
    top: 0;
    height: 100%;
    width: 400px; /* Default width for screens wider than 450px */
    background-color: rgba(255, 255, 255, 0.96); /* Semi-transparent background color */
    z-index: 1; /* Place the overlay above other content */
    overflow-y: auto; /* Enable vertical scrolling if content exceeds height */
}

#mobile-nav {
    z-index: 6; /* Higher value to ensure it's on top */
    display: flex;
    flex-direction: column; /* Stack items vertically */
    font-size: 1em;
    font-weight: bold;
    padding-top: 4.5em;
}

.mobile-nav-item {
    flex: 1;
    padding-left: 1.5em;
    padding-top: 0.7em;
    padding-bottom: 0.7em;
    border-top: 1px dotted #bbb;
}

.expandable {
    padding-left: 1.5em;
    /*background-image: url("/static/img/hamburger_menu_icon.png");*/
    background-size: 0.7em 0.6em;
    background-position: 1.3em 1.1em;
    background-repeat: no-repeat; /* Prevent background image from repeating */
}

.expanded {
}

.mobile-nav-subitem {
    flex: 1;
    padding-left: 3.0em;
    padding-top: 0.7em;
    padding-bottom: 0.7em;
    border-top: 1px dotted #bbb;
}

.mobile-nav-link:link, .mobile-nav-link:visited {
    color: #444;
    text-decoration: none;

}

.mobile-nav-link:hover {
    background-color: #efefef;
}

#mobile-nav-close {
    position: absolute;
    z-index: 5; /* Higher value to ensure it's on top */
    top: 0; /* Adjust as needed */
    left: 0; /* Adjust as needed */
    height: 1.5em;
    width: 100%;
    background-color: transparent;
}

#mobile-nav-close-icon {
    height: 100%;
    padding: 1.6em;
    float: right;
    border-radius: 0.4em;
}

.hidden {
    display: none;
}

#urlDisplay {
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: #333;
    color: #eee;
    font-size: 0.65em;
    padding-left: 4px;
    padding-right: 7px;
    padding-bottom: 3px;
    padding-top: 3px;
    display: block;
    border-top-right-radius: 0.6em; /* Optional for rounded corners */
    display: none;
}

@media (max-width: 450px) {
    #mobile-nav-container {
        width: 100%; /* Full width for screens narrower than 450px */
    }
}

header {
    /**background: url("/static/img/header_bg.jpg") no-repeat center;
    background-size: 820px;
    background-position: center -11px; **/
    width: 100%;
    padding-bottom: 2em;
}

#header-topbar {
    width: 100%;
    height: 1.4em;
    background-color: #1d2327;
    background-color: transparent;
    /*border-radius: 0 0 0.2em 0.2em;*/
}


#mobile-nav-icon {
    width: 25px;
    margin-top: 3px;
    padding: 8px;
    border: 0px solid black;
    border-radius: 0.5em;
    display: none;
}

#logo {
    width: 220px;
    height: 230px;
}

#header-social-links, #header-subscribe-newsletter, #header-search, #header-middle-left {
    padding-right: 5%;
    display: flex;
    align-items: center;
    justify-content: right;
    white-space: nowrap; /* Prevent text from breaking into multiple lines */
    height: 2em;
}


#header-middle-logo {
    margin: 0 auto;
}

#header-middle-left {
    justify-content: left;
    margin: 0;
    padding: 0;
}

#header-middle-right {
    justify-content: right;
    margin: 0;
    padding: 0;
}

#subscribe-to-newsletter-form {
}

.header-text {
    font-size: 0.8em;
    font-weight: bold;
    margin-right: 0.5em;
    margin-left: 0.1em;
    margin-top: 0.1em;
}

#header-middle-right input {
        font-size: 0.7em;
}

#header-middle-right input[type="submit"]:hover {
    background-color: black;
    color: white;
    box-shadow: 0px 0px black;
    cursor: pointer;
}

#header-middle-left {
}

.header-social-link {
    display: inline-block; /* Make links behave like blocks */
    box-sizing: border-box; /* Include padding and border in the element's total width */
    line-height: 1px;
    text-decoration: none; /* Remove underlines from links */
    border: 1px solid transparent; /* Initially, a transparent border */
    margin-right: 0.05em;
    margin-left: 0.05em;
}

.header-social-link:hover {
    border: 1px solid #444;
    border-radius: 0.3em;
}

.header-social-icon {
    width: 1.4em;
    margin-right: 0.2em;
    margin-left: 0.2em;
    padding-top: 0.2em;
    padding-bottom: 0.2em;
}

#header-middle-logo {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: top;     /* Center vertically */
    margin-top: -15px;
    padding-top: 15px;
}

#header-slogan {
    text-align: center;
    font-family: b72;
    font-size: 1.9em;
    padding-bottom: 0.5em;
}

#header-nav {
    font-size: 0.8em;
    line-height: 2.5em;
    text-align: center;
    padding-top: 0.8em;
    padding-bottom: 0.8em;
    background-color: #ffffff; /* Adjust as needed */
    z-index: 2; /* Place the overlay above other content */
}

.header-nav-separator {
    width: 100%;
    height: 1px;
    background-color: #bbb;
    margin: 0 auto; /* Center the body and split remaining space as margin */
    margin-top: 5px;
    margin-bottom: 5px;
    box-sizing: border-box; /* Include padding and border in the element's total width */
}

/* Unvisited link */
.header-nav-link:link, .header-nav-link-active {
    color: var(--theme-font-color);
    text-decoration: none;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 0.2em;
    padding-bottom: 0.22em;
    border-radius: 0.4em;
}

/* Visited link */
.header-nav-link:visited {
    color: var(--theme-font-color);
    text-decoration: none;
}

/* Hover state */
.header-nav-link:hover {
    background-color: #e9e9e9;
}

/* Active state */
.header-nav-link:active {
    color: #fff;
}

/* Focus state */
.header-nav-link:focus {
}

.header-nav-link-active {
    pointer-events: none;
    cursor: default;
    background-color: #444;
    color: #fff;
}

#middle-container {
    width: 100%;
    display: flex;
}

#main-content {
    flex: 1;
    flex: 0 0 70%;
    padding-bottom: 0;
    padding-right: 2.5%;
    line-height: 1.6em;
}

/**** ARTICLES GRID ****/

.grid-view-container {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: -0.6em;
    margin-left: -0.6em;
    margin-right: -0.6em;
    margin-bottom: 1em;
}

.grid-view-item {
    --items-per-grid-row: 3;
    font-size: 0.9em;
    width: calc(100% / var(--items-per-grid-row) - 1.2em - 2px);
    padding: 0.6em;
    border: 1px solid white;
    border-radius: 0.5em;
    line-height: 1.6em;
    cursor: pointer;
}

.grid-view-item:hover {
    border: 1px solid #bbb;
    background-color: #fafafa;
}

.grid-view-img {
    width: 100%;
    height: 10em;
    border-radius: 0.5em;
    object-fit: cover;
}

.read_more_link {
    color: var(--theme-font-color);
    text-decoration underline;
    font-weight: bold;
}

.grid-view-item-title, .sidebar-item-title {
    font-family: "open-sans-condensed-medium", Arial Narrow, sans-serif;
    font-size: 1.2em;
    letter-spacing: 0.03em;
    font-weight: bold;
}

article {
    padding: 0;
    margin 0;
}

h1 {
    font-family: "open-sans-condensed-medium";
    letter-spacing: 0.02em;
    font-size: 1.9em;
    line-height: 1.3em;
    margin-top: 0;
    margin-bottom: 1.2em;
    margin-bottom: 0;
}

#article-meta-info {
    margin: 0;
    padding: 0;
}

#article-date {
    display: inline-block;
    font-size: 0.9em;
    color: #999;
}

#article-tags {
    display: inline-block;
    color: #444;
    font-size: 0.75em;
    margin-left: 10px;
}

.grid-view-link {
    text-decoration: none;
    color: var(--theme-font-color);
}

.article-tag:link, .article-tag:visited {
    text-decoration: underline;
    color: #444;
}

.article-tag:hover {
    text-decoration: none;
}

.content-img-left {
    width: 55%;
    float: left;
    margin-right: 30px;
    margin-top: 25px;
    margin-bottom: 15px;
    border-radius: 0.5em;
}

.content-img-right {
    width: 55%;
    float: right;
    margin-left: 30px;
    margin-top: 25px;
    margin-bottom: 15px;
    border-radius: 0.5em;
}

#sidebar-container {
    flex: 1; /** Take remaining width next to main-content **/
    padding-top: 0em;
 /**   display: none; **/
}

#sidebar {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1em;
    margin-top: -0.6em;
}

.sidebar-item, .sidebar-item-hover {
    --items-per-sidebar-row: 1;
    font-size: 0.9em;
    width: calc(100% / var(--items-per-sidebar-row) - 1.2em - 2px);
    padding: 0.6em;
    padding-bottom: 0.4em;
    border-radius: 0.5em;
    border: 1px solid white;
    position: relative;
}

.sidebar-item-hover:hover {
    border: 1px solid #bbb;
    background-color: #fafafa;
}

.sidebar-img {
    width: 100%;
    border-radius: 0.5em;
}

.sidebar-item-title {
    margin-top: 0px;
}

.sponsored-label {
    position: absolute;
    top: calc(1.3em);
    right: 1.3em;
    background-color: rgba(255, 255, 255, 0.5); /* Semi-transparent black */
    color: #444;
    padding: 0.6em;
    padding-top: 0.3em;
    padding-bottom: 0.3em;
    margin: 0;
    font-size: 0.8em;
    border-radius: 0.6em; /* Optional for rounded corners */
    z-index: 1; /* Place the overlay above other content */
}


.loader {
  border: 3px solid #ddd; /* Light grey */
  border-top: 3px solid #666; /* Blue */
  border-radius: 50%;
  height: 1em;
  width: 1em;
  margin-left: 0.35em;
  margin-right: 0.35em;
  display: inline-block;
  animation: spinloader 2s linear infinite;
  vertical-align: middle;
}

@keyframes spinloader {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@font-face {
    font-family: 'open-sans-regular';
    src: url('/static/fonts/open_sans_regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'open-sans-condensed-medium';
    src: url('/static/fonts/open_sans_condensed_medium.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/** For large screens (1280+ px width) add padding to the body **/
@media only screen and (min-width: 1280px) {
    #master-container {
      width: 1280px;
      box-sizing: border-box; /* Include padding and border in the element's total width */
      margin: 0 auto;
    }
}

@media only screen and (max-width: 1280px) {
    #master-container {
      margin: 0;
      padding-right: 5%;
    }
    .grid-view-item {
        --items-per-grid-row: 3;
    }
    .grid-view-img {
        height: 9em;
    }
}

@media only screen and (max-width: 1024px) {
    #header-middle-logo {
        margin-top: 65px;
    }
}

@media only screen and (max-width: 950px) {
    header {
        padding-bottom: 0.5em;
    }
    #logo {
        width: 220px;
    }
    #middle-container {
        flex-direction: column; /* Stack items vertically */
    }
    #main-content {
        padding-right: 0;
    }
    .sidebar-item-hover {
        --items-per-sidebar-row: 3;
    }
    #sidebar-container {
        padding-top: 1em;
    }
    .sidebar-img {
        float: left;
        width: 30%;
        margin-left: 3%;
    }
    h1 {
        text-align: center;
    }
    h2 {
        font-size: 1.5em;
    }
    #article-meta-info {
        text-align: center;
    }
    #header-slogan {
        display: none;
    }
    #header-nav {
        display: none;
    }
    #header-subscribe-newsletter {
        /*flex-direction: column;
        padding-top: 1em;
        white-space: normal;*/
        height: 2em;
    }
    #subscribe-to-newsletter-form {
        /*display: flex;
        flex-direction: column;*/
    }
    #mobile-nav-icon {
        display: block;
    }
    #header-middle-left {
        position: fixed;
        padding-left: 5%;
        padding-top: 1.4em;
        padding-bottom: 3em;
        left: 0;
        top: 0;
        background-color: white;
        width: 100%;
    }
    #header-middle-right {
        right: 5%;
        position: fixed;
        background-color: white;
    }
    #header-subscribe-newsletter {
        display: none;
    }
}

@media only screen and (max-width: 768px) {
    .content-img-left, .content-img-right {
        display: block;
        width: 100%;
        float: none;
        margin: 0;
        margin-top: 25px;
    }
    .grid-view-item {
        --items-per-grid-row: 2;
    }
    .grid-view-img {
        height: 11em;
    }
}

@media only screen and (max-width: 550px) {
    .grid-view-item {
        --items-per-grid-row: 1;
    }
    .grid-view-img {
        height: 16em;
    }
}
