/**
 * Menu Generator - A4 Print & Display Styles
 *
 * White background, black/orange text, tile background with low opacity.
 * Used in: admin preview, homepage display, print/PDF output.
 */

/* ==========================================================================
   A4 Menu Container
   ========================================================================== */

.beseder-menu-a4 {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    margin: 20px auto;
    overflow: hidden;
    font-family: Calibri, 'Segoe UI', Tahoma, sans-serif;
    color: #1a1a1a;
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Tile background layer */
.beseder-menu-a4-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 1;
    /* opacity set via inline style per-menu */
}

/* Light overlay for readability */
.beseder-menu-a4-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 2;
}

/* Content layer */
.beseder-menu-a4-content {
    position: relative;
    z-index: 3;
    padding: 8mm 20mm 15mm;
    display: flex;
    flex-direction: column;
    height: 297mm;
}

/* ==========================================================================
   Logo
   ========================================================================== */

.beseder-menu-a4-logo {
    text-align: center;
    margin-bottom: 6mm;
}

.beseder-menu-a4-logo img {
    max-width: 110mm;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   Title / Date Line
   ========================================================================== */

.beseder-menu-a4-title {
    text-align: center;
    font-size: 11pt;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #1a1a1a;
    padding: 3mm 0;
    margin-bottom: 4mm;
    border-top: 2px solid #c4744c;
    border-bottom: 2px solid #c4744c;
}

/* ==========================================================================
   Menu Body (WYSIWYG content)
   ========================================================================== */

.beseder-menu-a4-body {
    flex: 1;
    font-size: 11pt;
    font-weight: bold;
    line-height: 1.4;
    color: #1a1a1a;
}

.beseder-menu-a4-body h2 {
    font-size: 13pt;
    margin: 3mm 0 2mm;
    color: #3d2b1f;
}

.beseder-menu-a4-body h3 {
    font-size: 12pt;
    margin: 2mm 0 1mm;
    color: #3d2b1f;
}

.beseder-menu-a4-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.beseder-menu-a4-body table td {
    padding: 1mm 2mm;
    vertical-align: top;
    line-height: 1.4;
    font-size: 11pt;
    font-weight: bold;
}

.beseder-menu-a4-body hr {
    border: none;
    border-top: 2px solid #c4744c;
    margin: 2mm 0;
}

.beseder-menu-a4-body p {
    margin: 1mm 0;
}

/* ==========================================================================
   Tagline
   ========================================================================== */

.beseder-menu-a4-tagline {
    text-align: center;
    font-style: italic;
    font-size: 11pt;
    font-weight: bold;
    color: #c4744c;
    margin: 4mm 0;
    padding: 3mm 0;
}

/* ==========================================================================
   Footer (QR + Info)
   ========================================================================== */

.beseder-menu-a4-footer {
    margin-top: auto;
    padding-top: 4mm;
    border-top: 2px solid #c4744c;
    display: flex;
    align-items: center;
    gap: 8mm;
}

.beseder-menu-a4-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.beseder-menu-a4-qr img {
    width: 30mm;
    height: 30mm;
    padding: 0;
    border-radius: 1mm;
}

.beseder-menu-a4-qr-text {
    font-size: 11pt;
    font-weight: 700;
    color: #c4744c;
    text-align: center;
    line-height: 1.3;
}

.beseder-menu-a4-footer-text {
    flex: 1;
    text-align: center;
}

.beseder-menu-a4-footer-phone {
    font-size: 11pt;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 3mm;
}

.beseder-menu-a4-footer-info {
    font-size: 10pt;
    color: #666666;
    line-height: 1.5;
}

/* ==========================================================================
   Auto-scale: when content overflows A4 height
   ========================================================================== */

.beseder-menu-a4.beseder-menu-scaled {
    height: 297mm;
    overflow: hidden;
}

/* ==========================================================================
   Preview Toolbar
   ========================================================================== */

.beseder-preview-toolbar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.beseder-preview-toolbar .button .dashicons {
    vertical-align: middle;
    margin-right: 3px;
}

/* ==========================================================================
   Homepage Context - Responsive
   ========================================================================== */

.beseder-menu-homepage {
    width: 100%;
    max-width: 700px;
    min-height: auto;
    box-shadow: none;
    margin: 0 auto;
    border-radius: 8px;
}

.beseder-menu-homepage .beseder-menu-a4-content {
    padding: 25px 25px 20px;
    height: auto;
}

.beseder-menu-homepage .beseder-menu-a4-logo img {
    max-width: 350px;
}

@media (max-width: 768px) {
    .beseder-menu-homepage .beseder-menu-a4-content {
        padding: 20px 15px 15px;
    }

    .beseder-menu-homepage .beseder-menu-a4-logo img {
        max-width: 250px;
    }

    .beseder-menu-homepage .beseder-menu-a4-title {
        font-size: 11pt;
    }

    .beseder-menu-homepage .beseder-menu-a4-body {
        font-size: 11pt;
    }

    .beseder-menu-homepage .beseder-menu-a4-body h2 {
        font-size: 13pt;
    }

    .beseder-menu-homepage .beseder-menu-a4-footer {
        flex-direction: column;
        align-items: center;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    body * {
        visibility: hidden;
    }

    .beseder-menu-a4,
    .beseder-menu-a4 * {
        visibility: visible;
    }

    .beseder-menu-a4 {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm;
        height: 297mm;
        margin: 0;
        box-shadow: none;
        overflow: hidden;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .beseder-preview-toolbar {
        display: none !important;
    }

    @page {
        size: A4 portrait;
        margin: 0;
    }
}
