/* PDF Search – Public Search Widget */

.pdf-search-widget {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
}

/* Form */
.pdf-search-form { margin-bottom: 24px; }

.pdf-search-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.pdf-search-input,
.pdf-search-submit,
.pdf-search-reset {
    margin: 0;
}

.pdf-search-input {
    flex: 1;
    padding: 10px 14px;
    margin-bottom: 0 !important;
    font-size: 16px;
    font-family: inherit;
    border: 2px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color .2s;
}

.pdf-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.pdf-search-submit,
.pdf-search-reset {
    padding: 0 20px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    transition: background .2s;
}

.pdf-search-submit {
    background: #2271b1;
    color: #fff;
}
.pdf-search-submit:hover { background: #135e96; }

.pdf-search-reset {
    background: #666;
    color: #fff;
}
.pdf-search-reset:hover { background: #444; color: #fff; }

/* Results */
.pdf-search-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

.pdf-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.pdf-filter-toggle input[type="radio"] {
    margin: 0;
}

.pdf-year-fields {
    display: none;
    align-items: center;
    gap: 6px;
}

.pdf-year-fields.is-visible {
    display: inline-flex;
}

.pdf-year-select {
    padding: 5px 8px;
    font-size: 14px;
    font-family: inherit;
    border: 2px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin: 0 !important;
    background: #fff;
    cursor: pointer;
}

.pdf-year-select:focus {
    outline: none;
    border-color: #2271b1;
}

.pdf-year-sep {
    color: #999;
}

/* Results */
.pdf-result-count {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

.pdf-no-results { color: #666; }

.pdf-result-doc {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
    background: #fafafa;
}

.pdf-result-title {
    margin: 0 0 10px;
    font-size: 18px;
}

.pdf-result-title a {
    text-decoration: none;
    color: #1a0dab;
}
.pdf-result-title a:hover { text-decoration: underline; }

/* Snippets */
.pdf-result-snippets {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pdf-result-snippet {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 6px 0;
    border-top: 1px solid #eee;
    font-size: 14px;
    line-height: 1.5;
}

.pdf-page-link {
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid #2271b1;
    border-radius: 3px;
    flex-shrink: 0;
    cursor: pointer;
}
.pdf-page-link:hover { background: #2271b1; color: #fff; }

.pdf-snippet-text { color: #333; }

/* Highlighted terms */
.pdf-snippet-text mark {
    background: #fff3cd;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* ── PDF Lightbox modal ───────────────────────────────────────────────────── */

.pdf-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.pdf-modal-overlay.is-open {
    display: flex;
}

.pdf-modal {
    position: relative;
    width: 90vw;
    height: 90vh;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.pdf-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #1e1e1e;
    color: #fff;
    flex-shrink: 0;
    gap: 12px;
}

.pdf-modal-title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-modal-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pdf-modal-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.pdf-modal-btn:hover { background: rgba(255,255,255,0.25); color: #fff; }

.pdf-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}
.pdf-modal-close:hover { color: #f88; }

.pdf-modal-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #525659;
}

.pdf-modal-notice {
    padding: 8px 16px;
    background: #fffbe6;
    font-size: 12px;
    color: #666;
    text-align: center;
    flex-shrink: 0;
    border-top: 1px solid #ffe;
}

/* ── Through the Green issue archive — [ttg_issues] ──────────────────────── */
/* Self-contained, light palette with a fairway-green accent. Inherits the
   theme's font (Crimson Pro on the live site) rather than loading its own.
   Column count is set per-shortcode via the --ttg-cols custom property. */
.ttg-archive {
    --ttg-accent:#4c5e46;
    --ttg-accent-soft:rgba(76,94,70,.12);
    --ttg-card:#eef0ea;
    --ttg-card-hover:#ffffff;
    --ttg-border:#d7dccd;
    --ttg-fg:#1e241c;
    --ttg-muted:#6c7366;
    --ttg-surface:#ffffff;
    --ttg-shadow:0 5px 16px rgba(31,40,28,.10);
    --ttg-cols:4;
    font-family:inherit;
    color:var(--ttg-fg);
    max-width:1040px;
    margin:0 auto;
}

.ttg-toolbar {
    display:flex;flex-wrap:wrap;align-items:flex-end;gap:1rem 1.4rem;
    margin:0 0 1.1rem;padding-bottom:.9rem;border-bottom:1px solid var(--ttg-border);
}
.ttg-control { display:flex;flex-direction:column;gap:.3rem; }
.ttg-control label {
    font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;
    color:var(--ttg-muted);font-weight:600;margin:0;
}
.ttg-control select {
    font-family:inherit;font-size:1rem;color:var(--ttg-fg);background:var(--ttg-surface);
    border:1px solid var(--ttg-border);border-radius:8px;padding:.45rem 2rem .45rem .7rem;
    cursor:pointer;appearance:none;-webkit-appearance:none;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 8l3-3.5' fill='none' stroke='%236c7366' stroke-width='1.4'/></svg>");
    background-repeat:no-repeat;background-position:right .6rem center;
}
.ttg-control select:focus-visible { outline:none;border-color:var(--ttg-accent);box-shadow:0 0 0 3px var(--ttg-accent-soft); }
.ttg-count { margin-left:auto;align-self:center;font-size:.9rem;color:var(--ttg-muted);font-variant-numeric:tabular-nums; }

.ttg-grid { display:grid;grid-template-columns:repeat(var(--ttg-cols),1fr);gap:14px; }
.ttg-issue {
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.22rem;
    text-align:center;text-decoration:none;color:inherit;
    background:var(--ttg-card);border:1px solid var(--ttg-border);border-radius:11px;
    padding:.9rem .75rem;min-height:98px;
    transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background .16s ease;
}
/* display:flex above beats the UA [hidden] rule, so hide paged-out cards explicitly. */
.ttg-issue[hidden] { display:none !important; }
.ttg-issue .ttg-kicker { font-size:.78rem;color:var(--ttg-muted);font-style:italic;line-height:1.1; }
.ttg-issue .ttg-date { font-size:1.3rem;font-weight:600;line-height:1.1;letter-spacing:-.01em; }
.ttg-issue .ttg-no {
    font-size:.72rem;letter-spacing:.16em;text-transform:uppercase;
    color:var(--ttg-muted);font-weight:600;font-variant-numeric:tabular-nums;
}
.ttg-issue .ttg-cta {
    font-size:.72rem;letter-spacing:.09em;text-transform:uppercase;color:var(--ttg-accent);font-weight:600;
    opacity:0;height:0;transform:translateY(2px);transition:opacity .16s ease,transform .16s ease;
}
.ttg-issue:hover,.ttg-issue:focus-visible {
    border-color:var(--ttg-accent);background:var(--ttg-card-hover);box-shadow:var(--ttg-shadow);
    transform:translateY(-3px);outline:none;
}
.ttg-issue:hover .ttg-date,.ttg-issue:focus-visible .ttg-date { color:var(--ttg-accent); }
.ttg-issue:hover .ttg-cta,.ttg-issue:focus-visible .ttg-cta { opacity:1;height:auto;transform:translateY(0);margin-top:.15rem; }
.ttg-issue:focus-visible { box-shadow:0 0 0 3px var(--ttg-accent-soft),var(--ttg-shadow); }

.ttg-more-row { display:flex;justify-content:center;margin-top:1.8rem; }
.ttg-more {
    font-family:inherit;font-size:.95rem;font-weight:600;letter-spacing:.04em;color:var(--ttg-accent);
    background:transparent;border:1.5px solid var(--ttg-accent);border-radius:999px;
    padding:.6rem 1.8rem;cursor:pointer;transition:background .16s ease,color .16s ease;
}
.ttg-more:hover { background:var(--ttg-accent);color:var(--ttg-surface); }
.ttg-more:focus-visible { outline:none;box-shadow:0 0 0 3px var(--ttg-accent-soft); }

.ttg-empty { color:#6c7366;font-style:italic; }

/* Quarter-aligned mode: an empty seasonal slot holds its column (desktop) but
   is dropped on phones so the real cards still pack 2-up with no gaps. */
.ttg-slot-empty { min-height:98px;border:1px solid transparent;border-radius:11px;background:transparent; }
/* Mirror the card rule so a paged/filtered-out placeholder can't be re-shown by a theme rule that sets display on grid children. */
.ttg-slot-empty[hidden] { display:none !important; }

/* ── Browse / Search toggle ─────────────────────────────────────────────── */
.ttg-modes { display:inline-flex;margin:0 0 .4rem;border:1px solid var(--ttg-border);border-radius:999px;background:var(--ttg-surface);padding:.25rem;gap:.2rem; }
.ttg-mode { font-family:inherit;font-size:1rem;font-weight:600;color:var(--ttg-muted);background:transparent;border:none;border-radius:999px;padding:.45rem 1.4rem;cursor:pointer;transition:background .15s ease,color .15s ease; }
.ttg-mode[aria-selected="true"] { background:var(--ttg-accent);color:var(--ttg-surface); }
.ttg-mode:focus-visible { outline:none;box-shadow:0 0 0 3px var(--ttg-accent-soft); }
.ttg-panel[hidden] { display:none !important; }

/* ── Search panel ───────────────────────────────────────────────────────── */
.ttg-search-form { margin:0; }
.ttg-search-row { display:flex;gap:.6rem;flex-wrap:wrap;align-items:stretch; }
.ttg-archive .ttg-search-input { flex:1;min-width:220px;height:48px;box-sizing:border-box;font-family:inherit;font-size:1.1rem;color:var(--ttg-fg);background:var(--ttg-surface);border:1px solid var(--ttg-border);border-radius:10px;padding:0 .9rem;margin:0;line-height:normal; }
.ttg-search-input:focus-visible { outline:none;border-color:var(--ttg-accent);box-shadow:0 0 0 3px var(--ttg-accent-soft); }
/* High-specificity, vendor-prefixed, !important so the theme's own lighter
   placeholder can't win on first paint. Separate rules (not comma-grouped) so an
   unrecognised vendor selector can't invalidate the others. */
.ttg-archive .ttg-search-input::placeholder { color:#5a6356 !important;opacity:1 !important; }
.ttg-archive .ttg-search-input::-webkit-input-placeholder { color:#5a6356 !important;opacity:1 !important; }
.ttg-archive .ttg-search-input::-moz-placeholder { color:#5a6356 !important;opacity:1 !important; }
.ttg-archive .ttg-search-input:-ms-input-placeholder { color:#5a6356 !important;opacity:1 !important; }
.ttg-archive .ttg-search-btn { height:48px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;font-family:inherit;font-size:1rem;font-weight:600;line-height:normal;color:var(--ttg-surface);background:var(--ttg-accent);border:none;border-radius:10px;padding:0 1.5rem;margin:0;cursor:pointer;white-space:nowrap; }
.ttg-search-btn:focus-visible { outline:none;box-shadow:0 0 0 3px var(--ttg-accent-soft); }

.ttg-result-count { font-size:.9rem;color:var(--ttg-muted);font-variant-numeric:tabular-nums;margin:.2rem 0 .3rem; }
.ttg-tip { font-size:.85rem;color:var(--ttg-muted);font-style:italic;margin:0 0 1rem; }
.ttg-tip::before { content:"\1F4A1\00A0"; font-style:normal; }
.ttg-results { display:flex;flex-direction:column;gap:1rem; }
.ttg-result { background:var(--ttg-card);border:1px solid var(--ttg-border);border-radius:11px;padding:1rem 1.15rem; }
.ttg-result-title { margin:0 0 .5rem;font-size:1.15rem;font-weight:700;line-height:1.2; }
.ttg-result-title a { color:inherit;text-decoration:none; }
.ttg-result-title a:hover { color:var(--ttg-accent); }
.ttg-snips { list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.4rem; }
.ttg-snip { display:flex;gap:.6rem;align-items:baseline;font-size:.98rem;line-height:1.45; }
.ttg-snip-text { min-width:0; }
.ttg-pagelink { flex-shrink:0;font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;font-weight:600;color:var(--ttg-accent);border:1px solid var(--ttg-accent);border-radius:999px;padding:.12rem .55rem;text-decoration:none;white-space:nowrap; }
.ttg-pagelink:hover { background:var(--ttg-accent);color:var(--ttg-surface); }
.ttg-snip mark { background:var(--ttg-accent-soft);color:inherit;border-radius:3px;padding:0 .12em;font-weight:600; }
.ttg-hint, .ttg-noresults { color:var(--ttg-muted);font-style:italic;padding:.8rem 0; }

@media (max-width:620px) {
    .ttg-grid { grid-template-columns:repeat(2,1fr); }
    .ttg-count { margin-left:0;width:100%; }
    .ttg-slot-empty { display:none; }
    .ttg-modes { display:flex;width:100%; }
    .ttg-mode { flex:1;text-align:center; }
}
