/* Unique styles for mastering-communication-in-relationships page */

/* Communication functions cards */
.communication-functions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.function-card {
    background: var(--lavender-mist);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.function-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.function-card h4 {
    color: var(--abyss);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.function-card p {
    margin: 0;
    color: var(--abyss-80);
    line-height: 1.5;
}

/* Elements and barriers lists */
.elements-list, .barriers-list {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.elements-list li, .barriers-list li {
    background: var(--white);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 8px;
    padding: 1rem;
    list-style: none;
}

.elements-list li strong, .barriers-list li strong {
    color: var(--abyss);
}

/* Listening components */
.listening-components {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.component {
    background: var(--white);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 10px;
    padding: 1.5rem;
}

.component h4 {
    color: var(--abyss);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.component p {
    margin: 0;
    color: var(--abyss-80);
    line-height: 1.5;
}

/* Listening messages */
.listening-messages {
    background: var(--lavender-mist);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.listening-messages li {
    color: var(--abyss-80);
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* Technique examples */
.technique-examples {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.technique {
    background: var(--white);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 10px;
    padding: 1.5rem;
}

.technique h4 {
    color: var(--abyss);
    margin-bottom: 1rem;
}

.example-dialogue {
    background: var(--lavender-mist);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.example-dialogue p {
    margin: 0.5rem 0;
}

/* Mistakes list */
.mistakes-list {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.mistake {
    background: var(--white);
    border-left: 4px solid var(--coral);
    border-radius: 8px;
    padding: 1.5rem;
}

.mistake h4 {
    color: var(--coral);
    margin-bottom: 0.75rem;
}

/* I-statement structure */
.i-statement-structure {
    background: var(--lavender-mist);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.structure-formula {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--abyss);
    font-style: italic;
}

/* Statement examples */
.statement-examples {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.example-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid var(--lavender-mist-dark);
}

@media (max-width: 768px) {
    .example-pair {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.instead-of, .try-this {
    padding: 1rem;
    border-radius: 8px;
}

.instead-of {
    background: #ffebee;
    border-left: 4px solid var(--coral);
}

.try-this {
    background: var(--lavender-mist);
    border-left: 4px solid var(--sage);
}

.instead-of h4 {
    color: var(--coral);
    margin-bottom: 0.75rem;
}

.try-this h4 {
    color: var(--sage);
    margin-bottom: 0.75rem;
}

/* Communication comparison table */
.communication-comparison {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.communication-comparison th {
    background: var(--abyss);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.communication-comparison td {
    padding: 1rem;
    border-bottom: 1px solid var(--lavender-mist-dark);
    vertical-align: top;
}

.communication-comparison tr:nth-child(even) {
    background: var(--lavender-mist);
}

/* Emotion expression */
.emotion-expression {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.emotion-type {
    background: var(--white);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 10px;
    padding: 1.5rem;
}

.emotion-example {
    background: var(--lavender-mist);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

/* Timing guidelines */
.timing-guidelines {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .timing-guidelines {
        grid-template-columns: 1fr;
    }
}

.good-timing, .avoid-timing {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
}

.good-timing {
    border-left: 4px solid var(--sage);
}

.avoid-timing {
    border-left: 4px solid var(--coral);
}

/* Requests vs demands */
.requests-vs-demands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .requests-vs-demands {
        grid-template-columns: 1fr;
    }
}

.requests, .demands {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
}

.requests {
    border-left: 4px solid var(--sage);
}

.demands {
    border-left: 4px solid var(--coral);
}

.request-example {
    background: var(--lavender-mist);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    grid-column: 1 / -1;
}

/* Conflict comparison */
.conflict-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .conflict-comparison {
        grid-template-columns: 1fr;
    }
}

.healthy-conflict, .unhealthy-conflict {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
}

.healthy-conflict {
    border-left: 4px solid var(--sage);
}

.unhealthy-conflict {
    border-left: 4px solid var(--coral);
}

/* Four horsemen */
.four-horsemen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.horseman {
    background: var(--white);
    border: 1px solid var(--coral);
    border-radius: 10px;
    padding: 1.5rem;
}

.horseman h4 {
    color: var(--coral);
    margin-bottom: 1rem;
}

.horseman-example {
    background: #ffebee;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

/* Resolution strategies */
.resolution-strategies {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.strategy {
    background: var(--white);
    border: 1px solid var(--sage);
    border-radius: 10px;
    padding: 1.5rem;
}

.strategy h4 {
    color: var(--sage);
    margin-bottom: 1rem;
}

.need-example {
    background: var(--lavender-mist);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

/* Problem solving steps */
.problem-solving-steps {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.step {
    background: var(--white);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 10px;
    padding: 1.5rem;
    position: relative;
}

.step h4 {
    color: var(--abyss);
    margin-bottom: 1rem;
}

/* Emotional safety */
.emotional-safety {
    background: var(--lavender-mist);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.emotional-safety h4 {
    color: var(--abyss);
    margin-bottom: 1rem;
}

/* Vulnerability guidance */
.vulnerability-guidance {
    background: var(--white);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.vulnerability-guidance h4 {
    color: var(--abyss);
    margin-bottom: 1rem;
}

/* Connection rituals */
.connection-rituals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.ritual {
    background: var(--white);
    border: 1px solid var(--sage);
    border-radius: 10px;
    padding: 1.5rem;
}

.ritual h4 {
    color: var(--sage);
    margin-bottom: 1rem;
}

/* Stress strategies */
.stress-strategies {
    background: var(--lavender-mist);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.stress-strategies h4 {
    color: var(--abyss);
    margin-bottom: 1rem;
}

/* References list */
.references-list {
    background: var(--white);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.references-list li {
    margin-bottom: 1rem;
    color: var(--abyss-80);
    line-height: 1.5;
}

/* Support notice */
.support-notice {
    background: var(--lavender-mist);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.notice-content p {
    margin-bottom: 1rem;
    color: var(--abyss-80);
    font-style: italic;
    line-height: 1.6;
}

.notice-content p:last-child {
    margin-bottom: 0;
}

/* Inline links */
.inline-link {
    color: var(--sage);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.inline-link:hover {
    color: var(--abyss);
}

/* Conflict opportunities list */
.conflict-opportunities {
    background: var(--lavender-mist);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.conflict-opportunities li {
    color: var(--abyss-80);
    margin-bottom: 0.5rem;
}

/* Article meta styling */
.article-meta {
    display: flex;
    gap: 2rem;
    margin: 1rem 0 2rem 0;
    font-size: 0.95rem;
    color: var(--slate);
}

@media (max-width: 600px) {
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Article intro styling */
.article-intro {
    background: var(--lavender-mist);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.article-intro p {
    margin: 0;
    color: var(--abyss-80);
}

/* On-page table of contents */
.onpage-toc {
    background: var(--lavender-mist);
    border: 1px solid var(--lavender-mist-dark);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem 0;
}

.onpage-toc-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.05rem;
    color: var(--abyss);
}

.onpage-toc-nav ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.onpage-toc-nav a {
    display: inline-block;
    color: var(--abyss-80);
    text-decoration: none;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.onpage-toc-nav a:hover {
    background: var(--white);
    color: var(--abyss);
}

/* Icon bullets for selected lists */
.icon-bullets {
    list-style: none;
    padding-left: 0;
}

.icon-bullets li {
    position: relative;
    padding-left: 1.75rem;
}

.icon-bullets li::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.55rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--sage);
    box-shadow: 0 0 0 2px var(--white);
}

/* Problem-solving step counters */
.problem-solving-steps {
    counter-reset: step-counter;
}

.problem-solving-steps .step {
    counter-increment: step-counter;
}

.problem-solving-steps .step h4::before {
    content: counter(step-counter) '.';
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--sage);
    font-weight: 700;
}

/* Four horsemen antidotes table */
.horsemen-antidotes {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 0 0;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.horsemen-antidotes th {
    background: var(--abyss);
    color: var(--white);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
}

.horsemen-antidotes td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--lavender-mist-dark);
    vertical-align: top;
}

.horsemen-antidotes tr:nth-child(even) td {
    background: var(--lavender-mist);
}

/* Two-column layout with sticky TOC on desktop */
@media (min-width: 1024px) {
    .resource-article {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 2rem;
        align-items: start;
    }

    .resource-article > .article-header {
        grid-column: 1 / -1;
    }

    .resource-article > .onpage-toc {
        grid-column: 1;
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow: auto;
    }

    .resource-article > section {
        grid-column: 2;
    }
}

/* Smooth scroll and anchor offset */
html {
    scroll-behavior: smooth;
}

.resource-article section[id] {
    scroll-margin-top: 90px;
}

/* Refine heading rhythm inside article */
.resource-article h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.resource-article h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.resource-article h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Microinteractions for card-like blocks */
.component, .technique, .mistake, .emotion-type, .strategy, .ritual, .step {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.component:hover, .technique:hover, .mistake:hover, .emotion-type:hover, .strategy:hover, .ritual:hover, .step:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Requests vs Demands cues */
.requests h4::before, .demands h4::before {
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: 700;
}

.requests h4::before {
    content: "✓";
    color: var(--sage);
}

.demands h4::before {
    content: "!";
    color: var(--coral);
}

.requests ul, .demands ul {
    list-style: none;
    padding-left: 0;
}

.requests ul li, .demands ul li {
    position: relative;
    padding-left: 1.5rem;
}

.requests ul li::before, .demands ul li::before {
    position: absolute;
    left: 0;
    top: 0.35rem;
    font-size: 0.9rem;
}

.requests ul li::before {
    content: "✓";
    color: var(--sage);
}

.demands ul li::before {
    content: "–";
    color: var(--coral);
}

/* Table hover for readability */
.horsemen-antidotes tbody tr {
    transition: background 0.15s ease;
}

.horsemen-antidotes tbody tr:hover td {
    background: #f3eef6;
}

/* TOC link focus/hover refinement */
.onpage-toc-nav a:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 2px;
    background: var(--white);
}