/* ------------------------------
   Base Layout & Typography
--------------------------------*/
body {
    margin: 50px;
    font-family: Aptos, Arial, sans-serif;
}

img {
    width: 75%;
    max-width: 800px;
    margin-bottom: clamp(1rem, 2vw, 2rem);
}

h1, h2, h3 {
    font-weight: 600;
}

/* ------------------------------
   Container (screen layout)
--------------------------------*/
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* ------------------------------
   Buttons
--------------------------------*/
.copy-btn {
    margin-bottom: 1rem;
    padding: 6px 12px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f8f8f8;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

.copy-btn:hover {
    background: #eaeaea;
}

/* ------------------------------
   Table Titles
--------------------------------*/
.table-title {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    page-break-after: avoid; /* keep title with table */
}

/* ------------------------------
   Address Table
--------------------------------*/
.address-table {
    width: 75%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    animation: fadeInUp 0.35s ease-out;
}

.address-table th,
.address-table td {
    padding: 8px 12px;
    border: 1px solid #ccc;
}

.address-table th {
    background: #f5f5f5;
    font-weight: 600;
    text-align: left;
}

.address-table tbody tr:hover td {
    background: #fafafa;
}

.address-table tbody tr:nth-child(even) {
    background: #fcfcfc;
}

/* ------------------------------
   SpecTable
--------------------------------*/
.spec-table {
    width: 75%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    animation: fadeInUp 0.35s ease-out;
}

.spec-table td,
.spec-table th {
    padding: 8px 16px;
    border-bottom: 1px solid #ddd;
}

.spec-table th {
    background: #f5f5f5;
    font-weight: 600;
    text-align: left;
}

.spec-table td:nth-child(1),
.spec-table th:nth-child(1) {
    width: 30%;
}

.spec-table td:nth-child(2),
.spec-table th:nth-child(2) {
    width: 70%;
}

.spec-table tbody tr:hover td {
    background: #fafafa;
}

.spec-table .task-cell {
    background: #fcfcfc;
    font-weight: 600;
    border-right: 1px solid #e0e0e0;
}

.spec-table .section-header td {
    background: #e9eef7;
    font-weight: 700;
    font-size: 1rem;
    border-top: 2px solid #c7d4ec;
    border-bottom: 2px solid #c7d4ec;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* ------------------------------
   Animations
--------------------------------*/
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ------------------------------
   Mobile (≤600px)
--------------------------------*/
@media (max-width: 600px) {
    .spec-table {
        width: 100%;
        table-layout: auto;
    }

    .spec-table td,
    .spec-table th {
        padding: 6px 10px;
    }

    .spec-table td:nth-child(1),
    .spec-table th:nth-child(1),
    .spec-table td:nth-child(2),
    .spec-table th:nth-child(2) {
        width: auto;
    }
}

/* ------------------------------
   Print Styles (PDF Output)
--------------------------------*/
@media print {

    /* Control actual PDF margins */
    @page {
        margin: 0.2in;
    }

    /* Remove ALL default body spacing */
    body {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide UI elements */
    .copy-btn,
    .footer,
    .sidebar,
    .top-row {
        display: none !important;
    }

    /* Collapse layout to a single full-width column */
    .page {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Remove padding from content area */
    .content,
    .container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    /* Make tables full width for PDF */
    .spec-table,
    .address-table {
        width: 100% !important;
        animation: none !important;
        page-break-inside: avoid;
    }

    /* Prevent table splitting */
    .table-wrapper {
        page-break-inside: avoid;
    }

    /* Keep titles with tables */
    .table-title {
        page-break-after: avoid;
    }
}
