/* Container for Flexbox */
div.container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    max-width: 100%; /* Ensure the container uses the full available width */
    flex-wrap: nowrap; /* Prevents wrapping of items */
}

/* Block styles */
div#left-block, div#right-block {
    width: 250px;
    padding: 10px;
    border-width: 2px;
    border-style: solid;
    border-color: black;
    background: rgba(255, 255, 255, 0.5);
    margin: 10px;
    flex-shrink: 0; /* Prevents blocks from shrinking */
}

div#central-block {
    flex-grow: 1; /* Allows the central block to grow */
    padding: 8px 10px 10px 10px;
    border: none;
    background: none;
    min-width: 300px;
    flex-shrink: 1; /* Allows the central block to shrink */
}

/* Responsive layout: Stack blocks on top of each other on small screens */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        align-items: stretch;
    }

    div#left-block, div#right-block, div#central-block {
        width: 95%; /* Full width for all blocks */
        margin: 10px 0; /* Add vertical margin between blocks */
    }
}

/* Other existing styles */
.title {
    text-align: center;
}

p.small {
    font-size: small;
}

.map {
    width: 100%;
    height: 200px;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    background-color: rgba(255, 255, 255, 0.2);
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid transparent;
    transition: background-color 0.3s, border-color 0.3s;
}

.button:hover {
    background-color: rgba(255, 255, 255, 0.4);
    border-color: #333;
}

/* Tab CSS */
.tab {
    display: grid;
    /* All tabs on a single row, however many there are; each shares the width. */
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 5px;
    border-bottom: 1px solid #ccc;
    background-color: rgba(255, 255, 255, 0.2);
}

.tab button {
    background-color: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: 15px;
    text-align: center;
    width: 100%;
    font-family: "Garamond";
    font-weight: bold;
}

.tab button:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.tab button.active {
    background-color: rgba(255, 255, 255, 0.6);
}

.tabcontent-single {
    display: block;
    padding: 6px 12px;
    border-top: none;
    background-color: rgba(255, 255, 255, 0.5);
}

.tabcontent {
    display: none;
    padding: 6px 12px;
    border-top: none;
    background-color: rgba(255, 255, 255, 0.5);
}

.tabcontent.show {
    display: block;
}

/* Responsive layout for tab buttons: single row everywhere except narrow
   phones, where 6 tabs on one line would be unusable, so they stack. */
@media (max-width: 599px) {
    .tab {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: 1fr;
    }
}

/* Grid for infoboxes */
.infobox-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 10px !important;
    padding: 10px;
}

.infobox {
    padding: 10px;
    border: 1px solid #ccc;
}

/* Responsive layout */
@media (max-width: 599px) {
    #Informacion {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 600px) and (max-width: 1199px) {
    #Informacion {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    #Informacion {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* CSS for territories template */
#contenido-fuentes h3 {
    margin-top: 20px;
}

#contenido-fuentes ul {
    list-style-type: none;
    padding: 0;
}

#contenido-fuentes ul li {
    margin-bottom: 5px;
}

#contenido-fuentes ul li a:hover {
    text-decoration: underline;
}

#contenido-fuentes ul li strong {
    font-weight: bold;
}

#contenido-fuentes ul li[style*="font-size: smaller;"] {
    font-size: smaller;
}


/* CSS for search templates */


        .results {
            margin-top: 20px;
        }
.form-container {
    padding: var(--sp-3, 14px) var(--sp-4, 18px);
    background: var(--surface-2, #f4f5f7);
    color: var(--ink, #1a1a1a);
    border: 1px solid var(--border, #ccc);
    border-radius: var(--radius, 10px);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Three columns */
    gap: 20px;
    width: 100%;
}

.main-inputs, .middle-inputs, .additional-inputs {
    display: flex;
    flex-direction: column;
}

form {
	margin:0;
    align-items: flex-start;
}

form label {
    font-size: 0.85em;
    margin-top: 8px;
    color: var(--ink, #1a1a1a);
}

form input, form select {
    width: 100%;
    padding: 7px 9px;
    margin-top: 4px;
    font-size: 0.9em;
    max-width: 320px;              /* slimmer boxes */
    background: var(--surface, #fff);
    color: var(--ink, #1a1a1a);
    border: 1px solid var(--border-strong, #b8b8b8);
    border-radius: 7px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

form input:focus, form select:focus {
    outline: none;
    border-color: var(--accent, #2b4b68);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #2b4b68) 25%, transparent);
}

form input::placeholder { color: var(--muted, #888); }

form button {
    width: auto;
    padding: 9px 20px;
    margin-top: 15px;
    background: var(--accent, #2b4b68);
    color: var(--accent-ink, #fff);
    border: none;
    border-radius: 7px;
    font-size: 0.9em;
    cursor: pointer;
}

form button:hover {
    filter: brightness(1.08);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr; /* Stack columns on small screens */
    }
}


.checkbox-group {
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-size: 0.9em;
    color: var(--muted, #555);
}

.search-help {
    background: var(--surface, #fff);
    color: var(--ink, #1a1a1a);
    border: 1px solid var(--border, #ddd);
    padding: 10px 12px;
    border-radius: var(--radius, 8px);
    margin-top: 10px;
    font-size: 0.9em;
}

.search-tips-columns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tips-spanish,
.tips-english {
    flex: 1;
    min-width: 300px;
}

.tips-spanish ul,
.tips-english ul {
    margin: 0;
    padding-left: 20px;
}

@media (max-width: 768px) {
    .search-tips-columns {
        flex-direction: column;
        gap: 10px;
    }
    
    .tips-spanish,
    .tips-english {
        min-width: unset;
    }
}