/* 4ey_main.css
   ────────────────────────────────────────────────────────────────
   OFFSET DEPENDENCY
   - Requires 4ey_nav.css to define:
       --nav-banner-height: px value from top of screen to bottom of banner menu
       --nav-button-height: px value from top of screen to bottom of toggle button

   - This file computes:
       --offset-gap: additional spacing above content
       --offset-banner: calc(--nav-banner-height + --offset-gap)
       --offset-button: calc(--nav-button-height + --offset-gap)
*/

body {
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
    justify-content: flex-start;   /* anchor content at top */
    align-items: center;           /* keep horizontal centering */

    /* shared offset variables */
    --offset-gap: 10px; /* adjust for extra space under nav/banner globally */

    /* fallbacks preserve existing layout if nav vars are missing */
    --offset-banner: calc(var(--nav-banner-height, 75px) + var(--offset-gap));
    --offset-button: calc(var(--nav-button-height, 28px) + var(--offset-gap));
}

.font4ey {
    color: #B31017;
}

/* Special class for plain links -- do not change font effect for link. */
a.plain {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  font-style: inherit;
}
a.plain:visited,
a.plain:hover,
a.plain:active {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  font-style: inherit;
}

.tables-container {
    display: flex;
    flex-direction: column;
    justify-content: center;   /* stacked: horizontally center pair */
    align-items: center;       /* stacked: center in container */
    gap: 20px;
    margin-top: 0 !important;
    padding: 0;
}

.tables-container .container-jukebox {
    flex: 0 0 299px;           /* fixed width jukebox */
    max-width: 299px;
}

.tables-container .fun-facts {
    flex: 0 1 auto;            /* flexible width, natural height */
    max-width: 600px;          /* cap width */
    width: 100%;               /* scale responsively */
    padding: 0;
}

.article-tables {
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
}
.article-tables tr {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center; 
    gap: 20px;
}
.article-tables td {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 280px;
    text-align: center;
    padding: 10px;
}

/* Default: small/mid screens use button offset */
.container-600,
.container-700,
.container-1060 {
    margin: var(--offset-button) auto 0;
    width: 100%;
    max-width: 1060px;
    overflow-x: hidden;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}
.container-600 table,
.container-700 table,
.container-1060 table {
    width: 100%;
    min-width: 0;
    margin: 0 auto;
}

.container-600,
.container-600 table {
    max-width: 600px;
}
.container-700,
.container-700 table {
    max-width: 700px;
}
.container-1060,
.container-1060 table {
    max-width: 1060px;
}

.container-600 table,
.container-700 table {
    border-collapse: collapse;
}

.content-wrapper {
    width: 100%;
    max-width: 1060px;
    overflow-x: hidden;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.order-table,
.bestseller-table {
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

* {
    box-sizing: border-box;
}

img, table {
    max-width: 100%;
    height: auto;
}

img[src="images/cdcover_smaller.jpg"] {
    width: 250px !important;
    height: 247px !important;
    max-width: none !important;
}

p, td {
    overflow-wrap: break-word;
}

.banner-container {
    position: relative;
    width: 488px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.main-photo {
    display: block;
    width: 488px;
    max-width: 100%;
    height: auto;
    border: 1px solid black;
}

.banner-logo {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 442px;
    max-width: 90.57%;
    height: auto;
    z-index: 2;
}

@media (max-width: 400px) {
    .banner-container {
        width: 100%;
    }
    .main-photo {
        width: 100%;
    }
    .banner-logo {
        bottom: 0;
        width: 90.57%;
    }
    .content-wrapper {
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
    }
}

@media (min-width: 401px) and (max-width: 1060px) {
    .banner-container {
        width: 488px;
        max-width: 100%;
    }
    .main-photo {
        width: 488px;
        max-width: 100%;
    }
    .banner-logo {
        width: 442px;
        max-width: 90.57%;
        bottom: 0;
    }
    .content-wrapper {
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 1060px) {
    .container-700 table:not(.track-table, .bestseller-table) {
        width: 100% !important;
        max-width: 700px !important;
        min-width: 0 !important;
        margin: 0 auto;
	}
	
    .nested-table:not(.track-table, .ho, .h1, .bestseller-table) {
        width: auto !important;
        max-width: 100% !important;
        table-layout: auto;
    }
}
	
@media (max-width: 820px) {
    .track-table {
        width: 270px !important;
        margin: 0 auto !important;
    }
    .track-table tr {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }
    .track-table > tbody > tr > td {
        flex: 0 0 auto !important;
        width: 270px !important;
        padding: 10px !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
    }
    .track-table > tbody > tr > td[align="center"] {
        text-align: center !important;
    }
    .track-table .ho, .track-table .h1 {
        display: table !important;
        width: 270px !important;
        table-layout: auto !important;
        margin: 0 auto !important;
    }
    .track-table .ho tr, .track-table .h1 tr {
        display: table-row !important;
    }
    .track-table .ho td, .track-table .h1 td {
        display: table-cell !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        padding: 2px 5px !important;
        text-align: left !important;
    }
}

/* ───────────────────────────────────────────────
   LARGE SCREENS
   >1060px: side-by-side row anchored at top,
   tables centered with each other vertically
   ─────────────────────────────────────────────── */
@media (min-width: 1061px) {
    .tables-container,
    .container-600,
    .container-700,
    .container-1060 {
        margin-top: var(--offset-banner);
    }

    .tables-container {
        flex-direction: row;
        justify-content: center;  /* center horizontally */
        align-items: center;      /* center shorter table vertically */
        gap: 20px;
    }
	
    .article-tables tr {
        flex-direction: row;
        justify-content: center;
        gap: 50px;
    }

    .banner-container {
        width: 488px;
        margin-bottom: 15px;
    }
    .main-photo {
        width: 488px;
    }
    .banner-logo {
        width: 442px;
        bottom: 0;
    }
    .content-wrapper {
        max-width: 1060px;
        width: 100%;
    }
}

@media (orientation: landscape) and (max-width: 800px) {
    .banner-container {
        width: 488px;
        max-width: 100%;
    }
    .main-photo {
        width: 488px;
        max-width: 100%;
    }
    .banner-logo {
        bottom: 0;
        width: 442px;
        max-width: 90.57%;
    }
    .content-wrapper {
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
    }
}

.nested-table {
    width: auto !important;
    /*max-width: 100% !important;*/
    max-width: none !important;
    table-layout: auto;
    border-collapse: separate;
}
.nested-table-parent {
    text-align: center;
}

/* PATCH: Ensure nested tables always shrink to content width */
/* Put this at the very end of 4ey_main.css */
.tables-container table.nested-table,
.container-600 table.nested-table,
.container-700 table.nested-table,
.container-1060 table.nested-table {
    display: inline-table !important;
    width: auto !important;
    max-width: none !important;
    table-layout: auto !important;
    margin: 0 auto !important;   /* keeps them centered */
}

