/* 
   AVES DEL CHACO - Global Style Sheet
   Modernized vintage & book-like design system.
*/

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lora:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* Base Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    color: #2c1804;
    background-color: #162413; /* Fallback deep green */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Category Specific Backgrounds / Page Gradient Wrappers */
.degradado {
    min-height: 100vh;
    padding: 20px 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Book Container - The primary container simulating a physical book layout */
.book-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #f7eedb url('fotos/papelvie2.jpg') repeat;
    border: 1px solid #4a3417;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 0 40px rgba(74, 52, 23, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    padding: 10px;
}

/* Border styling matching the vintage aesthetic */
.book-container::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px double #8a683e;
    pointer-events: none;
    border-radius: 2px;
}

/* Typography Modernization */
h1, h2, h3, h4, h5, h6, th, .family-title {
    font-family: 'Cinzel', Georgia, serif;
    color: #4a2f0f;
    letter-spacing: 0.05em;
    margin-top: 0.5em;
}

h2 {
    border-bottom: 1px double #8a683e;
    padding-bottom: 5px;
    display: inline-block;
    width: 100%;
    text-align: center;
}

p, td {
    font-family: 'Lora', Georgia, serif;
    font-size: 16px;
    color: #381e06;
}

/* Table layout overrides to ensure responsiveness */
table {
    max-width: 100% !important;
    width: 100% !important;
    border-collapse: collapse;
    margin: 15px auto;
}

/* Keep internal image links responsive */
img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
}

/* Navigation Links Style (Vintage Buttons) */
a {
    color: #6c400c;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease, transform 0.2s ease;
}

a:hover {
    color: #c48a12;
}

/* Category Index Pages (e.g. fotosp1.htm, flores1.htm) */
.family-header {
    background: #4a3417 url('fotos/papelvie4.jpg') repeat !important;
    color: #ffffff !important;
    font-family: 'Cinzel', serif;
    font-size: 18px;
    padding: 8px !important;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    border-radius: 2px;
}

/* Bird/Species list items (Tables styled as cards on mobile) */
td[align="center"] {
    vertical-align: middle;
}

/* Audio Player Vintage Button styling */
.audio-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e6d3af;
    border: 1px solid #9c7b4f;
    border-radius: 30px;
    padding: 6px 12px;
    margin: 5px 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.audio-link:hover {
    background: #8a683e;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    transform: translateY(-1px);
}

.audio-link img {
    margin-right: 5px;
    width: 16px;
    height: 16px;
}

/* Photo Gallery (Detail Pages e.g. verdugopiofs.htm) */
#content {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
}

#info {
    width: 100%;
    box-sizing: border-box;
}

#holder {
    position: relative !important;
    display: flex !important;
    flex-direction: row-reverse !important; /* Carrete right, preview left */
    justify-content: flex-start !important;
    align-items: flex-start !important;
    width: 960px !important;
    height: 650px !important;
    background: #151208 !important; /* Premium dark vintage sepia */
    border: 1px solid #3d2f1d !important;
    border-radius: 4px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8) !important;
    margin: 20px auto !important;
    box-sizing: border-box !important;
    padding: 0 !important;
}

#scrollContainer {
    position: static !important;
    width: 130px !important;
    height: 610px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin: 5px 5px 5px auto !important; /* Push to the right edge */
    box-sizing: border-box !important;
}

#scrollbox {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 110px !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

#scrollbox li {
    width: 110px !important;
    height: 100px !important;
    background: url(fotos/35mmb.gif) no-repeat center center !important;
    background-size: cover !important;
    transition: box-shadow 0.2s ease !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

#scrollbox li:hover {
    box-shadow: 0 0 12px #d1b894 !important;
}

#scrollbox a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background: none !important; /* Disable double frame backgrounds for all slides */
}

#scrollbox a img.thumb {
    width:105px !important;
    height:105px !important;
    display: block !important;
    padding:18px 2px !important;
    border: 0 !important;
    box-sizing: border-box !important;
}

/* Detail view (nested ul containing full size image) */
#scrollbox ul {
    display: none !important;
}

/* Hover effect to reveal the full image */
#scrollbox li:hover ul, #scrollbox li:focus-within ul {
    display: block !important;
    position: absolute !important;
    left: 20px !important; /* Position relative to #holder on the left */
    top: 20px !important;
    width: 760px !important;
    height: 610px !important;
    background: #151208 !important; /* Matches holder background */
    z-index: 10 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
}

#scrollbox li:hover ul li {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    list-style: none !important;
}

#scrollbox li:hover ul li a {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    text-decoration: none !important;
}

#scrollbox li:hover ul li a img {
    max-width: 100% !important;
    max-height: 520px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border: 8px solid #4a3417 !important;
    border-image: url('fotos/marco.jpg') 30 repeat !important;
    border-radius: 2px !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5) !important;
}

/* Caption span inside full size image */
#scrollbox li:hover ul li a span {
    position: absolute !important;
    display: block !important;
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    height: auto !important;
    background: rgba(44, 24, 4, 0.95) !important;
    color: #f7eedb !important;
    padding: 8px 25px !important;
    border-radius: 2px !important;
    font-family: 'Lora', serif !important;
    font-size: 15px !important;
    text-align: center !important;
    border: 1px solid #8a683e !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4) !important;
    white-space: nowrap !important;
    z-index: 20 !important;
}

p.instructions {
    position: absolute !important;
    left: 40px !important;
    top: 250px !important;
    width: 700px !important;
    font-size: 20px !important;
    color: #d1b894 !important; /* Golden/cream readable text */
    text-align: center !important;
    font-family: 'Cinzel', serif !important;
    pointer-events: none !important;
    z-index: 1 !important;
    line-height: 1.6 !important;
}

/* Responsive Overrides (Mobile screens) */
@media (max-width: 800px) {
    /* Stack tables and columns vertically */
    table, tbody, tr, td {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    /* Stack index side menu and main area */
    td[width="140"] {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        background: transparent !important;
        padding: 10px !important;
        border-bottom: 2px double #8a683e !important;
    }

    td[width="140"] a img {
        height: 40px !important;
        width: auto !important;
    }

    td[width="610"], td[width="620"] {
        padding: 15px !important;
    }

    /* Transform species table layout into clean mobile cards */
    tr[background="fotos/marco.jpg"] {
        background: rgba(247, 238, 219, 0.5) !important;
        border: 1px solid #9c7b4f !important;
        border-radius: 6px !important;
        margin-bottom: 25px !important;
        padding: 15px !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    tr[background="fotos/marco.jpg"] td {
        text-align: center !important;
        padding: 5px 0 !important;
    }

    tr[background="fotos/marco.jpg"] td[rowspan="4"] {
        order: -1 !important; /* Move bird image to the top of the card */
        margin-bottom: 10px !important;
    }

    tr[background="fotos/marco.jpg"] td[rowspan="4"] img {
        width: 100% !important;
        max-width: 250px !important;
        height: auto !important;
        border-radius: 4px !important;
        border: 3px solid #8a683e !important;
    }

    /* Mobile Detail Gallery Layout */
    #holder {
        flex-direction: column !important;
        height: auto !important;
        padding: 15px 10px !important;
        background: #151208 !important;
    }

    p.instructions {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        font-size: 16px !important;
        margin-bottom: 20px !important;
        color: #d1b894 !important;
    }

    #scrollContainer {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin-left: 0 !important;
        padding: 0 !important;
    }

    #scrollbox {
        width: 100% !important;
        height: auto !important;
        gap: 30px !important;
    }

    /* Hide the thumbnail negatives entirely on mobile */
    #scrollbox > li {
        width: 100% !important;
        height: auto !important;
        background: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    #scrollbox > li > a {
        display: none !important;
    }

    /* Force full-size images to display stacked vertically */
    #scrollbox ul {
        display: block !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
    }

    #scrollbox ul li {
        width: 100% !important;
        height: auto !important;
    }

    #scrollbox ul li a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        height: auto !important;
    }

    #scrollbox ul li a img {
        max-width: 100% !important;
        max-height: none !important;
        height: auto !important;
        border: 4px solid #4a3417 !important;
        border-image: url('fotos/marco.jpg') 30 repeat !important;
    }

    #scrollbox ul li a span {
        position: relative !important;
        left: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        display: block !important;
        margin: 10px auto 0 auto !important;
        background: rgba(44, 24, 4, 0.95) !important;
    }
}
