/**
 * Planting calendar tool — static CSS (no Tailwind CDN in production).
 * Scoped under .gd-planting-calendar where useful.
 */

[x-cloak] {
    display: none !important;
}

@media print {
    @page {
        margin: 12mm;
    }

    body * {
        visibility: hidden !important;
    }

    #planting-calendar-print-area,
    #planting-calendar-print-area * {
        visibility: visible !important;
    }

    #planting-calendar-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .gd-pcal-print-hide {
        display: none !important;
    }
}

/** Same horizontal bounds as the rest of the site (Bootstrap .container). */
.gd-pcal-outer {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.gd-pcal-root {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
}

.gd-pcal-card {
    border: 2px solid #0a0a0a;
    border-radius: 0;
    background: #ffffff;
    padding: 1.5rem;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .gd-pcal-card {
        padding: 2rem;
    }
}

.gd-pcal-row-between {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.gd-pcal-h2 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0a0a0a;
}

@media (min-width: 640px) {
    .gd-pcal-h2 {
        font-size: 1.5rem;
    }
}

.gd-pcal-lead {
    margin: 0;
    font-size: 0.875rem;
    color: #525252;
}

.gd-pcal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gd-pcal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid #0a0a0a;
    border-radius: 0;
    background: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0a0a0a;
    cursor: pointer;
}

.gd-pcal-btn:hover {
    background: #fef3c7;
}

.gd-pcal-btn--primary {
    background: #fcd34d;
}

.gd-pcal-btn--primary:hover {
    background: #fbbf24;
}

.gd-pcal-grid-2 {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

@media (min-width: 1024px) {
    .gd-pcal-grid-2 {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.gd-pcal-fields > * + * {
    margin-top: 1rem;
}

.gd-pcal-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0a0a0a;
}

.gd-pcal-select,
.gd-pcal-input {
    width: 100%;
    border: 2px solid #0a0a0a;
    border-radius: 0;
    background: #fff;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    color: #0a0a0a;
    outline: none;
}

.gd-pcal-select:focus,
.gd-pcal-input:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* Searchable crop combobox (replaces native select) */
.gd-pcal-combo {
    position: relative;
    width: 100%;
}

.gd-pcal-combo-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 2px solid #0a0a0a;
    border-radius: 0;
    background: #fff;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: #0a0a0a;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}

.gd-pcal-combo-toggle:hover {
    background: #fefce8;
}

.gd-pcal-combo-toggle:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.gd-pcal-combo-caret {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1;
    color: #0a0a0a;
}

.gd-pcal-combo-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 40;
    margin-top: 4px;
    border: 2px solid #0a0a0a;
    border-radius: 0;
    background: #fff;
    max-height: 18rem;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.gd-pcal-combo-search {
    width: 100%;
    border: 0;
    border-bottom: 2px solid #0a0a0a;
    border-radius: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    color: #0a0a0a;
    outline: none;
    box-shadow: none;
}

.gd-pcal-combo-search:focus {
    background: #fffbeb;
}

.gd-pcal-combo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    max-height: 14rem;
}

.gd-pcal-combo-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #e5e5e5;
    font-size: 0.9375rem;
}

.gd-pcal-combo-item:last-child {
    border-bottom: 0;
}

.gd-pcal-combo-item:hover,
.gd-pcal-combo-item--active {
    background: #fef3c7;
}

.gd-pcal-combo-empty {
    margin: 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    color: #525252;
}

.gd-pcal-hint {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: #525252;
}

.gd-pcal-checkrow {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #0a0a0a;
}

.gd-pcal-checkrow input {
    margin-top: 0.25rem;
}

.gd-pcal-aside {
    border: 2px solid #0a0a0a;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.gd-pcal-aside-title {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0a0a0a;
}

.gd-pcal-timeline {
    position: relative;
    max-width: 100%;
}

/* Inset so edge markers (translate -50%) stay inside the column */
.gd-pcal-timeline-track {
    position: relative;
    height: 2.75rem;
    padding: 0 10px;
    box-sizing: border-box;
}

.gd-pcal-timeline-bar {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 0.5rem;
    margin: 0;
    transform: translateY(-50%);
    background: #d4d4d4;
}

.gd-pcal-timeline-layer {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
}

.gd-pcal-marker {
    position: absolute;
    top: 50%;
    width: 1rem;
    height: 1rem;
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
}

.gd-pcal-marker--black {
    background: #0a0a0a;
}

.gd-pcal-marker--gray {
    background: #737373;
}

.gd-pcal-marker--amber {
    background: #fbbf24;
}

.gd-pcal-marker--invert {
    background: #0a0a0a;
    border-color: #fde68a;
}

/* Date scale under the timeline (same horizontal positions as markers) */
.gd-pcal-timeline-scale {
    position: relative;
    min-height: 2.25rem;
    margin-top: 0.35rem;
    padding: 0.35rem 10px 0;
    border-top: 1px solid #d4d4d4;
    box-sizing: border-box;
}

.gd-pcal-timeline-scale__label {
    position: absolute;
    top: 0.4rem;
    left: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #404040;
    line-height: 1.2;
    max-width: min(6.25rem, 30vw);
}

.gd-pcal-steplist {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: #0a0a0a;
}

.gd-pcal-steplist li + li {
    margin-top: 0.5rem;
}

.gd-pcal-strong {
    font-weight: 600;
}

.gd-pcal-results {
    margin-top: 2rem;
}

.gd-pcal-results-title {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #0a0a0a;
}

.gd-pcal-results-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .gd-pcal-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .gd-pcal-results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gd-pcal-result-card {
    border: 2px solid #0a0a0a;
    border-radius: 0;
    background: #fff;
    padding: 1rem;
}

.gd-pcal-result-card--tint {
    background: #fef3c7;
}

.gd-pcal-result-card--invert {
    background: #0a0a0a;
    color: #fcd34d;
}

.gd-pcal-result-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #525252;
}

.gd-pcal-result-card--invert .gd-pcal-result-label {
    color: #fde68a;
}

.gd-pcal-result-date {
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #0a0a0a;
}

.gd-pcal-result-card--invert .gd-pcal-result-date {
    color: #fcd34d;
}

.gd-pcal-result-note {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #525252;
}

.gd-pcal-result-card--invert .gd-pcal-result-note {
    color: rgba(253, 230, 138, 0.9);
}

.gd-pcal-related {
    margin-top: 2.5rem;
}

.gd-pcal-related-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0a0a0a;
}

.gd-pcal-muted {
    font-size: 0.875rem;
    color: #525252;
}

.gd-pcal-empty {
    border: 2px dashed #0a0a0a;
    border-radius: 0;
    background: #fff;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #404040;
}

.gd-pcal-empty a {
    color: #0a0a0a;
    font-weight: 500;
    text-decoration: underline;
}

.gd-pcal-empty a:hover {
    color: #b45309;
}

.gd-pcal-article-grid {
    display: grid;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

@media (min-width: 640px) {
    .gd-pcal-article-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gd-pcal-article-link {
    display: block;
    height: 100%;
    border: 2px solid #0a0a0a;
    border-radius: 0;
    background: #fff;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
}

.gd-pcal-article-link:hover {
    background: #fef3c7;
}

.gd-pcal-article-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 600;
    color: #0a0a0a;
}

.gd-pcal-article-meta {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #525252;
}
