/* =========================================================
   guidebook-category.css v3.3
   Layout: Map | Currency+Flight | Stacked Utils
   ========================================================= */

/* --- 1. MAIN LAYOUT --- */
.guidebook-layout {
    position: absolute; top: 70px; left: 0; right: 0; bottom: 0;
    display: flex; background: #fff;
}
.guidebook-layout .archive-sidebar {
    width: 260px; background: var(--bg-tan); border-right: 1px solid var(--rule);
    display: flex; flex-direction: column; flex-shrink: 0;
}
.guidebook-main {
    flex: 1; overflow-y: auto; padding: 2rem; background: #f4f2ef;
}

/* --- 2. WIDGETS GRID SYSTEM --- */
.guidebook-widgets {
    display: grid;
    /* Col 1 (Map) | Col 2 (Currency/Flight) | Col 3 (Stack) */
    grid-template-columns: 1.5fr 1fr 1fr;
    /* 3 Rows align perfectly */
    grid-template-rows: auto auto auto;
    gap: 12px;
    margin: 1.5rem 0;
}

/* --- 3. WIDGET PLACEMENT --- */

/* Col 1: MAP (Spans all 3 rows) */
.utility-widget.map-widget {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
    display: flex; flex-direction: column;
    min-height: 450px;
}
.map-wrapper {
    flex: 1; border-radius: 4px; overflow: hidden;
    border: 1px solid #ddd; background: #eee;
}

/* Col 2: CURRENCY (Spans top 2 rows) & FLIGHT (Bottom row) */
.currency-widget {
    grid-column: 2 / 3;
    grid-row: 1 / 3; /* Tall but leaves room for flight */
    display: flex; flex-direction: column;
}
.currency-widget-inner {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; padding: 10px 0;
}

.flight-widget {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

/* Col 3: STACKED (1 row each) */
.google-widget   { grid-column: 3 / 4; grid-row: 1 / 2; }
.clocks-widget   { grid-column: 3 / 4; grid-row: 2 / 3; }
.weather-widget  { grid-column: 3 / 4; grid-row: 3 / 4; }


/* --- 4. COMPACT WIDGET STYLING --- */
.utility-widget {
    background: #fff; border: 1px solid var(--rule);
    border-radius: 6px; padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.utility-widget .widget-title {
    font-family: var(--serif); font-size: 0.95rem; font-weight: 700;
    margin: 0 0 0.8rem; padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--rule); color: var(--ink);
}

/* Currency */
.currency-header { font-size: 12px; background: var(--bg-tan); padding: 4px; border-radius: 4px; margin-bottom: 8px; font-weight: 600; text-align: center; }
.currency-body { display: flex; flex-direction: column; gap: 8px; }
.converter-row { display: flex; gap: 8px; margin-bottom: 4px; justify-content: center; font-size: 11px; }
.currency-select, .amount-row input { width: 100%; padding: 6px; font-size: 13px; border: 1px solid #ccc; border-radius: 4px; }
.result-display { background: #f4f4f4; padding: 10px; border-radius: 4px; margin-top: 8px; text-align: center; }
.result-amount { font-size: 1.4rem; font-weight: 700; color: #e06700; line-height: 1.1; }
.result-currency { font-size: 10px; color: #666; }
.rate-info { font-size: 9px; color: #999; text-align: right; margin-top: 4px; }

/* Flight Widget (Link Card) */
.flight-link-card {
    display: flex; align-items: center; background: #f0f7ff;
    border: 1px solid #d0e3ff; border-radius: 6px; padding: 10px;
    margin-bottom: 10px;
}
.flight-icon { font-size: 1.8rem; margin-right: 10px; }
.flight-text p { margin: 0 0 6px 0; font-size: 0.85rem; font-weight: 600; color: #005a9c; line-height: 1.3; }
.flight-btn {
    display: inline-block; background: #005a9c; color: #fff;
    padding: 4px 10px; border-radius: 12px; font-size: 0.8rem;
    text-decoration: none; transition: background 0.2s;
}
.flight-btn:hover { background: #00447a; }
.flight-links-sub { display: flex; justify-content: space-between; font-size: 0.75rem; padding: 0 4px; }
.flight-links-sub a { color: #666; text-decoration: underline; }
.flight-links-sub a:hover { color: #e07a00; }

/* Google */
.google-search-form { display: flex; flex-direction: column; gap: 8px; }
.google-input-wrapper { display: flex; gap: 6px; }
.google-input { flex: 1; padding: 6px; font-size: 13px; border: 1px solid #d7c3ba; border-radius: 4px; }
.google-btn { width: 36px; background: #4285f4; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.google-links { display: flex; gap: 8px; flex-wrap: wrap; }
.g-link { font-size: 11px; padding: 4px 8px; background: var(--bg-tan); color: var(--ink-soft); text-decoration: none; border-radius: 12px; }

/* Clocks */
.timezone-clocks.two-column { display: flex; gap: 8px; justify-content: center; }
.tz-clock { text-align: center; }
.tz-label { font-size: 10px; background: #f0f0f0; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-bottom: 2px; }
.tz-flag { width: 12px; height: auto; margin-right: 3px; vertical-align: middle; }
.tz-digital-time { font-family: monospace; font-size: 13px; font-weight: 600; margin-top: 2px; }
#mn-clock-canvas, #jp-clock-canvas { width: 80px !important; height: 80px !important; }

/* Weather */
.ub-weather-header { font-size: 12px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.ub-weather-temp { font-size: 1.8rem; font-weight: 700; color: #e06700; line-height: 1; margin: 4px 0; }
.ub-weather-desc { font-size: 11px; color: var(--ink-soft); }

/* Article Block */
.guidebook-article-block {
    background: #fff; border: 1px solid var(--rule); border-radius: 6px;
    padding: 2rem; margin-bottom: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.article-body { font-size: 0.95rem; line-height: 1.8; color: var(--ink); }
.article-body h4 { margin: 1.5rem 0 0.5rem; font-size: 1.05rem; color: var(--wood-dark); border-bottom: 1px dashed var(--rule); padding-bottom: 0.3rem; }
.note-box { margin-top: 1.5rem; padding: 1rem; background: #fffaf0; border: 1px solid #e8d0b0; border-radius: 4px; font-size: 0.9rem; }

/* --- 5. RESPONSIVE --- */
@media (max-width: 960px) {
    .guidebook-layout { position: static; display: block; }
    .guidebook-main { padding: 1.5rem 1rem; }
    .guidebook-widgets {
        /* Tablet: Map Top, 2 columns below */
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    .utility-widget.map-widget { grid-column: 1 / -1; grid-row: auto; min-height: 300px; }
    /* Currency/Flight on Left */
    .currency-widget { grid-column: 1 / 2; grid-row: auto; }
    .flight-widget { grid-column: 1 / 2; grid-row: auto; }
    /* Stack on Right */
    .google-widget { grid-column: 2 / 3; grid-row: auto; }
    .clocks-widget { grid-column: 2 / 3; grid-row: auto; }
    .weather-widget { grid-column: 2 / 3; grid-row: auto; }
}

@media (max-width: 600px) {
    .guidebook-widgets {
        grid-template-columns: 1fr; /* Stack everything */
    }
    .utility-widget.map-widget, .currency-widget, .flight-widget, 
    .google-widget, .clocks-widget, .weather-widget {
        grid-column: 1 / -1;
    }
}

/* Post Stream */
.guidebook-posts { margin-top: 3rem; }
.section-divider { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; border-bottom: 2px solid var(--accent-river); margin-bottom: 1.5rem; padding-bottom: 0.5rem; }
.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.pagination-wrapper { margin-top: 2rem; text-align: center; }