/* =============================
   RIREKISHO STYLES (A4 EXACT)
   ============================= */

@page {
    size: A4;
    margin: 15mm;
}

body {
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.a4 {
    width: 210mm;
    min-height: 297mm;
    background: white;
    padding: 20mm;
    border: 1px solid #000;
    box-sizing: border-box;
}

/* TITLE */
.title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 2mm;
    letter-spacing: 6px;
    font-weight: bold;
}

.date {
    text-align: right;
    margin-bottom: 8mm;
}

/* MAIN TABLE */
.main-table,
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8mm;
}

.main-table td,
.history-table td {
    border: 1px solid #000;
    padding: 4px 6px;
    font-size: 13px;
}

/* For Photo */
.rirekisho-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}


.label {
    width: 18mm;
    background: #fafafa;
    font-weight: bold;
}

.small {
    width: 10mm;
}

.photo-box {
    width: 35mm;
    height: 45mm;
    text-align: center;
    font-size: 10px;
    vertical-align: middle;
}

.section-title {
    font-weight: bold;
    margin: 10px 0 5px;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
}

/* HISTORY TABLE */
.year {
    width: 20mm;
}

.month {
    width: 3px;
}

.center {
    text-align: center;
}

/* TEXT BOX (PR, MOTIVATION, ETC.) */
.textbox {
    border: 1px solid #000;
    min-height: 35mm;
    padding: 8px 10px;
    line-height: 1.8em;
    white-space: pre-line;
    font-size: 14px;
    margin-bottom: 12mm;
}

.textbox.small {
    min-height: 10mm;
}

/* =============================
    Bottom Rirekisho Table
   ============================= */

.bottom-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000; /* SINGLE outer border */
    margin-bottom: 10mm;
}

.bottom-table th,
.bottom-table td {
    border: 1px solid #000;
    padding: 6px;
    font-size: 13px;
    vertical-align: top;
}

.bottom-table th {
    font-weight: normal;
    text-align: left;
}

.bottom-table .large-box {
    height: 95px;
}

.bottom-table .wish-box {
    height: 80px;
}

.bottom-table .center {
    text-align: center;
    vertical-align: middle;
}


/* Print Btn */
.print-btn {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 14px 36px;
    font-size: 1.2em;
    background: #1976d2;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 0 0 4px rgba(25,118,210,0.15);
    transition: background 0.2s, box-shadow 0.2s, border 0.2s;
    font-weight: bold;
    letter-spacing: 0.5px;
    outline: none;
}

.print-btn:hover {
    background: #fff;
    color: #1976d2;
    border: 2px solid #1976d2;
    box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}

/* Hide the print button when printing */
@media print {
    .print-btn {
        display: none;
    }
}

/* A4 page size and margins */
@page {
    size: A4;
    margin: 10mm;   /* reduce left & right space */
}

/* Print-specific styles */
@media print {
    body {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Main container */
    .a4 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    /* Remove unwanted elements */
    button,
    nav,
    footer {
        display: none !important;
    }
}

/* Zoom Control in mobile and desktop device */

/* Desktop */
.a4 {
    width: 794px; /* A4 at 96dpi */
    margin: auto;
}

/* Mobile */
@media screen and (max-width: 768px) {
    .a4 {
        width: 100%;
        min-width: unset;
        padding: 12px;
    }
}




