
/* --- Basic Reset & Body --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px; /* Base font size */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* System font stack */
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    display: flex; /* Crucial for sidebar layout IF sidebar is present */
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

h1 { font-size: 2.2rem; color: #212529; }
h2 { font-size: 1.8rem; }
h2 small { font-size: 1rem; margin-left: 10px; color: #6c757d; }

/* --- Layout --- */
/* Sidebar styles: Assumes a fixed sidebar IS used (defined outside this template or in header.html.twig). */
/* If no fixed sidebar, remove .sidebar styles and set content-wrapper margin-left to 0. */
.sidebar {
    width: 200px; /* <<< MUST MATCH margin-left on .content-wrapper */
    background-color: #315a6d;
    padding: 20px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    color: #f8f9fa;
    overflow-y: auto;
    /*box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);*/
    z-index: 1000; /* Ensure sidebar is above content */
}

.sidebar img {
    max-width: 100%;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
/* End Optional Sidebar Styles */

.content-wrapper {
     /* This margin pushes content past the fixed sidebar. */
     /* Set to 0 if no fixed sidebar is used. */
    margin-left: 200px; /* <<< MUST MATCH width of .sidebar */
    padding: 20px;
    width: calc(100% - 200px); /* Adjust width if sidebar exists */
    /* width: 100%; */ /* Use if no sidebar */
    flex-grow: 1;
    position: relative; /* Needed for stacking context if sidebar uses z-index */
    z-index: 1; /* Ensure content is below fixed sidebar if it has higher z-index */
}

.page-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px; /* Gutters */
    padding-right: 15px;
}

/* --- Grid System (Flexbox based) --- */
.grid-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px; /* Gutter compensation */
    margin-right: -10px;
}

.grid-row > [class*="grid-col-"] {
    padding-left: 10px; /* Gutters */
    padding-right: 10px;
    margin-bottom: 1.5rem; /* Default vertical spacing */
    width: 100%; /* Default to full width (mobile first) */
}

/* Column Widths */
.grid-col-12 { flex: 0 0 100%; max-width: 100%; }

/* Responsive Columns (Apply base, override for larger screens) */
@media (min-width: 768px) { /* Medium devices + */
    .grid-col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .grid-col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .grid-col-md-12 { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 992px) { /* Large devices + */
     .grid-col-lg-6 { flex: 0 0 50%; max-width: 50%; }
     .grid-col-lg-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
     .grid-col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}


/* --- Spacing Utilities --- */
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }

/* --- Text Utilities --- */
.text-success { color: #198754 !important; }
.text-danger { color: #dc3545 !important; }
.text-muted { color: #6c757d !important; }
.text-center { text-align: center !important; }
.text-start { text-align: left !important; }

/* --- Cards --- */
.custom-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.custom-card-header {
    background-color: #f7f7f7; /* Slightly lighter header */
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.custom-card-body {
    padding: 1.25rem;
    flex-grow: 1;
}

/* --- Definition Lists (Profile/Price) --- */
.definition-list { }
.definition-item {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping for consistency */
    margin-bottom: 0.6rem; /* Slightly more space */
    font-size: 0.95rem;
    line-height: 1.4; /* Adjust line height */
}
.definition-item dt {
    flex: 0 0 130px; /* Slightly wider label */
    max-width: 130px;
    padding-right: 10px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}
.definition-item dd {
    flex: 1;
    color: #212529;
    margin-left: 0;
    word-break: break-word;
}

/* --- Buttons --- */
.custom-btn {
    display: inline-block; font-weight: 400; line-height: 1.5;
    color: #212529; text-align: center; text-decoration: none;
    vertical-align: middle; cursor: pointer; user-select: none;
    background-color: transparent; border: 1px solid transparent;
    padding: 0.375rem 0.75rem; font-size: 1rem; border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.custom-btn:hover { text-decoration: none; }
.custom-btn:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

.btn-primary { color: #fff; background-color: #0d6efd; border-color: #0d6efd; }
.btn-primary:hover { color: #fff; background-color: #0b5ed7; border-color: #0a58ca; }

/* --- Tables --- */
.table-responsive-wrapper { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
.custom-table {
    width: 100%; min-width: 600px; margin-bottom: 0; /* Remove margin if wrapper handles spacing */
    color: #212529; vertical-align: middle; border-collapse: collapse;
}
.custom-table th, .custom-table td {
    padding: 0.75rem; border-top: 1px solid #dee2e6;
    text-align: center; white-space: nowrap;
}
.custom-table thead th {
    vertical-align: bottom; border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa; font-weight: 600;
}
.custom-table tbody tr:nth-of-type(odd) { background-color: rgba(0, 0, 0, 0.03); }
.custom-table tbody tr:hover { background-color: rgba(0, 0, 0, 0.06); }
.custom-table td[colspan] { text-align: center; }

/* --- News List --- */
.news-list { list-style: none; padding-left: 0; margin-bottom: 0; }
.news-list li { border-bottom: 1px solid #eee; }
.news-list li:last-child { border-bottom: none; }
.news-list a {
    display: block; padding: 1rem 0; /* Pad only top/bottom if body has padding */
    color: inherit; text-decoration: none; transition: background-color 0.15s ease-in-out;
}
.news-list a:hover { background-color: #f0f0f0; text-decoration: none; }
.news-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.25rem; flex-wrap: wrap; gap: 0 1rem; }
.news-item-header h5 { margin-bottom: 0; font-size: 1.05rem; color: #0056b3; flex-grow: 1; }
.news-item-header small { white-space: nowrap; font-size: 0.85rem; color: #6c757d; padding-top: 0.1em; }
.news-summary { font-size: 0.9rem; color: #555; margin-bottom: 0; }
.no-news { padding: 1rem 0; }

/* --- Collapse Functionality --- */
.collapse-trigger {
    cursor: pointer; position: relative; user-select: none;
    transition: background-color 0.2s ease;
}
.collapse-trigger:hover { background-color: #dde2e6; }
.collapse-trigger:focus-visible { outline: 2px solid #0d6efd; outline-offset: 1px; background-color: #dde2e6; }

.collapse-trigger::after {
    content: '+'; font-family: monospace; font-weight: bold; font-size: 1.4em;
    line-height: 1; position: absolute; right: 1.25rem; top: 50%;
    transform: translateY(-50%); transition: transform 0.25s ease-in-out; color: #555;
}
.collapse-trigger.active::after { transform: translateY(-50%) rotate(45deg); } /* Changed to X */

.collapsible-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease-out, padding-top 0.35s ease-out, padding-bottom 0.35s ease-out, border-top-width 0.35s ease-out;
    padding-top: 0 !important; padding-bottom: 0 !important;
    border-top: 0px solid transparent;
}
.collapsible-content.active {
    padding-top: 1.25rem !important; padding-bottom: 1.25rem !important;
    border-top: 1px solid #dee2e6;
    /* max-height is set by JS */
}
/* Styling for content inside the collapsed financials section */
.financials-subsection-title {
     font-size: 1.1rem;
     font-weight: 600;
     color: #333;
     margin-top: 1rem;
     margin-bottom: 0.75rem;
     padding-bottom: 0.25rem;
     border-bottom: 1px solid #eee;
}
.financials-subsection-title:first-of-type {
     margin-top: 0; /* Remove top margin for the first title */
}
.financial-item { /* Class for each line item */
     font-size: 0.9rem;
     margin-bottom: 0.4rem; /* Space between items */
     line-height: 1.4;
}
.financial-item strong {
     display: inline-block; /* Or block if preferred */
     color: #495057;
     margin-right: 5px;
     /* min-width: 200px; */ /* Optional fixed width for labels */
}
.remove-btn {
    margin-left: 10px;
    padding: 2px 8px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.remove-btn:hover {
    background-color: #cc0000;
}


/* --- Responsive Design --- */
@media (max-width: 767.98px) {
     /* Stack sidebar if it exists and is using the .sidebar class */
    body { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: static;
        box-shadow: none; border-bottom: 1px solid #495057;
        /* Ensure content wrapper has no margin when sidebar stacks */
        .content-wrapper { margin-left: 0; width: 100%; }
    }
     /* Adjust content wrapper padding if needed for stacked sidebar */
     /* .content-wrapper { padding: 15px; } */


    .definition-item { flex-wrap: wrap; } /* Allow dt/dd to wrap */
    .definition-item dt,
    .definition-item dd {
        flex-basis: 100%; /* Stack definition items */
        max-width: 100%;
    }
    .definition-item dt { margin-bottom: 0.1rem; }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }

    .news-item-header { flex-wrap: wrap; }
    .news-item-header small { white-space: normal; } /* Allow date/source wrap */
}