/*
 Theme Name:   Tropica Vibes
 Theme URI:    https://tropica-vibes.example
 Description:  A bright, playful tropical-pop WordPress theme for travel & lifestyle blogs — front page, category, and single-post templates with an at-a-glance info box and a Google Maps embed per post.
 Author:       Tropica Vibes
 Author URI:   https://tropica-vibes.example
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Tags:         travel, blog, custom-colors, custom-logo, featured-images, grid-layout, one-column, two-columns, responsive-layout
 Text Domain:  tropica-vibes
*/

/* =========================================================
   Tropica Vibes — Design System
   Shared palette across front-page / category / single
   ========================================================= */
:root {
  /* ---- Brand palette ---- */
  --sea:        #00B4D8;   /* turquoise sea */
  --sea-deep:   #0096C7;
  --ocean:      #023E8A;   /* deep navy */
  --coral:      #FF6B6B;   /* coral sunset */
  --sun:        #FFD166;   /* sunny yellow */
  --palm:       #06D6A0;   /* palm green */
  --sand:       #FFF8F0;   /* cream sand */
  --ink:        #1B2A4A;   /* dark text */

  /* ---- Derived ---- */
  --sea-soft:   #E0F7FB;
  --card-bg:    #FFFFFF;
  --shadow:     0 14px 40px rgba(2, 62, 138, .14);
  --shadow-sm:  0 6px 18px rgba(2, 62, 138, .10);
  --radius:     22px;
  --radius-sm:  14px;

  --font-head:  "Baloo 2", "Kanit", "Sarabun", system-ui, sans-serif;
  --font-body:  "Kanit", "Sarabun", system-ui, -apple-system, sans-serif;
}



/* ---------- Article info box ---------- */
.info-box {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 22px;
  background: linear-gradient(135deg, var(--sea-soft), #fff);
  border: 1px solid rgba(0,150,199,.25);
  border-radius: var(--radius); padding: 22px 24px; margin: 26px 0 8px;
}


.info-box .info-row { display: flex; align-items: flex-start; gap: 10px; font-size: .96rem; }
.info-box .info-row .ico { font-size: 1.15rem; line-height: 1.3; }
.info-box .info-row .k { font-weight: 700; color: var(--ocean); min-width: 92px; }
.info-box .info-row .v { color: var(--ink); }
.info-box .stars { color: var(--sun); letter-spacing: 2px; }
@media (max-width: 560px) { .info-box { grid-template-columns: 1fr; } }

/* ---------- Map embed ---------- */
.map-wrap {
  margin-top: 30px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(2,62,138,.12);
}


.map-wrap iframe { width: 100%; height: 360px; border: 0; display: block; }
.map-cap { font-size: .85rem; color: #56657f; text-align: center; margin-top: 8px; }

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 110% -10%, var(--sea-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, #FFF1DA, transparent 55%),
    var(--sand);
  line-height: 1.7;
}


img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 70px 0; }
.section-head { text-align: center; margin-bottom: 42px; }
.section-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  color: var(--ocean);
}


.section-head p { color: #4a5a78; max-width: 620px; margin: 10px auto 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  padding: 13px 26px; border-radius: 999px;
}


.btn:hover { transform: translateY(-3px); }
.btn-primary { background: linear-gradient(120deg, var(--sea), var(--sea-deep)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-coral  { background: linear-gradient(120deg, var(--coral), #ff8e53); color: #fff; box-shadow: var(--shadow-sm); }
.btn-ghost  { background: #fff; color: var(--ocean); border: 2px solid var(--sea); }
.btn-ghost:hover { background: var(--sea-soft); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 248, 240, .82);
}


.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 22px; }
.nav-links { margin-left: auto; }
.nav > .btn-coral { margin-left: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--ocean); }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--sea), var(--palm));
  display: grid; place-items: center; font-size: 1.3rem;
}


.site-logo { height: 32px; width: auto; border-radius: 8px; display: block; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { font-weight: 600; color: var(--ink); position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 3px; width: 0;
}


.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ocean); }

/* ---------- Auto-menu dropdown (Categories) ---------- */
.menu-item-has-children { position: relative; }
.menu-item-has-children > a::after { content: " ▾"; font-size: .7em; opacity: .7; }
.sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 180px;
  background: var(--sand); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 8px 0; margin: 0; list-style: none;
  display: none; flex-direction: column; z-index: 50;
}


.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu { display: flex; }
.sub-menu li { width: 100%; }
.sub-menu a { display: block; padding: 8px 18px; white-space: nowrap; font-weight: 600; color: var(--ink); }
.sub-menu a:hover { color: var(--coral); background: var(--sea-soft); }
.sub-menu a::after { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  background: linear-gradient(135deg, var(--ocean), #0353a4);
}


.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; padding-top: 56px; padding-bottom: 30px; }
.footer-grid h4 { font-family: var(--font-head); color: #fff; margin-bottom: 14px; font-size: 1.1rem; }
.footer-grid a { color: #b9dcff; display: block; padding: 4px 0; transition: color .2s; }
.footer-grid a:hover { color: var(--sun); }
.footer-about p { color: #cfe6ff; font-size: .95rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.16); padding: 18px 0; text-align: center; font-size: .85rem; color: #a9ccff; }
.footer-social { display: flex; gap: 12px; margin-top: 14px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.12);
}


.footer-social a:hover { background: var(--sun); color: var(--ocean); transform: translateY(-3px); }

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg); border-radius: var(--radius); overflow: hidden;
}


.card:hover { transform: translateY(-6px); box-shadow: 0 22px 50px rgba(2,62,138,.20); }
.card-media { height: 180px; overflow: hidden; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.08); }
.tag {
  position: absolute; top: 12px; left: 12px;
  background: var(--sun); color: var(--ink); font-weight: 700;
  font-size: .72rem; padding: 5px 12px; border-radius: 999px;
}


.card-body { padding: 18px 20px 22px; }
.card-body h3 { font-family: var(--font-head); color: var(--ocean); font-size: 1.18rem; margin-bottom: 6px; }
.card-body p { color: #56657f; font-size: .92rem; }
.card-meta { margin-top: 12px; font-size: .8rem; color: var(--sea-deep); font-weight: 600; display: flex; gap: 14px; }

/* ---------- Grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }

/* ---------- Reveal animation ---------- */
/* Reveal animation — content is VISIBLE by default so the page works even
   when JS is blocked (e.g. Cloudflare tunnel / mixed-content). JS only
   adds the entrance effect; it never hides content permanently. */
.reveal { opacity: 1; transform: none; }
.reveal.show { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  /* Start hidden ONLY for below-the-fold items that JS will later reveal.
     Items already in the viewport get .show immediately via main.js, so a
     fresh page load (e.g. after clicking a navbar link) never looks blank. */
  .js .reveal:not(.show) { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.show { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
}



/* ---------- Pills / badges ---------- */
.pill {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: var(--sea-soft); color: var(--sea-deep); font-weight: 700; font-size: .8rem;
}



/* ---------- Hero (front page) ---------- */
.hero { position: relative; overflow: hidden; min-height: 460px; display: flex; align-items: center; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(120deg, rgba(2,62,138,.7), rgba(0,180,216,.4)); }
.hero-inner { position: relative; z-index: 2; padding: 96px 22px; color: #fff; }
.hero-inner h1 { font-family: var(--font-head); font-size: clamp(2rem, 6vw, 3.6rem); max-width: 780px; text-shadow: 0 3px 14px rgba(0,0,0,.3); }
.hero-inner p { font-size: 1.15rem; max-width: 620px; margin: 16px 0 26px; opacity: .96; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Category hero (smaller) ---------- */
.cat-hero { position: relative; overflow: hidden; }
.cat-hero-inner { position: relative; z-index: 2; padding: 70px 22px; color: #fff; }

/* ---------- Post hero (single) ---------- */
.post-hero { position: relative; overflow: hidden; }
.post-hero-inner { position: relative; z-index: 2; padding: 80px 22px; color: #fff; }
.post-hero-inner h1 { font-family: var(--font-head); font-size: clamp(1.7rem, 5vw, 2.8rem); margin: 12px 0 10px; max-width: 780px; text-shadow: 0 3px 14px rgba(0,0,0,.3); }
.post-meta { display: flex; gap: 18px; font-size: .9rem; opacity: .95; flex-wrap: wrap; }

/* ---------- Article body ---------- */
.article-body { max-width: 780px; margin: 0 auto; }
.article-body h2 { font-family: var(--font-head); color: var(--ocean); margin: 32px 0 10px; font-size: 1.5rem; }
.article-body h3 { font-family: var(--font-head); color: var(--ocean); margin: 26px 0 8px; font-size: 1.18rem; font-weight: 700; }
.article-body p { margin-bottom: 16px; }
.article-body blockquote {
  border-left: 5px solid var(--coral); background: var(--sea-soft);
  padding: 16px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}



/* ---------- Post layout (Phase 3) ---------- */
.post-layout { display: flex; gap: 40px; align-items: flex-start; }
.post-layout .article-main { flex: 1 1 auto; min-width: 0; }
.post-layout .article-sidebar { flex: 0 0 300px; max-width: 300px; }
.post-layout.layout-sidebar-left .article-sidebar { order: -1; }
.post-layout.layout-full-width { display: block; }
.post-layout.layout-full-width .article-body { max-width: 860px; }
@media (max-width: 860px) {
  .post-layout { flex-direction: column; }
  .post-layout .article-sidebar { flex-basis: auto; max-width: 100%; width: 100%; }
}



/* ---------- Widgets / share CTA ---------- */
.share-cta { text-align: center; background: linear-gradient(135deg, var(--coral), #ff8e53); color: #fff; }
.share-cta h2 { color: #fff; font-family: var(--font-head); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
}




@media (max-width: 640px) {
  .nav-links { position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--sand); padding: 0; height: 0; overflow: hidden; transition: height .3s ease; box-shadow: var(--shadow); }
  .nav-links.open { height: auto; padding: 12px 0; }
  .nav-links a { padding: 12px 22px; width: 100%; }
  .nav-toggle { display: block; }
  .menu-item-has-children:hover > .sub-menu,
  .menu-item-has-children:focus-within > .sub-menu { display: block; }
  .sub-menu { position: static; box-shadow: none; background: transparent; padding: 0 0 0 16px; display: none; }
}



/* ---------- Accessibility: skip link + screen-reader text ---------- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px; width: 1px;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: #fff; color: var(--ocean);
  clip: auto !important; height: auto; width: auto;
  display: block; left: 12px; top: 12px; padding: 10px 16px;
  z-index: 1000; border-radius: 8px; box-shadow: var(--shadow);
}

/* ---------- Archive / Page hero overlay tones ---------- */
/* Applied via hero-tone-* class on .cat-hero / .post-hero. */
.hero-tone-ocean  .hero-overlay { background: linear-gradient(120deg, rgba(2,62,138,.78), rgba(0,180,216,.42)); }
.hero-tone-forest .hero-overlay { background: linear-gradient(120deg, rgba(13,110,72,.78), rgba(76,175,120,.42)); }
.hero-tone-sunset .hero-overlay { background: linear-gradient(120deg, rgba(214,69,69,.74), rgba(255,140,80,.42)); }
.hero-tone-slate  .hero-overlay { background: linear-gradient(120deg, rgba(45,55,72,.80), rgba(90,105,120,.45)); }
.hero-tone-none  .hero-overlay { background: rgba(2,62,138,.55); }

/* ---------- Subscribe modal ---------- */
.sub-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sub-modal[hidden] { display: none; }
.sub-modal-backdrop { position: absolute; inset: 0; background: rgba(2,62,138,.55); backdrop-filter: blur(2px); }
.sub-modal-box {
  position: relative; z-index: 1; background: #fff; border-radius: 18px;
  padding: 30px 28px; max-width: 420px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.sub-modal-box h3 { font-family: var(--font-head); color: var(--ocean); margin-bottom: 8px; }
.sub-modal-box p { color: #4a5a78; margin-bottom: 16px; }
.sub-modal-box form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sub-modal-box input[type=email] {
  flex: 1 1 200px; min-width: 0; padding: 12px 14px; border: 2px solid var(--sea);
  border-radius: 999px; font-size: 1rem;
}
.sub-modal-box input[type=email]:focus { outline: none; border-color: var(--ocean); }
.sub-modal-x {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: #95a3bd;
}
.sub-note { font-size: .8rem; margin: 14px 0 0; opacity: .8; }

