/* ── Site-wide shared styles ───────────────────────────────────────────────── */
/* Matching organicchemistrydata.org branding                                 */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --ocd-red: #ba0000;
    --ocd-red-dark: #8a0000;
    --ocd-blue: #3a6486;
    --ocd-blue-light: #81bedb;
    --ocd-sidebar-width: 300px;
}

body {
    font-family: 'Open Sans', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Trebuchet MS', 'Open Sans', sans-serif;
}

a {
    color: #0056b3;
}
a:hover {
    color: var(--ocd-red);
}

/* ── Navbar ────────────────────────────────────────────────────────────────── */

.ocd-navbar {
    background-color: var(--ocd-red);
    padding-top: 0;
    padding-bottom: 0;
}

.ocd-navbar .navbar-brand {
    padding: 0.3rem 0;
}

.ocd-navbar .navbar-brand img {
    height: 50px;
    width: auto;
}

.ocd-navbar .nav-link {
    font-family: Verdana, sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    padding: 0.75rem 0.9rem;
    color: rgba(255,255,255,0.85);
}

.ocd-navbar .nav-link:hover,
.ocd-navbar .nav-link:focus {
    color: #fff;
}

.ocd-navbar .dropdown-menu {
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 0;
}

/* Resources mega-dropdown */
.ocd-resources-dropdown {
    min-width: 400px;
}
@media (max-width: 768px) {
    .ocd-resources-dropdown {
        min-width: auto;
    }
}

.ocd-resources-dropdown .dropdown-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ocd-red);
    padding-top: 0.75rem;
}

/* Active collection highlight in navbar */
.ocd-navbar .nav-link.active {
    color: #fff;
    background-color: var(--ocd-red-dark);
}

/* Collections dropdown — bold active item */
.ocd-navbar .dropdown-item.fw-bold {
    color: var(--ocd-red);
}

/* ── Admin bar (only shown on admin pages) ─────────────────────────────────── */

.ocd-admin-bar {
    background-color: #333;
    font-size: 0.78rem;
    padding: 0.3rem 1rem;
}

.ocd-admin-bar a {
    color: #ccc;
    text-decoration: none;
    margin-right: 1rem;
}

.ocd-admin-bar a:hover {
    color: #fff;
}

.ocd-admin-bar .admin-user {
    color: #999;
    margin-right: 1rem;
}

/* ── Sidebar (for hansreich, reusch) ───────────────────────────────────────── */

.ocd-sidebar {
    width: var(--ocd-sidebar-width);
    min-height: calc(100vh - 58px);
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
    background: #f8f9fa;
    position: sticky;
    top: 58px;
    flex-shrink: 0;
}

.ocd-sidebar .nav-link {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    color: #333;
    border-left: 3px solid transparent;
}

.ocd-sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: #333;
}

.ocd-sidebar .nav-link.active {
    background-color: #e2e6ea;
    border-left-color: var(--ocd-red);
    font-weight: 600;
}

.ocd-sidebar-toggle {
    display: none;
}

@media (max-width: 991.98px) {
    .ocd-sidebar {
        position: fixed;
        top: 58px;
        left: -100%;
        z-index: 1040;
        width: 85%;
        max-width: 320px;
        height: calc(100vh - 58px);
        transition: left 0.3s ease;
        box-shadow: none;
    }
    .ocd-sidebar.show {
        left: 0;
        box-shadow: 4px 0 12px rgba(0,0,0,0.15);
    }
    .ocd-sidebar-toggle {
        display: inline-flex;
    }
    .ocd-sidebar-overlay {
        display: none;
        position: fixed;
        top: 58px;
        left: 0;
        width: 100%;
        height: calc(100vh - 58px);
        background: rgba(0,0,0,0.3);
        z-index: 1039;
    }
    .ocd-sidebar-overlay.show {
        display: block;
    }
}

/* ── Content area ──────────────────────────────────────────────────────────── */

.ocd-content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
}

.ocd-content img {
    max-width: 100%;
    height: auto;
}

/* ── Breadcrumbs ───────────────────────────────────────────────────────────── */

.ocd-breadcrumb {
    font-size: 0.85rem;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.ocd-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.ocd-breadcrumb a:hover {
    color: var(--ocd-red);
}

/* ── Footer — Social bar (top) ─────────────────────────────────────────────── */

.ocd-footer-social {
    background-color: var(--ocd-blue);
    color: #fff;
    padding: 0.6rem 0;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.ocd-footer-social .social-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-right: 0.75rem;
    white-space: nowrap;
}

.ocd-footer-social .social-icons {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    gap: 0.15rem;
    align-items: center;
}

.ocd-footer-social .social-icons a {
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    padding: 4px 6px;
    text-decoration: none;
    transition: color 0.15s;
    vertical-align: middle;
}

.ocd-footer-social .social-icons a:hover {
    color: var(--ocd-red);
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

/* ── Footer — Bottom (logos + info) ────────────────────────────────────────── */

.ocd-footer-bottom {
    background-color: #fff;
    padding: 0.75rem 0 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

.ocd-footer-bottom a {
    color: #555;
    text-decoration: none;
}

.ocd-footer-bottom a:hover {
    color: var(--ocd-red);
}

.ocd-footer-logos img {
    display: inline-block;
    max-width: 150px;
    max-height: 120px;
    width: auto;
    height: auto;
    margin: 0.4rem 1.25rem;
}

@media (max-width: 768px) {
    .ocd-footer-logos img {
        max-width: 110px;
        max-height: 90px;
        margin: 0.3rem 0.5rem;
    }
}

/* ── Hexagon tile grid (home page) ─────────────────────────────────────────── */

.hex-container {
    background: rgb(58, 100, 134);
    padding: 0.5rem 0.5rem 1.5rem;
    margin: 0;
}

.hex-col {
    padding-top: 1.5%;
}

/* ── Mobile: rectangles ──────────────────────────────────── */
.hex-holder {
    position: relative;
    width: 90%;
    height: 60px;
    background-color: white;
    color: var(--ocd-red);
    margin: 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.hex-holder:hover {
    text-decoration: none;
}

.hex-content {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Trebuchet MS', sans-serif;
    font-weight: bold;
    height: 56px;
    text-align: center;
    color: var(--ocd-red);
    font-size: 1.5rem;
    padding: 0 8px;
}

.hex-content-detail {
    display: none;
    font-size: 14px;
    max-height: 90px;
    overflow-y: auto;
    font-family: 'Roboto Condensed', 'Open Sans', sans-serif;
    color: white;
    text-align: center;
    padding: 0 8px;
}

/* ── Desktop: actual hexagons ─────────────────────────────── */
@media screen and (min-width: 576px) {
    .hex-container {
        background: url('/img/orgn-bkg.jpg') no-repeat center center;
        background-size: cover;
        padding: 0 1rem 1rem;
    }

    .hex-col {
        padding-top: 0;
    }

    .hex-holder {
        width: 170px;
        height: 98.15px;
        margin: 49.07px 0;
    }

    .hex-holder:before,
    .hex-holder:after {
        content: "";
        position: absolute;
        width: 0;
        left: 0;
        border-left: 85px solid transparent;
        border-right: 85px solid transparent;
    }

    .hex-holder:before {
        bottom: 100%;
        border-bottom: 49.07px solid white;
    }

    .hex-holder:after {
        top: 100%;
        border-top: 49.07px solid white;
    }

    .hex-holder:hover {
        background-color: #0E2D46;
        color: white;
    }

    .hex-holder:hover:before {
        border-bottom-color: #0E2D46;
    }

    .hex-holder:hover:after {
        border-top-color: #0E2D46;
    }

    .hex-holder:hover .hex-content {
        display: none;
    }

    .hex-holder:hover .hex-content-detail {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hex-content {
        height: 60px;
        font-family: 'Trebuchet MS', sans-serif;
        font-size: 1.5rem;
    }
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */

.ocd-external-link::after {
    content: " \2197";
    font-size: 0.7em;
    vertical-align: super;
}

img[loading="lazy"] {
    background-color: transparent;
}

/* Go-to-top button */
#toTopButton {
    display: none;
    position: fixed;
    bottom: 12px;
    right: 12px;
    z-index: 1000;
    background-color: rgba(128,128,128,0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 1.2rem;
    line-height: 1;
}

#toTopButton:hover {
    background-color: #555;
}

/* Print */
@media print {
    .ocd-navbar, .ocd-admin-bar, .ocd-sidebar, .ocd-sidebar-toggle,
    .ocd-footer-social, .ocd-footer-bottom, #toTopButton { display: none !important; }
    .ocd-content { padding: 0; }
}
