/* Page-owned styles for mecanicas-e-regras */

.mecanicas-page {
    padding-block: var(--space-4xl);
    background-color: var(--color-canvas);
    position: relative;
}

.mecanicas-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAwIDIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZmlsdGVyIGlkPSJub2lzZSI+PGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuOSIgbnVtT2N0YXZlcz0iNCIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNub2lzZSkiIG9wYWNpdHk9IjAuMDMiLz48L3N2Zz4=");
    pointer-events: none;
    z-index: 0;
}

.mecanicas-page > * {
    position: relative;
    z-index: 1;
}

/* Section spacing */
.mecanicas-page > section {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding-mobile);
    margin-block-end: var(--space-4xl);
}

@media (min-width: 768px) {
    .mecanicas-page > section {
        padding-inline: var(--container-padding-desktop);
    }
}

.mecanicas-page > section:last-child {
    margin-block-end: 0;
}

/* Case note */
.case-note {
    display: flex;
    justify-content: center;
}

.case-note__panel {
    max-width: 800px;
    width: 100%;
    padding: var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.case-note__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.case-note__intro {
    max-width: 65ch;
    text-align: left;
}

.case-note__quote {
    max-width: 55ch;
    align-self: flex-end;
    width: 40%;
    min-width: 0;
}

/* Attributes */
.attributes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl);
    margin-block-start: var(--space-xl);
}

.attribute-card {
    background-color: var(--color-cream-light);
    border: var(--border-hairline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
    min-width: 0;
    transition: box-shadow var(--transition-image), transform var(--transition-image);
    position: relative;
}

.attribute-card::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A5A5A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.6;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.attribute-card:hover {
    box-shadow: var(--shadow-pinned);
    transform: rotate(1deg);
}

.attribute-card:hover::after {
    transform: translateY(-2px);
    opacity: 1;
}

.attribute-card h3 {
    margin-block-end: var(--space-md);
}

.attribute-card p {
    max-width: 60ch;
    margin-block-end: var(--space-md);
}

.attribute-card ul {
    margin-block-end: 0;
    padding-inline-start: var(--space-xl);
}

/* Skills */
.skills-section__intro {
    max-width: 65ch;
    margin-block-end: var(--space-xl);
}

.skills-table-wrapper {
    overflow-x: auto;
    border: var(--border-hairline);
    border-radius: var(--radius-card);
    background-color: var(--color-cream-light);
}

.skills-table {
    width: 100%;
    border-collapse: collapse;
    margin-block-end: 0;
    min-width: 600px;
}

.skills-table th,
.skills-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border-subtle);
}

.skills-table th {
    background-color: var(--color-cream-light);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--text-small);
}

.skills-table tbody tr:nth-child(even) {
    background-color: rgba(251, 245, 232, 0.6);
}

.skills-table tbody tr:hover {
    background-color: var(--color-cream-light);
    box-shadow: inset 3px 0 0 var(--color-turquoise);
}

.skills-table td {
    max-width: 50ch;
}

/* Tests */
.tests-layout {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: var(--space-2xl);
    align-items: start;
}

.tests-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    min-width: 0;
}

.test-block p {
    max-width: 65ch;
}

.tests-image {
    margin-block-end: 0;
    min-width: 0;
}

.tests-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-image);
    border: var(--border-image-frame);
    box-shadow: var(--shadow-image);
    transition: transform var(--transition-image), box-shadow var(--transition-image);
}

.tests-image img:hover {
    transform: rotate(1deg);
    box-shadow: var(--shadow-image-hover);
}

/* Thought cabinet */
.thought-cabinet-layout {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: var(--space-2xl);
    align-items: start;
}

.thought-cabinet-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    min-width: 0;
}

.thought-block p {
    max-width: 60ch;
}

.thought-cabinet-image {
    margin-block-end: 0;
    min-width: 0;
}

.thought-cabinet-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-image);
    border: var(--border-image-frame);
    box-shadow: var(--shadow-image);
    transition: transform var(--transition-image), box-shadow var(--transition-image);
}

.thought-cabinet-image img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-image-hover);
}

/* Health & Morale */
.health-morale-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl);
}

.health-panel,
.morale-panel {
    background-color: var(--color-cream-light);
    border: var(--border-hairline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
    min-width: 0;
    transition: box-shadow var(--transition-image);
}

.health-panel:hover,
.morale-panel:hover {
    box-shadow: var(--shadow-pinned);
}

.health-panel p,
.morale-panel p {
    max-width: 55ch;
    margin-block-end: var(--space-lg);
}

.health-bar,
.morale-bar {
    height: 8px;
    background-color: rgba(90, 90, 90, 0.2);
    border-radius: var(--radius-button);
    overflow: hidden;
    margin-block-start: var(--space-lg);
}

.health-bar span {
    display: block;
    width: 70%;
    height: 100%;
    background-color: var(--color-burgundy);
}

.morale-bar span {
    display: block;
    width: 50%;
    height: 100%;
    background-color: var(--color-turquoise);
}

/* Interface */
.interface-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-xl);
}

.interface-card {
    background-color: var(--color-cream-light);
    border: var(--border-hairline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
    min-width: 0;
    transition: border-color var(--transition-link), box-shadow var(--transition-image);
}

.interface-card:hover {
    border-color: var(--color-turquoise);
    box-shadow: var(--shadow-pinned);
}

.interface-card p {
    max-width: 55ch;
}

/* Golden rules */
.golden-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl);
}

.sticky-note {
    background-color: var(--color-cream-light);
    border: var(--border-hairline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-pinned);
    padding: var(--space-lg);
    min-width: 0;
    max-width: 60ch;
    transform: rotate(-1deg);
    transition: transform var(--transition-image), box-shadow var(--transition-image);
    position: relative;
}

.sticky-note:nth-child(even) {
    transform: rotate(1deg);
}

.sticky-note:hover {
    transform: rotate(0deg);
    box-shadow: var(--shadow-image-hover);
}

.sticky-note::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A5A5A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.6;
}

/* Examples */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl);
}

.example-panel {
    background-color: var(--color-cream-light);
    border: 1px dashed var(--color-rust);
    border-radius: var(--radius-card);
    padding: var(--space-xl);
    min-width: 0;
    transition: border-color var(--transition-link), box-shadow var(--transition-image);
}

.example-panel:hover {
    border-color: var(--color-turquoise);
    box-shadow: var(--shadow-card);
}

.example-panel p {
    max-width: 60ch;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 800px;
}

.faq-item {
    background-color: var(--color-cream-light);
    border: var(--border-hairline);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: background-color var(--transition-link);
}

.faq-item:hover {
    background-color: var(--color-canvas);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: var(--weight-semibold);
    font-size: var(--text-body);
    color: var(--color-ink);
    text-align: left;
    position: relative;
}

.faq-question::before {
    content: "";
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A5A5A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
    background-size: contain;
    transition: transform var(--transition-accordion);
}

.faq-question[aria-expanded="true"]::before {
    transform: rotate(90deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-accordion), padding var(--transition-accordion);
    padding-inline: var(--space-xl);
    color: var(--color-ink-muted);
}

.faq-item.aberto .faq-answer {
    max-height: 200px;
    padding-block: var(--space-md);
}

/* Summary */
.summary-table-wrapper {
    border: 2px solid var(--color-border-subtle);
    border-radius: var(--radius-card);
    background-color: var(--color-cream-light);
    padding: var(--space-lg);
    margin-block-end: var(--space-xl);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-block-end: 0;
}

.summary-table th,
.summary-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border-subtle);
}

.summary-table th {
    font-weight: var(--weight-semibold);
    width: 30%;
    color: var(--color-ink);
}

.summary-table td {
    max-width: 50ch;
}

.summary-table tbody tr:hover {
    background-color: rgba(58, 155, 155, 0.1);
}

.summary-section__closing {
    max-width: 65ch;
    font-style: italic;
    font-family: var(--font-heading);
    font-size: var(--text-h4);
    line-height: var(--leading-h4);
    color: var(--color-ink);
}

/* Responsive */
@media (max-width: 1024px) {
    .tests-layout,
    .thought-cabinet-layout {
        grid-template-columns: 1fr;
    }

    .tests-image,
    .thought-cabinet-image {
        order: -1;
    }

    .interface-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .interface-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    .mecanicas-page {
        padding-block: var(--space-3xl);
    }

    .mecanicas-page > section {
        margin-block-end: var(--space-3xl);
    }

    .case-note__panel {
        padding: var(--space-lg);
    }

    .case-note__content {
        gap: var(--space-lg);
    }

    .case-note__quote {
        width: 100%;
        align-self: flex-start;
        max-width: 100%;
    }

    .attributes-grid,
    .health-morale-grid,
    .golden-rules-grid,
    .examples-grid,
    .interface-grid {
        grid-template-columns: 1fr;
    }

    .interface-card:last-child {
        grid-column: auto;
    }

    .attribute-card,
    .health-panel,
    .morale-panel,
    .interface-card,
    .example-panel {
        padding: var(--space-lg);
    }

    .sticky-note {
        transform: none;
        max-width: 100%;
    }

    .sticky-note:nth-child(even) {
        transform: none;
    }

    .tests-image img,
    .thought-cabinet-image img {
        aspect-ratio: auto;
    }

    .skills-table-wrapper {
        border-radius: var(--radius-card);
    }

    .skills-table {
        min-width: 600px;
    }

    .faq-question {
        padding: var(--space-md) var(--space-lg);
    }

    .faq-answer {
        padding-inline: var(--space-lg);
    }

    .summary-section__closing {
        font-size: var(--text-h4);
    }
}

@media (max-width: 480px) {
    .case-note__panel {
        padding: var(--space-md);
    }

    .attribute-card,
    .health-panel,
    .morale-panel,
    .interface-card,
    .example-panel {
        padding: var(--space-md);
    }

    .faq-question {
        font-size: var(--text-small);
        padding: var(--space-sm) var(--space-md);
    }

    .faq-answer {
        padding-inline: var(--space-md);
    }
}
