/* ==========================================================================
   Plant Article Styles - Extends Astra Child Theme (Vegan Biss)
   Matches existing recipe page design language:
   - Primary green: #77ab59
   - Accent coral: #ff6f61
   - Font: Nunito Sans
   - Border-radius: 30px images, 0.625rem cards
   - Green shadow cards: 4px 4px 0 4px #77ab59
   ========================================================================== */

/* ---- Layout ---- */
:root {
    /* Tune to match the real sticky-header height on deblum.com. */
    --sticky-header-offset: 200px;
}
.pflanze {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Anchor-jump offset so sticky headers don't cover the heading on scroll. */
.pflanze h2[id],
.pflanze h3[id],
.pflanze [id="entry"] {
    scroll-margin-top: var(--sticky-header-offset);
}

/* ---- Quick-Answer Card (above fold) ---- */
.plant-quick-card {
    background: #fff;
    border: 1px solid #77ab59;
    border-radius: 0.625rem;
    box-shadow: 4px 4px 0 4px #77ab59;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.plant-quick-card h2 {
    width: 100%;
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #333;
}

.plant-quick-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 45%;
    min-width: 180px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.plant-quick-item .icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.plant-quick-item .label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    min-width: 100px;
    white-space: nowrap;
}

.plant-quick-item .value {
    font-size: 0.9rem;
    color: #222;
}

/* ---- Difficulty Badge ---- */
.difficulty-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    color: ivory;
}
.difficulty-badge.anfaenger { background: #77ab59; }
.difficulty-badge.fortgeschritten { background: #f0a830; }
.difficulty-badge.experte { background: #ff6f61; }

/* ---- Table of Contents ---- */
.plant-toc {
    background: #f9f9f7;
    border-radius: 0.625rem;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.plant-toc h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.plant-toc ol {
    margin: 0;
    padding-left: 1.4em;
}

.plant-toc li {
    padding: 4px 0;
}

.plant-toc a {
    color: #77ab59;
    text-decoration: none;
    font-size: 0.95rem;
}

.plant-toc a:hover {
    text-decoration: underline;
}

/* ---- Section Headings ---- */
.pflanze h2 {
    font-size: 1.4rem;
    margin-top: 32px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #77ab59;
}

.pflanze h3 {
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 8px;
}

/* ---- Summary Boxes (per section) ---- */
.zusammenfassung {
    background: #f0f7ec;
    border-left: 4px solid #77ab59;
    border-radius: 0 0.625rem 0.625rem 0;
    padding: 12px 16px;
    margin: 16px 0 24px 0;
}

.zusammenfassung strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #4a7a3a;
}

.zusammenfassung ul {
    margin: 0;
    padding-left: 1.2em;
    font-size: 0.9rem;
}

.zusammenfassung li {
    padding: 2px 0;
}

/* ---- Care Tables ---- */
.care-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.care-table th {
    background: #77ab59;
    color: ivory;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
}

.care-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e8e8e8;
}

.care-table tr:nth-child(even) td {
    background: #f9f9f7;
}

/* ---- Do / Don't Lists ---- */
.do-dont {
    display: flex;
    gap: 16px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.do-list, .dont-list {
    flex: 1;
    min-width: 200px;
    padding: 14px;
    border-radius: 0.625rem;
}

.do-list {
    background: #f0f7ec;
    border: 1px solid #77ab59;
}

.dont-list {
    background: #fef0ee;
    border: 1px solid #ff6f61;
}

.do-list h4, .dont-list h4 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
}

.do-list li, .dont-list li {
    padding: 3px 0;
    font-size: 0.9rem;
    list-style: none;
    padding-left: 1.4em;
    position: relative;
}

.do-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #77ab59;
    font-weight: bold;
}

.dont-list li::before {
    content: "\2717";
    position: absolute;
    left: 0;
    color: #ff6f61;
    font-weight: bold;
}

/* ---- Step-by-Step Guide ---- */
.step-guide {
    counter-reset: step-counter;
    margin: 16px 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    counter-increment: step-counter;
}

.step-number {
    background: #77ab59;
    color: ivory;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin: 0;
    font-size: 0.95rem;
}

/* ---- Problem/Solution Table ---- */
.problem-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.problem-table th {
    background: #ff6f61;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
}

.problem-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: top;
}

.problem-table tr:nth-child(even) td {
    background: #fef8f7;
}

/* ---- Toxicity Warning ---- */
.toxicity-box {
    border-radius: 0.625rem;
    padding: 16px;
    margin: 16px 0;
}

.toxicity-box.giftig {
    background: #fef0ee;
    border: 1px solid #ff6f61;
}

.toxicity-box.ungiftig {
    background: #f0f7ec;
    border: 1px solid #77ab59;
}

.toxicity-box h3 {
    margin: 0 0 10px 0;
}

.toxicity-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.toxicity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

/* ---- FAQ Accordion ---- */
.faq-section {
    margin: 24px 0;
}

.faq-item {
    border: 1px solid #ddd;
    border-radius: 0.625rem;
    margin-bottom: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 14px 16px;
    background: #f9f9f7;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: "+";
    font-size: 1.2rem;
    color: #77ab59;
    font-weight: 700;
}

.faq-item.open .faq-question::after {
    content: "\2212";
}

.faq-answer {
    display: none;
    padding: 14px 16px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.faq-item.open .faq-answer {
    display: block;
}

/* ---- deblum.com Promo Box (inline) ---- */
.deblum-promo-inline {
    background: #fff;
    border: 1px solid #77ab59;
    border-radius: 0.625rem;
    box-shadow: 4px 4px 0 4px #77ab59;
    padding: 16px 20px;
    margin: 24px 0;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.deblum-promo-inline .promo-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.deblum-promo-inline .promo-body {
    flex: 1;
    min-width: 200px;
}

.deblum-promo-inline .promo-body p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
}

.deblum-promo-inline .promo-link {
    display: inline-block;
    background: #ff6f61;
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

.deblum-promo-inline .promo-link:hover {
    background: #e8564a;
}

/* ---- deblum.com Promo Cards (bottom) ---- */
.deblum-promo-cards {
    margin: 32px 0;
}

.deblum-promo-cards h3 {
    margin-bottom: 16px;
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.promo-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.625rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.promo-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.promo-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f7ec;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.promo-card-body {
    padding: 12px;
}

.promo-card-body h4 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
}

.promo-card-body p {
    margin: 0 0 8px 0;
    font-size: 0.82rem;
    color: #666;
}

.promo-card-body .price-hint {
    color: #77ab59;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ---- Internal Plant Links ---- */
.related-plants {
    margin: 24px 0;
}

.related-plants-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.related-plant-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9f9f7;
    border: 1px solid #ddd;
    border-radius: 30px;
    text-decoration: none;
    color: #333;
    white-space: nowrap;
    font-size: 0.85rem;
    transition: border-color 0.2s;
}

.related-plant-link:hover {
    border-color: #77ab59;
    background: #f0f7ec;
}

/* ---- Author Box ---- */
.author-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #f9f9f7;
    border-radius: 0.625rem;
    padding: 20px;
    margin: 32px 0;
}

.author-box .author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #77ab59;
    color: ivory;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

.author-box .author-info h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.author-box .author-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.author-box .author-dates {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #999;
}

/* ---- Tags (reusing recipe tag style) ---- */
.plant-tags .tag {
    background: #77ab59;
    color: ivory;
    padding: 5px 15px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-block;
    margin: 0 6px 6px 0;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 767px) {
    .pflanze {
        padding: 0 12px;
    }

    .plant-quick-item {
        flex: 1 1 100%;
    }

    .do-dont {
        flex-direction: column;
    }

    .deblum-promo-inline {
        flex-direction: column;
        text-align: center;
    }

    .promo-grid {
        grid-template-columns: 1fr 1fr;
    }

    .related-plants-grid {
        flex-wrap: nowrap;
    }

    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ---- /pflanzen/ landing page search ---- */
.pflanzen-search {
    display: flex;
    gap: 0;
    max-width: 600px;
    margin-bottom: 8px;
}

.pflanzen-search input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-right: none;
    border-radius: 30px 0 0 30px;
    outline: none;
    font-family: inherit;
}

.pflanzen-search input[type="search"]:focus {
    border-color: #77ab59;
}

.pflanzen-search button {
    padding: 12px 24px;
    background: #77ab59;
    color: #fff;
    border: 2px solid #77ab59;
    border-radius: 0 30px 30px 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.pflanzen-search button:hover {
    background: #6a9a4e;
    border-color: #6a9a4e;
}

.dark-mode .pflanzen-search input[type="search"] {
    background: #2a2a2a;
    border-color: #444;
    color: #ddd;
}

.dark-mode .pflanzen-landing h1,
.dark-mode .pflanzen-landing h2,
.dark-mode .pflanzen-landing p {
    color: #ddd;
}

/* ---- Pflanze category archive grid ---- */
.pflanze-archive-grid .grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 20px 0 30px;
}

.pflanze-archive-grid .grid-item {
    overflow: hidden;
}

.pflanze-archive-grid .grid-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.pflanze-archive-grid .grid-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 0.625rem;
}

.pflanze-archive-grid .grid-item h2 {
    font-size: 0.85rem;
    margin: 6px 0 0;
    padding: 0;
    font-weight: 600;
    border-bottom: none;
    color: #333;
    text-align: center;
}

.pflanze-archive-grid .pagination {
    text-align: center;
    margin: 30px 0;
}

@media (max-width: 767px) {
    .pflanze-archive-grid .grid-container {
        grid-template-columns: 1fr;
    }
}

.dark-mode .pflanze-archive-grid .grid-item h2 {
    color: #ddd;
}

/* ---- Dark Mode Support ---- */
.dark-mode .plant-quick-card,
.dark-mode .collapsible,
.dark-mode .deblum-promo-inline {
    background: #2a2a2a;
    border-color: #77ab59;
}

.dark-mode .plant-toc,
.dark-mode .faq-question,
.dark-mode .author-box,
.dark-mode .related-plant-link {
    background: #333;
}

.dark-mode .zusammenfassung {
    background: #2a3a24;
}

.dark-mode .care-table th {
    background: #5a8a44;
}

.dark-mode .care-table td,
.dark-mode .problem-table td {
    border-color: #444;
}

.dark-mode .care-table tr:nth-child(even) td {
    background: #333;
}

.dark-mode .promo-card {
    background: #2a2a2a;
    border-color: #444;
}

.dark-mode .faq-item {
    border-color: #444;
}

.dark-mode .faq-answer,
.dark-mode .plant-quick-item .value,
.dark-mode .step-content p {
    color: #ddd;
}

/* ---- Social share row (Lucide icons, no plugin) ---- */
.plant-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0;
    padding: 14px 16px;
    background: #eef4e6;
    border-radius: 0.625rem;
}
.plant-share-label {
    font-weight: 600;
    color: #4a7a2c;
    margin-right: 4px;
}
.plant-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #77ab59;
    border-radius: 50%;
    background: #fff;
    color: #77ab59;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.plant-share-btn:hover,
.plant-share-btn:focus-visible {
    background: #77ab59;
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}
.plant-share-btn.copied {
    background: #77ab59;
    color: #fff;
}
.plant-share-btn svg { width: 18px; height: 18px; }
.dark-mode .plant-share { background: #2a3a22; }
.dark-mode .plant-share-label { color: #bcd7a0; }
.dark-mode .plant-share-btn { background: #1c1c1c; }

/* ---- Page-level overrides (pflanze CPT only — this CSS is only enqueued on singular pflanze) ---- */

/* Remove article / Astra container padding-top */
.single-pflanze article,
.single-pflanze .ast-article-single,
.single-pflanze .ast-article-post,
.single-pflanze .ast-separate-container .ast-article-single,
.single-pflanze .ast-separate-container .ast-article-post {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Remove recipetitle padding-top */
.pflanze .recipetitle {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Layout is handled by Astra filters (no-sidebar + plain-container) in PHP.
   This is a CSS fallback in case the filters don't fire. */
.single-pflanze #secondary {
    display: none !important;
}
.single-pflanze #primary {
    width: 100% !important;
    float: none !important;
}

/* Prevent recipe square image styles from overriding plant article images */
.pflanze .image-container img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: cover;
    border-radius: 30px;
}

/* Remove underlines from all links (override Astra .entry-content a) */
.single-pflanze .entry-content a,
.single-pflanze .pflanze a,
.pflanze a {
    text-decoration: none !important;
}
.single-pflanze .entry-content a:hover,
.single-pflanze .pflanze a:hover,
.pflanze a:hover {
    text-decoration: none !important;
}

/* Category/tag links appearance */
.pflanze .plant-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

/* ---- Dark Mode: quick card labels ---- */
.dark-mode .plant-quick-item .label {
    color: #eee;
}

/* ---- Dark Mode: do/dont headings ---- */
.dark-mode .do-list h4,
.dark-mode .dont-list h4 {
    color: #eee;
}

/* ---- Dark Mode: problem table even rows ---- */
.dark-mode .problem-table tr:nth-child(even) td {
    background: #333;
    color: #ddd;
}

/* ---- Dark Mode: problem table odd rows ---- */
.dark-mode .problem-table tr:nth-child(odd) td {
    background: #2a2a2a;
    color: #ddd;
}

/* ---- Dark Mode: toxicity box ---- */
.dark-mode .toxicity-box {
    background: #2a2a2a;
}

.dark-mode .toxicity-box.giftig {
    background: #3a2220;
    border-color: #ff6f61;
}

.dark-mode .toxicity-box.ungiftig {
    background: #2a3a24;
    border-color: #77ab59;
}

.dark-mode .toxicity-box p,
.dark-mode .toxicity-box h3,
.dark-mode .toxicity-item,
.dark-mode .toxicity-box small {
    color: #ddd;
}

/* ---- Dark Mode: do/dont boxes ---- */
.dark-mode .do-list {
    background: #2a3a24;
    border-color: #77ab59;
}

.dark-mode .dont-list {
    background: #3a2220;
    border-color: #ff6f61;
}

.dark-mode .do-list li,
.dark-mode .dont-list li {
    color: #ddd;
}

/* ---- Dark Mode: problem table text ---- */
.dark-mode .problem-table td {
    color: #ddd;
}
