/* Guide Pages Shared Styles - Matching App Aesthetic */
/* Works both standalone (opened directly) and when loaded in iframe */

:root {
    --bg: #050505;
    --panel: rgba(18, 24, 38, 0.75);
    --text: #e6e9ef;
    --muted: #9aa4b2;
    --accent: #00F3FF; /* neon-cyan */
    --accent2: #FF0055; /* neon-pink */
    --border: rgba(0, 243, 255, 0.3);
    --warn: #ffcc00;
    --font-mono: 'Courier New', Courier, monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Also define on #guide-html-content for iframe context */
#guide-html-content {
    --bg: #050505;
    --panel: rgba(18, 24, 38, 0.75);
    --text: #e6e9ef;
    --muted: #9aa4b2;
    --accent: #00F3FF; /* neon-cyan */
    --accent2: #FF0055; /* neon-pink */
    --border: rgba(0, 243, 255, 0.3);
    --warn: #ffcc00;
    --font-mono: 'Courier New', Courier, monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Apply box-sizing globally when this CSS is loaded */
* {
    box-sizing: border-box;
}

/* Base styles for body - applies when opened directly */
body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    background-image: radial-gradient(circle at top, rgba(15, 22, 41, 0.5), rgba(8, 11, 16, 0.8) 70%);
    color: var(--text);
    line-height: 1.7;
    padding: 20px;
    padding-bottom: calc(100vh - 100px); /* Extended bottom padding to allow scrolling anchors near bottom to top */
}

/* Styles for #guide-html-content wrapper - applies when loaded in iframe */
#guide-html-content {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    background-image: radial-gradient(circle at top, rgba(15, 22, 41, 0.5), rgba(8, 11, 16, 0.8) 70%);
    color: var(--text);
    line-height: 1.7;
    padding: 20px;
    padding-bottom: calc(100vh - 100px); /* Extended bottom padding to allow scrolling anchors near bottom to top */
}

/* Header bar - sticky layout with button left, title centered */
body .guide-header-bar,
#guide-html-content .guide-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.8);
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(0, 243, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body .guide-header-left,
#guide-html-content .guide-header-left {
    width: 120px;
    display: flex;
    align-items: center;
}

body .guide-header-center,
#guide-html-content .guide-header-center {
    flex: 1;
    text-align: center;
}

body .guide-header-right,
#guide-html-content .guide-header-right {
    width: 120px;
}

/* Legacy header styles - keep for backwards compatibility */
body > header,
#guide-html-content header {
    padding: 0 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    display:none;
}

body > h1,
#guide-html-content h1 {
    margin: 0;
    font-size: 2rem;
    color: var(--accent);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 2px var(--accent), 0 0 8px var(--accent);
}

/* Header bar title - smaller size for sticky header */
body .guide-header-bar h1,
#guide-html-content .guide-header-bar h1 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 2px var(--accent), 0 0 8px var(--accent);
}

body .guide-header-bar .subtitle,
#guide-html-content .guide-header-bar .subtitle {
    color: var(--muted);
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

body > .subtitle,
#guide-html-content .subtitle {
    color: var(--muted);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

#guide-html-content .topnav {
    padding: 1rem 0;
    background: rgba(18, 24, 38, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}

#guide-html-content .topnav a {
    color: var(--accent2);
    text-decoration: none;
    font-size: 0.95rem;
    font-family: var(--font-mono);
    transition: all 0.3s;
}

#guide-html-content .topnav a:hover {
    text-decoration: underline;
    text-shadow: 0 0 4px var(--accent2);
}

/* Navigation menu (for section navigation within pages) */
body nav,
#guide-html-content nav {
    /*margin: 1.5rem 0;*/
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

/* Quick Search buttons (Area guides) */
body .area-search-button-wrapper,
#guide-html-content .area-search-button-wrapper {
    margin: 12px 0;
}

body .area-search-button,
#guide-html-content .area-search-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 243, 255, 0.4);
    background: rgba(0, 243, 255, 0.08);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

body .area-search-button:hover,
#guide-html-content .area-search-button:hover {
    border-color: var(--accent);
    background: rgba(0, 243, 255, 0.14);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.25);
}

body .area-search-button:active,
#guide-html-content .area-search-button:active {
    transform: translateY(1px);
}

/* Guide "Nearest ATM" / "Nearest Exchange" buttons (e.g. late-night-infrastructure) */
body .guide-search-btn,
#guide-html-content .guide-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.4);
    background: rgba(0, 243, 255, 0.08);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

body .guide-search-btn:hover,
#guide-html-content .guide-search-btn:hover {
    border-color: var(--accent);
    background: rgba(0, 243, 255, 0.14);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.25);
}

body .guide-search-btn:active,
#guide-html-content .guide-search-btn:active {
    transform: translateY(1px);
}

body nav ul,
#guide-html-content nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

body nav li,
#guide-html-content nav li {
    margin: 0;
}

body nav a,
#guide-html-content nav a {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent); /* Cyan - keep as is */
    text-decoration: none;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    background: rgba(11, 15, 20, 0.35);
    transition: all 0.3s;
    display: inline-block;
}

body nav a:hover,
#guide-html-content nav a:hover {
    border-color: var(--accent);
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.3);
    text-shadow: 0 0 4px var(--accent);
}

/* Main content sections */
body main,
#guide-html-content main {
    margin-top: 2rem;
}

body section,
#guide-html-content section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

body section:last-child,
#guide-html-content section:last-child {
    border-bottom: none;
}

body .container,
#guide-html-content .container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0;
}

body .card,
#guide-html-content .card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    margin: 0rem 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s;
}

body .card:hover,
#guide-html-content .card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

body h2,
#guide-html-content h2 {
    color: #ff00ff;
    margin: 0.25rem 0 0;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.5rem;
    text-shadow: 0 0 2px #ff00ff;
}

body h3,
#guide-html-content h3 {
    color: var(--accent);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

body h4,
#guide-html-content h4 {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

body .jp,
#guide-html-content .jp {
    color: var(--muted);
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
    font-weight: 400;
    letter-spacing: 0.05em;
}

body .kicker,
#guide-html-content .kicker {
    color: var(--muted);
    margin: 0.25rem 0 1rem;
    font-size: 0.9rem;
}

body > .toc,
body .toc,
#guide-html-content .toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 0;
}

/* TOC links - ensure they're cyan, not dark blue */
body .toc a,
#guide-html-content .toc a {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #00F3FF !important; /* Cyan - force with !important and explicit color */
    text-decoration: none !important;
    font-size: 0.9rem;
    background: rgba(11, 15, 20, 0.35);
    font-family: var(--font-mono);
    transition: all 0.3s;
    font-weight: 500;
}

body .toc a:hover,
#guide-html-content .toc a:hover {
    border-color: #00F3FF !important;
    background: rgba(0, 243, 255, 0.15) !important;
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.4) !important;
    color: #00F3FF !important;
    text-shadow: 0 0 4px #00F3FF !important;
}

body .tip,
#guide-html-content .tip {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(15, 20, 36, 0.6);
    border-left: 3px solid var(--accent2);
    font-size: 0.95rem;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body .notice,
#guide-html-content .notice {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(15, 18, 32, 0.6);
    border-left: 3px solid var(--warn);
    font-size: 0.95rem;
    color: var(--text);
    border-radius: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body .footer,
body footer,
#guide-html-content .footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

body small a,
#guide-html-content small a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
}

body small a:hover,
#guide-html-content small a:hover {
    color: var(--accent); /* Cyan - keep as is */
}

/* Links */
body a,
#guide-html-content a {
    color: var(--accent); /* Cyan - keep as is */
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

body a:hover,
#guide-html-content a:hover {
    color: var(--accent);
    text-shadow: 0 0 6px var(--accent), 0 0 12px rgba(0, 243, 255, 0.5);
}

/* Links in paragraphs and lists - change dark blue to purple */
body p a,
body li a,
#guide-html-content p a,
#guide-html-content li a {
    color: var(--accent) ; /*#B026FF;*/ /* Neon purple instead of dark blue */
    /*text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 2px;*/
}

body p a:hover,
body li a:hover,
#guide-html-content p a:hover,
#guide-html-content li a:hover {
    color: var(--accent); /*#C84AFF;*/
    /*text-decoration-color: #B026FF;
    text-shadow: 0 0 4px #B026FF;*/
}

/* Lists */
body ul,
body ol,
#guide-html-content ul,
#guide-html-content ol {
    padding-left: 1.5rem;
}

body li,
#guide-html-content li {
    margin: 0.5rem 0;
}

/* Code blocks */
#guide-html-content code {
    background: rgba(11, 15, 20, 0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--accent);
    border: 1px solid var(--border);
}

#guide-html-content pre {
    background: rgba(11, 15, 20, 0.5);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
}

#guide-html-content pre code {
    background: none;
    padding: 0;
    border: none;
}

/* Tables */
#guide-html-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

#guide-html-content th,
#guide-html-content td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

#guide-html-content th {
    background: rgba(18, 24, 38, 0.5);
    color: var(--accent);
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Images */
#guide-html-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Card Grid Layout - Max 2 per line, 1 for mobile */
body .guide-cards-grid,
#guide-html-content .guide-cards-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default: 1 card per line (iPhone) */
    gap: 1rem;
    margin-bottom: 2rem;
}

/* iPad: 2 cards per line with wider cards */
@media (min-width: 768px) and (max-width: 1024px) {
    body .guide-cards-grid,
    #guide-html-content .guide-cards-grid {
        grid-template-columns: repeat(2, 1fr); /* Two cards per line on iPad */
        gap: 1.5rem; /* Wider gap for better spacing */
    }
    
    /* Make cards wider on iPad - they'll take up more space in the 2-column grid */
    body .guide-cards-grid .card,
    #guide-html-content .guide-cards-grid .card {
        min-width: 0; /* Allow cards to grow to fill available space */
    }
    
    /* Area guides: always 1 card per line even on iPad */
    body.area-guides-page .guide-cards-grid,
    #guide-html-content.area-guides-page .guide-cards-grid {
        grid-template-columns: 1fr !important; /* One card per line for area guides */
    }
}

/* Desktop: 2 cards per line */
@media (min-width: 1025px) {
    body .guide-cards-grid,
    #guide-html-content .guide-cards-grid {
        grid-template-columns: repeat(2, 1fr); /* Two cards per line on desktop */
    }
    
    /* Area guides: always 1 card per line even on desktop */
    body.area-guides-page .guide-cards-grid,
    #guide-html-content.area-guides-page .guide-cards-grid {
        grid-template-columns: 1fr !important; /* One card per line for area guides */
    }
}

/* Responsive */
@media (max-width: 767px) {
    body .guide-cards-grid,
    #guide-html-content .guide-cards-grid {
        grid-template-columns: 1fr; /* One card per line on iPhone */
        gap: 1.5rem; /* Wider gap */
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    body,
    #guide-html-content {
        padding: 15px 1px !important; /* Reduced horizontal padding on iPhone */
    }
    
    body > .toc,
body .toc,
#guide-html-content .toc {
    gap: 0.5rem;
}
    
    body h1,
    #guide-html-content h1 {
        font-size: 1.5rem;
    }
    
    body h2,
    #guide-html-content h2 {
        font-size: 1.2rem;
    }
    
    body .container,
    #guide-html-content .container {
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    /* Make sub-category cards wider on iPhone */
    body .guide-cards-grid .card,
    #guide-html-content .guide-cards-grid .card {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 1.5rem !important;
        box-sizing: border-box !important;
    }
    
    body .card,
    #guide-html-content .card {
        padding: 1rem;
    }
}


  /* ============================================================
   HERO IMAGES (compact + multi-image rows)
   Drop into guide-styles.css
   ============================================================ */

/* A single hero image stays compact */
.hero {
  margin: 14px 0;
}

/* If your existing CSS styles figure/figcaption, this won't break them */
.hero img {
  display: block;
  width: 100%;
  max-width: 520px;   /* <-- locks hero images to a small/compact size */
  max-height: 260px;  /* <-- prevents tall images from dominating */
  height: auto;
  object-fit: cover;  /* crop nicely instead of stretching */
  border-radius: 10px;
}

/* Optional: keep captions tight */
.hero figcaption {
  max-width: 520px;
  margin-top: 6px;
  opacity: 0.9;
}

/* ============================================================
   HERO ROWS: multiple images on one line
   Usage:
     <div class="hero-row">
       <figure class="hero">...</figure>
       <figure class="hero">...</figure>
     </div>
   ============================================================ */

.hero-row {
  display: flex;
  flex-wrap: wrap;     /* allows wrapping on smaller screens */
  gap: 12px;
  align-items: flex-start;
  margin: 14px 0;
}

/* Make each hero figure behave like a “tile” */
.hero-row .hero {
  margin: 0;           /* row controls spacing */
  flex: 1 1 260px;     /* grows, but wraps; ~2–3 per row depending on screen */
  max-width: 520px;    /* same as single hero cap */
}

/* Ensure images fill their tile but stay compact */
.hero-row .hero img {
  width: 100%;
  max-width: 100%;     /* in-row image should fill its tile */
  max-height: 220px;   /* slightly smaller for multi-image rows */
  height: auto;
  object-fit: cover;
}

/* ============================================================
   AREA SEARCH BUTTON
   Usage:
     <div class="area-search-button-wrapper">
       <button class="area-search-button" 
               data-category="all"
               data-area="Shin-Okubo"
               data-prefecture="Tokyo"
               data-query="新大久保">
         🔍 Search Shin-Ōkubo venues
       </button>
     </div>
   ============================================================ */

body .area-search-button-wrapper,
#guide-html-content .area-search-button-wrapper {
  margin-top: 20px;
  text-align: center;
}

body .area-search-button,
#guide-html-content .area-search-button {
  background: rgba(0, 243, 255, 0.2);
  border: 1px solid rgba(0, 243, 255, 0.5);
  color: var(--accent, #00F3FF);
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-mono, 'Courier New', Courier, monospace);
}

body .area-search-button:hover,
#guide-html-content .area-search-button:hover {
  background: rgba(0, 243, 255, 0.3);
  border-color: rgba(0, 243, 255, 0.7);
}

body .area-search-button:active,
#guide-html-content .area-search-button:active {
  background: rgba(0, 243, 255, 0.25);
}

/* ============================================================
   OPTIONAL: "Tiny" variant if you want even smaller rows
   Usage: <div class="hero-row tiny">...</div>
   ============================================================ */
.hero-row.tiny .hero {
  flex: 1 1 200px;
  max-width: 420px;
}

.hero-row.tiny .hero img {
  max-height: 180px;
}