/*
Theme Name: ApexStay
Theme URI: https://example.com/apexstay
Author: ApexStay Team
Author URI: https://example.com
Description: A clean, SEO-friendly, ad-friendly WordPress theme built for travel and destination blogs. Includes a widgetized sidebar on every template (including the home page), dedicated ad slots, footer widget columns, and schema.org markup for better search visibility. Site name: APEXSTAY.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apexstay
Tags: blog, travel, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, footer-widgets, threaded-comments, translation-ready, seo-friendly, ad-friendly
*/

/* =========================================================
   0. DESIGN TOKENS
   Palette: deep travel-map navy + sky blue, warm amber accent
   Type: Fraunces (display serif, headings) / Inter (body, UI)
   ========================================================= */
:root{
  --color-primary:        #16324D; /* deep navy - matches logo wordmark, header, nav, headings */
  --color-primary-light:  #2E5C8A;
  --color-accent:         #3F8FC4; /* sky blue - links, highlights */
  --color-accent-dark:    #1B4A73;

  /* Extended "travel" accent palette — used for category badges, tags,
     hero decoration, and buttons so the site reads as colorful and
     destination-themed while the navy logo stays the fixed anchor. */
  --color-amber:          #E8935B; /* sunset amber */
  --color-amber-light:    #FBE8D9;
  --color-teal:           #1C9C90; /* lagoon teal */
  --color-teal-light:     #DCF2EF;
  --color-gold:           #E8AA2E; /* desert / sand gold */
  --color-gold-light:     #FBEDCB;
  --color-rose:           #D9637E; /* dusk rose */
  --color-rose-light:     #FAE4E9;

  --color-bg:             #F7F9FB;
  --color-bg-alt:         #EDF2F7;
  --color-card:           #FFFFFF;
  --color-text:           #1A2332;
  --color-text-muted:     #5C6B7A;
  --color-border:         #DCE4EA;
  --color-white:          #FFFFFF;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --content-max: 1220px;
  --radius: 6px;
  --shadow-card: 0 1px 3px rgba(22,50,77,0.08), 0 1px 2px rgba(22,50,77,0.06);
  --shadow-hover: 0 8px 24px rgba(22,50,77,0.12);
}

/* =========================================================
   1. RESET & BASE
   ========================================================= */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img{ max-width:100%; height:auto; display:block; }
a{ color: var(--color-accent-dark); text-decoration: none; }
a:hover, a:focus{ color: var(--color-amber); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}
ul, ol{ padding-left: 1.25em; }
h1,h2,h3,h4,h5,h6{
  font-family: var(--font-display);
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1{ font-size: clamp(1.9rem, 3.2vw, 2.75rem); }
h2{ font-size: clamp(1.5rem, 2.4vw, 2rem); }
h3{ font-size: 1.3rem; }
p{ margin: 0 0 1.2em; }
.screen-reader-text{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0,0,0,0); border:0;
}
.skip-link{
  position:absolute; left:-9999px; top:0; z-index:10000;
  background: var(--color-primary); color:#fff; padding:12px 20px;
  border-radius: 0 0 6px 0;
}
.skip-link:focus{ left:0; }

/* =========================================================
   2. LAYOUT SHELL
   ========================================================= */
.site-wrap{ max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }

.content-layout{
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 44px;
  align-items: start;
  padding: 40px 0 60px;
}
.content-layout.no-sidebar{ grid-template-columns: 1fr; }
.primary-content{ min-width: 0; }
.widget-area{ min-width: 0; }

@media (max-width: 900px){
  .content-layout{ grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 480px){
  .content-layout{ padding: 28px 0 40px; }
}

/* =========================================================
   3. HEADER
   ========================================================= */
.site-header{
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(22,50,77,0.04);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  gap: 24px; padding: 14px 0;
}
.site-branding{ display:flex; align-items:center; }
.site-branding a{ display:flex; align-items:center; gap:10px; }
.site-branding img.custom-logo{ max-height: 48px; width:auto; }
.site-logo-img{ height:40px; width:auto; display:block; }
.site-branding .site-title{
  font-family: var(--font-display); font-size: 1.5rem; font-weight:600;
  color: var(--color-primary); margin:0; letter-spacing:.3px;
}
.site-branding .site-title a{ color: var(--color-primary); }
.site-branding .site-description{
  display:block; font-size:.7rem; letter-spacing:2px; text-transform:uppercase;
  color: var(--color-text-muted); margin-top:2px;
}

.primary-navigation{ display:flex; align-items:center; }
.primary-navigation ul{
  list-style:none; margin:0; padding:0; display:flex; gap: 4px; flex-wrap: wrap;
}
.primary-navigation li{ position:relative; }
.primary-navigation a{
  display:block; padding:10px 14px; color: var(--color-primary); font-weight:500;
  font-size:.95rem; border-radius: var(--radius);
}
.primary-navigation a:hover,
.primary-navigation .current-menu-item > a{
  background: var(--color-bg-alt); color: var(--color-accent-dark);
}
.primary-navigation .sub-menu{
  list-style:none; margin:0; padding:8px; position:absolute; top:100%; left:0;
  background: var(--color-white); min-width: 200px; border-radius: var(--radius);
  box-shadow: var(--shadow-hover); border: 1px solid var(--color-border); display:none; z-index:50;
}
.primary-navigation li:hover > .sub-menu,
.primary-navigation li:focus-within > .sub-menu{ display:block; }
.primary-navigation .sub-menu a{ color: var(--color-text); }
.primary-navigation .sub-menu a:hover{ background: var(--color-bg-alt); color: var(--color-accent-dark); }

.menu-toggle{
  display:none; background: var(--color-bg-alt); border: 1px solid var(--color-border);
  color: var(--color-primary); padding:8px 12px; border-radius: var(--radius); cursor:pointer;
  font-size: 1rem;
}
@media (max-width: 900px){
  .menu-toggle{ display:inline-flex; align-items:center; gap:8px; }
  .primary-navigation{
    display:none; width:100%; order:3;
  }
  .primary-navigation.is-open{ display:block; }
  .primary-navigation ul{ flex-direction:column; }
  .primary-navigation .sub-menu{ position:static; box-shadow:none; display:block; margin-left:12px; }
  .header-inner{ flex-wrap:wrap; }
}

/* ridge divider - signature motif echoing "apex" peaks */
.ridge-divider{ display:block; width:100%; line-height:0; }
.ridge-divider svg{ width:100%; height:22px; display:block; }

/* =========================================================
   4. HERO (front page)
   ========================================================= */
.hero{
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-accent-dark) 55%, var(--color-teal) 130%);
  color:#fff; padding: 56px 0 64px; position:relative; overflow:hidden;
}
.hero::before, .hero::after{
  content:""; position:absolute; border-radius:50%; filter: blur(6px); opacity:.35; z-index:1;
}
.hero::before{
  width:260px; height:260px; background: var(--color-gold); top:-90px; right:8%;
}
.hero::after{
  width:180px; height:180px; background: var(--color-rose); bottom:-70px; right:22%;
}
.hero .site-wrap{ position:relative; z-index:2; }
.hero-eyebrow{
  text-transform:uppercase; letter-spacing:3px; font-size:.78rem; color: var(--color-gold);
  font-weight:600; margin-bottom:10px; display:block;
}
.hero h1{ color:#fff; max-width: 820px; margin-bottom:.4em; }
.hero p.hero-sub{ color:#CFE0EE; max-width:640px; font-size:1.1rem; }
.hero-search .search-form{
  display:flex; max-width: 480px; width:100%; margin-top: 22px; box-shadow: var(--shadow-hover);
  border-radius: var(--radius); overflow:hidden;
}
.hero-search input[type="search"]{
  border:0; padding:14px 16px; flex:1; min-width:0; font-size:1rem; font-family:var(--font-body);
}
.hero-search button{
  border:0; background: var(--color-amber); color:#fff; padding:0 22px; font-weight:600; cursor:pointer;
}
.hero-search button:hover{ background:#d67f42; }

/* =========================================================
   5. AD SLOTS (ad-friendly widget areas)
   ========================================================= */
.ad-slot{
  margin: 28px 0; text-align:center; background: var(--color-bg-alt);
  border: 1px dashed var(--color-border); border-radius: var(--radius);
  padding: 10px; overflow:hidden;
}
.ad-slot .ad-label{
  display:block; font-size:.68rem; letter-spacing:1.5px; text-transform:uppercase;
  color: var(--color-text-muted); margin-bottom:8px;
}
.ad-slot.ad-leaderboard{ min-height: 100px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.ad-slot.ad-in-content{ min-height: 100px; }
.ad-slot.ad-sidebar{ min-height: 260px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.ad-slot img, .ad-slot iframe{ max-width:100%; }

/* =========================================================
   6. POST CARDS / ARCHIVE GRID
   ========================================================= */
.post-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 26px; }
.post-card{
  background: var(--color-card); border-radius: var(--radius); overflow:hidden;
  box-shadow: var(--shadow-card); transition: box-shadow .2s ease, transform .2s ease;
  display:flex; flex-direction:column;
}
.post-card:hover{ box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.post-card .post-thumb{ aspect-ratio: 16/10; overflow:hidden; background: var(--color-bg-alt); }
.post-card .post-thumb img{ width:100%; height:100%; object-fit:cover; }
.post-card .post-card-body{ padding: 18px 20px 22px; flex:1; display:flex; flex-direction:column; }
.post-card .post-cat{
  display:inline-block; font-size:.7rem; letter-spacing:1.2px; text-transform:uppercase;
  padding:4px 10px; border-radius:20px;
  margin-bottom:10px; align-self:flex-start; font-weight:600;
}
.post-card{ border-top: 3px solid var(--color-border); }
.post-card.cat-color-0{ border-top-color: var(--color-teal); }
.post-card.cat-color-1{ border-top-color: var(--color-amber); }
.post-card.cat-color-2{ border-top-color: var(--color-gold); }
.post-card.cat-color-3{ border-top-color: var(--color-rose); }
.post-card.cat-color-4{ border-top-color: var(--color-accent); }
.post-card h2, .post-card h3{ font-size:1.15rem; margin-bottom:.4em; }
.post-card h2 a, .post-card h3 a{ color: var(--color-primary); }
.post-card .post-excerpt{ color: var(--color-text-muted); font-size:.94rem; margin-bottom: 12px; }
.post-meta{
  font-size:.8rem; color: var(--color-text-muted); display:flex; gap:12px; flex-wrap:wrap;
  align-items:center; margin-top:auto;
}
.post-meta a{ color: var(--color-text-muted); }
.post-meta .sep{ opacity:.5; }

.section-heading{
  display:flex; align-items:baseline; justify-content:space-between; gap:16px;
  margin: 8px 0 22px; border-bottom: 2px solid var(--color-border); padding-bottom:10px;
}
.section-heading h2{ margin:0; }
.section-heading a{ font-size:.85rem; font-weight:600; white-space:nowrap; }

/* =========================================================
   7. SINGLE POST / PAGE
   ========================================================= */
.entry-header{ margin-bottom: 20px; }
.entry-header .post-cat{
  display:inline-block; font-size:.72rem; letter-spacing:1.2px; text-transform:uppercase;
  padding:4px 10px; border-radius:20px;
  margin-bottom:12px; font-weight:600;
}

/* Category badge color cycle — assigned by apexstay_category_badge() so
   different sections of the blog read as visually distinct at a glance. */
.cat-color-0{ color: #0E6459; background: var(--color-teal-light); }
.cat-color-1{ color: #A2551E; background: var(--color-amber-light); }
.cat-color-2{ color: #8A6208; background: var(--color-gold-light); }
.cat-color-3{ color: #A13655; background: var(--color-rose-light); }
.cat-color-4{ color: var(--color-accent-dark); background: #E4F0F8; }
.entry-header h1{ margin-bottom:.3em; }
.entry-thumbnail{ margin: 18px 0 28px; border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow-card); }
.entry-content{ font-size: 1.05rem; }
.entry-content h2{ margin-top: 1.6em; }
.entry-content h3{ margin-top: 1.4em; }
.entry-content img{ border-radius: var(--radius); margin: 1.2em 0; }
.entry-content figure{ margin: 1.4em 0; }
.entry-content figcaption{ font-size:.85rem; color: var(--color-text-muted); text-align:center; margin-top:6px; }
.entry-content blockquote{
  border-left: 4px solid var(--color-amber); margin: 1.6em 0; padding: 4px 0 4px 20px;
  font-style: italic; color: var(--color-primary-light); font-family: var(--font-display); font-size:1.15rem;
}
.entry-content a{ text-decoration: underline; text-decoration-color: var(--color-accent); text-underline-offset:2px; }
.entry-content table{ width:100%; border-collapse: collapse; margin: 1.4em 0; display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.entry-content table th, .entry-content table td{ border:1px solid var(--color-border); padding:10px 12px; text-align:left; }
.entry-content table th{ background: var(--color-bg-alt); }
.entry-content ul, .entry-content ol{ margin-bottom: 1.2em; }
.entry-content iframe, .entry-content video, .entry-content embed{ max-width:100%; }

.entry-footer{
  margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--color-border);
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px;
}
.tag-list{ display:flex; flex-wrap:wrap; gap:8px; list-style:none; padding:0; margin:0; }
.tag-list a{
  background: var(--color-bg-alt); padding:5px 12px; border-radius:20px; font-size:.82rem;
  color: var(--color-primary);
}
.tag-list li:nth-child(5n+1) a{ background: var(--color-teal-light); color:#0E6459; }
.tag-list li:nth-child(5n+2) a{ background: var(--color-amber-light); color:#A2551E; }
.tag-list li:nth-child(5n+3) a{ background: var(--color-gold-light); color:#8A6208; }
.tag-list li:nth-child(5n+4) a{ background: var(--color-rose-light); color:#A13655; }
.tag-list li:nth-child(5n+5) a{ background: #E4F0F8; color: var(--color-accent-dark); }
.tag-list a:hover{ background: var(--color-primary); color:#fff !important; }

.author-box{
  display:flex; gap:16px; background: var(--color-card); border:1px solid var(--color-border);
  border-radius: var(--radius); padding: 20px; margin: 32px 0; align-items:flex-start;
}
.author-box img{ border-radius:50%; width:64px; height:64px; }
.author-box h3{ margin:0 0 6px; font-size:1rem; }
.author-box p{ margin:0; color: var(--color-text-muted); font-size:.92rem; }

.post-nav-links{
  display:grid; grid-template-columns: 1fr 1fr; gap:18px; margin: 32px 0;
}
.post-nav-links .nav-prev, .post-nav-links .nav-next{
  background: var(--color-card); border:1px solid var(--color-border); border-radius: var(--radius);
  padding: 16px 18px; display:block;
}
.post-nav-links .nav-next{ text-align:right; }
.post-nav-links .nav-label{
  display:block; font-size:.72rem; text-transform:uppercase; letter-spacing:1px; color: var(--color-text-muted); margin-bottom:4px;
}
@media (max-width:600px){ .post-nav-links{ grid-template-columns:1fr; } }

/* Breadcrumbs (SEO) */
.apexstay-breadcrumbs{
  font-size:.85rem; color: var(--color-text-muted); margin: 18px 0 4px;
}
.apexstay-breadcrumbs a{ color: var(--color-text-muted); }
.apexstay-breadcrumbs a:hover{ color: var(--color-accent-dark); }

/* =========================================================
   8. SIDEBAR / WIDGETS
   ========================================================= */
.widget-area{ display:flex; flex-direction:column; gap: 28px; }
.widget{
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 22px; border-top: 3px solid var(--color-teal);
}
.widget-area .widget:nth-child(4n+1){ border-top-color: var(--color-teal); }
.widget-area .widget:nth-child(4n+2){ border-top-color: var(--color-amber); }
.widget-area .widget:nth-child(4n+3){ border-top-color: var(--color-gold); }
.widget-area .widget:nth-child(4n+4){ border-top-color: var(--color-rose); }
.widget-title{
  font-family: var(--font-display); font-size:1.05rem; margin:0 0 16px; padding-bottom:12px;
  border-bottom: 2px solid var(--color-amber); color: var(--color-primary);
}
.widget ul{ list-style:none; margin:0; padding:0; }
.widget li{ padding: 8px 0; border-bottom: 1px solid var(--color-border); font-size:.92rem; }
.widget li:last-child{ border-bottom:0; }
.widget a{ color: var(--color-text); }
.widget a:hover{ color: var(--color-accent-dark); }
.widget select, .widget input[type="text"], .widget input[type="search"]{
  width:100%; padding:9px 10px; border:1px solid var(--color-border); border-radius: var(--radius); font-family: var(--font-body); max-width:100%;
}
.widget img{ border-radius: var(--radius); }
.widget_media_image img{ width:100%; }
.widget .tagcloud a{
  display:inline-block; margin:0 6px 6px 0; padding:5px 10px; background: var(--color-bg-alt);
  border-radius:20px; font-size:.8rem !important; color: var(--color-primary);
}
.widget .tagcloud a:nth-child(5n+1){ background: var(--color-teal-light); color:#0E6459; }
.widget .tagcloud a:nth-child(5n+2){ background: var(--color-amber-light); color:#A2551E; }
.widget .tagcloud a:nth-child(5n+3){ background: var(--color-gold-light); color:#8A6208; }
.widget .tagcloud a:nth-child(5n+4){ background: var(--color-rose-light); color:#A13655; }

/* =========================================================
   9. FOOTER
   ========================================================= */
.site-footer{ background: var(--color-primary); color:#CFE0EE; margin-top: 40px; }
.footer-widgets{
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding: 48px 0 32px;
}
.footer-widgets .widget{
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.footer-widgets .widget-title{ color:#fff; border-bottom-color: var(--color-amber); }
.footer-widgets .widget:nth-child(4n+1) .widget-title{ border-bottom-color: var(--color-teal); }
.footer-widgets .widget:nth-child(4n+2) .widget-title{ border-bottom-color: var(--color-amber); }
.footer-widgets .widget:nth-child(4n+3) .widget-title{ border-bottom-color: var(--color-gold); }
.footer-widgets .widget:nth-child(4n+4) .widget-title{ border-bottom-color: var(--color-rose); }
.footer-widgets .widget a{ color:#CFE0EE; }
.footer-widgets .widget a:hover{ color: var(--color-gold); }
.footer-widgets .widget li{ border-bottom-color: rgba(255,255,255,0.08); }
@media (max-width: 980px){ .footer-widgets{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px){ .footer-widgets{ grid-template-columns: 1fr; } }

.site-info{
  border-top: 1px solid rgba(255,255,255,0.12); padding: 20px 0; font-size:.85rem;
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; color:#9FBAD1;
}
.site-info a{ color:#CFE0EE; }
.footer-social{ display:flex; gap:12px; list-style:none; margin:0; padding:0; }
.footer-social a{
  display:flex; align-items:center; justify-content:center; width:34px; height:34px;
  border-radius:50%; background: rgba(255,255,255,0.08); color:#fff;
}
.footer-social a:hover{ background: var(--color-amber); }

/* =========================================================
   10. FORMS / COMMENTS / SEARCH / MISC
   ========================================================= */
.comments-area{ margin-top: 48px; }
.comment-list{ list-style:none; margin:0; padding:0; }
.comment-list li{ margin-bottom: 20px; }
.comment-body{
  background: var(--color-card); border:1px solid var(--color-border); border-radius: var(--radius); padding:18px;
}
.comment-author img{ border-radius:50%; margin-right:10px; }
.comment-meta{ font-size:.82rem; color: var(--color-text-muted); }
.comment-form input, .comment-form textarea{
  width:100%; padding:11px 12px; border:1px solid var(--color-border); border-radius: var(--radius);
  font-family: var(--font-body); margin-bottom:14px;
}
.btn, .comment-form input[type="submit"], .search-form button, button.wp-block-button__link{
  display:inline-block; background: linear-gradient(135deg, var(--color-accent-dark), var(--color-teal)); color:#fff !important; border:0;
  padding: 12px 22px; border-radius: var(--radius); font-weight:600; cursor:pointer; text-decoration:none;
  transition: filter .15s ease;
}
.btn:hover, .comment-form input[type="submit"]:hover{ filter: brightness(1.08); background: linear-gradient(135deg, var(--color-amber), var(--color-gold)); }

.search-form{ display:flex; }
.search-form label{ flex:1; margin:0; min-width:0; }
.search-form input[type="search"]{
  width:100%; padding:10px 12px; border:1px solid var(--color-border); border-radius: var(--radius) 0 0 var(--radius);
}
.search-form button{ border-radius: 0 var(--radius) var(--radius) 0; padding:0 18px; flex-shrink:0; }

.pagination{ display:flex; gap:8px; flex-wrap:wrap; margin: 36px 0; justify-content:center; }
.pagination a, .pagination span{
  padding:9px 15px; border:1px solid var(--color-border); border-radius: var(--radius); font-size:.9rem;
  background: var(--color-card); color: var(--color-text);
}
.pagination .current{ background: var(--color-amber); color:#fff; border-color: var(--color-amber); }
.pagination a:hover{ background: var(--color-teal-light); border-color: var(--color-teal); }

.alignwide{ margin-left:-40px; margin-right:-40px; max-width: none; }
.alignfull{ margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: none; width:100vw; }
.wp-caption, .wp-block-image{ max-width:100%; }

::selection{ background: var(--color-amber); color:#fff; }

@media (max-width: 600px){
  .site-wrap{ padding: 0 16px; }
  .hero{ padding: 40px 0 44px; }
  .site-logo-img{ height:34px; }
  .header-inner{ padding: 12px 0; }
  .hero::before{ width:170px; height:170px; }
  .hero::after{ width:120px; height:120px; }
}
