@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Lato:wght@300;400;700&display=swap');

/* ── Variables ───────────────────────────────────────────────── */
.goodplate-cal {
    --gpc-brown-dark:  #4a3728;
    --gpc-brown-mid:   #7a5c45;
    --gpc-brown-light: #c4a882;
    --gpc-tan-bg:      #f9f4ee;
    --gpc-tan-card:    #fff8f0;
    --gpc-accent:      #b5651d;
    --gpc-text-dark:   #2c1f14;
    --gpc-text-mid:    #5a4030;
    --gpc-text-light:  #9a8070;
    --gpc-border:      #ddd0c0;
    --gpc-radius:      6px;

    font-family: 'Lato', sans-serif;
    color: var(--gpc-text-dark);
    background: var(--gpc-tan-bg);
    border: 1px solid var(--gpc-border);
    border-radius: var(--gpc-radius);
    overflow: hidden;
    max-width: 960px;
    margin: 1.5em auto;
}

/* ── Header ─────────────────────────────────────────────────── */
.gpc-header {
    background: var(--gpc-brown-dark);
    color: #fff8f0;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gpc-month-label {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── View toggle ─────────────────────────────────────────────── */
.gpc-view-toggle {
    display: flex;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--gpc-radius);
    overflow: hidden;
}

.gpc-btn-view {
    background: none;
    border: none;
    padding: 5px 16px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.12s, color 0.12s;
}

.gpc-btn-view.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.gpc-btn-view:hover:not(.active) {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ── Legend ─────────────────────────────────────────────────── */
.gpc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    padding: 8px 20px;
    background: var(--gpc-tan-card);
    border-bottom: 1px solid var(--gpc-border);
}

.gpc-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--gpc-text-mid);
}

.gpc-legend-swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
}

/* ── Grid view ───────────────────────────────────────────────── */
.gpc-grid-view {
    padding: 14px 14px 20px;
}

.gpc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.gpc-day-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gpc-text-light);
    padding: 3px 0 6px;
}

.gpc-day-cell {
    min-height: 82px;
    border-radius: var(--gpc-radius);
    border: 1px solid var(--gpc-border);
    padding: 5px 5px 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
}

.gpc-day-cell.gpc-empty {
    background: transparent !important;
    border-color: transparent;
}

.gpc-day-num {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--gpc-text-mid);
    line-height: 1;
}

.gpc-thumb {
    width: 100%;
    height: 40px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.gpc-chip {
    font-size: 0.66rem;
    line-height: 1.3;
    color: var(--gpc-text-dark);
    background: rgba(255,255,255,0.5);
    border-radius: 3px;
    padding: 2px 4px;
    word-break: break-word;
    display: block;
    text-decoration: none;
}

a.gpc-chip.gpc-has-link,
a.gpc-has-link {
    font-weight: 700;
    color: var(--gpc-brown-dark);
    text-decoration: underline;
    text-decoration-color: var(--gpc-brown-light);
    text-underline-offset: 2px;
    cursor: pointer;
}

a.gpc-chip.gpc-has-link:hover,
a.gpc-has-link:hover {
    color: var(--gpc-accent);
    background: rgba(255,255,255,0.85);
}

/* ── List view ───────────────────────────────────────────────── */
.gpc-list-view {
    padding: 14px 20px 24px;
}

.gpc-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--gpc-radius);
    border: 1px solid var(--gpc-border);
    margin-bottom: 5px;
    background: var(--gpc-tan-card);
}

.gpc-list-date {
    min-width: 44px;
    text-align: center;
    flex-shrink: 0;
}

.gpc-list-day {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gpc-brown-dark);
    line-height: 1;
}

.gpc-list-dow {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gpc-text-light);
    font-weight: 700;
}

.gpc-list-bar {
    width: 5px;
    align-self: stretch;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.gpc-list-thumb {
    width: 54px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.gpc-list-thumb-placeholder {
    width: 54px;
    height: 40px;
    flex-shrink: 0;
}

.gpc-list-info {
    flex: 1;
    min-width: 0;
}

.gpc-list-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gpc-text-dark);
    line-height: 1.25;
    display: block;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.gpc-list-title.gpc-has-link {
    color: var(--gpc-brown-dark);
    text-decoration: underline;
    text-decoration-color: var(--gpc-brown-light);
    text-underline-offset: 2px;
}

a.gpc-list-title.gpc-has-link:hover {
    color: var(--gpc-accent);
}

.gpc-list-cat {
    font-size: 0.68rem;
    color: var(--gpc-text-light);
    margin-top: 2px;
}

/* ── Misc ────────────────────────────────────────────────────── */
.gpc-empty-msg {
    text-align: center;
    color: var(--gpc-text-light);
    font-style: italic;
    padding: 30px 0;
}

.goodplate-error {
    color: #a00;
    font-size: 0.85rem;
    padding: 8px 12px;
    border: 1px solid #f5c6cb;
    background: #fff3f3;
    border-radius: 4px;
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
    .gpc-header,
    .gpc-view-toggle {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .gpc-btn-view,
    .gpc-view-toggle { display: none; }
    .gpc-day-cell,
    .gpc-legend-swatch,
    .gpc-list-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .gpc-grid { gap: 2px; }
    .gpc-day-cell { min-height: 58px; padding: 3px; }
    .gpc-chip { font-size: 0.58rem; }
    .gpc-thumb { height: 28px; }
    .gpc-day-num { font-size: 0.68rem; }
    .gpc-grid-view { padding: 6px 6px 14px; }
    .gpc-day-header { font-size: 0.58rem; }
    .gpc-list-thumb, .gpc-list-thumb-placeholder { width: 40px; height: 32px; }
}
