/*
Theme Name: GPCR Workgroup
Description: Research group website for the GPCR Workgroup, Institute of Chemistry, University of Tartu
Version: 1.0
Requires at least: 5.9
Requires PHP: 7.4
Text Domain: gpcr-workgroup
*/

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, body, html, p, blockquote, fieldset, input { margin: 0; padding: 0; }
a img { border: 0; }
a { text-decoration: none; }

body {
    position: relative;
    width: 100%;
    background: #2B2B2B;
    color: #9b9b9b;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.8em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #2B2B2B;
    transition: color 200ms ease-in;
}
a:hover { color: #2B2B2B; opacity: 0.75; }

h2 {
    padding-bottom: 10px;
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.3em;
}

h3 { color: #333333; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; }

p, .paragraph { line-height: 1.8em; }

blockquote {
    position: relative;
    display: inline;
    color: #a0a0a0;
    padding: 0 1.5em;
    font-size: 1.35em;
    line-height: 1.65em;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrapper {
    position: relative;
    right: 0;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: right 610ms cubic-bezier(0, 0.8, 0.55, 1);
}

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

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
.header-wrap {
    position: relative;
}

.nav-wrap {
    position: relative;
    z-index: 200;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #cccccc;
    text-align: center;
}

#logo {
    padding: 10px 0;
    text-align: center;
    font-family: 'Cookie', cursive;
    font-size: 40px;
    font-weight: normal;
    line-height: 1.1;
}

#logo a {
    color: black;
    transition: all 300ms ease-in;
}
#logo a:hover { opacity: 0.8; }

.wsite-logo { display: inline-block; padding: 30px 0 20px; }

#wsite-title {
    display: block;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 26px;
    letter-spacing: 2px;
}

.hamburger { display: none; }
.sub-menu-toggle { display: none; }

/* Desktop nav */
.menu {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    border-top: 1px solid rgba(116, 116, 116, 0.15);
}

.menu .container {
    position: relative;
    padding: 0;
}

.menu ul { list-style: none; }

/* Top-level nav items */
.menu .wsite-menu-default {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.menu .wsite-menu-default > .menu-item {
    position: relative;
    display: inline-block;
    padding: 7px 0;
    margin-right: 30px;
}

.menu .wsite-menu-default > .menu-item:last-child { margin-right: 0; }

.menu .wsite-menu-default > .menu-item > a {
    color: #3b3b3b;
    border-bottom: 3px solid transparent;
    padding-bottom: 11px;
    transition: border-bottom 0.2s ease-in;
    letter-spacing: .03em;
}

.menu .wsite-menu-default > .menu-item > a:hover,
.menu .wsite-menu-default > .current-menu-item > a,
.menu .wsite-menu-default > .current-menu-ancestor > a {
    border-bottom: 3px solid #2B2B2B;
    opacity: 1;
}

/* First-level dropdown */
.menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    z-index: 500;
    list-style: none;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #ebebeb;
    margin-top: 7px;
    padding: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.menu .wsite-menu-default > .menu-item:hover > .sub-menu,
.menu .wsite-menu-default > .menu-item:focus-within > .sub-menu { display: block; }

.menu .sub-menu > .menu-item {
    display: block;
    position: relative;
    margin: 0;
    padding: 0;
    border: 1px solid #ebebeb;
}

.menu .sub-menu > .menu-item + .menu-item { border-top: none; }

.menu .sub-menu > .menu-item > a {
    display: block;
    padding: 10px 30px 10px 15px;
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    color: #3B3B3B;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    letter-spacing: .03em;
    transition: background 150ms ease-in;
}

.menu .sub-menu > .menu-item > a:hover {
    background: rgba(240, 240, 240, 0.95);
    opacity: 1;
}

/* Arrow for items with children */
.menu .sub-menu > .menu-item-has-children > a::after {
    content: '›';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
}

/* Second-level dropdown (fly out right) */
.menu .sub-menu .sub-menu {
    top: -1px;
    left: 100%;
    margin-top: 0;
}

.menu .sub-menu > .menu-item:hover > .sub-menu,
.menu .sub-menu > .menu-item:focus-within > .sub-menu { display: block; }

/* ============================================================
   HERO BANNER
   ============================================================ */
.banner-wrap { position: relative; }

.banner-wrap .wsite-section {
    position: relative;
    background: url('assets/images/default-hero.jpg') center center / cover no-repeat;
    min-height: 450px;
    display: flex;
    align-items: center;
}

.banner-wrap .wsite-section::before {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2);
    content: '';
    z-index: 0;
}

.banner-wrap .container {
    position: relative;
    z-index: 1;
    padding: 80px 1.5em;
}

.banner-wrap .banner {
    text-align: center;
}

.banner-wrap .banner h2 {
    color: white;
    font-family: 'Lato', sans-serif;
    font-size: 58px;
    font-weight: 300;
    text-transform: uppercase;
    line-height: normal;
}

/* Home page gets taller banner */
.home .banner-wrap .wsite-section { min-height: 600px; }

/* No-banner pages: add top padding to push content below fixed header */
.no-header-page #main-wrap { padding-top: 0; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#main-wrap {
    background: #fff;
    flex: 1;
}

#main-wrap > .container,
.page-content-wrap {
    padding: 60px 1.5em;
}

#wsite-content h2,
.entry-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 400;
    text-transform: uppercase;
    color: #333;
    padding-bottom: 10px;
}

#wsite-content p,
.entry-content p,
#wsite-content .paragraph {
    color: #9b9b9b;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    line-height: 1.8em;
    padding-bottom: 1em;
}

#wsite-content a,
.entry-content a {
    color: #2B2B2B;
    text-decoration: underline;
}

#wsite-content ul,
#wsite-content ol,
.entry-content ul,
.entry-content ol {
    padding-left: 3em;
    margin: 5px 0;
    color: #9b9b9b;
    font-family: 'Montserrat', sans-serif;
}

#wsite-content li,
.entry-content li {
    padding-left: 5px;
    margin: 3px 0;
    line-height: 1.8em;
}

/* Image alignment */
.entry-content img { max-width: 100%; height: auto; }
.entry-content .alignleft { float: left; margin: 0 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: 0 0 1em 1.5em; }
.entry-content .aligncenter { display: block; margin: 0 auto 1em; }

/* Two-column layout helper */
.two-col { display: flex; gap: 30px; }
.two-col > * { flex: 1; }

/* ============================================================
   BUTTONS
   ============================================================ */
.wsite-button,
.btn {
    display: inline-block;
    height: auto;
    padding: 0;
    background: none;
}

.wsite-button .wsite-button-inner,
.btn-inner,
.wp-block-button__link {
    display: block;
    height: auto;
    padding: 8px 16px;
    background: white;
    color: #1e1e1e !important;
    border: 2px solid #1e1e1e;
    text-transform: uppercase;
    letter-spacing: .02em;
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.5em;
    transition: all 400ms ease-in;
    text-decoration: none;
}

.wsite-button:hover .wsite-button-inner,
.btn:hover .btn-inner,
.wp-block-button__link:hover {
    background: #1e1e1e;
    color: white !important;
    text-decoration: none;
}

/* ============================================================
   BLOG / NEWS
   ============================================================ */
.blog-wrap {
    display: flex;
    gap: 40px;
    padding: 60px 1.5em;
    max-width: 960px;
    margin: 0 auto;
}

.blog-content { flex: 1; min-width: 0; }

.blog-sidebar {
    width: 200px;
    flex-shrink: 0;
    font-size: 14px;
    line-height: 24px;
}

.blog-post {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #ebebeb;
}

.blog-post:last-child { border-bottom: none; }

h2.blog-title { padding-bottom: 5px; }

h2.blog-title a {
    display: block;
    color: #333;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    transition: color 200ms ease-in;
    margin-bottom: 10px;
}

h2.blog-title a:hover { color: #2B2B2B; opacity: 0.7; }

.blog-date {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
    font-family: 'Lato', sans-serif;
}

.blog-post-body {
    color: #9b9b9b;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.8em;
}

.blog-post-body p { margin-bottom: 1em; }

.blog-post-body img { max-width: 100%; height: auto; margin-bottom: 1em; }

.blog-separator { margin-bottom: 15px; border: none; border-top: 1px solid #ebebeb; }

/* Read more / blog button */
.blog-button {
    display: inline-block;
    margin-top: 10px;
}

.blog-button span,
.blog-button a {
    display: inline-block;
    background-color: #2B2B2B;
    padding: 6px 20px;
    color: white;
    text-transform: uppercase;
    font-family: 'Roboto', sans-serif;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 34px;
    text-decoration: none;
    transition: background 200ms ease-in;
}

.blog-button span:hover,
.blog-button a:hover { background: #444; }

/* Blog sidebar */
.blog-sidebar h2 {
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 5px;
    color: #333;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
}

.blog-sidebar ul { list-style: none; padding: 0; }
.blog-sidebar ul li { padding: 3px 0; }
.blog-sidebar ul li a { color: #9b9b9b; font-size: 13px; }
.blog-sidebar ul li a:hover { color: #2B2B2B; }
.blog-sidebar p { color: #9b9b9b; padding-bottom: 20px; }

/* Pagination */
.blog-pagination {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    align-items: center;
}

.blog-pagination a,
.blog-pagination span {
    padding: 6px 12px;
    border: 1px solid #cccccc;
    font-size: 13px;
    color: #3b3b3b;
    text-decoration: none;
}

.blog-pagination a:hover { background: #2B2B2B; color: white; border-color: #2B2B2B; opacity: 1; }
.blog-pagination .current { background: #2B2B2B; color: white; border-color: #2B2B2B; }

/* Single post */
.single-post-wrap {
    display: flex;
    gap: 40px;
    padding: 60px 1.5em;
    max-width: 960px;
    margin: 0 auto;
}

.single-post-content { flex: 1; min-width: 0; }

.entry-header { margin-bottom: 30px; }
.entry-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
}

.entry-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
}

.entry-content { color: #9b9b9b; font-family: 'Montserrat', sans-serif; line-height: 1.8em; }
.entry-content p { margin-bottom: 1.2em; }
.entry-content h2 { margin-top: 1.5em; margin-bottom: 0.5em; }
.entry-content h3 { margin-top: 1.2em; margin-bottom: 0.4em; color: #333; }

.post-navigation {
    display: flex;
    justify-content: space-between;
    padding: 30px 0;
    border-top: 1px solid #ebebeb;
    margin-top: 40px;
    font-size: 13px;
}

.post-navigation a { color: #2B2B2B; text-decoration: none; }
.post-navigation a:hover { opacity: 0.7; }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-item { flex: 0 0 calc(33.333% - 7px); }
.gallery-item img { width: 100%; height: auto; display: block; border: 1px solid rgba(179,153,100,0.4); transition: border-color 200ms; }
.gallery-item img:hover { border-color: #b39964; }

/* ============================================================
   FORMS
   ============================================================ */
.wsite-form-field { font-size: 15px; font-weight: normal; color: #626262; }
.wsite-form-label { padding: 5px 0; display: block; }
.wsite-form-input {
    width: 100%;
    height: auto;
    background: none;
    border: 1px solid #cccccc;
    border-radius: 0;
    color: #626262;
    padding: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    font-weight: normal;
    transition: all 200ms ease-in;
    -webkit-appearance: none;
}

.wsite-form-input:hover,
.wsite-form-input:focus { border-color: #1e1e1e; outline: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.sticky-footer-push { display: block; flex: 0; }

#footer-wrap {
    border-top: 1px solid #ebebeb;
    background: #2B2B2B;
    position: relative;
    z-index: 5;
}

#footer-wrap .footer-inner {
    padding: 60px 1.5em;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

#footer-wrap .footer-col { flex: 1; min-width: 200px; }

#footer-wrap h2 {
    color: white;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    padding-bottom: 10px;
}

#footer-wrap p,
#footer-wrap .paragraph {
    color: white;
    font-size: 14px;
    line-height: 1.6em;
    font-family: 'Montserrat', sans-serif;
}

#footer-wrap a {
    color: white;
    text-decoration: underline;
}

#footer-wrap a:hover { opacity: 0.8; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrap { padding: 60px 1.5em; max-width: 960px; margin: 0 auto; }

.search-form { display: flex; gap: 10px; margin-bottom: 40px; }

#wsite-search-query,
.search-field,
#s {
    flex: 1;
    padding: 10px;
    height: auto;
    background: none;
    color: #3d3d3d;
    border: 1px solid #cccccc;
    border-radius: 0;
    font-family: 'Lato', sans-serif;
    font-size: 1.1em;
    transition: border 200ms ease-in;
}

#wsite-search-query:focus,
.search-field:focus,
#s:focus { border-color: #1e1e1e; outline: none; }

#searchsubmit,
.search-submit {
    padding: 10px 20px;
    background: #2B2B2B;
    color: white;
    border: none;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9em;
    transition: background 200ms;
}

#searchsubmit:hover,
.search-submit:hover { background: #444; }

/* ============================================================
   404
   ============================================================ */
.error-404-wrap { padding: 80px 1.5em; max-width: 960px; margin: 0 auto; text-align: center; }
.error-404-wrap h2 { font-size: 32px; margin-bottom: 20px; }
.error-404-wrap p { color: #9b9b9b; margin-bottom: 30px; }

/* ============================================================
   MOBILE NAVIGATION (≤ 992px)
   ============================================================ */
@media screen and (max-width: 992px) {
    body { overflow-x: hidden; }

    /* Wrapper slides right when nav is open */
    body.nav-open .wrapper { right: 70%; }

    /* Fixed header bar */
    .nav-wrap {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 55px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 200;
        transition: all 610ms cubic-bezier(0, 0.8, 0.55, 1);
    }

    body.nav-open .nav-wrap { left: -70%; }

    /* Logo in mobile bar */
    #logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        font-size: 1.4em;
        padding: 0 50px;
    }

    .wsite-logo { padding: 0; }

    #wsite-title { font-size: 18px !important; }

    /* Hamburger button */
    .hamburger {
        position: absolute;
        top: 0;
        right: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 55px;
        cursor: pointer;
        text-decoration: none;
    }

    .hamburger span,
    .hamburger span::before,
    .hamburger span::after {
        position: relative;
        display: block;
        width: 20px;
        height: 2px;
        background: black;
        content: '';
        transition: all 300ms ease;
    }

    .hamburger span { top: 0; margin: 6px 0; }
    .hamburger span::before { top: -8px; }
    .hamburger span::after { bottom: -6px; }

    /* Mobile slide-in nav */
    .menu {
        position: fixed;
        top: 0;
        right: -70%;
        width: 70%;
        height: 100%;
        background: #1e1e1e;
        z-index: 100;
        overflow-y: auto;
        padding: 18px 30px;
        transition: right 610ms cubic-bezier(0, 0.8, 0.55, 1);
        text-align: left;
        border-top: none;
    }

    body.nav-open .menu { right: 0; }

    /* Mobile nav items */
    .menu .wsite-menu-default {
        display: block;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 55px;
    }

    .menu .wsite-menu-default > .menu-item {
        display: block;
        padding: 0;
        margin: 0 0 5px 0;
    }

    .menu .wsite-menu-default > .menu-item > a {
        display: inline-block;
        color: white;
        border-bottom: 2px solid transparent;
        text-transform: uppercase;
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 10px;
        padding-bottom: 2px;
        transition: border-bottom 200ms ease-in;
    }

    .menu .wsite-menu-default > .menu-item > a:hover,
    .menu .wsite-menu-default > .current-menu-item > a {
        border-bottom: 2px solid white;
        opacity: 1;
    }

    /* Submenus on mobile - hidden by default, toggled by JS */
    .menu .sub-menu {
        display: none;
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        margin: 0;
        padding-left: 15px;
        width: auto;
        min-width: 0;
    }

    .menu .sub-menu.open { display: block; }

    .menu .sub-menu > .menu-item { border: none; }

    .menu .sub-menu > .menu-item > a {
        color: #ccc;
        background: transparent;
        padding: 5px 0;
        font-size: 13px;
        display: inline-block;
    }

    .menu .sub-menu > .menu-item > a:hover { color: white; }

    /* Sub-menu toggle button */
    .sub-menu-toggle {
        display: inline-block;
        background: none;
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        padding: 0 0 0 8px;
        vertical-align: middle;
        line-height: 1;
    }

    /* Banner needs top padding on mobile */
    .banner-wrap { padding-top: 55px; }
    .no-header-page #main-wrap { padding-top: 55px; }

    .banner-wrap .banner h2 { font-size: 2.5em; }

    #footer-wrap { position: relative; right: 0; transition: all 610ms cubic-bezier(0, 0.8, 0.55, 1); }
    body.nav-open #footer-wrap { right: 70%; }

    .blog-sidebar { font-size: 14px; line-height: 24px; }
    .blog-sidebar h2 { font-size: 16px; padding-bottom: 5px; }

    /* Reset container constraints inside the slide-in nav panel */
    .menu .container { max-width: none; margin: 0; }
}

/* ============================================================
   SMALL SCREENS (≤ 767px)
   ============================================================ */
@media screen and (max-width: 767px) {
    body { font-size: 14px; }
    h2 { font-size: 1.3em; line-height: 1.5em; }
    p, .paragraph { padding: 0 0 1.5em; line-height: 1.7em; }

    .banner-wrap .wsite-section { min-height: 300px; }
    .banner-wrap .banner h2 { font-size: 2em; }

    .home .banner-wrap .wsite-section { min-height: 350px; }

    #main-wrap > .container,
    .page-content-wrap { padding: 25px 2em; }

    .blog-wrap,
    .single-post-wrap { flex-direction: column; padding: 25px 2em; }
    .blog-sidebar { width: 100%; }

    .two-col { flex-direction: column; }
    .gallery-item { flex: 0 0 calc(50% - 5px); }
}
