/* === Variables === */
:root {
    --primary:       #2d6a6a;
    --primary-light: #43b1b0;
    --primary-dark:  #1e4e4e;
    --accent:        #e8f4f4;
    --text:          #2c2c2c;
    --text-light:    #6b7280;
    --text-muted:    #9ca3af;
    --bg:            #f8fafa;
    --bg-card:       #ffffff;
    --border:        #e5e7eb;
    --shadow:        0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover:  0 4px 16px rgba(0, 0, 0, 0.12);
    --radius:        8px;
    --radius-sm:     4px;
    --transition:    0.2s ease;
    --font-sans:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif:    Georgia, 'Times New Roman', serif;
    --container:     1100px;
    --header-h:      77px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

/* === Container === */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* === Header === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--bg-card);
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.site-header .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 8px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}
.site-logo:hover { text-decoration: none; }
.site-logo__img {
    height: 56px;
    width: auto;
    display: block;
}
.site-logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.site-logo__text strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.3px;
}
.site-logo__text small {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 400;
    letter-spacing: 0.2px;
}
.site-logo:hover .site-logo__text strong { color: var(--primary); }

/* Nav */
.site-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-left: auto;
    height: 100%;
}
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 12px;
    height: 100%;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
}
.nav-link:hover,
.nav-item:hover > .nav-link {
    background: var(--accent);
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.nav-arrow { font-size: 0.65rem; opacity: 0.6; }
.nav-search {
    background: var(--primary);
    color: #fff !important;
    border-radius: var(--radius-sm);
    margin: 0 4px;
    height: auto;
    padding: 6px 14px;
    border-bottom: none !important;
    margin-bottom: 0 !important;
}
.nav-search:hover { background: var(--primary-dark) !important; color: #fff !important; }

/* Dropdown menus */
.nav-dropdown__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    list-style: none;
    padding: 6px 0;
    z-index: 200;
    margin: 0;
}
.nav-dropdown:hover > .nav-dropdown__menu,
.nav-dropdown.open > .nav-dropdown__menu {
    display: block;
}
.nav-dropdown__menu li {
    position: relative;
    list-style: none;
}
.nav-dropdown__menu a {
    display: block;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: var(--text);
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}
.nav-dropdown__menu a:hover,
.nav-dropdown__menu .nav-dropdown:hover > a {
    background: var(--accent);
    color: var(--primary);
}

/* Sub-menus (nivel 3) */
.nav-dropdown--sub { position: relative; }
.nav-dropdown__menu--sub {
    top: -9px;
    left: 100%;
    border-top: 3px solid var(--primary);
}
.nav-dropdown--sub:hover > .nav-dropdown__menu--sub,
.nav-dropdown--sub.open > .nav-dropdown__menu--sub {
    display: block;
}

/* Nav toggle (mobile) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === Main === */
.site-main { flex: 1; }

/* === Hero === */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    color: #fff;
    padding: 72px 0 80px;
    text-align: center;
}
.hero__title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.hero__sub {
    font-size: 1.15rem;
    opacity: 0.88;
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}
.hero__cta {
    display: inline-block;
    background: #fff;
    color: var(--primary);
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: transform var(--transition), box-shadow var(--transition);
}
.hero__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: var(--primary-dark);
}

/* === Sections === */
.section { padding: 56px 0; }
.section__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 32px;
}
.section__title { font-size: 1.5rem; font-weight: 700; }
.section__link { font-size: 0.9rem; font-weight: 500; }

/* === Post cards grid === */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition);
}
.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.post-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.post-card__image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--accent) 0%, #c9e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary-light);
}
.post-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.post-card__cats { display: flex; flex-wrap: wrap; gap: 6px; }
.post-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--primary); }
.post-card__excerpt {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 4px;
}
.post-card__meta-sep { opacity: 0.5; }

/* === Badges / Tags / Categories === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.badge--cat {
    background: var(--accent);
    color: var(--primary);
}
.badge--cat:hover { background: var(--primary-light); color: #fff; }
.badge--tag {
    background: #f3f4f6;
    color: var(--text-light);
}
.badge--tag:hover { background: var(--border); color: var(--text); }

/* === Blog index page === */
.blog-index { padding: 48px 0; }

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 32px;
    align-items: start;
}
.blog-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 20px);
}
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.widget__title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.widget__list { list-style: none; }
.widget__list li { border-bottom: 1px solid var(--border); }
.widget__list li:last-child { border-bottom: none; }
.widget__list a {
    display: block;
    padding: 8px 4px;
    font-size: 0.875rem;
    color: var(--text-light);
    transition: color var(--transition), padding-left var(--transition);
}
.widget__list a:hover,
.widget__list a.active {
    color: var(--primary);
    padding-left: 8px;
    font-weight: 500;
}

.blog-active-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: var(--text-light);
    background: var(--accent);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
}
.blog-active-filter a { color: var(--primary); font-weight: 500; margin-left: auto; }

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 48px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.pagination a:hover {
    background: var(--accent);
    border-color: var(--primary-light);
    color: var(--primary);
}
.pagination .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .disabled { opacity: 0.4; cursor: default; }

/* === Blog post detail === */
.post-hero {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}
.post-hero-accent {
    height: 6px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
}
.post-layout {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}
.post-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.post-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 18px;
    letter-spacing: -0.3px;
}
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-light);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}
.post-meta__author { font-weight: 500; color: var(--text); }
.post-meta__sep { color: var(--border); }

/* === Rich text body === */
.rich-text {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
}
.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4 {
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: 1.3;
    margin: 1.8em 0 0.6em;
    color: var(--text);
}
.rich-text h2 { font-size: 1.5rem; }
.rich-text h3 { font-size: 1.25rem; }
.rich-text h4 { font-size: 1.05rem; }
.rich-text p { margin: 0 0 1.2em; }
.rich-text ul, .rich-text ol {
    margin: 0 0 1.2em 1.5em;
}
.rich-text li { margin-bottom: 0.4em; }
.rich-text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rich-text a:hover { color: var(--primary-light); }
.rich-text blockquote {
    border-left: 4px solid var(--primary-light);
    margin: 1.5em 0;
    padding: 14px 20px;
    background: var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-light);
}
.rich-text img {
    border-radius: var(--radius-sm);
    margin: 1.5em 0;
}
.rich-text strong { font-weight: 700; }
.rich-text em { font-style: italic; }
.rich-text code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
.rich-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
    font-family: var(--font-sans);
}
.rich-text th, .rich-text td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.rich-text th {
    background: var(--accent);
    font-weight: 600;
}

.post-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.post-tags__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-right: 4px;
}
.post-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 18px;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    align-self: flex-start;
    transition: background var(--transition), color var(--transition);
}
.post-back:hover { background: var(--primary); color: #fff; }

/* === Search page === */
.search-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}
.search-page h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 28px;
}
.search-form {
    display: flex;
    margin-bottom: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.search-form input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    border: none;
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg-card);
    outline: none;
}
.search-form button {
    padding: 14px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background var(--transition);
    white-space: nowrap;
}
.search-form button:hover { background: var(--primary-dark); }
.search-results-list { list-style: none; }
.search-result {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: none; }
.search-result h4 { font-size: 1.05rem; margin-bottom: 6px; }
.search-result h4 a { color: var(--text); }
.search-result h4 a:hover { color: var(--primary); }
.search-result p { font-size: 0.875rem; color: var(--text-light); }
.search-pagination {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    font-size: 0.9rem;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-light);
}
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text); }

/* === Footer === */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.65);
    padding: 28px 0;
    font-size: 0.875rem;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.site-footer a { color: rgba(255, 255, 255, 0.8); }
.site-footer a:hover { color: #fff; }
.site-footer nav { display: flex; gap: 8px; align-items: center; }

/* === Logo text-only fallback === */
.site-logo__text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.3px;
    display: block;
    line-height: 1;
}
.site-logo:hover .site-logo__text { color: var(--primary); }

/* === Conspecte: dropdown 2 coloane === */
.nav-dropdown__menu--wide {
    columns: 2;
    column-gap: 0;
    min-width: 400px;
}
.nav-dropdown__menu--wide li { break-inside: avoid; }

/* === Pagina Echipa === */
.page-echipa .post-layout { max-width: 860px; }
.page-echipa .rich-text {
    font-family: var(--font-sans);
    font-size: 0.95rem;
}
.page-echipa .rich-text h2 {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin: 48px 0 20px;
}
.page-echipa .rich-text h2:first-child { margin-top: 0; }

.page-echipa .team-member {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.page-echipa .team-member figure {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 50%;
    border: 3px solid var(--accent);
    background: var(--accent);
    margin: 0;
    padding: 0;
}
.page-echipa .team-member figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-radius: 50%;
    margin: 0;
}
.page-echipa .team-member-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.page-echipa .team-member h3 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: capitalize;
    margin: 0 0 2px;
    color: var(--text);
}
.page-echipa .team-member p {
    margin: 0 0 4px;
    line-height: 1.5;
    color: var(--text-light);
}
.page-echipa .team-member p:first-of-type {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.page-echipa .team-member a {
    font-size: 0.8rem;
    color: var(--primary-light);
    align-self: flex-start;
}
.page-echipa .team-member a:hover { color: var(--primary); }

/* === Responsive === */
@media (max-width: 900px) {
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { position: static; order: -1; }
    .widget__list { display: flex; flex-wrap: wrap; gap: 0; }
    .widget__list li { border: none; }
    .widget__list a { padding: 4px 10px; border-radius: 20px; }
    .widget__list a:hover,
    .widget__list a.active { background: var(--accent); padding-left: 10px; }
}

@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        align-items: stretch;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        gap: 0;
        z-index: 99;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }
    .site-nav.open { display: flex; }
    .nav-item { flex-direction: column; align-items: stretch; }
    .nav-link {
        padding: 11px 20px;
        height: auto;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--border);
        margin-bottom: 0;
        border-bottom-color: var(--border) !important;
        justify-content: space-between;
    }
    .nav-link:last-child { border-bottom: none; }
    /* Mobile dropdowns: show on .open */
    .nav-dropdown__menu {
        position: static;
        display: none;
        border: none;
        border-top: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
        background: var(--bg);
        padding: 0;
    }
    .nav-dropdown.open > .nav-dropdown__menu { display: block; }
    .nav-dropdown:hover > .nav-dropdown__menu { display: none; }
    .nav-dropdown.open > .nav-dropdown__menu { display: block; }
    .nav-dropdown__menu a { padding: 9px 32px; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
    .nav-dropdown__menu--sub { left: 0; top: 0; }
    .nav-dropdown__menu--sub a { padding-left: 48px; }
    .nav-search { margin: 8px 20px; border-radius: var(--radius-sm) !important; text-align: center; justify-content: center; }
}

@media (max-width: 640px) {
    .hero { padding: 48px 0 56px; }
    .page-echipa .team-member { flex-direction: column; align-items: center; text-align: center; }
    .posts-grid { grid-template-columns: 1fr; }
    .site-footer .container { flex-direction: column; text-align: center; }
    .post-layout { padding: 28px 16px 60px; }
    .section { padding: 36px 0; }
}
