/* ================================
   Base and Reset Styles for Print
   ================================ */

* {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
}

html, body {
    font-family: 'Georgia', serif;
    font-size: 12pt;
    line-height: 1.6;
    background: #fff;
    color: #000;
    margin: 0;
    padding: 1in;
    width: 100%;
}

/* Hide elements that don't make sense in print */
header,
nav,
.navbar,
.footer,
.carousel,
.carousel-inner,
.carousel-control-prev,
.carousel-control-next,
.carousel-indicators,
.mask,
.btn,
.button,
.btn-group,
.alert,
.toast,
.form-control,
form,
input,
select,
textarea,
canvas,
iframe,
video,
audio,
.daily-picture,
#fibonacci,
#pagination,
script,
style {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* ================================
   Typography
   ================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    margin: 1em 0 0.5em;
    page-break-after: avoid;
    color: #000;
}

h1 {
    font-size: 20pt;
    border-bottom: 2px solid #000;
    padding-bottom: 0.3em;
}

h2 {
    font-size: 16pt;
    border-bottom: 1px solid #000;
    padding-bottom: 0.2em;
}

h3 {
    font-size: 14pt;
}

p {
    font-size: 12pt;
    margin: 0.6em 0;
    orphans: 3;
    widows: 3;
}

blockquote {
    margin: 1em 2em;
    font-style: italic;
    border-left: 4px solid #ccc;
    padding-left: 1em;
}

/* ================================
   Links and Anchors
   ================================ */

a {
    color: #000;
    text-decoration: underline;
}

a::after {
    content: " [" attr(href) "]";
    font-size: 90%;
}

/* ================================
   Tables
   ================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    page-break-inside: avoid;
}

th, td {
    border: 1px solid #000;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

th {
    background-color: #eee;
    font-weight: bold;
}

caption {
    caption-side: top;
    font-weight: bold;
    margin-bottom: 0.5em;
}

/* ================================
   Layout and Containers
   ================================ */

.container,
.container-fluid,
.row,
.col,
.col-md-6,
.col-sm-12,
.col-lg-4 {
    display: block;
    width: 100% !important;
    float: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

.text-muted {
    color: #333 !important;
}

/* ================================
   Specific Sections
   ================================ */

#tableContainer, #tableBody {
    margin-top: 2em;
    page-break-before: always;
}

#quote, #quote-author {
    font-style: italic;
    font-size: 14pt;
    margin-top: 1em;
    text-align: center;
}

#movies {
    page-break-before: always;
}

#movies h2 {
    font-size: 16pt;
    border-bottom: 1px solid #000;
    margin-bottom: 1em;
}

.movie-card {
    margin-bottom: 2em;
    page-break-inside: avoid;
}

.products {
    page-break-before: always;
}

.product {
    page-break-inside: avoid;
    margin-bottom: 2em;
    padding: 1em;
    border: 1px solid #aaa;
}

.product h3 {
    font-size: 14pt;
    margin-bottom: 0.5em;
}

.product img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-bottom: 0.5em;
}

.product p {
    font-size: 11pt;
}

/* ================================
   Footer Styling
   ================================ */

footer {
    display: block !important;
    font-size: 10pt;
    border-top: 1px solid #000;
    margin-top: 2em;
    padding-top: 1em;
    text-align: center;
}

footer .text-uppercase {
    text-transform: uppercase;
    font-weight: bold;
}

/* ================================
   Pagination and Page Breaks
   ================================ */

.page-break {
    page-break-before: always;
}

section, article, aside {
    page-break-inside: avoid;
}

img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
}

/* ================================
   Hide Empty Dynamic Elements
   ================================ */

#tableBody:empty,
#quote:empty,
#quote-author:empty {
    display: none !important;
}
