/* ------------------------------------------------------------------
   CS1-theme for Grav: additions to the original template stylesheet.
   Put your own tweaks in css/custom.css (loaded last).
   ------------------------------------------------------------------ */

/* Original template referenced these fonts without loading them; fall back cleanly */
.topbar .top-info,
.topbar .top-link,
.navbar .navbar-nav .nav-link,
.navbar .nav-item .dropdown-menu {
    font-family: "Open Sans", sans-serif;
}

/* Buttons: the template's custom Bootstrap build uses dark text on primary;
   the HTML always overrides it with .text-white, so make that the default. */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus {
    color: var(--cs1-on-primary, #fff);
}

/* Logo image */
.cs1-logo {
    max-height: 56px;
    width: auto;
}
.cs1-logo-footer {
    max-height: 64px;
    align-self: flex-start;
}

/* Newsletter banner (inline gradient in the original HTML) */
.cs1-banner {
    background: rgb(202, 203, 185);
}

/* Ticker: one item at a time, rotated by js/main.js */
.cs1-ticker #note a {
    white-space: nowrap;
}

/* Meta row over the main image */
.cs1-img-meta {
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.cs1-main-title {
    display: block;
    font-size: calc(1.475rem + 2.2vw);
    line-height: 1.15;
}
@media (min-width: 1200px) {
    .cs1-main-title { font-size: 2.9rem; }
}

/* Clamp long titles in cards so carousel cards keep the same height */
.cs1-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Carousels: equal height cards */
.owl-carousel .owl-stage { display: flex; }
.owl-carousel .owl-item { display: flex; }
.owl-carousel .owl-item > .latest-news-item { width: 100%; }

/* Pills that are links (tabs, tags, category filter) */
.populer-news .tab-class .nav-item a.active span,
.cs1-cat-pills a.active span {
    color: var(--cs1-on-primary, #fff) !important;
}
.cs1-cat-pills a.active {
    background: var(--bs-primary) !important;
}
.cs1-sidebar .nav-pills a:hover span,
.cs1-cat-pills a:hover span {
    color: var(--bs-primary) !important;
}

/* Footer */
.cs1-footer-thumb {
    width: 90px;
    height: 90px;
}
.footer a.text-white:hover,
.footer .footer-item-1 a:hover {
    color: var(--bs-primary) !important;
}

/* Article / page body typography */
.cs1-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}
.cs1-content h2,
.cs1-content h3,
.cs1-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.cs1-content p,
.cs1-content ul,
.cs1-content ol {
    margin-bottom: 1.25rem;
}
.cs1-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}
.cs1-content blockquote {
    border-left: 4px solid var(--bs-primary);
    background: var(--bs-light);
    padding: 1.25rem 1.5rem;
    border-radius: 0 10px 10px 0;
    font-size: 1.15rem;
    color: var(--bs-dark);
    margin: 2rem 0;
}
.cs1-content blockquote p:last-child { margin-bottom: 0; }
.cs1-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}
.cs1-content th,
.cs1-content td {
    border: 1px solid #dee2e6;
    padding: .5rem .75rem;
}
.cs1-content pre {
    background: var(--bs-dark);
    color: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
}
.cs1-article .breadcrumb a { color: var(--bs-secondary); }

/* Pagination */
.cs1-pagination .page-link {
    border-radius: 50% !important;
    margin: 0 .25rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-dark);
    border-color: var(--bs-primary);
}
.cs1-pagination .page-item.active .page-link {
    color: var(--cs1-on-primary, #fff);
}

/* Contact form rendered by the Form plugin (the class sits on the <form> itself) */
form.cs1-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
form.cs1-form > *:not(.cs1-field),
form.cs1-form > .cs1-field.cs1-wide,
form.cs1-form > .cs1-field:has(textarea) {
    grid-column: 1 / -1;
}
@media (max-width: 991.98px) {
    form.cs1-form { grid-template-columns: 1fr; }
}
.cs1-form .form-input-wrapper,
.cs1-form .form-data { width: 100%; }
.cs1-form .cs1-form-buttons { margin: 0; }
.cs1-form .form-errors,
.cs1-form .form-errors p { color: var(--bs-danger); font-size: .9rem; margin: .25rem 0 0; }
.cs1-form textarea.form-control { padding-top: 1rem; padding-bottom: 1rem; }

/* Dropdown on touch devices / below xl */
@media (max-width: 1199.98px) {
    .navbar .dropdown-menu {
        background: var(--bs-light) !important;
        border: 0;
    }
}

/* Keep the sticky header from hiding anchor targets */
html { scroll-padding-top: 140px; }

/* Form plugin / Grav notices */
.notices {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #198754;
    background: #e8f5ee;
    color: #0f5132;
}
.notices p:last-child { margin-bottom: 0; }
.notices.red, .notices.error { border-color: #dc3545; background: #fbe9eb; color: #842029; }
.notices.yellow, .notices.warning { border-color: #ffc107; background: #fff8e1; color: #664d03; }
.notices.blue, .notices.info { border-color: var(--bs-primary); background: rgba(var(--cs1-primary-rgb), .08); color: var(--bs-dark); }

/* Carousel headings: leave room for the arrow buttons on small screens */
@media (max-width: 767.98px) {
    .cs1-carousel-title {
        padding-right: 150px;
        font-size: 1.5rem;
    }
}

/* Top menu items in bold */
.navbar .navbar-nav .nav-link {
    font-weight: 600;
}

/* Footer code-block strip (above the footer) */
.cs1-footer-blocks {
    border-top: 1px solid rgba(0, 0, 0, .06);
}

/* ---------- Menu font (Theme → Header → Menu Font) ---------- */
html.cs1-menu-font-oswald .navbar .navbar-nav .nav-link {
    font-family: Oswald, 'Arial Narrow', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 17px;
}
html.cs1-menu-font-oswald .navbar .dropdown-menu .dropdown-item {
    font-family: Oswald, 'Arial Narrow', sans-serif;
    font-weight: 600;
}
html.cs1-menu-font-roboto-condensed .navbar .navbar-nav .nav-link {
    font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 16px;
}
html.cs1-menu-font-roboto-condensed .navbar .dropdown-menu .dropdown-item {
    font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;
    font-weight: 600;
}
html.cs1-menu-font-montserrat .navbar .navbar-nav .nav-link {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    font-size: 16px;
}
html.cs1-menu-font-montserrat .navbar .dropdown-menu .dropdown-item {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
}
html.cs1-menu-font-exo-2 .navbar .navbar-nav .nav-link {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    text-transform: none;
    letter-spacing: .01em;
    font-size: 17px;
}
html.cs1-menu-font-exo-2 .navbar .dropdown-menu .dropdown-item {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
}
html.cs1-menu-font-playfair-display .navbar .navbar-nav .nav-link {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    font-size: 17px;
}
html.cs1-menu-font-playfair-display .navbar .dropdown-menu .dropdown-item {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
}

/* Footer map */
.cs1-footer-map {
    height: 220px;
    border: 0;
    display: block;
}

/* Date and time next to the menu */
.cs1-clock { display: block; line-height: 1.3; white-space: nowrap; }

/* Sidebar promo banners: adjustable shade over the image (Theme → Sidebar → Shade) */
.banner-content-2.cs1-promo-shade {
    background: none;
}
.banner-content-2.cs1-promo-shade::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(rgb(var(--cs1-primary-rgb)), rgb(255, 255, 255));
    opacity: var(--cs1-shade, .7);
    z-index: -1;
    pointer-events: none;
}
.cs1-promo-above { margin-bottom: .75rem; }
.cs1-promo-below { margin-top: .75rem; }
.cs1-promo-above > :last-child,
.cs1-promo-below > :last-child { margin-bottom: 0 !important; }

/* Page background (Theme → Colour Palette → Page Background Colour) */
body {
    background-color: var(--cs1-page-bg, #fff);
}

/* Sidebar: a column of separate cards, 1.5rem apart (Stay Connected, Popular News,
   Trending Tags, custom menus, promo banners, code blocks) */
.cs1-sidebar-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.cs1-sidebar-wrap > .cs1-sidebar-card {
    margin-top: 0;
    margin-bottom: 0;
}
/* Trending Tags: no extra space below the last row of tags */
.cs1-tags-card .nav { margin-bottom: -.5rem; }
/* Code block cards: images never stick out of the card */
.cs1-code-card img {
    max-width: 100%;
    height: auto;
}

/* ---------- Top bar with logo and tagline (centred) ---------- */
.cs1-brandbar {
    padding: 14px 0;
}
.cs1-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    text-decoration: none;
}
.cs1-brand-name {
    font-family: "Raleway", sans-serif;
    font-weight: 600;
    font-size: calc(1.375rem + 1.5vw);
    line-height: 1.1;
    color: #fff;
}
@media (min-width: 1200px) {
    .cs1-brand-name { font-size: 2.5rem; }
}
.cs1-brand-tagline {
    color: rgba(255, 255, 255, .75);
    letter-spacing: .35em;
    text-transform: uppercase;
    font-size: .85rem;
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, .35);
    line-height: 1.6;
}
.cs1-brandbar .cs1-logo {
    max-height: 56px;
    width: auto;
}
@media (max-width: 575.98px) {
    .cs1-brand-tagline { letter-spacing: .2em; padding-left: 12px; }
}

/* ---------- Navigation bar: centred content ---------- */
.sticky-top {
    top: 0;
}
@media (max-width: 1199.98px) {
    #navbarCollapse .navbar-nav { align-items: center; }
    #navbarCollapse .navbar-nav .dropdown-menu { text-align: center; }
}

/* ---------- Sidebar custom menu card ---------- */
.cs1-side-menu li + li {
    border-top: 1px dashed rgba(0, 0, 0, .1);
}
.cs1-side-menu-link {
    color: var(--bs-dark);
    font-weight: 600;
    transition: color .2s, padding-left .2s;
}
.cs1-side-menu-icon {
    color: var(--bs-primary);
}
.cs1-side-menu-ext {
    opacity: .45;
}
.cs1-side-menu-link:hover,
.cs1-side-menu-link:focus {
    color: var(--bs-primary);
    padding-left: 4px;
}
.cs1-side-menu-link.active {
    color: var(--bs-primary);
}

/* ---------- Floating sidebar (Theme → Sidebar → Floating Sidebar) ----------
   Only where the sidebar sits beside the content (lg and up). js/main.js sets "top"
   as the page scrolls, so the sidebar follows the scroll direction. */
@media (min-width: 992px) {
    .cs1-sidebar-floating {
        position: sticky;
        top: 100px;
    }
}

/* ---------- Full-width code blocks (Header – Above Menu / Below Menu, Footer – Top) ---------- */
.cs1-code-full img {
    max-width: 100%;
    height: auto;
}
/* Footer – Top sits on the dark footer: light text */
.footer .cs1-footer-top {
    color: rgba(255, 255, 255, .85);
}
.footer .cs1-footer-top a {
    color: #fff;
}
