/* HappyHour Aggregator v4 — Frontend Styles
 * Dark-theme aware (cellar.dropt.beer --db-* tokens) with hex fallbacks.
 * Mobile-first responsive. Tables get a horizontal scroll wrapper.
 */

/* ── Wrapper ─────────────────────────────────────────────────────────── */

.hha-content {
    font-family: inherit;
    line-height: 1.7;
    color: var(--db-text, #f0ece4);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.hha-content > * {
    max-width: 100%;
}

/* ── Lead / intro ────────────────────────────────────────────────────── */

.hha-intro,
.hha-snippet {
    font-size: 1.08em;
    line-height: 1.7;
    color: var(--db-text, #f0ece4);
    margin: 0 0 1.5em;
    padding: 16px 20px;
    background: var(--db-surface, rgba(255,255,255,0.04));
    border-left: 4px solid var(--db-amber, #c47a25);
    border-radius: 0 8px 8px 0;
}

/* ── Last-updated bar ────────────────────────────────────────────────── */

.hha-last-updated {
    font-size: 0.85em;
    color: var(--db-text-muted, #b8a890);
    margin-bottom: 0.8em;
    font-style: italic;
}

/* ── Table of contents ───────────────────────────────────────────────── */

.hha-toc {
    background: var(--db-surface, rgba(255,255,255,0.04));
    border: 1px solid var(--db-glass-border, rgba(196,122,37,0.15));
    border-radius: 12px;
    padding: 14px 20px;
    margin: 0 0 2em;
    display: block;
}

.hha-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.hha-toc li {
    margin: 0;
}

.hha-toc a {
    color: var(--db-amber-light, #e8a94d);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
}

.hha-toc a:hover {
    text-decoration: underline;
    color: var(--db-gold-light, #f0c87a);
}

/* ── Sections ────────────────────────────────────────────────────────── */

.hha-section {
    margin-bottom: 2.5em;
    scroll-margin-top: 90px;
}

.hha-section h2 {
    font-family: var(--db-font-heading, inherit);
    font-size: clamp(1.35em, 4vw, 1.7em);
    font-weight: 700;
    color: var(--db-text, #f0ece4);
    border-bottom: 3px solid var(--db-amber, #c47a25);
    padding-bottom: 10px;
    margin: 1.6em 0 0.8em;
    line-height: 1.3;
}

.hha-neighbourhood,
.hha-section h3 {
    font-family: var(--db-font-heading, inherit);
    color: var(--db-amber-light, #e8a94d);
    font-size: clamp(1.1em, 3vw, 1.25em);
    margin: 1.6em 0 0.6em;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--db-glass-border, rgba(196,122,37,0.4));
    line-height: 1.3;
}

/* FAQ headings keep their own style (override the .hha-section h3 default) */
.hha-section .faq-question {
    border-bottom: 0;
    padding-bottom: 0;
    margin: 0 0 8px;
}

/* ── Item cards (venues, deals, events) ──────────────────────────────── */

.hha-item {
    background: var(--db-bg-3, #180e06);
    border: 1px solid var(--db-border, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 18px 20px;
    margin: 0 0 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.hha-item:hover {
    border-color: var(--db-border-hover, rgba(196,122,37,0.5));
    box-shadow: 0 6px 20px rgba(0,0,0,.4);
    transform: translateY(-1px);
}

.hha-item h3,
.hha-item h4 {
    font-family: var(--db-font-heading, inherit);
    font-size: clamp(1.05em, 3vw, 1.18em);
    font-weight: 700;
    color: var(--db-amber-light, #e8a94d);
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    line-height: 1.3;
}

.hha-item p {
    margin: 6px 0;
    font-size: 0.96em;
    color: var(--db-text, #f0ece4);
}

.hha-item p strong {
    color: var(--db-gold-light, #f0c87a);
    font-weight: 600;
}

.hha-item .hha-why {
    background: var(--db-grad-subtle, rgba(196,122,37,0.15));
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 0.94em;
    color: var(--db-text, #f0ece4);
    border-left: 3px solid var(--db-amber, #c47a25);
}

.hha-item .hha-why strong {
    color: var(--db-amber-light, #e8a94d);
}

/* ── Urgent / time-sensitive flags ───────────────────────────────────── */

.hha-urgent {
    display: inline-block;
    background: var(--db-amber, #c47a25);
    color: #1a0f04;
    padding: 2px 10px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.82em;
    letter-spacing: 0.02em;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Tables (with horizontal-scroll wrapper) ─────────────────────────── */

.hha-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
    border-radius: 10px;
    border: 1px solid var(--db-border, rgba(255,255,255,0.08));
    background: var(--db-bg-3, #180e06);
    /* subtle gradient edge as a "scroll affordance" hint */
    background-image:
        linear-gradient(to right, var(--db-bg-3, #180e06) 30%, transparent),
        linear-gradient(to right, transparent, var(--db-bg-3, #180e06) 70%) 100% 0;
    background-repeat: no-repeat;
    background-size: 24px 100%, 24px 100%;
    background-attachment: local, local;
}

.hha-table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
    font-size: 0.93em;
    margin: 0;
    background: transparent;
}

.hha-table thead {
    background: var(--db-grad, linear-gradient(135deg, #c47a25 0%, #d4a853 100%));
    color: #1a0f04;
}

.hha-table th {
    padding: 12px 14px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    color: #1a0f04;
    border: 0;
}

.hha-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--db-border, rgba(255,255,255,0.08));
    color: var(--db-text, #f0ece4);
    vertical-align: top;
}

.hha-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.025);
}

.hha-table tbody tr:hover {
    background: var(--db-surface-hover, rgba(255,255,255,0.08));
}

.hha-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── FAQ section ─────────────────────────────────────────────────────── */

.hha-faq .faq-item {
    background: var(--db-bg-3, #180e06);
    border: 1px solid var(--db-border, rgba(255,255,255,0.08));
    border-left: 3px solid var(--db-amber, #c47a25);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 0 0 12px;
}

.hha-faq .faq-question {
    font-family: var(--db-font-heading, inherit);
    font-size: 1.05em;
    color: var(--db-amber-light, #e8a94d);
    margin: 0 0 10px;
    line-height: 1.4;
    font-weight: 700;
}

.hha-faq .faq-answer p {
    margin: 0;
    color: var(--db-text, #f0ece4);
    line-height: 1.65;
}

/* ── Internal links ──────────────────────────────────────────────────── */

.hha-internal-link {
    color: var(--db-amber-light, #e8a94d);
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-color: var(--db-glass-border, rgba(196,122,37,0.5));
    text-underline-offset: 3px;
}

.hha-internal-link:hover {
    color: var(--db-gold-light, #f0c87a);
    text-decoration-style: solid;
}

/* ── Closing meta block (city / season / verified) ───────────────────── */

.hha-meta {
    background: var(--db-surface, rgba(255,255,255,0.04));
    border: 1px solid var(--db-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 2em;
    font-size: 0.88em;
    color: var(--db-text-muted, #b8a890);
}

.hha-meta p {
    margin: 4px 0;
}

/* ── Post footer (transparency + RSS) ────────────────────────────────── */

.hha-post-footer {
    border-top: 2px solid var(--db-border, rgba(255,255,255,0.08));
    margin-top: 2.5em;
    padding-top: 1.5em;
}

.hha-post-footer h4 {
    font-family: var(--db-font-heading, inherit);
    color: var(--db-text, #f0ece4);
    font-size: 1.05em;
    margin: 0 0 12px;
}

.hha-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.84em;
    color: var(--db-text-muted, #b8a890);
    margin-bottom: 14px;
}

.hha-post-meta span {
    background: var(--db-surface, rgba(255,255,255,0.04));
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid var(--db-border, rgba(255,255,255,0.08));
    white-space: nowrap;
}

.hha-source-note {
    font-size: 0.85em;
    color: var(--db-text-muted, #b8a890);
    line-height: 1.5;
    margin: 0 0 14px;
}

.hha-subscribe {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
}

.hha-rss-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--db-amber, #c47a25);
    color: #1a0f04 !important;
    padding: 9px 18px;
    border-radius: 100px;
    text-decoration: none !important;
    font-size: 0.92em;
    font-weight: 700;
    transition: background .2s ease, transform .2s ease;
}

.hha-rss-btn:hover {
    background: var(--db-amber-light, #e8a94d);
    transform: translateY(-1px);
}

.hha-pexels-credit {
    font-size: 0.8em;
    color: var(--db-text-faint, #7a6850);
    margin: 0;
}

.hha-pexels-credit a {
    color: var(--db-text-muted, #b8a890);
}

.hha-sitemap-link {
    color: var(--db-text-muted, #b8a890);
    font-size: 0.85em;
    text-decoration: none;
}

.hha-sitemap-link:hover {
    color: var(--db-amber, #c47a25);
    text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hha-toc ul { gap: 6px 14px; }
    .hha-section { margin-bottom: 2em; }
    .hha-item { padding: 16px; }
    .hha-intro, .hha-snippet { padding: 14px 16px; font-size: 1em; }
}

@media (max-width: 480px) {
    .hha-content { font-size: 0.98em; }
    .hha-item { padding: 14px; border-radius: 10px; }
    .hha-item h3, .hha-item h4 { font-size: 1.05em; }
    .hha-item p { font-size: 0.93em; }
    .hha-item .hha-why { padding: 8px 12px; font-size: 0.9em; }

    .hha-table { font-size: 0.85em; min-width: 480px; }
    .hha-table th, .hha-table td { padding: 9px 10px; }

    .hha-toc { padding: 12px 14px; }
    .hha-toc ul { flex-direction: column; gap: 8px; }

    .hha-faq .faq-item { padding: 14px; }
    .hha-meta { padding: 12px 14px; font-size: 0.85em; }

    .hha-post-meta { flex-direction: column; gap: 6px; }
    .hha-post-meta span { align-self: flex-start; }
    .hha-subscribe { flex-direction: column; align-items: flex-start; }
    .hha-rss-btn { width: 100%; justify-content: center; }
}

/* ── Print ───────────────────────────────────────────────────────────── */

@media print {
    .hha-table-scroll { overflow: visible; border: 1px solid #999; }
    .hha-table { min-width: 0; }
    .hha-rss-btn, .hha-subscribe { display: none; }
}
