/* RBS RE - INSTITUTIONAL Styles */
/* Aesthetic: Munich Re / Blueprint / Engineering */

:root {
    --color-rbs-blue: #004b87;
    --color-navy-dark: #003359;
    --color-slate: #94a3b8;
    /* Lighter for dark bg */
    --color-light-gray: #0d1b2a;
    /* Dark for 'light' sections */
    --color-white: #e2e8f0;
    /* Off-white for text */
    --color-black: #020617;
    /* Deep black for body */
    --color-bg-dark: #0f172a;

    --font-serif: 'Roboto', sans-serif;
    --font-sans: 'Roboto', sans-serif;

    --container-width: 1200px;
    --header-height: 90px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--color-white);
    line-height: 1.5;
    background-color: var(--color-black);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-sans);
    /* Modern corporate tech feel, can switch to serif for headlines if desired */
    font-weight: 700;
    color: var(--color-navy-dark);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* --- HEADER --- */
.site-header {
    height: var(--header-height);
    /* More transparent as requested */
    background-color: rgba(13, 27, 42, 0.2);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
}

/* Fallback if PDF doesn't render well */
.logo-fallback {
    display: none;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-rbs-blue);
    letter-spacing: -0.05em;
}

img[src$=".pdf"]:after {
    /* CSS trick likely won't work for PDF img content replacement, relies on alt */
    content: "RBS RE";
}

/* --- HEADER & TOP BAR --- */
.site-header {
    height: auto;
    /* Allow content to define height */
    padding: 10px 0;
    /* Reduced padding */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    /* Prevent wrapping */
}

.brand-logo {
    flex-shrink: 0;
    /* Prevent logo from shrinking */
    margin-right: 40px;
    /* Force gap between logo and menu */
}

.brand-logo-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    display: inline-block;
    white-space: nowrap;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
    /* Ensure it takes available space */
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    margin-bottom: 5px;
    width: 100%;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
    align-items: center;
}

.main-nav a {
    color: var(--color-white) !important;
}

.main-nav>ul>li {
    position: relative;
    /* Context for dropdown */
    padding: 10px 0;
    /* Increase hit area */
}

/* Dropdown Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--color-white);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-top: 3px solid var(--color-rbs-blue);
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
    display: block;
    /* Override flex */
    border-radius: 0 0 4px 4px;
}

.main-nav li:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    display: block;
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 24px;
    font-size: 0.85rem;
    color: var(--color-navy-dark);
    text-transform: none;
    /* Submenus usually nicer in normal case */
    border-bottom: 1px solid #f5f5f5;
    white-space: nowrap;
    transition: background 0.2s;
    text-align: left;
}

.dropdown-menu a:hover {
    background-color: var(--color-light-gray);
    color: var(--color-rbs-blue);
    padding-left: 28px;
    /* Slide effect */
    border-bottom: 1px solid #f5f5f5;
    /* Keep border */
}

/* Specific adjustment for wider dropdowns if needed */
.dropdown-wide {
    min-width: 260px;
}

.lang-toggle {
    font-size: 0.8rem;
    font-weight: 600;
}

.lang-toggle a {
    color: #999;
}

.lang-toggle a.active {
    color: var(--color-navy-dark);
}

/* --- RISK CARDS (IMAGE BASED) --- */

/* Reset/Override grid for cards */
.risks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Auto fit for responsiveness */
    gap: 24px;
}

.risk-card.image-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}

.risk-card.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    height: 200px;
    /* Fixed height for image */
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-card:hover .card-image img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 51, 89, 0.85);
    /* Navy transparent */
    padding: 12px 16px;
}

.card-overlay h3 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.image-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--color-rbs-blue);
    /* Accent line */
}

/* Remove old card header styles if they conflict, but risk-card structure changed so likely fine. */
.image-card .risk-row.dark {
    background: #fff;
    padding: 24px;
    flex: 1;
}

.main-nav a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-navy-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-nav a:hover {
    color: var(--color-rbs-blue);
    border-bottom: 2px solid var(--color-rbs-blue);
}

/* --- HERO CAROUSEL --- */
.hero-carousel {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    margin-top: 0;
    /* Cover everything */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    visibility: hidden;
}

.active-slide {
    opacity: 1;
    visibility: visible;
}

.video-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
    /* Much darker as requested */
    /* Darken for text readability */
}

/* Persistent Main Text Position */
.main-hero-text {
    position: absolute;
    top: 40%;
    /* Moved up to spacing for slide text */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: var(--container-width);
    padding: 0 24px;
    z-index: 20;
    color: var(--color-white);
    text-align: left;
    pointer-events: none;
}

.main-hero-text h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--color-white);
    max-width: 800px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    /* improved readability */
}

.main-hero-text .subheadline {
    font-size: 1.25rem;
    max-width: 600px;
    color: #f0f0f0;
    /* slightly brighter */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Slide Specific Overlay Text (Semi-transparent box) */
.slide-overlay {
    position: absolute;
    bottom: 60px;
    /* Explicit space from bottom */
    left: 0;
    width: 100%;
    z-index: 25;
}

.slide-content {
    background: rgba(13, 27, 42, 0.8);
    /* 80% opacity dark */
    /* Deeper navy, higher opacity */
    padding: 24px 32px;
    max-width: 480px;
    /* Contained width */
    border-left: 4px solid var(--color-rbs-blue);
    margin-left: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    color: var(--color-white);
}

.slide-tag {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #a0c4ff;
    margin-bottom: 8px;
}

.slide-text {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-white);
    line-height: 1.3;
}

/* Carousel Controls */
.carousel-nav {
    position: absolute;
    bottom: 30px;
    right: 40px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.indicators {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
}

.active-dot {
    background-color: var(--color-white);
}

/* --- SECTIONS GENERAL --- */
section {
    padding: 100px 0;
}

.section-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-rbs-blue);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
    max-width: 800px;
}

.bg-light {
    background-color: var(--color-light-gray);
}

.bg-navy {
    background-color: var(--color-navy-dark);
    color: var(--color-white);
}

/* --- PROBLEM SECTION --- */
.section-problem p {
    font-size: 1.25rem;
    color: var(--color-slate);
    margin-bottom: 24px;
    max-width: 900px;
}

/* --- CATEGORY SECTION --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.cat-col h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 8px;
    display: inline-block;
}

.highlight h3 {
    border-color: var(--color-rbs-blue);
    color: var(--color-rbs-blue);
}

/* --- RISKS SECTION (FICHAS) --- */
.risks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
}

.risk-card {
    border: 1px solid #e0e0e0;
    background: var(--color-white);
}

.card-header {
    background: var(--color-navy-dark);
    padding: 16px 24px;
}

.card-header h3 {
    color: var(--color-white);
    font-size: 1.2rem;
    margin: 0;
}

.risk-card {
    background: #1e293b;
    border: 1px solid #334155;
}

.risk-row.dark {
    background: transparent;
    color: var(--color-white);
}

.risk-row p {
    color: #cbd5e1;
}

.card-body {
    display: flex;
    flex-direction: column;
}

.risk-row {
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.risk-row.dark {
    background-color: #f9fbff;
    border-bottom: none;
}

.risk-tag {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-slate);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.risk-row p {
    font-size: 0.95rem;
    color: #333;
    margin: 0;
}

/* --- SOLUCIONES (Updated to Cards) --- */
.solutions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

.solution-item {
    background: #ffffff;
    padding: 32px;
    border-radius: 4px;
    border-left: 6px solid var(--color-rbs-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.solution-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.solution-item h4 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: var(--color-navy-dark);
}

.solution-item p {
    color: var(--color-slate);
    line-height: 1.6;
    margin: 0;
}

/* --- METHOD SECTION --- */
.method-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.step {
    position: relative;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    /* Subtle light line for dark mode */
}

.step-num {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-rbs-blue);
    /* Visible color */
    position: absolute;
    top: -35px;
    /* Adjusted to center on line */
    right: 10px;
    background-color: var(--color-black);
    /* Match section bg to mask line */
    /* Mask the line */
    padding-left: 10px;
    padding-right: 0;
    z-index: 2;
}

.step h3 {
    margin-bottom: 16px;
    margin-top: 20px;
    /* Push content down slightly */
}

/* --- CREDENTIALS SECTION --- */
.creds-flex {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.cred-item {
    flex: 1;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 32px;
}

.cred-title {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 16px;
}

.cred-item p {
    color: #a0c4ff;
    font-size: 0.95rem;
}

/* --- FOOTER / CTA --- */
.site-footer {
    background-color: #0d1b2a;
    color: var(--color-white);
    padding: 100px 0 40px;
    text-align: center;
}

.footer-content-wrapper h2 {
    color: var(--color-white);
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.btn-cta {
    display: inline-block;
    background-color: var(--color-rbs-blue);
    color: var(--color-white);
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--color-rbs-blue);
}

.btn-cta:hover {
    background-color: transparent;
    border-color: var(--color-white);
}

.footer-bottom {
    margin-top: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    font-size: 0.8rem;
    color: #666;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .hero-carousel {
        height: 600px;
        /* Smaller fixed height on tablets */
    }

    .main-hero-text h1 {
        font-size: 2.5rem;
    }

    .method-steps,
    .solutions-list,
    .creds-flex {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .header-container {
        flex-direction: column;
        height: auto;
        padding: 16px;
    }

    .site-header {
        height: auto;
        position: relative;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        margin: 16px 0;
    }
}