/* Define root-level custom properties (CSS variables) */
:root {
    --gold_box: rgb(143, 109, 45); /* Gold color for year buttons */
    --gold_box_hoover: rgb(143, 109, 45); /* Hover state for year buttons */
    --clicked_year_color: #442A14; /* Selected year button color */
    --light_gray: #dadada; /* Primary light gray */
    --lighter_gray: #f8f9fa; /* Secondary lighter gray */
}

/* General settings for the entire page */
body {
    padding-left: 0.4rem; /* Consistent margin */
    padding-right: 0.4rem; /* Consistent margin */
    width: 100%;
}
p {
    margin-top: 2px;
    margin-bottom: 2px;
}

ol, ul, li {
    margin-bottom: 0px;
}

/* Adjust all h4 elements globally */
h4 { text-align: center; }
h5 { text-align: center; }

/* Add padding to ordered lists for spacing */
ol {
    padding-left: 0.1rem; /* Space on the left */
    margin-left: 0.1rem; /* Consistent margin */
    margin-right: 0.2rem; /* Consistent margin */
}

/* Reusable column style (adjustable for various layouts) */
.left-panel {
    padding-left: 1.5rem; /* Consistent margin */
    padding-right: 1.5rem; /* Consistent margin */
    padding-top: 2px;
}
.central-panel {
    padding-left: 1.5rem; /* Consistent margin */
    padding-right: 1.5rem; /* Consistent margin */
    padding-top: 2px;
    background-color: var(--light_gray);
}
.right-panel {
    padding-left: 1.5rem; /* Consistent margin */
    padding-right: 1.5rem; /* Consistent margin */
    padding-top: 2px;
    padding-bottom: 12px;
}
.catalogue-panel {
    padding-left: 0.1rem; /* Consistent margin */
    padding-right: 0.1rem; /* Consistent margin */
    padding-top: 5px;
    padding-bottom: 1.5rem;
    background-color: var(--light_gray);
}

footer {
    margin-top: 5rem;
}

/* Applies a pointer cursor to clickable elements */
.clickable { cursor: pointer; }

/* Ensure the container uses full width */
.container-fluid {
    margin: 0 auto;
    padding: 0;
}

/* Panels (general style for grouped elements) */
.light_gray_panel {
    background-color: var(--light_gray);
    color: #000; /* Text in panels is black */
    padding: 15px; /* Internal padding */
}

/* Style for year buttons */
.year-box {
    display: inline-block;
    text-align: center;
    width: 80px; /* Fixed width */
    height: 40px; /* Fixed height */
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: var(--gold_box); /* Default color */
    color: white; /* Text color */
    cursor: pointer; /* Show pointer on hover */
}
.year-box:hover {
    background-color: var(--gold_box_hoover);
}

/* Radio buttons container */
.radio-toolbar {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap */
    gap: 5px; /* Consistent spacing */
    justify-content: center; /* Center the buttons */
}

/* Hide the actual radio buttons */
.radio-toolbar input[type="radio"] { display: none; }

/* Style for the labels of radio buttons */
.radio-toolbar label {
    display: flex; /* Flex for centering */
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 50px; /* Match year-box width */
    height: 30px; /* Match year-box height */
    font-size: 14px;
    background-color: var(--gold_box); /* Default color */
    color: white;
    cursor: pointer; /* Pointer for clickability */
}
.radio-toolbar label:hover {
    background-color: var(--gold_box_hoover);
}

/* Selected radio button label */
.radio-toolbar input[type="radio"]:checked + label {
    background-color: var(--clicked_year_color);
}

/* iframe */
.iframe-container {
    position: relative;
    width: 100%; /* Full width */
    padding-bottom: 56.25%; /* Aspect ratio for 16:9 */
    height: 0;
    overflow: hidden;
}
.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===== moved from HTML: table + search UI ===== */
thead { background-color: #898989; cursor: pointer; }
* { box-sizing: border-box; }

.float-parent-element { width: 100%; }
.float-child-element_left { float: left; width: 90%; height: 80px; }
.float-child-element_right { float: left; width: 10%; height: 80px; }
.left_div { margin-left: 10px; }
.right_div { margin-left: 0px; }

#myInput {
    background-position: 10px 10px;
    width: 90%;
    font-size: 16px;
    padding: 12px 20px;
    border: 1px solid #ddd;
    margin-bottom: 12px;
}

/* make table smaller by default (desktop too) */
#myTable {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

#myTable th, #myTable td {
    text-align: left;
    padding: 12px;
}

#myTable tr { border-bottom: 1px solid #ddd; }

th, td { text-align: left; padding: 8px; }

/* Responsiveness for small screens */
@media (max-width: 800px) {
    /* Adjust font sizes for headings */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.2rem; }

    h4 {
        font-size: 1.1rem;
        padding-bottom: 0px;
        padding-top: 0px;
        margin-bottom: 0px;
        text-align: center;
    }

    h5 {
        font-size: 1.1rem;
        text-align: center;
        padding-top: 5px;
        margin-bottom: 3px;
        margin-top: 3px;
    }

    h6 { font-size: 0.6rem; }

    p { margin-top: 1px; }

    /* Adjust font sizes for paragraph text */
    body, p, ol, ul, li {
        font-size: 0.8rem;
        margin-bottom: 0px;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    /* Reusable column style (adjustable for various layouts) */
    .left-panel {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .central-panel { margin-top: 1rem; }
    .right-panel {
        padding-left: 1.5rem;
        padding-right: 0.5rem;
    }

    /* Adjust year button font sizes */
    .year-box {
        font-size: 0.8rem;
        width: 60px;
        height: 30px;
    }
    .light_gray_panel{
        padding: 5px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .radio-toolbar label {
        font-size: 0.5rem;
        width: 30px;
        height: 18px;
    }
    .text-center{
        margin-top: 1px;
        margin-bottom: 0px;
    }

    /* force table font size */
    #myTable, #myTable th, #myTable td {
        font-size: 0.6rem !important;
        line-height: 1.15 !important;
    }

    /* avoid iOS/Safari auto text scaling */
    html { -webkit-text-size-adjust: 100%; }

    /* Horizontal scroll for the table (mobile-safe) */
    .table-scroll{
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #myTable{
        width: 100%;
        table-layout: auto;
    }

    /* Default behaviour: allow wrapping for text columns */
    #myTable th,
    #myTable td{
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* Column 1: Piece */
    #myTable th:nth-child(1),
    #myTable td:nth-child(1){
        min-width: 15ch;
    }

    /* Column 2: Type */
    #myTable th:nth-child(2),
    #myTable td:nth-child(2){
        min-width: 10ch;
        width: 1%;
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
        text-align: left;
    }

    /* Column 3: Composer */
    #myTable th:nth-child(3),
    #myTable td:nth-child(3){
        min-width: 10ch;
    }

    /* Column 4: Times (never wrap numbers) */
    #myTable th:nth-child(4),
    #myTable td:nth-child(4){
        min-width: 4ch;
        width: 1%;
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
        text-align: right;
    }
}

/* Tabs match panel background */
.nav-tabs .nav-link {
    color: #444;
    background-color: transparent;
    border: 1px solid transparent;
}

.nav-tabs .nav-link.active {
    background-color: var(--light_gray);
    color: #000;
    border-color: #dee2e6 #dee2e6 var(--light_gray);
}

.plot-box{
  background:#fff;
  border:1px solid #ddd;
  border-radius:8px;
  padding: 8px;
}

/* fixed chart area, NOT fixed canvas */
.plot-chart{
  position: relative;
  height: 240px;   /* ajusta aqui: 220, 260, 300... */
}

.plot-chart canvas{
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.plot-title{
  font-size:0.95rem;
  margin:0 0 6px 0;
}

.plot-desc {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 6px;
}

.plot-reading {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 6px;
  margin-top: 16px;
  font-style: italic;
}

.plot-reading::before{
  content: "Plot reading: ";
  font-weight: bold;
}

.page-subtitle {
  font-size: 0.95rem;
  color: #555;
  margin: 0.25rem 0 0;
}

@media (max-width: 576px) {
  .page-subtitle {
    font-size: 0.85rem;
  }
}
